|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="page-wrap page-wrap-account">
|
|
|
<tool-bar
|
|
|
- :text="['account_name', 'email', 'ad_name', 'campaign_name']"
|
|
|
- :label="['账户名', '邮箱', '计划名称(或ID)', '广告组名称']"
|
|
|
+ :text="['ad_id', 'advertiser_id', 'campaign_id']"
|
|
|
+ :label="['计划ID', '账号', '广告组名称']"
|
|
|
v-model:loading="inSearching"
|
|
|
@confirm="onSearch"
|
|
|
>
|
|
@@ -62,13 +62,8 @@
|
|
|
<template #external_url="{ text, record }">
|
|
|
<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.account_name }}</p>
|
|
|
<p>广告名:{{ record.ad_name }}</p>
|
|
|
<p>广告ID:{{ record.ad_id }}</p>
|
|
|
</template>
|
|
@@ -171,7 +166,7 @@
|
|
|
|
|
|
<template #cpa_bid="{ text, record }">
|
|
|
<editable-cell
|
|
|
- :text="text"
|
|
|
+ :text="`${text}`"
|
|
|
title="预算"
|
|
|
@change="(val) => onCellChange(record, 'cpa_bid', val)"
|
|
|
/>
|
|
@@ -179,7 +174,7 @@
|
|
|
|
|
|
<template #budget="{ text, record }">
|
|
|
<editable-cell
|
|
|
- :text="text"
|
|
|
+ :text="`${text}`"
|
|
|
title="出价"
|
|
|
@change="(val) => onCellChange(record, 'budget', val)"
|
|
|
/>
|
|
@@ -307,6 +302,7 @@ const PutAdPlan = defineComponent({
|
|
|
price: 0,
|
|
|
},
|
|
|
],
|
|
|
+ cost_order: 0,
|
|
|
optionList: opList,
|
|
|
statsList: stList,
|
|
|
currentStats: "paid_order_amount",
|
|
@@ -323,14 +319,13 @@ const PutAdPlan = defineComponent({
|
|
|
});
|
|
|
const onSearch = async (fields: Record<string, string>) => {
|
|
|
try {
|
|
|
- const { email, account_name, ad_name, status, campaign_name } = fields;
|
|
|
+ const { ad_id, advertiser_id, campaign_id, status } = fields;
|
|
|
state.fields = fields;
|
|
|
const data = {
|
|
|
- email,
|
|
|
- account_name,
|
|
|
- ad_name,
|
|
|
+ ad_id,
|
|
|
+ advertiser_id,
|
|
|
status: state.currentSelect,
|
|
|
- campaign_name,
|
|
|
+ campaign_id,
|
|
|
page: 1,
|
|
|
};
|
|
|
getData(data);
|
|
@@ -351,9 +346,14 @@ const PutAdPlan = defineComponent({
|
|
|
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 },
|
|
|
+ {
|
|
|
+ page: 1,
|
|
|
+ status: "AD_STATUS_DELIVERY_OK",
|
|
|
+ ...state.fields,
|
|
|
+ },
|
|
|
query || {},
|
|
|
- { begin_date, end_date, status: state.currentSelect }
|
|
|
+ { begin_date, end_date, status: state.currentSelect },
|
|
|
+ state.cost_order ? { cost_order:state.cost_order } : {}
|
|
|
);
|
|
|
getADPlanlist(data).then((res) => {
|
|
|
let newList: any[] = res.data.list.map((item) => {
|
|
@@ -384,10 +384,11 @@ const PutAdPlan = defineComponent({
|
|
|
dataIndex: string;
|
|
|
slots?: any;
|
|
|
width?: string | number;
|
|
|
+ sorter?: boolean;
|
|
|
} = {
|
|
|
title: item.desc,
|
|
|
dataIndex: item.name,
|
|
|
- width: 150,
|
|
|
+ width: 110,
|
|
|
};
|
|
|
|
|
|
if (item.name == "external_url") {
|
|
@@ -396,6 +397,10 @@ const PutAdPlan = defineComponent({
|
|
|
if (item.name == "cpa_bid" || item.name == "budget") {
|
|
|
lolumnItem.slots = { customRender: item.name };
|
|
|
}
|
|
|
+ if (item.name == "cost") {
|
|
|
+ lolumnItem.sorter = true;
|
|
|
+ }
|
|
|
+
|
|
|
columns.push(lolumnItem);
|
|
|
});
|
|
|
let newColunms = columns.filter(
|
|
@@ -420,7 +425,16 @@ const PutAdPlan = defineComponent({
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- const handleTableChange = (pagination: PageOptions) => {
|
|
|
+ const handleTableChange = (
|
|
|
+ pagination: PageOptions,
|
|
|
+ filters: any,
|
|
|
+ sorter: any
|
|
|
+ ) => {
|
|
|
+ if (sorter.columnKey == "cost") {
|
|
|
+ sorter.order == "ascend"
|
|
|
+ ? (state.cost_order = 1)
|
|
|
+ : (state.cost_order = 2);
|
|
|
+ }
|
|
|
const { current, pageSize, total } = pagination;
|
|
|
getData({ page: current });
|
|
|
};
|
|
@@ -467,7 +481,7 @@ const PutAdPlan = defineComponent({
|
|
|
onCellChange(record: any, dataIndex: string, value: string) {
|
|
|
let ad_id = record.ad_id;
|
|
|
if (dataIndex == "cpa_bid") {
|
|
|
- adChangeCrem({ ad_id, bid: value })
|
|
|
+ adChangeCrem({ ad_id, bid: Number(value) })
|
|
|
.then((res) => {
|
|
|
this.$message.success("修改成功!");
|
|
|
})
|
|
@@ -476,7 +490,7 @@ const PutAdPlan = defineComponent({
|
|
|
});
|
|
|
}
|
|
|
if (dataIndex == "budget") {
|
|
|
- adChangeMoney({ ad_id, budget: value })
|
|
|
+ adChangeMoney({ ad_id, budget: Number(value) })
|
|
|
.then((res) => {
|
|
|
this.$message.success("修改成功!");
|
|
|
})
|
|
@@ -490,7 +504,6 @@ const PutAdPlan = defineComponent({
|
|
|
},
|
|
|
editBackConfig() {},
|
|
|
switchMethod(record: any) {
|
|
|
- console.log(record);
|
|
|
let ad_id = record.ad_id;
|
|
|
statusChange({
|
|
|
ad_id,
|