|
@@ -125,7 +125,7 @@
|
|
|
修改条数:{{ visibleData.totalCount }} 失败条数:{{ visibleData.failCount }}
|
|
|
<div style="margin-top:20px">
|
|
|
<p v-for="(item, index) of visibleData.failInfo" :key="index">
|
|
|
- <span>名称:{{ item.unitName }}</span><br />
|
|
|
+ <span>名称:{{ item.campaignName }}</span><br />
|
|
|
<span>错误信息:{{ item.message }}</span>
|
|
|
</p>
|
|
|
</div>
|
|
@@ -179,11 +179,16 @@
|
|
|
<a-radio-group buttonStyle="solid" v-decorator="[
|
|
|
'createType',
|
|
|
{
|
|
|
- initialValue:'1' } ]">
|
|
|
+ initialValue:'1' } ]" @change="createUnitName">
|
|
|
<a-radio-button value="1">系统生成</a-radio-button>
|
|
|
<a-radio-button value="2">自定义</a-radio-button>
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
+ <a-form-item label="广告组名称输入" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
|
|
|
+ :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }"
|
|
|
+ v-if="getData('createCount')>1&&getData('createType')=='2'">
|
|
|
+ <a-input v-for="(item,key) in unitNameList" :key="key" v-model="item.unitName" />
|
|
|
+ </a-form-item>
|
|
|
</a-form>
|
|
|
<template slot="footer">
|
|
|
<a-button key="submit" type="primary" @click="handleSubmitCopy" :loading='loading'>
|
|
@@ -426,6 +431,7 @@
|
|
|
campaignType: '2',
|
|
|
campaignId: localStorage.getItem('advertisingGroupKey'),
|
|
|
createCount: 1,
|
|
|
+ unitNameList: [],
|
|
|
form: this.$form.createForm(this),
|
|
|
campaignList: [],
|
|
|
showEdit: false,
|
|
@@ -579,6 +585,14 @@
|
|
|
// }
|
|
|
// }
|
|
|
// },
|
|
|
+ createUnitName() {
|
|
|
+ this.unitNameList = []
|
|
|
+ for (let i = 0; i < this.getData('createCount'); i++) {
|
|
|
+ this.unitNameList.push({
|
|
|
+ unitName: ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
getData(className) {
|
|
|
return this.form.getFieldValue(className)
|
|
|
},
|
|
@@ -678,7 +692,7 @@
|
|
|
}
|
|
|
},
|
|
|
editDetail(item) {
|
|
|
- this.$refs.editGroup.handleOk(item)
|
|
|
+ this.$refs.editGroup.handleOk(item, 'edit')
|
|
|
},
|
|
|
copyDetail(item) {
|
|
|
this.visibleCopy = true
|
|
@@ -804,20 +818,27 @@
|
|
|
this.visibleEditAll = true
|
|
|
} else if (this.allType == '5') {
|
|
|
this.getCampaignList()
|
|
|
+ this.campaignId = localStorage.getItem('advertisingGroupKey')
|
|
|
this.visibleBatch = true
|
|
|
} else {
|
|
|
+
|
|
|
var params = {}
|
|
|
params.accountId = localStorage.getItem('accountId')
|
|
|
params.putStatus = this.allType
|
|
|
params.userId = this.userInfo().id
|
|
|
params.unitIds = this.selectedRowKeysValue
|
|
|
postAction('/kuaishou/batch/batchUpdateUnitStatus', params).then(res => {
|
|
|
- console.log(res)
|
|
|
- this.getDataList(localStorage.getItem('advertisingGroupKey'))
|
|
|
- this.$message.success('批量修改成功')
|
|
|
- this.allType = '1'
|
|
|
- this.selectedRowKeysValue = []
|
|
|
- this.selectedRowKeys = []
|
|
|
+ if (res.result.failCount > 0) {
|
|
|
+ this.visible = true
|
|
|
+ this.visibleData = res.result
|
|
|
+ } else {
|
|
|
+ this.getDataList(localStorage.getItem('advertisingGroupKey'))
|
|
|
+ this.$message.success('批量修改成功')
|
|
|
+ this.allType = '1'
|
|
|
+ this.selectedRowKeysValue = []
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -971,6 +992,7 @@
|
|
|
showSwich: v.putStatus == 1 ? true : false
|
|
|
}
|
|
|
})
|
|
|
+ this.ipagination.total = res.result.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1014,35 +1036,78 @@
|
|
|
})
|
|
|
},
|
|
|
handleSubmitCopy(e) {
|
|
|
- this.loading = true
|
|
|
+ if (this.getData('createCount') == 1) {
|
|
|
+ this.visibleCopy = false
|
|
|
+ this.$refs.editGroup.handleOk(this.copyData, 'copy', this.getData('campaignId'))
|
|
|
+ // postAction('/kuaishou/batch/copyUnit', params).then(res => {})
|
|
|
+ } else if (this.getData('createCount') > 1) {
|
|
|
+ this.loading = true
|
|
|
+ // v-if="getData('createCount')>1&&getData('createType')=='2'">
|
|
|
+ // <a-input v-for="(item,key) in unitNameList"
|
|
|
|
|
|
- var groupArr = this.allForm.group.map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
|
|
|
- bid: item.bid != '' ? item.bid * 1000 : '',
|
|
|
- deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
|
|
|
- ocpxActionType: item.bidType,
|
|
|
- bidType: item.bidType == '1' ? '2' : '6'
|
|
|
+ if (this.getData('createType') == '1') {
|
|
|
+ var params = {
|
|
|
+ // ...this.copyData,
|
|
|
+ // groupArr: groupArr,
|
|
|
+ type: 'copy',
|
|
|
+ unitId: this.copyData.unitId,
|
|
|
+ copyToCampaignId: this.getData('campaignId'),
|
|
|
+ createCount: this.getData('createCount'),
|
|
|
+ createType: this.getData('createType'),
|
|
|
+ accountId: this.copyData.accountId
|
|
|
+ }
|
|
|
+ postAction('/kuaishou/batch/copyUnit', params).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.visibleCopy = false
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.getData('createType') == '2') {
|
|
|
+ var params = {
|
|
|
+ // ...this.copyData,
|
|
|
+ // groupArr: groupArr,
|
|
|
+ type: 'copy',
|
|
|
+ unitId: this.copyData.unitId,
|
|
|
+ copyToCampaignId: this.getData('campaignId'),
|
|
|
+ createCount: this.getData('createCount'),
|
|
|
+ createType: this.getData('createType'),
|
|
|
+ accountId: this.copyData.accountId,
|
|
|
+ unitNames: this.unitNameList.map(item => {
|
|
|
+ return item.unitName
|
|
|
+ })
|
|
|
+ }
|
|
|
+ postAction('/kuaishou/batch/copyUnit', params).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.visibleCopy = false
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- var params = {
|
|
|
- ...this.copyData,
|
|
|
- groupArr: groupArr,
|
|
|
- type: 'copy',
|
|
|
- copyUnitId: this.copyData.unitId,
|
|
|
- copyToCampaignId: this.campaignId
|
|
|
+ // var groupArr = this.allForm.group.map(item => {
|
|
|
+ // return {
|
|
|
+ // ...item,
|
|
|
+ // cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
|
|
|
+ // bid: item.bid != '' ? item.bid * 1000 : '',
|
|
|
+ // deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
|
|
|
+ // ocpxActionType: item.bidType,
|
|
|
+ // bidType: item.bidType == '1' ? '2' : '6'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+
|
|
|
+ // postAction('/kuaishou/batch/createUnit', params).then(res => {
|
|
|
+ // if (res.success) {
|
|
|
+ // this.loading = false
|
|
|
+ // this.visibleCopy = false
|
|
|
+ // this.form.resetFields()
|
|
|
+ // this.getDataList(localStorage.getItem('advertisingGroupKey'))
|
|
|
+
|
|
|
+ // this.allForm.group = []
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
- postAction('/kuaishou/batch/createUnit', params).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.loading = false
|
|
|
- this.visibleCopy = false
|
|
|
- this.form.resetFields()
|
|
|
- this.getDataList(localStorage.getItem('advertisingGroupKey'))
|
|
|
|
|
|
- this.allForm.group = []
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
handleSubmit(e) {
|
|
|
// this.$refs.population.handleSubmit()
|