|
@@ -1,8 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<div class="page-wrap page-wrap-account page-adplan">
|
|
<div class="page-wrap page-wrap-account page-adplan">
|
|
<tool-bar
|
|
<tool-bar
|
|
- :text="['ad_id', 'advertiser_id', 'campaign_id']"
|
|
|
|
- :label="['计划名/ID', '账号名/ID', '广告组名称/ID']"
|
|
|
|
|
|
+ :text="['ad_id', 'advertiser_id', 'campaign_id', 'channel_id', 'book_id']"
|
|
|
|
+ :label="['计划名/ID', '账号名/ID', '广告组名称/ID', '站点ID', '书籍ID']"
|
|
:defaultVal="defaultToolvalue"
|
|
:defaultVal="defaultToolvalue"
|
|
v-model:loading="inSearching"
|
|
v-model:loading="inSearching"
|
|
@confirm="onSearch"
|
|
@confirm="onSearch"
|
|
@@ -268,7 +268,7 @@
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { defineComponent, reactive, toRefs, ref, unref, onMounted } from "vue";
|
|
import { defineComponent, reactive, toRefs, ref, unref, onMounted } from "vue";
|
|
-import moment from "moment";
|
|
|
|
|
|
+import moment,{ Moment } from "moment";
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
import PutData from "@/views/put/put-log.vue";
|
|
import PutData from "@/views/put/put-log.vue";
|
|
import CustomCloumn from "@/views/put/component/customClomu.vue";
|
|
import CustomCloumn from "@/views/put/component/customClomu.vue";
|
|
@@ -367,6 +367,8 @@ const PutAdPlan = defineComponent({
|
|
],
|
|
],
|
|
isInit: false,
|
|
isInit: false,
|
|
cost_order: 0,
|
|
cost_order: 0,
|
|
|
|
+ convert_order:0,
|
|
|
|
+ convert_cost_order:0,
|
|
optionList: opList,
|
|
optionList: opList,
|
|
statsList: stList,
|
|
statsList: stList,
|
|
currentStats: "paid_order_amount",
|
|
currentStats: "paid_order_amount",
|
|
@@ -375,14 +377,21 @@ const PutAdPlan = defineComponent({
|
|
rangePick: picker,
|
|
rangePick: picker,
|
|
});
|
|
});
|
|
|
|
|
|
- if (route.query && route.query.campaign_id) {
|
|
|
|
|
|
+ if (route.query &&( route.query.campaign_id || route.query.channel_id || route.query.book_id)) {
|
|
state.defaultToolvalue = {
|
|
state.defaultToolvalue = {
|
|
- campaign_id: route.query.campaign_id,
|
|
|
|
|
|
+ campaign_id: route.query.campaign_id || '',
|
|
|
|
+ channel_id: route.query.channel_id || '',
|
|
|
|
+ book_id: route.query.book_id || '',
|
|
};
|
|
};
|
|
state.fields = {
|
|
state.fields = {
|
|
- campaign_id: route.query.campaign_id,
|
|
|
|
|
|
+ campaign_id: route.query.campaign_id || '',
|
|
|
|
+ channel_id: route.query.channel_id || '',
|
|
|
|
+ book_id: route.query.book_id || '',
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
+ if (route.query && route.query.begin_date && route.query.end_date) {
|
|
|
|
+ state.pickerFilter =[moment(route.query.begin_date as any), moment(route.query.end_date as any)]
|
|
|
|
+ }
|
|
|
|
|
|
getAddStatus().then((res) => {
|
|
getAddStatus().then((res) => {
|
|
res.data.unshift({
|
|
res.data.unshift({
|
|
@@ -428,7 +437,7 @@ const PutAdPlan = defineComponent({
|
|
},
|
|
},
|
|
query || {},
|
|
query || {},
|
|
{ begin_date, end_date, status: state.currentSelect },
|
|
{ begin_date, end_date, status: state.currentSelect },
|
|
- state.cost_order ? { cost_order: state.cost_order } : {}
|
|
|
|
|
|
+ { cost_order: state.cost_order,convert_order:state.convert_order, convert_cost_order:state.convert_cost_order }
|
|
);
|
|
);
|
|
const { data } = await getADPlanlist(datas);
|
|
const { data } = await getADPlanlist(datas);
|
|
const { data: taotals } = await getadDataSum(datas);
|
|
const { data: taotals } = await getadDataSum(datas);
|
|
@@ -437,6 +446,7 @@ const PutAdPlan = defineComponent({
|
|
item.popShow = false;
|
|
item.popShow = false;
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
|
|
+ let sortList = ['cost','convert','convert_cost']
|
|
let columns = state.columns.map((r) => {
|
|
let columns = state.columns.map((r) => {
|
|
if (r.dataIndex === "ad_name") {
|
|
if (r.dataIndex === "ad_name") {
|
|
r.children = [
|
|
r.children = [
|
|
@@ -458,7 +468,8 @@ const PutAdPlan = defineComponent({
|
|
dataIndex: r.dataIndex,
|
|
dataIndex: r.dataIndex,
|
|
width: r.width,
|
|
width: r.width,
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
- sorter: r.dataIndex === "cost" ? true : false,
|
|
|
|
|
|
+ sorter: sortList.includes(r.dataIndex) ? true : false,
|
|
|
|
+ sortDirections:['descend', 'ascend',false]
|
|
},
|
|
},
|
|
];
|
|
];
|
|
}
|
|
}
|
|
@@ -555,6 +566,9 @@ const PutAdPlan = defineComponent({
|
|
});
|
|
});
|
|
|
|
|
|
const setSateSwitch = (val: string, name: string) => {
|
|
const setSateSwitch = (val: string, name: string) => {
|
|
|
|
+ state.cost_order = 0;
|
|
|
|
+ state.convert_order = 0;
|
|
|
|
+ state.convert_cost_order = 0;
|
|
switch (val) {
|
|
switch (val) {
|
|
case "ascend":
|
|
case "ascend":
|
|
(state as any)[name] = 2;
|
|
(state as any)[name] = 2;
|
|
@@ -572,22 +586,31 @@ const PutAdPlan = defineComponent({
|
|
filters: any,
|
|
filters: any,
|
|
sorter: any
|
|
sorter: any
|
|
) => {
|
|
) => {
|
|
- console.log(sorter)
|
|
|
|
|
|
+
|
|
if (sorter.columnKey == "cost") {
|
|
if (sorter.columnKey == "cost") {
|
|
setSateSwitch(sorter.order, "cost_order");
|
|
setSateSwitch(sorter.order, "cost_order");
|
|
}
|
|
}
|
|
|
|
+ if(sorter.columnKey == "convert"){
|
|
|
|
+ setSateSwitch(sorter.order, "convert_order");
|
|
|
|
+ }
|
|
|
|
+ if(sorter.columnKey == "convert_cost"){
|
|
|
|
+ setSateSwitch(sorter.order, "convert_cost_order");
|
|
|
|
+ }
|
|
|
|
+
|
|
const { current, pageSize, total } = pagination;
|
|
const { current, pageSize, total } = pagination;
|
|
- getData({ campaign_id: route.query?.campaign_id ?? "",page: current });
|
|
|
|
|
|
+ getData({ campaign_id: route.query?.campaign_id ?? "",channel_id:route.query?.channel_id ?? "",book_id:route.query?.book_id?? "",page: current });
|
|
};
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
getData({
|
|
getData({
|
|
campaign_id: route.query?.campaign_id ?? "",
|
|
campaign_id: route.query?.campaign_id ?? "",
|
|
|
|
+ channel_id:route.query?.channel_id ?? "",
|
|
|
|
+ book_id:route.query?.book_id ?? "",
|
|
current: 1,
|
|
current: 1,
|
|
});
|
|
});
|
|
},200)
|
|
},200)
|
|
-
|
|
|
|
|
|
+
|
|
});
|
|
});
|
|
|
|
|
|
return { ...toRefs(state), handleTableChange, onSearch, switchDate };
|
|
return { ...toRefs(state), handleTableChange, onSearch, switchDate };
|
|
@@ -596,7 +619,7 @@ const PutAdPlan = defineComponent({
|
|
let winHeight =
|
|
let winHeight =
|
|
document.documentElement.clientHeight || document.body.clientHeight;
|
|
document.documentElement.clientHeight || document.body.clientHeight;
|
|
this.scrollY = winHeight - 352;
|
|
this.scrollY = winHeight - 352;
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
moment,
|
|
moment,
|