|
@@ -16,8 +16,24 @@
|
|
|
</div>
|
|
|
</keep-alive>
|
|
|
<div class="topOptions">
|
|
|
- <span class="OptinItem">
|
|
|
- <Treeselect :appId.sync="accountID" :multiple="false" request="2,4" ref="treeSelect" style="margin-bottom:8px " />
|
|
|
+ <span class="OptinItem topOpt">
|
|
|
+ <!-- <Treeselect :appId.sync="accountID" :multiple="false" request="2,4" reqUrl='/ctop/projectMember/getProjectAccountByUserId' ref="treeSelect" style="margin-bottom:8px " /> -->
|
|
|
+
|
|
|
+ <a-tree-select
|
|
|
+ show-search
|
|
|
+ allow-clear
|
|
|
+ dropdownMatchSelectWidth
|
|
|
+ v-model="accountID"
|
|
|
+ style="width: 60%"
|
|
|
+ :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
+ :tree-data="treeData"
|
|
|
+ placeholder="请选择具体账户"
|
|
|
+ :filterOption='filterOption'
|
|
|
+ treeNodeFilterProp='title'
|
|
|
+ @change='accountIDChange'
|
|
|
+ >
|
|
|
+
|
|
|
+ </a-tree-select>
|
|
|
</span>
|
|
|
<span class="OptinItem">
|
|
|
<a-select style="width: 120px" v-model="statusValue" @change="statusChange" placeholder="请选择状态">
|
|
@@ -92,7 +108,7 @@
|
|
|
<a-radio value="BUDGET_MODE_INFINITE">不限</a-radio>
|
|
|
<a-radio value="BUDGET_MODE_DAY">日预算</a-radio>
|
|
|
</a-radio-group>
|
|
|
- <span v-show="radioValue=='dayBudget'">预计金额: <a-input-number :min="0" v-model="dayBudgetValue" :step="0.1" @change="budgetChange" size="small" style='margin-right:20px' /></span>
|
|
|
+ <span v-show="radioValue=='BUDGET_MODE_DAY'">预计金额: <a-input-number :min="0" v-model="dayBudgetValue" :step="0.1" @change="budgetChange" size="small" style='margin-right:20px' /></span>
|
|
|
<a-button type='default' @click="showPricecancel" style='margin-right:10px'>取消</a-button>
|
|
|
<a-button type='primary' @click="showPriceOk" class="ok">保存</a-button>
|
|
|
</div>
|
|
@@ -103,104 +119,125 @@
|
|
|
<a-button type='default' @click="changeofferPrice" v-show="tabkey=='plan'">更改出价</a-button>
|
|
|
|
|
|
</span>
|
|
|
- <span class="optionBtn">
|
|
|
+ <!-- <span class="optionBtn">
|
|
|
<a-button type='primary' @click="reset">自定义列</a-button>
|
|
|
- </span>
|
|
|
+ </span> -->
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
<a-table
|
|
|
:columns="columns"
|
|
|
- :data-source="data"
|
|
|
- :row-selection="rowSelection"
|
|
|
+ :data-source="data"
|
|
|
+ :rowSelection="rowSelection"
|
|
|
bordered
|
|
|
:pagination="ipagination"
|
|
|
:loading="loading"
|
|
|
@change="sort"
|
|
|
>
|
|
|
<template slot="name" slot-scope="text,record">
|
|
|
- <editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'campaignName', $event)" />
|
|
|
+ <editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'name', $event)" />
|
|
|
</template>
|
|
|
<span slot="budget" slot-scope="text,record">
|
|
|
- <editableCell :text="text" slotName='groupBudget' @change="onCellChange(record.key, 'groupBudget', $event)" />
|
|
|
+ <editableCell :text="text" slotName='groupBudget' @change="onCellChange(record.key, 'budget', $event)" />
|
|
|
+ </span>
|
|
|
+ <span slot="bid" slot-scope="text,record">
|
|
|
+ <editableCell :text="text" slotName='bid' @change="onCellChange(record.key, 'bid', $event)" />
|
|
|
</span>
|
|
|
<span slot="status" slot-scope="text,record">
|
|
|
<a-switch size="default" :checked=text @change="switchChange(text,record)"/>
|
|
|
</span>
|
|
|
- <span slot="options" slot-scope="record">
|
|
|
+ <!-- <span slot="toutiaoStatus" slot-scope="text,record">
|
|
|
+ <a-switch size="default" :checked=text @change="switchChange(text,record)"/>
|
|
|
+ </span> -->
|
|
|
+ <!-- <span slot="options" slot-scope="record">
|
|
|
<a href="javascript:;" style="margin-right:10px">编辑</a>
|
|
|
<a href="javascript:;" v-if="tabkey=='plan'" @click="copyPlan(record)">复制</a>
|
|
|
<a href="javascript:;" v-if="tabkey=='idea'">预览</a>
|
|
|
- </span>
|
|
|
- <span slot="parentGroup" slot-scope="text,record">
|
|
|
+ </span> -->
|
|
|
+ <span slot="parentGroup" slot-scope="text">
|
|
|
<a href="javascript:;" >{{text}}</a>
|
|
|
</span>
|
|
|
- <span slot="parentPlan" slot-scope="text,record">
|
|
|
+ <span slot="parentPlan" slot-scope="text">
|
|
|
<a href="javascript:;" >{{text}}</a>
|
|
|
</span>
|
|
|
+ <span slot="time" slot-scope="text,record">
|
|
|
+ {{record.startTime}}至{{record.endTime}}
|
|
|
+ </span>
|
|
|
+ <span slot="flowControlMode" slot-scope="text">
|
|
|
+ <span v-if="text=='FLOW_CONTROL_MODE_FAST'">优先跑量</span>
|
|
|
+ <span v-if="text=='FLOW_CONTROL_MODE_SMOOTH'">优先低成本</span>
|
|
|
+ <span v-if="text=='FLOW_CONTROL_MODE_BALANCE'">均衡投放</span>
|
|
|
+ </span>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 出价的模态框 -->
|
|
|
- <div class="batchModal">
|
|
|
- <a-modal v-model="offerPriceVisiable" :title="'批量修改'+ModalTitle" @ok="handleOk" width='55%' id="batchModal" >
|
|
|
- <div class="selectePlan">已选{{}}个广告计划</div>
|
|
|
- <div class="modifyRules">
|
|
|
- <span class="rules">修改规则:</span>
|
|
|
- <a-radio-group v-model="modifyRulesValue" @change="modifyRulesChange">
|
|
|
- <a-radio-button value="total">
|
|
|
- 统一修改
|
|
|
- </a-radio-button>
|
|
|
- <a-radio-button value="separately">
|
|
|
- 分别修改
|
|
|
- </a-radio-button>
|
|
|
- </a-radio-group>
|
|
|
- <span class="totalPrice" v-if="modifyRulesValue=='total'"><span>{{ModalTitle=='出价'?'出价':'总预算'}}</span>
|
|
|
- :
|
|
|
- <a-input-number :min="0" v-model="inputValue" :step="0.1" @change="budgetChange" size="small" /> 元
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div class="modifyTable">
|
|
|
- <a-table
|
|
|
- :columns="modifyTableCol"
|
|
|
- :data-source="modifyTableData"
|
|
|
- bordered
|
|
|
- tableLayout="auto"
|
|
|
- :pagination="false"
|
|
|
- :loading='modifyTableloading'
|
|
|
- style="word-break: break-all;"
|
|
|
- >
|
|
|
- <span slot="changeBudget" slot-scope="">
|
|
|
- <span v-if="ModalTitle=='出价'">oCPM</span>
|
|
|
- <span v-else>{{modifyRulesValue=='total'?'总预算':'日预算'}}</span>
|
|
|
- :<a-input-number :min="0" v-model="inputValue" :step="0.1" @change="budgetChange" size="small" :disabled="modifyRulesValue=='total'" /> 元
|
|
|
- </span>
|
|
|
- <span slot="currentCost" slot-scope="currentCost">{{ currentCost | decimalsHandle }}</span>
|
|
|
- <span slot="currentBudget" slot-scope="text">
|
|
|
- <span v-if="ModalTitle=='出价'">oCPM: {{text | decimalsHandle}}</span>
|
|
|
- <span v-else>日预算:{{ text | decimalsHandle }}</span>
|
|
|
+ <div class="batchModal" >
|
|
|
+ <a-modal v-model="offerPriceVisiable" :title="'批量修改'+ModalTitle" @ok="modifyChangeOk" width='55%' id="batchModal" >
|
|
|
+ <div id="batchModal">
|
|
|
+ <div class="selectePlan">已选{{}}个广告计划</div>
|
|
|
+ <div class="modifyRules">
|
|
|
+ <span class="rules">修改规则:</span>
|
|
|
+ <a-radio-group v-model="modifyRulesValue" @change="modifyRulesChange">
|
|
|
+ <a-radio-button value="total">
|
|
|
+ 统一修改
|
|
|
+ </a-radio-button>
|
|
|
+ <a-radio-button value="separately">
|
|
|
+ 分别修改
|
|
|
+ </a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ <span class="totalPrice" v-if="modifyRulesValue=='total'"><span>{{ModalTitle=='出价'?'出价:':'总预算:'}}</span>
|
|
|
+
|
|
|
+ <a-input-number :min="0" v-model="inputValue" :step="0.1" @change="totalbudgetChange" size="small" /> 元
|
|
|
</span>
|
|
|
- </a-table>
|
|
|
+ </div>
|
|
|
+ <div class="modifyTable">
|
|
|
+ <a-table
|
|
|
+ :columns="modifyTableCol"
|
|
|
+ :data-source="modifyTableData"
|
|
|
+ bordered
|
|
|
+ tableLayout="auto"
|
|
|
+ :pagination="false"
|
|
|
+ :loading='modifyTableloading'
|
|
|
+ style="word-break: break-all;"
|
|
|
+ >
|
|
|
+ <span slot="changeBudget" slot-scope="text,records">
|
|
|
+ <span v-if="ModalTitle=='出价'">oCPM</span>
|
|
|
+ <span v-else>{{modifyRulesValue=='total'?'总预算:':'日预算:'}}</span>
|
|
|
+ <a-input-number :min="0" :step="0.1" @blur='budgetChange($event,records)' size="small" :disabled="modifyRulesValue=='total'" /> 元
|
|
|
+ </span>
|
|
|
+ <span slot="currentCost" slot-scope="currentCost">{{ currentCost | decimalsHandle }}</span>
|
|
|
+ <span slot="budget" slot-scope="text">
|
|
|
+
|
|
|
+ <span >日预算:{{ text | decimalsHandle }}</span>
|
|
|
+ </span>
|
|
|
+ <span slot="bid" slot-scope="text" >
|
|
|
+ <span >oCPM: {{text | decimalsHandle}}</span>
|
|
|
+
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-
|
|
|
</a-modal>
|
|
|
</div>
|
|
|
|
|
|
<!-- 复制计划的弹出框 -->
|
|
|
<a-modal v-model="copyPlanVisiable" title="复制计划" @ok="copyPlanOk" id="copyModal" :maskClosable='false'>
|
|
|
+ <div id="copyModal">
|
|
|
+ <p class="copyTip">复制说明:适用于批量复制多个广告计划,默认同事复制所属创意。此类型不直接跨广告投放账号复制,且只能复制完成后逐一修改</p>
|
|
|
+ <p style="font-weight:700;font-size:15px">被复制广告计划:<span>{{}}</span></p>
|
|
|
+ <p><span class="copyName"><b class="copyKeyStart">*</b> 复制个数:</span>
|
|
|
+ <a-input-number :min="1" :max="10" v-model="copyNum" style="width:250px" />
|
|
|
|
|
|
- <p class="copyTip">复制说明:适用于批量复制多个广告计划,默认同事复制所属创意。此类型不直接跨广告投放账号复制,且只能复制完成后逐一修改</p>
|
|
|
- <p style="font-weight:700;font-size:15px">被复制广告计划:<span>{{}}</span></p>
|
|
|
- <p><span class="copyName"><b class="copyKeyStart">*</b> 复制个数:</span>
|
|
|
- <a-input-number :min="1" :max="10" v-model="copyNum" style="width:250px" />
|
|
|
-
|
|
|
- </p>
|
|
|
- <p><span class="copyName"><b class="copyKeyStart">*</b>复制到广告组:</span>
|
|
|
- <a-select size="default" default-value="a1" style="width: 250px" v-model="copyGroup" >
|
|
|
- <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
|
|
|
- {{ (i + 9).toString(36) + i }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </p>
|
|
|
+ </p>
|
|
|
+ <p><span class="copyName"><b class="copyKeyStart">*</b>复制到广告组:</span>
|
|
|
+ <a-select size="default" default-value="a1" style="width: 250px" v-model="copyGroup" >
|
|
|
+ <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
|
|
|
+ {{ (i + 9).toString(36) + i }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+
|
|
|
</a-modal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -215,7 +252,7 @@ let typeValue='预算'
|
|
|
let modifyTableCol=[
|
|
|
{
|
|
|
title: '广告计划',
|
|
|
- dataIndex: 'advertisingPlan',
|
|
|
+ dataIndex: 'name',
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
@@ -225,13 +262,19 @@ let modifyTableCol=[
|
|
|
scopedSlots: { customRender: 'currentCost' },
|
|
|
},
|
|
|
{
|
|
|
- title: '当前'+typeValue,
|
|
|
- dataIndex: 'currentBudget',
|
|
|
+ title: '当前预算',
|
|
|
+ dataIndex: 'budget',
|
|
|
align: 'center',
|
|
|
- scopedSlots: { customRender: 'currentBudget' },
|
|
|
+ scopedSlots: { customRender:'budget' },
|
|
|
},
|
|
|
{
|
|
|
- title: '统一修改'+typeValue,
|
|
|
+ title: '当前出价',
|
|
|
+ dataIndex: 'bid',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender:'bid' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '修改'+typeValue,
|
|
|
dataIndex: 'changeBudget',
|
|
|
align: 'center',
|
|
|
scopedSlots: { customRender: 'changeBudget' },
|
|
@@ -299,69 +342,71 @@ const planColumns = [
|
|
|
align: 'center',
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'options',
|
|
|
- key: 'options',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: { customRender: 'options' }
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '操作',
|
|
|
+ // dataIndex: 'options',
|
|
|
+ // key: 'options',
|
|
|
+ // align: 'center',
|
|
|
+ // width:200,
|
|
|
+ // scopedSlots: { customRender: 'options' }
|
|
|
+ // },
|
|
|
{
|
|
|
title: '计划名称',
|
|
|
- dataIndex: 'planName',
|
|
|
- key: 'planName',
|
|
|
+ dataIndex: 'name',
|
|
|
+ key: 'name',
|
|
|
align: 'center',
|
|
|
width:300,
|
|
|
- scopedSlots: { customRender: 'planName' }
|
|
|
+ scopedSlots: { customRender: 'name' }
|
|
|
},
|
|
|
{
|
|
|
title: '计划ID',
|
|
|
- dataIndex: 'planID',
|
|
|
- key: 'planID',
|
|
|
+ dataIndex: 'id',
|
|
|
+ key: 'id',
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
title: '账户',
|
|
|
- dataIndex: 'accountName',
|
|
|
- key: 'promotionPurpose',
|
|
|
+ dataIndex: 'accountId',
|
|
|
+ key: 'accountId',
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
title: '计划预算(元)',
|
|
|
- dataIndex: 'planBudget',
|
|
|
- key: 'planBudget',
|
|
|
+ dataIndex: 'budget',
|
|
|
+ key: 'budget',
|
|
|
align: 'center',
|
|
|
width:150,
|
|
|
- scopedSlots: { customRender: 'planBudget' }
|
|
|
+ scopedSlots: { customRender: 'budget' }
|
|
|
},
|
|
|
{
|
|
|
title: '出价(元)',
|
|
|
- dataIndex: 'planoffer',
|
|
|
- key: 'planoffer',
|
|
|
+
|
|
|
+ dataIndex: 'bid',
|
|
|
+ key: 'bid',
|
|
|
align: 'center',
|
|
|
width:150,
|
|
|
- scopedSlots: { customRender: 'planoffer' }
|
|
|
+ scopedSlots: { customRender: 'bid' }
|
|
|
},
|
|
|
{
|
|
|
title: '投放方式',
|
|
|
- dataIndex: 'Launchmode',
|
|
|
- key: 'Launchmode',
|
|
|
+ dataIndex: 'flowControlMode',
|
|
|
+ key: 'flowControlMode',
|
|
|
align: 'center',
|
|
|
- scopedSlots: { customRender: 'Launchmode' }
|
|
|
+ scopedSlots: { customRender: 'flowControlMode' }
|
|
|
},
|
|
|
{
|
|
|
title: '投放时间',
|
|
|
- dataIndex: 'LaunchTime',
|
|
|
- key: 'LaunchTime',
|
|
|
+ dataIndex: 'time',
|
|
|
+ key: 'time',
|
|
|
align: 'center',
|
|
|
- scopedSlots: { customRender: 'LaunchTime' }
|
|
|
+ scopedSlots: { customRender: 'time' }
|
|
|
},
|
|
|
{
|
|
|
title: '所属广告组',
|
|
|
- dataIndex: 'parentGroup',
|
|
|
- key: 'parentGroup',
|
|
|
+ dataIndex: 'campaignId',
|
|
|
+ key: 'campaignId',
|
|
|
align: 'center',
|
|
|
- scopedSlots: { customRender: 'parentGroup' }
|
|
|
+ scopedSlots: { customRender: 'campaignId' }
|
|
|
},
|
|
|
];
|
|
|
const ideaColumns = [
|
|
@@ -372,13 +417,13 @@ const ideaColumns = [
|
|
|
align: 'center',
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'options',
|
|
|
- key: 'options',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: { customRender: 'options' }
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '操作',
|
|
|
+ // dataIndex: 'options',
|
|
|
+ // key: 'options',
|
|
|
+ // align: 'center',
|
|
|
+ // scopedSlots: { customRender: 'options' }
|
|
|
+ // },
|
|
|
{
|
|
|
title: '创意ID',
|
|
|
dataIndex: 'ideaID',
|
|
@@ -473,12 +518,14 @@ export default {
|
|
|
editableCell,
|
|
|
Treeselect,
|
|
|
},
|
|
|
- mixins: [JeecgListMixin],
|
|
|
+ mixins: [JeecgListMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
moment,
|
|
|
loading:false,
|
|
|
- accountID:'',
|
|
|
+ accountID:undefined,
|
|
|
+ openID:undefined,
|
|
|
+ treeData:[],
|
|
|
// account:'',//媒体账号
|
|
|
optionId:'',//input输入的id或关键词
|
|
|
statusValue:undefined,
|
|
@@ -498,31 +545,29 @@ export default {
|
|
|
data:[],
|
|
|
columns,
|
|
|
selectedRowKeys:[],
|
|
|
+ selectedRows:[],
|
|
|
rowSelection:{
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
|
|
- console.log(selectedRowKeys);
|
|
|
this.selectedRowKeys=selectedRowKeys;
|
|
|
+ this.selectedRows=selectedRows;
|
|
|
},
|
|
|
onSelect: (record, selected, selectedRows) => {
|
|
|
console.log(record, selected, selectedRows);
|
|
|
-
|
|
|
+ this.modifyTableData=selectedRows;
|
|
|
+ this.selectedRows=selectedRows;
|
|
|
},
|
|
|
onSelectAll: (selected, selectedRows, changeRows) => {
|
|
|
console.log(selected, selectedRows, changeRows);
|
|
|
-
|
|
|
+ this.modifyTableData=selectedRows
|
|
|
+ this.selectedRows=selectedRows;
|
|
|
},
|
|
|
},
|
|
|
editID:0,
|
|
|
//批量修改里的表格
|
|
|
typeValue,
|
|
|
modifyTableData:[
|
|
|
- {
|
|
|
- advertisingPlan:'王者荣耀',
|
|
|
- currentCost:826595312,
|
|
|
- currentBudget:10000,
|
|
|
- changeBudget:''
|
|
|
- }
|
|
|
+
|
|
|
],
|
|
|
modifyTableCol,
|
|
|
modifyTableloading:false,
|
|
@@ -537,20 +582,50 @@ export default {
|
|
|
campaignList: "/ctop/byteDanceCampaign/list",
|
|
|
planList: "/ctop/byteDanceAdvertisePlan/list",
|
|
|
creativeList: "/ctop/byteDanceCreative/list",
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ xiugaiData:[],//存分别修改时候的数组
|
|
|
}
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // table里的函数
|
|
|
+
|
|
|
+ // table里的函数在上
|
|
|
+
|
|
|
+ accountIDChange(val){
|
|
|
+ console.log(val);
|
|
|
+ let currentData=this.treeData.filter((item)=>{
|
|
|
+ return item.value==val
|
|
|
+ })
|
|
|
+ console.log(currentData);
|
|
|
+ if(currentData.length>0){
|
|
|
+ this.accountID=undefined;
|
|
|
+ this.openID=val
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ filterOption(input, option){
|
|
|
+ console.log(input, option)
|
|
|
+ return (
|
|
|
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ );
|
|
|
+ },
|
|
|
//tab切换页的函数
|
|
|
callback(key) {
|
|
|
console.log(key);
|
|
|
- if(key=='plan'){
|
|
|
- this.columns=planColumns;
|
|
|
+ this.tabkey=key;
|
|
|
+ this.loading=true
|
|
|
+ if(key=='group'){
|
|
|
+ this.columns=columns;
|
|
|
let params = {};
|
|
|
this.refreshCampaignList();
|
|
|
- }else if(key=='group'){
|
|
|
- this.columns=columns;
|
|
|
+ }else if(key=='plan'){
|
|
|
+ this.getplanList({})
|
|
|
+ this.columns=planColumns;
|
|
|
}else if(key=='idea'){
|
|
|
this.columns=ideaColumns;
|
|
|
}
|
|
@@ -580,14 +655,27 @@ export default {
|
|
|
//查询按钮事件
|
|
|
search(){
|
|
|
// console.log(this.accountID,this.dateString,this.statusValue,this.optionId);
|
|
|
- this.refreshCampaignList({
|
|
|
- accountId:this.accountID,
|
|
|
- name:this.optionId,
|
|
|
- status:this.statusValue,
|
|
|
- startDate:this.dateString[0],
|
|
|
- endDate:this.dateString[1],
|
|
|
- pageNo:this.ipagination.current
|
|
|
- })
|
|
|
+ this.loading=true
|
|
|
+ if(this.tabkey=='group'){
|
|
|
+ this.refreshCampaignList({
|
|
|
+ accountId:this.accountID,
|
|
|
+ name:this.optionId,
|
|
|
+ status:this.statusValue,
|
|
|
+ startDate:this.dateString[0],
|
|
|
+ endDate:this.dateString[1],
|
|
|
+ pageNo:this.ipagination.current
|
|
|
+ })
|
|
|
+ }else if(this.tabkey=='plan'){
|
|
|
+ this.getplanList({
|
|
|
+ accountId:this.accountID,
|
|
|
+ name:this.optionId,
|
|
|
+ status:this.statusValue,
|
|
|
+ startDate:this.dateString[0],
|
|
|
+ endDate:this.dateString[1],
|
|
|
+ pageNo:this.ipagination.current
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
// postAction('',{
|
|
|
|
|
|
// }).then((res)=>{
|
|
@@ -608,13 +696,25 @@ export default {
|
|
|
//重置按钮事件
|
|
|
reset(){
|
|
|
|
|
|
+
|
|
|
},
|
|
|
//状态改变
|
|
|
switchChange(text,record){
|
|
|
- // console.log(`a-switch to ${checked}`);
|
|
|
+
|
|
|
console.log(text,record);
|
|
|
- record.status=!text;
|
|
|
- console.log(this.data)
|
|
|
+ let recordData=JSON.parse(JSON.stringify(record))
|
|
|
+ if(text){
|
|
|
+ recordData.toutiaoStatus='AD_STATUS_DISABLE'
|
|
|
+ }else{
|
|
|
+ recordData.toutiaoStatus='AD_STATUS_DELIVERY_OK'
|
|
|
+ }
|
|
|
+
|
|
|
+ postAction('/ctop/byteDanceAdvertisePlan/edit',recordData).then((res)=>{
|
|
|
+ console.log(res);
|
|
|
+ if(res.success){
|
|
|
+ record.status=!text;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
|
|
@@ -632,42 +732,35 @@ export default {
|
|
|
this.selectDisable=true;
|
|
|
if(this.optValue){
|
|
|
if(this.optValue=='pause'){
|
|
|
- if(this.selectedRowKeys.length>0){
|
|
|
- this.selectedRowKeys.forEach((item,index)=>{
|
|
|
- this.data.forEach((ele)=>{
|
|
|
- if(ele.key==item){
|
|
|
- ele.status=false;
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
+ if(this.selectedRowKeys.length>0){
|
|
|
+ this.selectedRows.forEach((item)=>{
|
|
|
+ item.toutiaoStatus='AD_STATUS_DISABLE'
|
|
|
})
|
|
|
}
|
|
|
}else if(this.optValue=='open'){
|
|
|
if(this.selectedRowKeys.length>0){
|
|
|
- this.selectedRowKeys.forEach((item,index)=>{
|
|
|
- this.data.forEach((ele)=>{
|
|
|
- if(ele.key==item){
|
|
|
- ele.status=true;
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
+ this.selectedRows.forEach((item)=>{
|
|
|
+ item.toutiaoStatus='AD_STATUS_DELIVERY_OK'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.data)
|
|
|
+
|
|
|
+ this.batchEditHttp(this.selectedRows)
|
|
|
}
|
|
|
-
|
|
|
+ // this.selectedRows=[];
|
|
|
},
|
|
|
//确定删除
|
|
|
confirm(e) {
|
|
|
- console.log(e);
|
|
|
+ // console.log(e);
|
|
|
if(this.optValue=='delete'){
|
|
|
- if(this.selectedRowKeys.length>0){
|
|
|
-
|
|
|
- this.selectedRowKeys.forEach((item,index)=>{
|
|
|
- this.data.splice(item,1)
|
|
|
+ if(this.selectedRowKeys.length>0){
|
|
|
+ this.selectedRows.forEach((item)=>{
|
|
|
+ item.toutiaoStatus='AD_STATUS_DELETE'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ this.batchEditHttp(this.selectedRows)
|
|
|
this.$message.success('删除成功');
|
|
|
|
|
|
},
|
|
@@ -690,35 +783,111 @@ export default {
|
|
|
radioChange(e) {
|
|
|
console.log('radio checked', e.target.value,this.radioValue);
|
|
|
},
|
|
|
- budgetChange(){
|
|
|
- console.log(this.inputValue)
|
|
|
+ totalbudgetChange(val){
|
|
|
+ console.log(this.inputValue,'------',val)
|
|
|
+ },
|
|
|
+ budgetChange(e,record){
|
|
|
+ console.log(e.target.value,'------',record);
|
|
|
+ this.xiugaiData.push(JSON.parse(JSON.stringify(record)))
|
|
|
+ if(this.typeValue=='预算'){
|
|
|
+ if(e.target.value ){
|
|
|
+ this.xiugaiData.forEach((item)=>{
|
|
|
+ if(item.id==record.id){
|
|
|
+ item.budget=e.target.value*1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(this.xiugaiData)
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(this.typeValue=='出价'){
|
|
|
+ if(e.target.value ){
|
|
|
+ this.xiugaiData.forEach((item)=>{
|
|
|
+ if(item.id==record.id){
|
|
|
+ item.bid==e.target.value*1
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//广告计划下的预算
|
|
|
changebudget(){
|
|
|
this.offerPriceVisiable=true;
|
|
|
this.ModalTitle='预算'
|
|
|
- typeValue='预算'
|
|
|
+ this.typeValue='预算'
|
|
|
+ this.modifyTableCol[4].title='修改预算';
|
|
|
+ this.xiugaiData=[];
|
|
|
+ this.inputValue=undefined;
|
|
|
},
|
|
|
//修改出价
|
|
|
changeofferPrice(){
|
|
|
this.offerPriceVisiable=true;
|
|
|
this.ModalTitle='出价'
|
|
|
- typeValue='出价';
|
|
|
- this.modifyTableCol[2].title='出价';
|
|
|
-
|
|
|
- this.modifyTableCol[3].title='统一修改出价';
|
|
|
-
|
|
|
+ this.typeValue='出价';
|
|
|
+ this.modifyTableCol[4].title='修改出价';
|
|
|
+ this.xiugaiData=[]
|
|
|
+ this.inputValue=undefined
|
|
|
},
|
|
|
- handleOk(e) {
|
|
|
+ //批量修改出价和预算的弹出框确定
|
|
|
+ modifyChangeOk(e) {
|
|
|
console.log(e);
|
|
|
this.offerPriceVisiable = false;
|
|
|
+ console.log(this.inputValue);
|
|
|
+ if(this.modifyRulesValue=='separately'){
|
|
|
+
|
|
|
+ let batchArr=[...this.xiugaiData]
|
|
|
+ // console.log(batchArr)
|
|
|
+ this.batchEditHttp(batchArr)
|
|
|
+ }else if(this.modifyRulesValue=='total'){
|
|
|
+ let batchArr=[...this.modifyTableData]
|
|
|
+ if(this.typeValue=='出价'){
|
|
|
+ batchArr.forEach((item)=>{
|
|
|
+ item.bid=this.inputValue
|
|
|
+ })
|
|
|
+ }else if(this.typeValue=='预算'){
|
|
|
+ batchArr.forEach((item)=>{
|
|
|
+ item.budget=this.inputValue
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.batchEditHttp(batchArr)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.modifyTableData=[];
|
|
|
+ this.selectedRowKeys=[]
|
|
|
+ // console.log(this.rowSelection)
|
|
|
+ // this.rowSelection.onChange('',[]);
|
|
|
+ // this.rowSelection.onSelect({},false,[]);
|
|
|
+ // this.rowSelection.onSelectAll([],[],[]);
|
|
|
+
|
|
|
+ },
|
|
|
+ batchEditHttp(params){
|
|
|
+ postAction('/ctop/byteDanceAdvertisePlan/batchEdit',params).then((res)=>{
|
|
|
+ console.log(res);
|
|
|
+ if(res.success){
|
|
|
+ if(res.result.length>0){
|
|
|
+ this.modifyTableData=[]
|
|
|
+ this.modifyTableData=res.result
|
|
|
+ this.getplanList({
|
|
|
+ accountId:this.accountID,
|
|
|
+ name:this.optionId,
|
|
|
+ status:this.statusValue,
|
|
|
+ startDate:this.dateString[0],
|
|
|
+ endDate:this.dateString[1],
|
|
|
+ pageNo:this.ipagination.current
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
//修改规则的改变
|
|
|
modifyRulesChange(e){
|
|
|
+ console.log(e.target.value)
|
|
|
+ this.modifyRulesValue=e.target.value
|
|
|
if(e.target.value=='total'){
|
|
|
this.inputValue=''
|
|
|
}else{
|
|
|
- this.inputValue=10000
|
|
|
+ this.inputValue=0
|
|
|
}
|
|
|
},
|
|
|
//更改文字提示的父节点
|
|
@@ -738,7 +907,19 @@ export default {
|
|
|
const target = dataSource.find(item => item.key === key);
|
|
|
if (target) {
|
|
|
target[dataIndex] = value;
|
|
|
- this.data = dataSource;
|
|
|
+ console.log(target)
|
|
|
+ //单独修改预算
|
|
|
+ postAction('/ctop/byteDanceAdvertisePlan/edit',target).then((res)=>{
|
|
|
+ console.log(res);
|
|
|
+ if(res.success){
|
|
|
+ // this.data = dataSource;
|
|
|
+ this.$message.success({
|
|
|
+ content:'修改成功!',
|
|
|
+ duration:2
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
console.log(this.data)
|
|
|
},
|
|
@@ -755,27 +936,83 @@ export default {
|
|
|
console.log(this.copyNum,'---',this.copyGroup)
|
|
|
},
|
|
|
refreshCampaignList(params){
|
|
|
- this.loading=true
|
|
|
+ // this.loading=true
|
|
|
getAction(this.url.campaignList, params).then(res => {
|
|
|
console.log(res);
|
|
|
if (res.success) {
|
|
|
this.ipagination.total = res.result.total
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
+ res.result.records.forEach((item)=>{
|
|
|
+ item.key=item.id
|
|
|
+ })
|
|
|
this.data = res.result.records;
|
|
|
|
|
|
} else {
|
|
|
console.log(res.message);
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ getplanList(params){
|
|
|
+
|
|
|
+ getAction(this.url.planList,params).then((res)=>{
|
|
|
+ this.data=[]
|
|
|
+ console.log(res)
|
|
|
+ if(res.success){
|
|
|
+
|
|
|
+ this.ipagination.total = res.result.total
|
|
|
+ this.loading = false
|
|
|
+ res.result.records.forEach((item)=>{
|
|
|
+ item.key=item.id
|
|
|
+ })
|
|
|
+
|
|
|
+ this.data = res.result.records;
|
|
|
+ console.log(this.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //请求项目和账户内容
|
|
|
+ accountHttp(){
|
|
|
+ this.treeData=[];
|
|
|
+ this.accountID=undefined;
|
|
|
+ getAction('/ctop/projectMember/getProjectAccountByUserId', {}).then(res => {
|
|
|
+ if(res.success){
|
|
|
+ // console.log(res);
|
|
|
+ if(res.result){
|
|
|
+ res.result.forEach((element,index) => {
|
|
|
+ if(element){
|
|
|
+ this.treeData.push({});
|
|
|
+ this.treeData[index].title=element.project.projectName +'_('+ element.project.advertiserName +')';
|
|
|
+ this.treeData[index].value='project'+element.project.projectId;
|
|
|
+ this.treeData[index].key=element.project.projectId;
|
|
|
+ this.treeData[index].mediaId=element.project.mediaId;
|
|
|
+ this.treeData[index].children=[];
|
|
|
+
|
|
|
+ if(element.account.length){
|
|
|
+ element.account.forEach((ele,i)=>{
|
|
|
+ this.treeData[index].children.push({});
|
|
|
+ this.treeData[index].children[i].title=ele.userName+'_'+ele.authName;
|
|
|
+ this.treeData[index].children[i].value=ele.accountId;
|
|
|
+ this.treeData[index].children[i].key=ele.accountId;
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // console.log(this.treeData)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
console.log(this);
|
|
|
- this.data=data;
|
|
|
+
|
|
|
let params = {}
|
|
|
// this.dateString=[moment().format("YYYY-MM-DD"),moment().format("YYYY-MM-DD")]
|
|
|
//初始
|
|
|
this.refreshCampaignList(params);
|
|
|
+ this.accountHttp()
|
|
|
},
|
|
|
filters: {
|
|
|
toPercentage(val) {
|
|
@@ -929,6 +1166,10 @@ export default {
|
|
|
}
|
|
|
.topOptions{
|
|
|
padding: 15px 0;
|
|
|
+ .topOpt{
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
.optionBtn{
|
|
|
// display: inline-block;
|