Browse Source

切换分支

朱鑫波 4 years ago
parent
commit
457285435f

+ 22 - 8
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -1176,18 +1176,32 @@ let realTimeColumn=[
               ...res.result.appInfo,
               ...res.result.target
             }
-
+          if(this.campaignType=='2'||this.campaignType==2){
+            getAction('/kuaishou/batch/getIsActivate', {
+              accountId: localStorage.getItem('accountId'),
+              appId:this.copyData.appId,
+              campaignType:2
+            }).then(res => {
+              if (res.success) {
+                this.allForm.groupTypeData = res.result
+              }
+            })
+          }else{
+            getAction('/kuaishou/batch/getIsActivate', {
+              accountId: localStorage.getItem('accountId'),
+              campaignType:this.campaignType
+            }).then(res => {
+              if (res.success) {
+                this.allForm.groupTypeData = res.result
+              }
+            })
+          }
             this.copyLoading = false
           }
 
         })
-        getAction('/kuaishou/batch/getIsActivate', {
-          accountId: localStorage.getItem('accountId')
-        }).then(res => {
-          if (res.success) {
-            this.allForm.groupTypeData = res.result
-          }
-        })
+        
+       
       },
       toDetail(record) {
         // 点击改行时要做的事情

+ 58 - 21
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -45,7 +45,7 @@
         <creat-application ref="application" />
       </a-form-item>
       <a-form-item label="转化类型" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" v-if="campaignType == '3'">
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" v-if="campaignType == 3">
         <a-radio-group buttonStyle="solid"
           v-decorator="['urlType', { rules: [{ required: true, message: '请选择目标应用' }], initialValue: '1' }]">
           <a-radio-button value="1">淘宝商品</a-radio-button>
@@ -672,18 +672,38 @@
         this.checkedTrue = e.target.checked
       },
       addGroup() {
-        this.allForm.group.push({
-          bidType:  10,
-          bid: '',
-          cpaBid: '',
-          showTipCheck: false,
-          deepConversionBidCheck: false,
-          unitName: '',
-          unitNameCheck: false,
-          deepConversionType: '',
-          deepConversionBid: '',
-          ocpxActionType:this.campaignType == '2' && this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
-        })
+        if(this.campaignType=='2'||this.campaignType==2){
+          if(this.getData('appId')){
+            this.allForm.group.push({
+              bidType:  10,
+              bid: '',
+              cpaBid: '',
+              showTipCheck: false,
+              deepConversionBidCheck: false,
+              unitName: '',
+              unitNameCheck: false,
+              deepConversionType: '',
+              deepConversionBid: '',
+              ocpxActionType:this.campaignType == '2' && this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
+            })
+          }else{
+            this.$message.error('请选择目标应用之后添加广告组')
+          }
+        }else{
+           this.allForm.group.push({
+              bidType:  10,
+              bid: '',
+              cpaBid: '',
+              showTipCheck: false,
+              deepConversionBidCheck: false,
+              unitName: '',
+              unitNameCheck: false,
+              deepConversionType: '',
+              deepConversionBid: '',
+              ocpxActionType:this.campaignType == '2' && this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
+            })
+        }
+
       },
       resData(index) {
         this.allForm.group[index].bid = ''
@@ -974,6 +994,16 @@
       },
       handleChange(value) {
         //   this.$refs.population.getAppList(value)
+        this.allForm.group = []
+        getAction('/kuaishou/batch/getIsActivate', {
+          accountId: localStorage.getItem('accountId'),
+          appId:this.getData('appId'),
+          campaignType:2
+        }).then(res => {
+          if (res.success) {
+            this.allForm.groupTypeData = res.result
+          }
+        })
       },
       handleChangeMould(value) {
         if (value) {
@@ -1044,7 +1074,19 @@
         getAction('/kuaishou/batch/getCampaignList', params).then(res => {
           if (res.success) {
             this.campaignType = res.result.records[0].campaignType
-            console.log(this.campaignType)
+
+
+            if(this.campaignType!=2){
+              getAction('/kuaishou/batch/getIsActivate', {
+                accountId: localStorage.getItem('accountId'),
+                campaignType:this.campaignType
+              }).then(res => {
+                if (res.success) {
+                  this.allForm.groupTypeData = res.result
+                }
+              })
+            }
+            // console.log(this.campaignType)
           }
         })
       },
@@ -1062,13 +1104,8 @@
       this.getAppList()
       this.getCampaignList()
       this.getMould()
-      getAction('/kuaishou/batch/getIsActivate', {
-        accountId: localStorage.getItem('accountId')
-      }).then(res => {
-        if (res.success) {
-          this.allForm.groupTypeData = res.result
-        }
-      })
+
+
 
       getAction('/kuaishou/batch/getWhiteList',{
         accountId:localStorage.getItem('accountId')

File diff suppressed because it is too large
+ 681 - 176
src/views/modules/kuaishouapp/newBatch/index.vue


+ 85 - 4
src/views/modules/kuaishouapp/newBatch/lookPreview.vue

@@ -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>

+ 2 - 2
vue.config.js

@@ -79,13 +79,13 @@ module.exports = {
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
         // target:'http://118.24.244.213:8804',
-        // target:'http://139.186.151.174:8804', //测试
+        target:'http://139.186.151.174:8804', //测试
 
         ws: false,