|
@@ -131,7 +131,7 @@ li.chouzhen.first:before {
|
|
|
<a-card title="预览区">
|
|
|
<div slot="extra">
|
|
|
预估生成<span style="color: #409EFF">{{ groupCount }}</span
|
|
|
- >个广告组 <a-button type="primary" style="margin: 0 15px"> 全部提交审核 </a-button>
|
|
|
+ >个广告组 <a-button type="primary" style="margin: 0 15px" @click="createAll"> 全部提交审核 </a-button>
|
|
|
</div>
|
|
|
<div v-if="campaignList">
|
|
|
<h2 style="display: flex; justify-content: space-between">
|
|
@@ -148,12 +148,14 @@ li.chouzhen.first:before {
|
|
|
<a-button style="margin: 0 15px"> 批量修改 <a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
<a-popconfirm :title="`确定要删除这 ${groupCheck.length} 项吗?`" @confirm="handleConfirmDelete">
|
|
|
- <a-button style="margin: 0 15px" :disabled="groupCheck.length == 0" @click="">
|
|
|
+ <a-button style="margin: 0 15px" :disabled="groupCheck.length == 0">
|
|
|
批量删除广告组
|
|
|
</a-button>
|
|
|
</a-popconfirm>
|
|
|
|
|
|
- <a-button type="primary" style="margin: 0 15px"> 全部提交审核 </a-button>
|
|
|
+ <a-button type="primary" style="margin: 0 15px" :disabled="groupCheck.length == 0" @click="createArr">
|
|
|
+ 提交审核
|
|
|
+ </a-button>
|
|
|
</div>
|
|
|
</h2>
|
|
|
<!-- <div v-for="(item, index) in campaignList" :key="index"></div> -->
|
|
@@ -170,7 +172,7 @@ li.chouzhen.first:before {
|
|
|
<span style="width: 10%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
|
|
|
>预算:{{ item.dayBudget ? item.dayBudget / 1000 + '元' : '不限' }}</span
|
|
|
>
|
|
|
- <a-checkbox style="width: 10%" v-model="item.checkAll" @click.stop> 全选 </a-checkbox>
|
|
|
+ <a-checkbox style="width: 10%" v-model="item.checkAll" @click.stop="setAll(item)"> 全选 </a-checkbox>
|
|
|
</h3>
|
|
|
</template>
|
|
|
<a-table
|
|
@@ -604,6 +606,9 @@ export default {
|
|
|
siteList: [],
|
|
|
allData: null,
|
|
|
editAll: false,
|
|
|
+
|
|
|
+ groupIds: [],
|
|
|
+ campaignIds: [],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -641,6 +646,62 @@ export default {
|
|
|
// })
|
|
|
},
|
|
|
methods: {
|
|
|
+ createArr() {
|
|
|
+ var params = {}
|
|
|
+ params.accountId = this.accountId
|
|
|
+ params.dataList = {
|
|
|
+ campaigns: this.groupCheckRow.map((item) => {
|
|
|
+ return item.planId
|
|
|
+ }),
|
|
|
+ groups: this.groupCheck,
|
|
|
+ }
|
|
|
+ this.postDataAction('/kuaishouBatch/creativePreview/createAdcampaignAndGroups', params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.getAction('/kuaishouBatch/campaignPreview/deleteBatch', {
|
|
|
+ ids: this.groupCheck,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.groupCheck = []
|
|
|
+ this.getPreviewList()
|
|
|
+ setTimeout(() => {
|
|
|
+ var dataConunt = this.campaignList.filter((a) => {
|
|
|
+ return a.kuaishouBatchGroupPreviews.length > 0
|
|
|
+ })
|
|
|
+ if (dataConunt.length > 0) {
|
|
|
+ } else {
|
|
|
+ window.close()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setAll(item) {
|
|
|
+ // groupIds:[],
|
|
|
+ // campaignIds:[]
|
|
|
+ setTimeout(() => {
|
|
|
+ if (item.checkAll) {
|
|
|
+ this.groupCheck.push(
|
|
|
+ ...item.kuaishouBatchGroupPreviews.map((i) => {
|
|
|
+ return i.id
|
|
|
+ })
|
|
|
+ )
|
|
|
+ this.groupCheckRow = JSON.parse(JSON.stringify(item.kuaishouBatchGroupPreviews))
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < item.kuaishouBatchGroupPreviews.length; i++) {
|
|
|
+ var index = this.groupCheck.findIndex((c) => c == item.kuaishouBatchGroupPreviews[i].id)
|
|
|
+ var indexTwo = this.groupCheckRow.findIndex((c) => c.id == item.kuaishouBatchGroupPreviews[i].id)
|
|
|
+ if (index > -1) {
|
|
|
+ this.groupCheck.splice(index, 1)
|
|
|
+ }
|
|
|
+ if (indexTwo > -1) {
|
|
|
+ this.groupCheckRow.splice(indexTwo, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
handleConfirmDelete() {
|
|
|
this.getAction('/kuaishouBatch/campaignPreview/deleteBatch', {
|
|
|
ids: this.groupCheck,
|
|
@@ -947,6 +1008,26 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ createAll() {
|
|
|
+ var groupIds = []
|
|
|
+ for (let i = 0; i < this.campaignList.length; i++) {
|
|
|
+ for (let j = 0; j < this.campaignList[i].kuaishouBatchGroupPreviews.length; j++) {
|
|
|
+ groupIds.push(this.campaignList[i].kuaishouBatchGroupPreviews[j].id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var params = {}
|
|
|
+ params.accountId = this.accountId
|
|
|
+ params.dataList = {
|
|
|
+ campaigns: this.campaignList.map((item) => {
|
|
|
+ return item.id
|
|
|
+ }),
|
|
|
+ groups: groupIds,
|
|
|
+ }
|
|
|
+ console.log(params)
|
|
|
+ this.postDataAction('/kuaishouBatch/creativePreview/createAdcampaignAndGroups', params).then((res) => {
|
|
|
+ window.close()
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|