|
@@ -18,6 +18,25 @@
|
|
>
|
|
>
|
|
</a-select>
|
|
</a-select>
|
|
</div>
|
|
</div>
|
|
|
|
+ <template v-if="!!is_admin">
|
|
|
|
+ <div class="tool-bar-item">
|
|
|
|
+ <p class="label">推广员</p>
|
|
|
|
+ <a-select
|
|
|
|
+ mode="multiple"
|
|
|
|
+ v-model:value="uids"
|
|
|
|
+ placeholder="请选择推广员"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option
|
|
|
|
+ v-for="user in available_uids"
|
|
|
|
+ :key="user.id"
|
|
|
|
+ :value="user.id"
|
|
|
|
+ >
|
|
|
|
+ {{ user.nickname }}
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</tool-bar>
|
|
</tool-bar>
|
|
|
|
|
|
<div class="table-filter">
|
|
<div class="table-filter">
|
|
@@ -267,8 +286,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
-import { defineComponent, reactive, toRefs, ref, unref, onMounted,computed } from "vue";
|
|
|
|
-import moment,{ Moment } from "moment";
|
|
|
|
|
|
+import {
|
|
|
|
+ defineComponent,
|
|
|
|
+ reactive,
|
|
|
|
+ toRefs,
|
|
|
|
+ ref,
|
|
|
|
+ unref,
|
|
|
|
+ onMounted,
|
|
|
|
+ computed
|
|
|
|
+} from "vue";
|
|
|
|
+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";
|
|
@@ -283,7 +310,7 @@ import { MutationType } from "@/store/modules/app/_type";
|
|
|
|
|
|
import {
|
|
import {
|
|
TableColumnOfPutAdPlan,
|
|
TableColumnOfPutAdPlan,
|
|
- ALLCloumnList,
|
|
|
|
|
|
+ ALLCloumnList
|
|
} from "../_pageOptions/table-put";
|
|
} from "../_pageOptions/table-put";
|
|
|
|
|
|
import {
|
|
import {
|
|
@@ -296,10 +323,11 @@ import {
|
|
getAdBackPlan,
|
|
getAdBackPlan,
|
|
setBackConfig,
|
|
setBackConfig,
|
|
getAdStatus,
|
|
getAdStatus,
|
|
- getadDataSum,
|
|
|
|
|
|
+ getadDataSum
|
|
} from "@/api";
|
|
} from "@/api";
|
|
|
|
|
|
import { ADPlanItem, PageOptions, PlanBack } from "@/types/api";
|
|
import { ADPlanItem, PageOptions, PlanBack } from "@/types/api";
|
|
|
|
+import useAuthUser from "@/hooks/composable/useAuthUser";
|
|
|
|
|
|
const PutAdPlan = defineComponent({
|
|
const PutAdPlan = defineComponent({
|
|
components: {
|
|
components: {
|
|
@@ -309,12 +337,13 @@ const PutAdPlan = defineComponent({
|
|
PutCount,
|
|
PutCount,
|
|
InfoCircleOutlined,
|
|
InfoCircleOutlined,
|
|
RegisterDatad,
|
|
RegisterDatad,
|
|
- CustomCloumn,
|
|
|
|
|
|
+ CustomCloumn
|
|
},
|
|
},
|
|
|
|
|
|
setup() {
|
|
setup() {
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
- const { router, route,store } = useApp();
|
|
|
|
|
|
+ const { is_admin, available_uids } = useAuthUser();
|
|
|
|
+ const { router, route, store } = useApp();
|
|
|
|
|
|
let list: any[] = [],
|
|
let list: any[] = [],
|
|
opList: any[] = [],
|
|
opList: any[] = [],
|
|
@@ -331,7 +360,7 @@ const PutAdPlan = defineComponent({
|
|
innerClomuns: ref<any[]>([]),
|
|
innerClomuns: ref<any[]>([]),
|
|
lineVisable: false,
|
|
lineVisable: false,
|
|
defaultToolvalue: {},
|
|
defaultToolvalue: {},
|
|
- tableLoading:false,
|
|
|
|
|
|
+ tableLoading: false,
|
|
scrollY: 600,
|
|
scrollY: 600,
|
|
visible: false,
|
|
visible: false,
|
|
popconfirmShow: false,
|
|
popconfirmShow: false,
|
|
@@ -342,11 +371,14 @@ const PutAdPlan = defineComponent({
|
|
columnShow: false,
|
|
columnShow: false,
|
|
register: {
|
|
register: {
|
|
ad_lid: 0,
|
|
ad_lid: 0,
|
|
- back_platform: "",
|
|
|
|
|
|
+ back_platform: ""
|
|
},
|
|
},
|
|
pickerFilter: computed(() =>
|
|
pickerFilter: computed(() =>
|
|
store.getters.selectTime.length > 0
|
|
store.getters.selectTime.length > 0
|
|
- ? [moment(store.getters.selectTime[0]),moment(store.getters.selectTime[1])]
|
|
|
|
|
|
+ ? [
|
|
|
|
+ moment(store.getters.selectTime[0]),
|
|
|
|
+ moment(store.getters.selectTime[1])
|
|
|
|
+ ]
|
|
: [moment(), moment()]
|
|
: [moment(), moment()]
|
|
),
|
|
),
|
|
tablePageOptions,
|
|
tablePageOptions,
|
|
@@ -356,7 +388,7 @@ const PutAdPlan = defineComponent({
|
|
ids: "",
|
|
ids: "",
|
|
begin_date: "",
|
|
begin_date: "",
|
|
end_date: "",
|
|
end_date: "",
|
|
- field: "",
|
|
|
|
|
|
+ field: ""
|
|
},
|
|
},
|
|
|
|
|
|
currentTbs: 0,
|
|
currentTbs: 0,
|
|
@@ -368,44 +400,51 @@ const PutAdPlan = defineComponent({
|
|
rate: 0,
|
|
rate: 0,
|
|
condition: "",
|
|
condition: "",
|
|
price: 0,
|
|
price: 0,
|
|
- float_rate: 0,
|
|
|
|
- },
|
|
|
|
|
|
+ float_rate: 0
|
|
|
|
+ }
|
|
],
|
|
],
|
|
isInit: false,
|
|
isInit: false,
|
|
cost_order: 0,
|
|
cost_order: 0,
|
|
- convert_order:0,
|
|
|
|
- convert_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",
|
|
defaultColumns: TableColumnOfPutAdPlan,
|
|
defaultColumns: TableColumnOfPutAdPlan,
|
|
fields: {},
|
|
fields: {},
|
|
rangePick: picker,
|
|
rangePick: picker,
|
|
|
|
+ uids: ref<number[]>([])
|
|
});
|
|
});
|
|
|
|
|
|
- if (route.query &&( route.query.campaign_id || route.query.channel_id || route.query.book_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 || '',
|
|
|
|
- channel_id: route.query.channel_id || '',
|
|
|
|
- book_id: route.query.book_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 || '',
|
|
|
|
- channel_id: route.query.channel_id || '',
|
|
|
|
- book_id: route.query.book_id || '',
|
|
|
|
|
|
+ campaign_id: route.query.campaign_id || "",
|
|
|
|
+ channel_id: route.query.channel_id || "",
|
|
|
|
+ book_id: route.query.book_id || ""
|
|
};
|
|
};
|
|
}
|
|
}
|
|
- if(route.query.channel_id && route.query.book_id){
|
|
|
|
- state.currentSelect = ''
|
|
|
|
|
|
+ if (route.query.channel_id && route.query.book_id) {
|
|
|
|
+ state.currentSelect = "";
|
|
}
|
|
}
|
|
if (route.query && route.query.begin_date && route.query.end_date) {
|
|
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)]
|
|
|
|
|
|
+ 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({
|
|
name: "",
|
|
name: "",
|
|
- desc: "不限",
|
|
|
|
|
|
+ desc: "不限"
|
|
});
|
|
});
|
|
state.optionList = res.data;
|
|
state.optionList = res.data;
|
|
});
|
|
});
|
|
@@ -418,7 +457,7 @@ const PutAdPlan = defineComponent({
|
|
ad_id,
|
|
ad_id,
|
|
status: state.currentSelect,
|
|
status: state.currentSelect,
|
|
campaign_id,
|
|
campaign_id,
|
|
- page: 1,
|
|
|
|
|
|
+ page: 1
|
|
};
|
|
};
|
|
getData(data);
|
|
getData(data);
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -428,7 +467,7 @@ const PutAdPlan = defineComponent({
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
- const switchDate = (date: any, dateString:any[]) => {
|
|
|
|
|
|
+ const switchDate = (date: any, dateString: any[]) => {
|
|
store.commit(MutationType.setSelectTime, dateString);
|
|
store.commit(MutationType.setSelectTime, dateString);
|
|
onSearch(state.fields);
|
|
onSearch(state.fields);
|
|
};
|
|
};
|
|
@@ -443,11 +482,16 @@ const PutAdPlan = defineComponent({
|
|
{
|
|
{
|
|
page: 1,
|
|
page: 1,
|
|
status: "AD_STATUS_DELIVERY_OK",
|
|
status: "AD_STATUS_DELIVERY_OK",
|
|
- ...state.fields,
|
|
|
|
|
|
+ ...state.fields
|
|
},
|
|
},
|
|
query || {},
|
|
query || {},
|
|
{ begin_date, end_date, status: state.currentSelect },
|
|
{ begin_date, end_date, status: state.currentSelect },
|
|
- { cost_order: state.cost_order,convert_order:state.convert_order, convert_cost_order:state.convert_cost_order }
|
|
|
|
|
|
+ {
|
|
|
|
+ cost_order: state.cost_order,
|
|
|
|
+ convert_order: state.convert_order,
|
|
|
|
+ convert_cost_order: state.convert_cost_order,
|
|
|
|
+ uids: state.uids.toString()
|
|
|
|
+ }
|
|
);
|
|
);
|
|
const { data } = await getADPlanlist(datas);
|
|
const { data } = await getADPlanlist(datas);
|
|
const { data: taotals } = await getadDataSum(datas);
|
|
const { data: taotals } = await getadDataSum(datas);
|
|
@@ -456,7 +500,7 @@ const PutAdPlan = defineComponent({
|
|
item.popShow = false;
|
|
item.popShow = false;
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
- let sortList = ['cost','convert','convert_cost']
|
|
|
|
|
|
+ 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 = [
|
|
@@ -464,11 +508,11 @@ const PutAdPlan = defineComponent({
|
|
title: "总计",
|
|
title: "总计",
|
|
dataIndex: "ad_name",
|
|
dataIndex: "ad_name",
|
|
slots: {
|
|
slots: {
|
|
- customRender: "ad_name",
|
|
|
|
|
|
+ customRender: "ad_name"
|
|
},
|
|
},
|
|
width: r.width,
|
|
width: r.width,
|
|
- ellipsis: true,
|
|
|
|
- },
|
|
|
|
|
|
+ ellipsis: true
|
|
|
|
+ }
|
|
];
|
|
];
|
|
}
|
|
}
|
|
if (Object.keys(taotals).includes(r.dataIndex)) {
|
|
if (Object.keys(taotals).includes(r.dataIndex)) {
|
|
@@ -479,13 +523,13 @@ const PutAdPlan = defineComponent({
|
|
width: r.width,
|
|
width: r.width,
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
sorter: sortList.includes(r.dataIndex) ? true : false,
|
|
sorter: sortList.includes(r.dataIndex) ? true : false,
|
|
- sortDirections:['descend', 'ascend',false]
|
|
|
|
- },
|
|
|
|
|
|
+ sortDirections: ["descend", "ascend", false]
|
|
|
|
+ }
|
|
];
|
|
];
|
|
}
|
|
}
|
|
return r;
|
|
return r;
|
|
});
|
|
});
|
|
- state.showTable = true;
|
|
|
|
|
|
+ state.showTable = true;
|
|
state.columns = columns;
|
|
state.columns = columns;
|
|
state.list = newList;
|
|
state.list = newList;
|
|
meta.value = data.meta;
|
|
meta.value = data.meta;
|
|
@@ -503,7 +547,7 @@ const PutAdPlan = defineComponent({
|
|
"ad_name",
|
|
"ad_name",
|
|
"account_name",
|
|
"account_name",
|
|
"ad_id",
|
|
"ad_id",
|
|
- "delivery_platform",
|
|
|
|
|
|
+ "delivery_platform"
|
|
];
|
|
];
|
|
let extendList = [
|
|
let extendList = [
|
|
"campaign_name",
|
|
"campaign_name",
|
|
@@ -515,7 +559,7 @@ const PutAdPlan = defineComponent({
|
|
"inventory_type",
|
|
"inventory_type",
|
|
"convert_id",
|
|
"convert_id",
|
|
"external_actions",
|
|
"external_actions",
|
|
- "ad_create_time",
|
|
|
|
|
|
+ "ad_create_time"
|
|
];
|
|
];
|
|
res.data.map(
|
|
res.data.map(
|
|
(item: { desc: string; name: string; width?: number | string }) => {
|
|
(item: { desc: string; name: string; width?: number | string }) => {
|
|
@@ -530,8 +574,8 @@ const PutAdPlan = defineComponent({
|
|
} = {
|
|
} = {
|
|
title: item.desc,
|
|
title: item.desc,
|
|
dataIndex: item.name,
|
|
dataIndex: item.name,
|
|
- width: item.width?item.width : 95,
|
|
|
|
- ellipsis: true,
|
|
|
|
|
|
+ width: item.width ? item.width : 95,
|
|
|
|
+ ellipsis: true
|
|
};
|
|
};
|
|
|
|
|
|
if (item.name == "external_url") {
|
|
if (item.name == "external_url") {
|
|
@@ -564,14 +608,14 @@ const PutAdPlan = defineComponent({
|
|
title: "操作记录",
|
|
title: "操作记录",
|
|
dataIndex: "opertate",
|
|
dataIndex: "opertate",
|
|
slots: { customRender: "opertate" },
|
|
slots: { customRender: "opertate" },
|
|
- width: 100,
|
|
|
|
|
|
+ width: 100
|
|
});
|
|
});
|
|
state.columns.push({
|
|
state.columns.push({
|
|
title: "日志",
|
|
title: "日志",
|
|
dataIndex: "opertate",
|
|
dataIndex: "opertate",
|
|
fixed: "right",
|
|
fixed: "right",
|
|
slots: { customRender: "dayt" },
|
|
slots: { customRender: "dayt" },
|
|
- width: 100,
|
|
|
|
|
|
+ width: 100
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
@@ -596,40 +640,49 @@ const PutAdPlan = defineComponent({
|
|
filters: any,
|
|
filters: any,
|
|
sorter: any
|
|
sorter: any
|
|
) => {
|
|
) => {
|
|
-
|
|
|
|
if (sorter.columnKey == "cost") {
|
|
if (sorter.columnKey == "cost") {
|
|
setSateSwitch(sorter.order, "cost_order");
|
|
setSateSwitch(sorter.order, "cost_order");
|
|
}
|
|
}
|
|
- if(sorter.columnKey == "convert"){
|
|
|
|
|
|
+ if (sorter.columnKey == "convert") {
|
|
setSateSwitch(sorter.order, "convert_order");
|
|
setSateSwitch(sorter.order, "convert_order");
|
|
}
|
|
}
|
|
- if(sorter.columnKey == "convert_cost"){
|
|
|
|
|
|
+ if (sorter.columnKey == "convert_cost") {
|
|
setSateSwitch(sorter.order, "convert_cost_order");
|
|
setSateSwitch(sorter.order, "convert_cost_order");
|
|
}
|
|
}
|
|
|
|
|
|
const { current, pageSize, total } = pagination;
|
|
const { current, pageSize, total } = pagination;
|
|
- getData({ campaign_id: route.query?.campaign_id ?? "",channel_id:route.query?.channel_id ?? "",book_id:route.query?.book_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 ?? "",
|
|
|
|
- channel_id:route.query?.channel_id ?? "",
|
|
|
|
- book_id:route.query?.book_id ?? "",
|
|
|
|
- current: 1,
|
|
|
|
- });
|
|
|
|
- },200)
|
|
|
|
-
|
|
|
|
|
|
+ campaign_id: route.query?.campaign_id ?? "",
|
|
|
|
+ channel_id: route.query?.channel_id ?? "",
|
|
|
|
+ book_id: route.query?.book_id ?? "",
|
|
|
|
+ current: 1
|
|
|
|
+ });
|
|
|
|
+ }, 200);
|
|
});
|
|
});
|
|
|
|
|
|
- return { ...toRefs(state), handleTableChange, onSearch, switchDate };
|
|
|
|
|
|
+ return {
|
|
|
|
+ ...toRefs(state),
|
|
|
|
+ is_admin,
|
|
|
|
+ available_uids,
|
|
|
|
+ handleTableChange,
|
|
|
|
+ onSearch,
|
|
|
|
+ switchDate
|
|
|
|
+ };
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
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,
|
|
@@ -671,7 +724,7 @@ const PutAdPlan = defineComponent({
|
|
rate,
|
|
rate,
|
|
condition,
|
|
condition,
|
|
price,
|
|
price,
|
|
- float_rate,
|
|
|
|
|
|
+ float_rate
|
|
};
|
|
};
|
|
|
|
|
|
setBackConfig(data).then((res) => {
|
|
setBackConfig(data).then((res) => {
|
|
@@ -712,7 +765,7 @@ const PutAdPlan = defineComponent({
|
|
let ad_id = record.ad_id;
|
|
let ad_id = record.ad_id;
|
|
statusChange({
|
|
statusChange({
|
|
ad_id,
|
|
ad_id,
|
|
- status: record.enable ? "disable" : "enable",
|
|
|
|
|
|
+ status: record.enable ? "disable" : "enable"
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
this.$message.success("修改广告状态成功!");
|
|
this.$message.success("修改广告状态成功!");
|
|
});
|
|
});
|
|
@@ -734,7 +787,7 @@ const PutAdPlan = defineComponent({
|
|
getBackData(record: any) {
|
|
getBackData(record: any) {
|
|
getAdBackPlan({
|
|
getAdBackPlan({
|
|
ad_lid: record.id,
|
|
ad_lid: record.id,
|
|
- back_platform: record.delivery_platform,
|
|
|
|
|
|
+ back_platform: record.delivery_platform
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
let list = res.data.map((r: PlanBack) => {
|
|
let list = res.data.map((r: PlanBack) => {
|
|
r.price = r.extra?.price;
|
|
r.price = r.extra?.price;
|
|
@@ -755,8 +808,8 @@ const PutAdPlan = defineComponent({
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
location.reload();
|
|
location.reload();
|
|
}, 1500);
|
|
}, 1500);
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
export default PutAdPlan;
|
|
export default PutAdPlan;
|