|
@@ -7,16 +7,6 @@
|
|
|
@confirm="onSearch"
|
|
|
@cancel="onCancel"
|
|
|
>
|
|
|
- <!-- <div class="tool-bar-item">
|
|
|
- <p class="label">回传方式</p>
|
|
|
- <a-select class="full-width" v-model:value="query.report_module">
|
|
|
- <a-select-option key="all" :value="''">全部</a-select-option>
|
|
|
- <a-select-option key="channel" value="channel"
|
|
|
- >按站点回传</a-select-option
|
|
|
- >
|
|
|
- <a-select-option key="ad" value="ad">按计划回传</a-select-option>
|
|
|
- </a-select>
|
|
|
- </div> -->
|
|
|
</tool-bar>
|
|
|
<a-table
|
|
|
rowKey="id"
|
|
@@ -27,16 +17,8 @@
|
|
|
bordered
|
|
|
:data-source="list"
|
|
|
@change="onLoadOfficials"
|
|
|
+
|
|
|
>
|
|
|
- <!-- <template #rate="{ text, record }">
|
|
|
- <editable-cell
|
|
|
- :text="`${text}`"
|
|
|
- title="回传比例"
|
|
|
- :maxValue="100"
|
|
|
- :minValue="1"
|
|
|
- @change="(val) => onCellChange(record, 'rate', val)"
|
|
|
- />
|
|
|
- </template> -->
|
|
|
<template #module="{ record }">
|
|
|
<p>{{ moduleType[record.report_module] }}</p>
|
|
|
</template>
|
|
@@ -52,151 +34,78 @@
|
|
|
回传配置
|
|
|
</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="getLogs(record)">
|
|
|
- 操作日志
|
|
|
+ 回传日志
|
|
|
</a-button>
|
|
|
</template>
|
|
|
- <!-- <template #operte="{ text, record }">
|
|
|
- <p
|
|
|
- v-clipboard:copy="record.fans_add_monitor_link"
|
|
|
- v-clipboard:success="copySuccess"
|
|
|
- >
|
|
|
- <a>复制监测链接</a>
|
|
|
- </p>
|
|
|
- </template> -->
|
|
|
</a-table>
|
|
|
<!-- 站点回传配置drawer -->
|
|
|
- <a-drawer
|
|
|
+ <a-modal
|
|
|
v-model:visible="visible"
|
|
|
title="回传配置"
|
|
|
width="40%"
|
|
|
class="drawer-back-config"
|
|
|
+ @ok="handleOk"
|
|
|
+ centered="true"
|
|
|
>
|
|
|
- <div class="wrap-box">
|
|
|
- <p class="title">回传方式</p>
|
|
|
- <a-radio-group
|
|
|
- v-model:value="report_module"
|
|
|
- @change="showConfig = report_module == 'ad' ? false : true"
|
|
|
- >
|
|
|
- <a-radio value="ad">计划</a-radio>
|
|
|
- <a-radio value="channel">站点</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- <a href="javascript:;" @click="onReportModuleChange">保存</a>
|
|
|
- </div>
|
|
|
- <div class="wrap-box" v-show="!showConfig">
|
|
|
- <p class="title">按计划回传配置</p>
|
|
|
- <a-form :label-col="{ span: 6 }" :wrapper-col="{ offset: 1, span: 11 }">
|
|
|
- <a-form-item label="回传比例">
|
|
|
- <a-input-number v-model:value="ad_config.rate" />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item :wrapper-col="{ offset: 7 }">
|
|
|
- <a-button type="primary" @click="onRateChange"> 保存 </a-button>
|
|
|
- </a-form-item>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- <div class="wrap-box" v-show="showConfig">
|
|
|
- <p class="title">按站点回传配置</p>
|
|
|
- <a-tabs size="small" @change="onTabChange">
|
|
|
- <a-tab-pane
|
|
|
- v-for="(d, i) in popForm"
|
|
|
- :key="i"
|
|
|
- :tab="d.desc"
|
|
|
- ></a-tab-pane>
|
|
|
- </a-tabs>
|
|
|
- <a-form :label-col="{ span: 6 }" :wrapper-col="{ offset: 1, span: 11 }">
|
|
|
- <a-form-item label="回传条件">
|
|
|
- <a-select
|
|
|
- style="width: 150px"
|
|
|
- size="small"
|
|
|
- v-model:value="popForm[currentTab].condition"
|
|
|
- >
|
|
|
- <a-select-option
|
|
|
- :value="item.name"
|
|
|
- v-for="item in popForm[currentTab].report_conditions"
|
|
|
- :key="item.name"
|
|
|
- >
|
|
|
- {{ item.desc }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="回传开关">
|
|
|
- <a-switch
|
|
|
- v-model:checked="popForm[currentTab].back_on"
|
|
|
- checked-children="开"
|
|
|
- un-checked-children="关"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="回传比例">
|
|
|
- <a-input
|
|
|
- v-model:value="popForm[currentTab].rate"
|
|
|
- size="small"
|
|
|
- style="width: 150px"
|
|
|
- type="number"
|
|
|
- placeholder="回传比例"
|
|
|
- >
|
|
|
- <template #suffix>
|
|
|
- <a-tooltip title="比例0-100">
|
|
|
- <info-circle-outlined style="color: rgba(0, 0, 0, 0.45)" />
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="回传平台">
|
|
|
- <a-input
|
|
|
- v-model:value="popForm[currentTab].back_platform"
|
|
|
- disabled
|
|
|
- size="small"
|
|
|
- style="width: 150px"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- label="回传付费最低金额"
|
|
|
- v-if="popForm[currentTab].report_type === 'recharge'"
|
|
|
+ <a-form :label-col="{ span: 6 }" :wrapper-col="{ offset: 1, span: 11 }">
|
|
|
+ <a-form-item label="回传条件">
|
|
|
+ <a-select
|
|
|
+ style="width: 150px"
|
|
|
+ size="small"
|
|
|
+ v-model:value="popForm[currentTab].condition"
|
|
|
>
|
|
|
- <a-input
|
|
|
- v-model:value="popForm[currentTab].price"
|
|
|
- size="small"
|
|
|
- style="width: 150px"
|
|
|
- type="number"
|
|
|
- placeholder="回传付费最低金额"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="浮动回传比例">
|
|
|
- <a-input
|
|
|
- v-model:value="popForm[currentTab].float_rate"
|
|
|
- size="small"
|
|
|
- style="width: 150px"
|
|
|
- type="number"
|
|
|
- placeholder="浮动回传比例"
|
|
|
+ <a-select-option
|
|
|
+ :value="item.name"
|
|
|
+ v-for="item in popForm[currentTab].report_conditions"
|
|
|
+ :key="item.name"
|
|
|
>
|
|
|
- <template #suffix>
|
|
|
- <a-tooltip title="浮动比例小于固定回传比例">
|
|
|
- <info-circle-outlined style="color: rgba(0, 0, 0, 0.45)" />
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item :wrapper-col="{ offset: 7 }">
|
|
|
- <a-button
|
|
|
- :disabled="!hasPopFormData"
|
|
|
- :loading="saving"
|
|
|
- type="primary"
|
|
|
- @click="onSaveConfig"
|
|
|
- >
|
|
|
- 保存
|
|
|
- </a-button>
|
|
|
- </a-form-item>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- </a-drawer>
|
|
|
+ {{ item.desc }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="回传比例">
|
|
|
+ <a-input
|
|
|
+ v-model:value="ad_config.rate"
|
|
|
+ size="small"
|
|
|
+ style="width: 150px"
|
|
|
+ type="number"
|
|
|
+ placeholder="回传比例"
|
|
|
+ :min="0"
|
|
|
+ :max="100"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <a-tooltip title="比例0-100">
|
|
|
+ <info-circle-outlined style="color: rgba(0, 0, 0, 0.45)" />
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="回传付费最低金额">
|
|
|
+ <a-input
|
|
|
+ v-model:value="ad_config.lowestMoney"
|
|
|
+ size="small"
|
|
|
+ style="width: 150px"
|
|
|
+ type="number"
|
|
|
+ placeholder="回传比例"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <a-tooltip title="元">
|
|
|
+ <span>元</span>
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </a-modal>
|
|
|
<!--回传日志-->
|
|
|
- <a-drawer title="日志详情"
|
|
|
+ <a-drawer
|
|
|
+ title="回传日志"
|
|
|
placement="right"
|
|
|
:closable="true"
|
|
|
width="80%"
|
|
|
- v-model:visible="visibleLog">
|
|
|
- <log-list :visible="visibleLog" :channel_id="curChannel_id">
|
|
|
-
|
|
|
- </log-list>
|
|
|
+ v-model:visible="visibleLog"
|
|
|
+ >
|
|
|
+ <log-list :visible="visibleLog" :channel_id="curChannel_id"> </log-list>
|
|
|
</a-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -221,9 +130,10 @@ import {
|
|
|
getOfficialAccounts,
|
|
|
setChannelRate,
|
|
|
getOfficialBackConfig,
|
|
|
+ backLogList,
|
|
|
} from "@/api";
|
|
|
import { IOfficials, PlanBack } from "#/api";
|
|
|
-import { message } from "ant-design-vue";
|
|
|
+import { message, Popconfirm } from "ant-design-vue";
|
|
|
import { InfoCircleOutlined } from "@ant-design/icons-vue";
|
|
|
import {
|
|
|
setOfficialBackConfig,
|
|
@@ -235,7 +145,7 @@ const Account = defineComponent({
|
|
|
ToolBar,
|
|
|
EditableCell,
|
|
|
InfoCircleOutlined,
|
|
|
- logList
|
|
|
+ logList,
|
|
|
},
|
|
|
setup() {
|
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
@@ -263,7 +173,7 @@ const Account = defineComponent({
|
|
|
back_on: false,
|
|
|
rate: 0,
|
|
|
condition: "",
|
|
|
- price: 0,
|
|
|
+ price: 30,
|
|
|
float_rate: 0,
|
|
|
desc: "",
|
|
|
},
|
|
@@ -272,32 +182,36 @@ const Account = defineComponent({
|
|
|
channel_id: "",
|
|
|
id: 0,
|
|
|
rate: 0,
|
|
|
+ lowestMoney: 30,
|
|
|
+ condition: "current_day_register_first_recharge",
|
|
|
},
|
|
|
report_module: "ad",
|
|
|
report_channel_id: 0,
|
|
|
showConfig: false,
|
|
|
visible: false,
|
|
|
saving: false,
|
|
|
- visibleLog:false,
|
|
|
- curChannel_id:0,
|
|
|
+ visibleLog: false,
|
|
|
+ curChannel_id: 0,
|
|
|
currentTab: 0,
|
|
|
});
|
|
|
|
|
|
const onSearch = (fields: Record<string, string>) => {
|
|
|
const { name } = fields;
|
|
|
state.query.official_name = name;
|
|
|
+ console.log(1);
|
|
|
onLoadOfficials();
|
|
|
};
|
|
|
+ //取消时触发
|
|
|
const onCancel = () => {
|
|
|
- // state.query.report_status = -1;
|
|
|
state.query.report_module = "";
|
|
|
onSearch({ name: "" });
|
|
|
+ onLoadOfficials();
|
|
|
};
|
|
|
|
|
|
const onLoadOfficials = (query?: { current: number }) => {
|
|
|
let params = JSON.parse(JSON.stringify(state.query));
|
|
|
if (query) params.page = query.current;
|
|
|
- params.report_platform = 'kuaishou';
|
|
|
+ params.report_platform = "kuaishou";
|
|
|
loading.value = true;
|
|
|
// if (state.query.report_status === -1) delete params.report_status;
|
|
|
if (state.query.report_module === "") delete params.report_module;
|
|
@@ -308,15 +222,23 @@ const Account = defineComponent({
|
|
|
state.searching = false;
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+ //获得公众号"/userOfficialAccounts"
|
|
|
onMounted(onLoadOfficials);
|
|
|
|
|
|
const initBackData = async (item: IOfficials) => {
|
|
|
try {
|
|
|
- const { data } = await getOfficialBackConfig(item.channel_id,'kuaishou');
|
|
|
+ const { data } = await getOfficialBackConfig(
|
|
|
+ item.channel_id,
|
|
|
+ "kuaishou"
|
|
|
+ );
|
|
|
+ console.log(item);
|
|
|
+ if (data.channel_configs[0].id) {
|
|
|
+ state.ad_config.id = +data.channel_configs[0].id;
|
|
|
+ }
|
|
|
state.ad_config.channel_id = data.ad_config.channel_id;
|
|
|
- state.ad_config.id = data.ad_config.id;
|
|
|
- state.ad_config.rate = data.ad_config.rate;
|
|
|
+ console.log(state.ad_config.id);
|
|
|
+ console.log(state.ad_config.channel_id);
|
|
|
+ state.ad_config.rate = data.channel_configs[0].rate;
|
|
|
state.report_module = data.report_module;
|
|
|
state.showConfig = data.report_module == "ad" ? false : true;
|
|
|
state.report_channel_id = +data.channel_id;
|
|
@@ -330,70 +252,43 @@ const Account = defineComponent({
|
|
|
? (state.hasPopFormData = true)
|
|
|
: (state.hasPopFormData = false);
|
|
|
state.popForm = list;
|
|
|
+ console.log(state.popForm)
|
|
|
state.visible = true;
|
|
|
} catch (error) {
|
|
|
console.log("error happened in get back plan data:", error.message);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+ const handlechange=(value:string)=>{
|
|
|
+ console.log(value)
|
|
|
+ state.ad_config.condition=value
|
|
|
+ console.log( state.ad_config.condition)
|
|
|
+ }
|
|
|
const onTabChange = (key: number) => {
|
|
|
state.currentTab = key;
|
|
|
};
|
|
|
|
|
|
- const onRateChange = () => {
|
|
|
- const { rate, channel_id } = state.ad_config;
|
|
|
- setChannelRate({ rate, channel_id,report_platform:'kuaishou' }).then((res) => {
|
|
|
- onLoadOfficials();
|
|
|
- message.success("修改回传比例成功!");
|
|
|
- state.visible = false;
|
|
|
- });
|
|
|
- };
|
|
|
- const onReportModuleChange = () => {
|
|
|
- // state.showConfig = state.report_module == "ad" ? false : true;
|
|
|
- onUpdateOfficialReportType(
|
|
|
- state.report_channel_id,
|
|
|
- state.report_module,
|
|
|
- "kuaishou"
|
|
|
- ).then((_) => {
|
|
|
- onLoadOfficials();
|
|
|
- message.success("修改回传方式成功!");
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- const onSaveConfig = () => {
|
|
|
- let { id, back_on, rate, condition, price, float_rate } =
|
|
|
- state.popForm[state.currentTab];
|
|
|
- if (float_rate && float_rate >= rate) {
|
|
|
- message.error("浮动比例必须小于固定回传比例");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- state.saving = true;
|
|
|
+ //保存站点回传比例
|
|
|
|
|
|
+ const SaveConfig = async () => {
|
|
|
+ state.visible = false;
|
|
|
let data = {
|
|
|
- id,
|
|
|
- back_on: Number(back_on),
|
|
|
- rate,
|
|
|
- condition,
|
|
|
- price,
|
|
|
- float_rate,
|
|
|
- report_platform:'kuaishou'
|
|
|
+ rate: state.ad_config.rate,
|
|
|
+ condition: state.popForm[state.currentTab].condition,
|
|
|
+ price: state.ad_config.lowestMoney,
|
|
|
+ report_platform: "kuaishou",
|
|
|
+ id: state.ad_config.id,
|
|
|
};
|
|
|
-
|
|
|
- setOfficialBackConfig(data)
|
|
|
- .then((_) => {
|
|
|
- onLoadOfficials();
|
|
|
- message.success("保存成功");
|
|
|
- state.visible = false;
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- message.error(e.message || e.msg || "系统错误");
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- state.saving = false;
|
|
|
- });
|
|
|
+ const res = await setOfficialBackConfig(data);
|
|
|
+ state.ad_config.lowestMoney = 30;
|
|
|
+ if (res.data.success == 0) {
|
|
|
+ message.success("保存成功");
|
|
|
+ }
|
|
|
+ onLoadOfficials()
|
|
|
+ };
|
|
|
+ //确定时提交表单
|
|
|
+ const handleOk = () => {
|
|
|
+ SaveConfig();
|
|
|
};
|
|
|
-
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
loading,
|
|
@@ -403,25 +298,14 @@ const Account = defineComponent({
|
|
|
onLoadOfficials,
|
|
|
initBackData,
|
|
|
onTabChange,
|
|
|
- onRateChange,
|
|
|
- onSaveConfig,
|
|
|
- onReportModuleChange,
|
|
|
+ handleOk,
|
|
|
+ handlechange
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- copySuccess() {
|
|
|
- this.$message.success("复制成功");
|
|
|
- },
|
|
|
- onCellChange(record: any, dataIndex: string, value: string) {
|
|
|
- setChannelRate({ rate: value, channel_id: record.channel_id }).then(
|
|
|
- (res) => {
|
|
|
- this.$message.success("修改回传比例成功!");
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
- getLogs(record:any){
|
|
|
- this.curChannel_id = record.channel_id;
|
|
|
- this.visibleLog = true;
|
|
|
+ getLogs(record: any) {
|
|
|
+ this.curChannel_id = record.channel_id;
|
|
|
+ this.visibleLog = true;
|
|
|
},
|
|
|
},
|
|
|
});
|