魏志佳 4 anos atrás
pai
commit
0c84faf7b3

+ 37 - 23
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -135,7 +135,8 @@
                 @change="sort"
                 >
                     <template slot="name" slot-scope="text,record">
-                        <editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'name', $event)" />
+                        <a href="javascript:;" @click="goNextPage(text)"><editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'name', $event)" /></a>
+                        
                     </template>
                     <span slot="budget" slot-scope="text,record">
                        <editableCell :text="text" slotName='groupBudget' @change="onCellChange(record.key, 'budget', $event)" />
@@ -551,7 +552,7 @@ export default {
                 onSelect: (record, selected, selectedRows) => {
                     console.log(record, selected, selectedRows);
                     this.modifyTableData=selectedRows;
-                    
+
                     this.selectedRows=selectedRows;
                 },
                 onSelectAll: (selected, selectedRows, changeRows) => {
@@ -578,6 +579,8 @@ export default {
                 this.accountID=undefined;
                 this.openID=val
             }
+
+            this.search();
         },
         
         filterOption(input, option){
@@ -589,20 +592,23 @@ export default {
         //tab切换页的函数
         callback(key) {
             console.log(key);
-            this.tabkey=key;
-            this.loading=true
-            if(key=='group'){
-                 this.columns=columns;
-                let params = {};
-                this.refreshCampaignList();
-            }else if(key=='plan'){               
-                this.getplanList({})
-                this.columns=planColumns;
-            }else if(key=='idea'){
-              this.columns=ideaColumns;
-              let params = {};
-            //   this.refreshCreativeList();
+            if(this.accountID){
+                this.tabkey=key;
+                this.loading=true
+                if(key=='group'){
+                    this.columns=columns;
+                    let params = {};
+                    this.refreshCampaignList();
+                }else if(key=='plan'){               
+                    this.getplanList({})
+                    this.columns=planColumns;
+                }else if(key=='idea'){
+                    this.columns=ideaColumns;
+                    let params = {};
+                    //   this.refreshCreativeList();
+                }
             }
+            
         },
         //跳转到批量页面
         goBatch(){
@@ -793,7 +799,7 @@ export default {
                                 item.toutiaoStatus='AD_STATUS_DISABLE'
                             })
                         }
-                        this.batchEditHttp(this.selectedRows)
+                        this.batchEditHttp('status',this.selectedRows)
                     }else if(this.tabkey=='idea'){
 
                     }               
@@ -807,7 +813,7 @@ export default {
                                 item.toutiaoStatus='AD_STATUS_DELIVERY_OK'
                             })
                         }
-                        this.batchEditHttp(this.selectedRows)
+                        this.batchEditHttp('status',this.selectedRows)
                     }else if(this.tabkey=='idea'){
 
                     }    
@@ -830,7 +836,7 @@ export default {
                                 item.toutiaoStatus='AD_STATUS_DELETE'
                             })
                         }
-                        this.batchEditHttp(this.selectedRows)
+                        this.batchEditHttp('status',this.selectedRows)
                         this.$message.success('删除成功');
                     }else if(this.tabkey=='idea'){
 
@@ -913,21 +919,29 @@ export default {
             console.log(this.inputValue);
             if(this.modifyRulesValue=='separately'){
                 
-                let batchArr=[...this.xiugaiData]
+                let batchArr=[...this.xiugaiData];
+                let changeZiduan=''
+                if(this.typeValue=='预算'){
+                    changeZiduan='budget'
+                }else if(this.typeValue=='出价'){
+                    changeZiduan='bid'
+                }
                 // console.log(batchArr)
-                this.batchEditHttp(batchArr)
+                this.batchEditHttp(changeZiduan,batchArr)
             }else if(this.modifyRulesValue=='total'){
                 let batchArr=[...this.modifyTableData]
                 if(this.typeValue=='出价'){
                     batchArr.forEach((item)=>{
                         item.bid=this.inputValue
                     })
+                    this.batchEditHttp('bid',batchArr)
                 }else if(this.typeValue=='预算'){
                     batchArr.forEach((item)=>{
                         item.budget=this.inputValue
                     })
+                    this.batchEditHttp('budget',batchArr)
                 }
-                this.batchEditHttp(batchArr)
+                
             }
             
             this.modifyTableData=[];
@@ -938,8 +952,8 @@ export default {
             // this.rowSelection.onSelectAll([],[],[]);
             
         },
-        batchEditHttp(params){
-            postAction('/ctop/byteDanceAdvertisePlan/batchEdit',params).then((res)=>{
+        batchEditHttp(type,params){
+            postAction(`/ctop/byteDanceAdvertisePlan/batchEdit/"${type}"`,params).then((res)=>{
                 console.log(res);
                 if(res.success){
                     if(res.result.length>0){

+ 16 - 6
src/views/modules/BatchCreate/newCreate.vue

@@ -23,14 +23,13 @@
             </div>
             <div class="input-item">
               <a-form-item>
-                <a-radio-group v-decorator="['adposition', { initialValue:'smartInventory' }]"
-                  @change="adPositionChange">
+                <a-radio-group v-model="adposition" @change="adPositionChange">
                   <a-radio-button value="smartInventory">优选广告位</a-radio-button>
                   <a-radio-button value="inventoryType">按媒体指定位置</a-radio-button>
                   <a-radio-button value="sceneInventory">按场景指定位置</a-radio-button>
                 </a-radio-group>
               </a-form-item>
-              <div style="width: 400px; margin-top: 24px;" v-if="getFormData('adposition')=='inventoryType'">
+              <div style="width: 400px; margin-top: 24px;" v-show="adposition=='inventoryType'">
                 <div class="inventory-tags-lists-header">
                   <a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange">
                   </a-checkbox>
@@ -40,7 +39,7 @@
                   <a-checkbox-group v-model="checkedList" :options="plainOptions" @change="onChange" />
                 </div>
               </div>
-              <div style="width: 400px; margin-top: 24px;" v-show="getFormData('adposition')=='sceneInventory'">
+              <div style="width: 400px; margin-top: 24px;" v-show="adposition=='sceneInventory'">
                 <div class="inventory-tags-lists-header">
                   <div class="inventory-tags-lists-name" style="padding-left:15px"><strong>位置选择</strong></div>
                 </div>
@@ -433,6 +432,7 @@
           children: 'children'
         },
         thirdIndustryId:undefined,
+        adposition:'smartInventory'
       }
     },
     components: {
@@ -499,7 +499,6 @@
           this.form.setFieldsValue({
             smartInventory: 1,
             inventoryType: [],
-
           })
         } else if (val.target.value == 'inventoryType') {
           this.form.setFieldsValue({
@@ -598,7 +597,18 @@
                 //   params.titles = this.titleData
                 params.titles = this.$refs.material.titleData
               }
-              values.thirdIndustryId=this.thirdIndustryId
+              values.thirdIndustryId=this.thirdIndustryId;
+
+                if (this.adposition == 'smartInventory') {
+                  values.smartInventory=1;                 
+                } else if (this.adposition == 'inventoryType') {
+                  values.inventoryType=this.checkedList
+                } else if (this.adposition == 'sceneInventory') {
+                  
+                  // values.sceneInventory
+                  console.log(this.getFormData('sceneInventory'))
+                }
+
                 postAction('/bytedance/batch/create/creative', {
                   accountId:this.accountInfo.value,
                   adIds: ["1673732908509245"],