|
@@ -21,7 +21,18 @@
|
|
|
|
|
|
<div class="table-filter">
|
|
|
<div class="item-right">
|
|
|
- <span>筛选条件:</span>
|
|
|
+ <span class="label">数据类型</span>
|
|
|
+ <a-select class="full-width" v-model:value="currentStats">
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in statsList"
|
|
|
+ :value="item.name"
|
|
|
+ :key="item.name"
|
|
|
+ >{{ item.desc }}</a-select-option
|
|
|
+ >
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ <div class="item-right">
|
|
|
+ <span class="label">筛选条件:</span>
|
|
|
<a-range-picker
|
|
|
v-model:value="pickerFilter"
|
|
|
@change="switchDate"
|
|
@@ -40,7 +51,7 @@
|
|
|
:loading="loading.value"
|
|
|
@change="handleTableChange"
|
|
|
rowKey="id"
|
|
|
- :scroll="{ x: 1500 }"
|
|
|
+ :scroll="{ x: true }"
|
|
|
>
|
|
|
<template #switch="{ text, record }">
|
|
|
<a-switch
|
|
@@ -52,6 +63,102 @@
|
|
|
<p @click="onGo(record)"><a>前往落地页链接</a></p>
|
|
|
</template>
|
|
|
|
|
|
+ <template #email="{ text, record }">
|
|
|
+ <p>{{ record.email }}</p>
|
|
|
+ <p>{{ record.account_name }}</p>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #ad_name="{ text, record }">
|
|
|
+ <p>广告名:{{ record.ad_name }}</p>
|
|
|
+ <p>广告ID:{{ record.ad_id }}</p>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #dayt="{ text, record }">
|
|
|
+ <a-popover title="回传配置" placement="left" trigger="click">
|
|
|
+ <template #content>
|
|
|
+ <div class="tab-list" style="width: 220px">
|
|
|
+ <a-tabs size="small" @change="tabChangeBack">
|
|
|
+ <a-tab-pane
|
|
|
+ v-for="(d, i) in popForm"
|
|
|
+ :key="i"
|
|
|
+ :tab="`配置-${i + 1}`"
|
|
|
+ ></a-tab-pane>
|
|
|
+ </a-tabs>
|
|
|
+ </div>
|
|
|
+ <div class="hover-content">
|
|
|
+ <span class="label">回传条件</span
|
|
|
+ ><a-select
|
|
|
+ style="width: 150px"
|
|
|
+ size="small"
|
|
|
+ v-model:value="popForm[currentTbs].condition"
|
|
|
+ >
|
|
|
+ <a-select-option value="common">
|
|
|
+ 普通都回传
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="current_day_register">
|
|
|
+ 当日注册/当日付费
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ <div class="hover-content">
|
|
|
+ <span class="label">回传开关</span>
|
|
|
+ <a-switch
|
|
|
+ v-model:checked="popForm[currentTbs].back_on"
|
|
|
+ checked-children="开"
|
|
|
+ un-checked-children="关"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="hover-content">
|
|
|
+ <span class="label">回传比例</span
|
|
|
+ ><a-input
|
|
|
+ v-model:value="popForm[currentTbs].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,.45)" />
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
+ </a-input>
|
|
|
+ </div>
|
|
|
+ <div class="hover-content">
|
|
|
+ <span class="label">回传付费最低金额</span
|
|
|
+ ><a-input
|
|
|
+ v-model:value="popForm[currentTbs].price"
|
|
|
+ size="small"
|
|
|
+ style="width: 150px"
|
|
|
+ type="number"
|
|
|
+ placeholder="回传付费最低金额"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="footer-slot">
|
|
|
+ <a-popconfirm
|
|
|
+ title="是否要修改回传配置?"
|
|
|
+ ok-text="是"
|
|
|
+ :visible="popconfirmShow"
|
|
|
+ cancel-text="否"
|
|
|
+ @confirm="confirmEdit"
|
|
|
+ @visibleChange="handleVisibleChange"
|
|
|
+ >
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="!hasPopFormData"
|
|
|
+ @click="editBackConfig"
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </a-button>
|
|
|
+ </a-popconfirm>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <p @click="getBackData(record)"><a>回传</a></p>
|
|
|
+ </a-popover>
|
|
|
+ <p @click="getregister(record)"><a>注册用户</a></p>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #cpa_bid="{ text, record }">
|
|
|
<editable-cell
|
|
|
:text="text"
|
|
@@ -85,7 +192,15 @@
|
|
|
:closable="false"
|
|
|
v-model:visible="visible1"
|
|
|
>
|
|
|
- <put-count :ids="ids"></put-count>
|
|
|
+ <put-count :ids="backData.ids" :begin_date="backData.begin_date" :end_date="backData.end_date" :field="backData.field"></put-count>
|
|
|
+ </a-drawer>
|
|
|
+ <a-drawer
|
|
|
+ title="注册用户"
|
|
|
+ placement="right"
|
|
|
+ :closable="false"
|
|
|
+ v-model:visible="registerVisable"
|
|
|
+ >
|
|
|
+ <register-datad :ad_lid="register.ad_lid" :back_platform="register.back_platform"></register-datad>
|
|
|
</a-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -96,10 +211,11 @@ import moment from "moment";
|
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
|
import PutData from "@/views/put/put-log.vue";
|
|
|
import PutCount from "@/views/put/put-ad-count.vue";
|
|
|
+import RegisterDatad from "@/views/put/register-data.vue";
|
|
|
import EditableCell from "@/components/edit-cell/index.vue";
|
|
|
import usePagination from "@/hooks/usePagination";
|
|
|
import { picker } from "@/helper/config/range";
|
|
|
-
|
|
|
+import { InfoCircleOutlined } from "@ant-design/icons-vue";
|
|
|
import {
|
|
|
TableColumnOfPutAdPlan,
|
|
|
ALLCloumnList,
|
|
@@ -112,9 +228,12 @@ import {
|
|
|
adChangeCrem,
|
|
|
statusChange,
|
|
|
getAddStatus,
|
|
|
+ getAdBackPlan,
|
|
|
+ setBackConfig,
|
|
|
+ getAdStatus,
|
|
|
} from "@/api";
|
|
|
|
|
|
-import { ADPlanItem, PageOptions } from "@/types/api";
|
|
|
+import { ADPlanItem, PageOptions, PlanBack } from "@/types/api";
|
|
|
|
|
|
const PutAdPlan = defineComponent({
|
|
|
components: {
|
|
@@ -122,11 +241,15 @@ const PutAdPlan = defineComponent({
|
|
|
EditableCell,
|
|
|
PutData,
|
|
|
PutCount,
|
|
|
+ InfoCircleOutlined,
|
|
|
+ RegisterDatad,
|
|
|
},
|
|
|
setup() {
|
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
|
let list: any[] = [],
|
|
|
- opList: any[] = [];
|
|
|
+ opList: any[] = [],
|
|
|
+ stList :any = [];
|
|
|
+
|
|
|
const state = reactive({
|
|
|
platform: "platform1",
|
|
|
list: ref<ADPlanItem[]>([]),
|
|
@@ -134,14 +257,41 @@ const PutAdPlan = defineComponent({
|
|
|
loading,
|
|
|
currentSelect: "AD_STATUS_DELIVERY_OK",
|
|
|
picker: [],
|
|
|
- currentId:'',
|
|
|
+ currentId: "",
|
|
|
+
|
|
|
visible: false,
|
|
|
+ popconfirmShow: false,
|
|
|
+ showPop: false,
|
|
|
visible1: false,
|
|
|
+ registerVisable: false,
|
|
|
+ register: {
|
|
|
+ ad_lid: 0,
|
|
|
+ back_platform: "",
|
|
|
+ },
|
|
|
pickerFilter: [moment(), moment()],
|
|
|
tablePageOptions,
|
|
|
columns: list,
|
|
|
- ids: "",
|
|
|
+ backData:{
|
|
|
+ ids: "",
|
|
|
+ begin_date:'',
|
|
|
+ end_date:'',
|
|
|
+ field:''
|
|
|
+ },
|
|
|
+
|
|
|
+ currentTbs: 0,
|
|
|
+ hasPopFormData: false,
|
|
|
+ popForm: [
|
|
|
+ {
|
|
|
+ id: 0,
|
|
|
+ back_on: false,
|
|
|
+ rate: 0,
|
|
|
+ condition: "",
|
|
|
+ price: 0,
|
|
|
+ },
|
|
|
+ ],
|
|
|
optionList: opList,
|
|
|
+ statsList:stList,
|
|
|
+ currentStats:'paid_order_amount',
|
|
|
defaultColumns: TableColumnOfPutAdPlan,
|
|
|
fields: {},
|
|
|
rangePick: picker,
|
|
@@ -182,10 +332,15 @@ const PutAdPlan = defineComponent({
|
|
|
let [begin_dates, end_dates] = pickerFilter;
|
|
|
let begin_date = moment(begin_dates).format("YYYY-MM-DD");
|
|
|
let end_date = moment(end_dates).format("YYYY-MM-DD");
|
|
|
- let data = Object.assign({ page: 1,status:'AD_STATUS_DELIVERY_OK',...state.fields},query || {}, {begin_date, end_date,status: state.currentSelect});
|
|
|
+ let data = Object.assign(
|
|
|
+ { page: 1, status: "AD_STATUS_DELIVERY_OK", ...state.fields },
|
|
|
+ query || {},
|
|
|
+ { begin_date, end_date, status: state.currentSelect }
|
|
|
+ );
|
|
|
getADPlanlist(data).then((res) => {
|
|
|
let newList: any[] = res.data.list.map((item) => {
|
|
|
item.enable = item.is_enable == 1 ? true : false;
|
|
|
+ item.popShow = false;
|
|
|
return item;
|
|
|
});
|
|
|
state.list = newList;
|
|
@@ -193,9 +348,18 @@ const PutAdPlan = defineComponent({
|
|
|
state.inSearching = false;
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+ getAdStatus().then(res=>{
|
|
|
+ state.statsList = res.data;
|
|
|
+ })
|
|
|
getCustomColumn().then((res) => {
|
|
|
let columns: any[] = [];
|
|
|
+ let blackList = [
|
|
|
+ "email",
|
|
|
+ "ad_name",
|
|
|
+ "account_name",
|
|
|
+ "ad_id",
|
|
|
+ "delivery_platform",
|
|
|
+ ];
|
|
|
res.data.map((item: { desc: string; name: string }) => {
|
|
|
let lolumnItem: {
|
|
|
title: string;
|
|
@@ -207,25 +371,35 @@ const PutAdPlan = defineComponent({
|
|
|
dataIndex: item.name,
|
|
|
width: 150,
|
|
|
};
|
|
|
+
|
|
|
if (item.name == "external_url") {
|
|
|
lolumnItem.slots = { customRender: "external_url" };
|
|
|
}
|
|
|
if (item.name == "cpa_bid" || item.name == "budget") {
|
|
|
lolumnItem.slots = { customRender: item.name };
|
|
|
}
|
|
|
-
|
|
|
columns.push(lolumnItem);
|
|
|
});
|
|
|
+ let newColunms = columns.filter(
|
|
|
+ (item) => !blackList.includes(item.dataIndex)
|
|
|
+ );
|
|
|
+
|
|
|
state.columns = [];
|
|
|
state.columns.push(...state.defaultColumns);
|
|
|
- state.columns.push(...columns);
|
|
|
+ state.columns.push(...newColunms);
|
|
|
state.columns.push({
|
|
|
- title: "操作",
|
|
|
+ title: "操作记录",
|
|
|
dataIndex: "opertate",
|
|
|
- fixed: "right",
|
|
|
slots: { customRender: "opertate" },
|
|
|
width: 100,
|
|
|
});
|
|
|
+ state.columns.push({
|
|
|
+ title: "日志",
|
|
|
+ dataIndex: "opertate",
|
|
|
+ fixed: "right",
|
|
|
+ slots: { customRender: "dayt" },
|
|
|
+ width: 100,
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
const handleTableChange = (pagination: PageOptions) => {
|
|
@@ -246,8 +420,34 @@ const PutAdPlan = defineComponent({
|
|
|
this.visible = true;
|
|
|
this.currentId = record.ad_id;
|
|
|
},
|
|
|
+ handleVisibleChange(visibale: boolean) {
|
|
|
+ if (!visibale) {
|
|
|
+ this.popconfirmShow = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.hasPopFormData) {
|
|
|
+ this.popconfirmShow = false;
|
|
|
+ } else {
|
|
|
+ this.popconfirmShow = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmEdit() {
|
|
|
+ console.log(this.currentTbs);
|
|
|
+ let { id, back_on, rate, condition, price } = this.popForm[
|
|
|
+ this.currentTbs
|
|
|
+ ];
|
|
|
+ let data = { id, back_on: Number(back_on), rate, condition, price };
|
|
|
+ setBackConfig(data).then((res) => {
|
|
|
+ this.$message.success("修改成功!");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getregister(record:any) {
|
|
|
+ console.log(record)
|
|
|
+ this.register.ad_lid = record.id;
|
|
|
+ this.register.back_platform =record.delivery_platform;
|
|
|
+ this.registerVisable = true;
|
|
|
+ },
|
|
|
onCellChange(record: any, dataIndex: string, value: string) {
|
|
|
- console.log(record);
|
|
|
let ad_id = record.ad_id;
|
|
|
if (dataIndex == "cpa_bid") {
|
|
|
adChangeCrem({ ad_id, bid: value })
|
|
@@ -268,6 +468,10 @@ const PutAdPlan = defineComponent({
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ tabChangeBack(key: number) {
|
|
|
+ this.currentTbs = key;
|
|
|
+ },
|
|
|
+ editBackConfig() {},
|
|
|
switchMethod(record: any) {
|
|
|
console.log(record);
|
|
|
let ad_id = record.ad_id;
|
|
@@ -283,9 +487,35 @@ const PutAdPlan = defineComponent({
|
|
|
this.list.map((item: ADPlanItem) => {
|
|
|
ids = ids + `,${item.ad_id}`;
|
|
|
});
|
|
|
- this.ids = ids.substring(1);
|
|
|
+ let [begin_dates, end_dates] = this.pickerFilter;
|
|
|
+ let begin_date = moment(begin_dates).format("YYYY-MM-DD");
|
|
|
+ let end_date = moment(end_dates).format("YYYY-MM-DD");
|
|
|
+ this.backData.ids = ids.substring(1);
|
|
|
+ this.backData.begin_date = begin_date;
|
|
|
+ this.backData.end_date = end_date;
|
|
|
+ this.backData.field = this.currentStats;
|
|
|
this.visible1 = true;
|
|
|
},
|
|
|
+ handleClickChange() {
|
|
|
+ console.log(this.showPop);
|
|
|
+ },
|
|
|
+ backPost() {},
|
|
|
+ getBackData(record: any) {
|
|
|
+ getAdBackPlan({
|
|
|
+ ad_lid: record.id,
|
|
|
+ back_platform: record.delivery_platform,
|
|
|
+ }).then((res) => {
|
|
|
+ let list = res.data.map((r: PlanBack) => {
|
|
|
+ r.price = r.extra?.price;
|
|
|
+ r.back_on = !!Number(r.back_on);
|
|
|
+ return r;
|
|
|
+ });
|
|
|
+ list.length > 0
|
|
|
+ ? (this.hasPopFormData = true)
|
|
|
+ : (this.hasPopFormData = false);
|
|
|
+ this.popForm = list;
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|
|
@@ -303,5 +533,34 @@ export default PutAdPlan;
|
|
|
}
|
|
|
.item-right {
|
|
|
margin-right: 10px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .ant-select{
|
|
|
+ width: 100px;
|
|
|
+ }
|
|
|
+ .label{
|
|
|
+ display: inline-block;
|
|
|
+ min-width:80px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.hover-content {
|
|
|
+ margin: 8px 0 5px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .label {
|
|
|
+ padding-right: 15px;
|
|
|
+ display: inline-block;
|
|
|
+ max-width: 72px;
|
|
|
+ width: 72px;
|
|
|
+ }
|
|
|
+ .ant-switch {
|
|
|
+ width: 50px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.footer-slot {
|
|
|
+ margin-top: 10px;
|
|
|
+ button {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|