魏志佳 4 лет назад
Родитель
Сommit
156d5486cb

+ 53 - 10
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -135,11 +135,12 @@
                 @change="sort"
                 >
                     <template slot="name" slot-scope="text,record">
-                        <a href="javascript:;" @click="goNextPage(text)"><editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'name', $event)" /></a>
-                        
+                        <a href="javascript:;" @click="goNextPage(text)">
+                            <editableCell :text="text" slotName='name' @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)" />
+                       <editableCell :text="text" slotName='budget' @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)" />
@@ -592,18 +593,41 @@ export default {
         //tab切换页的函数
         callback(key) {
             console.log(key);
+            this.tabkey=key;
+           
+            this.columns=[];
+            if(key=='group'){
+                this.columns=columns;              
+            }else if(key=='plan'){                              
+                this.columns=planColumns;
+            }else if(key=='idea'){
+                this.columns=ideaColumns;
+            }
             if(this.accountID){
                 this.tabkey=key;
                 this.loading=true
-                if(key=='group'){
-                    this.columns=columns;
+                this.columns=[];
+                if(key=='group'){         
                     let params = {};
-                    this.refreshCampaignList();
+                    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(key=='plan'){               
-                    this.getplanList({})
-                    this.columns=planColumns;
+                    this.getplanList({
+                        accountId:this.accountID,
+                        name:this.optionId,
+                        toutiaoStatus:this.statusValue,
+                        startDate:this.dateString[0],
+                        endDate:this.dateString[1],
+                        pageNo:this.ipagination.current
+                    })
+   
                 }else if(key=='idea'){
-                    this.columns=ideaColumns;
                     let params = {};
                     //   this.refreshCreativeList();
                 }
@@ -642,6 +666,7 @@ export default {
             if(this.accountID){
                 this.loading=true
                 if(this.tabkey=='group'){
+                    this.columns=columns;
                     this.refreshCampaignList({
                         accountId:this.accountID,
                         name:this.optionId,
@@ -651,6 +676,7 @@ export default {
                         pageNo:this.ipagination.current
                     })
                 }else if(this.tabkey=='plan'){
+                    this.columns=planColumns;
                     this.getplanList({
                         accountId:this.accountID,
                         name:this.optionId,
@@ -660,7 +686,7 @@ export default {
                         pageNo:this.ipagination.current
                     })
                 }else if(this.tabkey=='idea'){
-
+                    this.columns=ideaColumns;
                 }
             }else{
                 this.$message.error('请选择账户后重试')
@@ -1122,6 +1148,23 @@ export default {
                 }
             })
         },
+
+        refreshCreativeList(){
+            getAction(this.url.creativeList, params).then(res => {
+                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;
+
+                } else {
+                console.log(res.message);
+                }
+            })
+        },
         //请求项目和账户内容
         accountHttp(){
             this.treeData=[];

+ 2 - 2
src/views/modules/BatchCreate/components/material.vue

@@ -57,13 +57,13 @@
                       </div>
                     </a-form-item>
 
-                    <!-- <a-form-item label="封面上传" :labelCol="labelCol" :wrapperCol="wrapperCol"
+                    <a-form-item label="封面上传" :labelCol="labelCol" :wrapperCol="wrapperCol"
                       v-if="(materialType=='CREATIVE_IMAGE_MODE_VIDEO_VERTICAL'||materialType=='CREATIVE_IMAGE_MODE_VIDEO')">
                       <upload-to-ali v-model="item.imageUrl" :customDomain="customDomain" preview :region="region"
                         :bucket="bucket" :accept="acceptImage" :size="102400" :accessKeyId="accessKeyId"
                         :accessKeySecret="accessKeySecret"></upload-to-ali>
                       <a @click="getImageList(item)">选择图片</a>
-                    </a-form-item> -->
+                    </a-form-item>
 
                     <a-form-item label="创意标题" :labelCol="labelCol" :wrapperCol="wrapperCol"
                       v-if="creativeType == 'customCreativity'">

+ 3 - 2
src/views/modules/BatchCreate/editableCell.vue

@@ -9,8 +9,9 @@
           />
         </div>
         <div v-else class="editable-cell-text-wrapper">
-          {{ value*1? `日预算:${value*1}` :value }}
-          
+          <span v-if="slotName=='budget'">{{ value*1? `日预算:${value*1}` :value }}</span>
+          <span v-if="slotName=='bid'">{{ value*1? `日出价:${value*1}` :value }}</span>
+          <span v-if="slotName=='name'">{{value}}</span>
           <a-icon type="edit" class="editable-cell-icon" @click="edit" />
         </div>
       </div>

+ 34 - 33
src/views/modules/BatchCreate/newCreate.vue

@@ -24,12 +24,12 @@
             <div class="input-item">
               <a-form-item>
                 <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-button value="smartInventorys">优选广告位</a-radio-button>
+                  <a-radio-button value="inventoryTypes">按媒体指定位置</a-radio-button>
+                  <a-radio-button value="sceneInventorys">按场景指定位置</a-radio-button>
                 </a-radio-group>
               </a-form-item>
-              <div style="width: 400px; margin-top: 24px;" v-show="adposition=='inventoryType'">
+              <div style="width: 400px; margin-top: 24px;" v-show="adposition=='inventoryTypes'">
                 <div class="inventory-tags-lists-header">
                   <a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange">
                   </a-checkbox>
@@ -39,12 +39,12 @@
                   <a-checkbox-group v-model="checkedList" :options="plainOptions" @change="onChange" />
                 </div>
               </div>
-              <div style="width: 400px; margin-top: 24px;" v-show="adposition=='sceneInventory'">
+              <div style="width: 400px; margin-top: 24px;" v-show="adposition=='sceneInventorys'">
                 <div class="inventory-tags-lists-header">
                   <div class="inventory-tags-lists-name" style="padding-left:15px"><strong>位置选择</strong></div>
                 </div>
                 <div class="inventory-tags-lists-container">
-                  <a-radio-group v-decorator="['sceneInventory', { initialValue:'VIDEO_SCENE' }]">
+                  <a-radio-group  v-model=sceneInventory>
                     <a-radio :style="radioStyle" value="VIDEO_SCENE">沉浸式竖版视频场景广告位</a-radio>
                     <a-radio :style="radioStyle" value="FEED_SCENE">信息流场景广告位</a-radio>
                     <a-radio :style="radioStyle" value="TAIL_SCENE">视频后贴和尾帧场景广告位</a-radio>
@@ -432,7 +432,8 @@
           children: 'children'
         },
         thirdIndustryId:undefined,
-        adposition:'smartInventory'
+        adposition:'smartInventorys',
+        sceneInventory:'VIDEO_SCENE'
       }
     },
     components: {
@@ -495,30 +496,30 @@
       // 广告位置选择改变
       adPositionChange(val) {
         console.log(val)
-        if (val.target.value == 'smartInventory') {
-          this.form.setFieldsValue({
-            smartInventory: 1,
-            inventoryType: [],
-          })
-        } else if (val.target.value == 'inventoryType') {
-          this.form.setFieldsValue({
-            smartInventory: 0,
-            inventoryType: this.checkedList,
-          })
-        } else if (val.target.value == 'sceneInventory') {
-          this.form.setFieldsValue({
-            smartInventory: 0,
-            inventoryType: [],
-          })
-          console.log(this.getFormData('sceneInventory'))
-        }
+        // if (val.target.value == 'smartInventorys') {
+        //   this.form.setFieldsValue({
+        //     smartInventory: 1,
+        //     inventoryType: [],
+        //   })
+        // } else if (val.target.value == 'inventoryTypes') {
+        //   this.form.setFieldsValue({
+        //     smartInventory: 0,
+        //     inventoryType: this.checkedList,
+        //   })
+        // } else if (val.target.value == 'sceneInventorys') {
+        //   this.form.setFieldsValue({
+        //     smartInventory: 0,
+        //     inventoryType: [],
+        //   })
+        //   console.log(this.getFormData('sceneInventory'))
+        // }
 
       },
       // 注册表单的字段
       initFormValue() {
-        this.form.getFieldDecorator('inventoryType')
-        this.form.getFieldDecorator('smartInventory')
-        this.form.getFieldDecorator('thirdIndustryId')
+        // this.form.getFieldDecorator('inventoryType')
+        // this.form.getFieldDecorator('smartInventory')
+        // this.form.getFieldDecorator('thirdIndustryId')
         // this.form.getFieldDecorator('sceneInventory')
       },
       // 验证网址
@@ -597,16 +598,16 @@
                 //   params.titles = this.titleData
                 params.titles = this.$refs.material.titleData
               }
-              values.thirdIndustryId=this.thirdIndustryId;
+                values.thirdIndustryId=this.thirdIndustryId;
 
-                if (this.adposition == 'smartInventory') {
+                if (this.adposition == 'smartInventorys') {
                   values.smartInventory=1;                 
-                } else if (this.adposition == 'inventoryType') {
+                } else if (this.adposition == 'inventoryTypes') {
                   values.inventoryType=this.checkedList
-                } else if (this.adposition == 'sceneInventory') {
+                } else if (this.adposition == 'sceneInventorys') {
+                  
+                  values.sceneInventory=this.sceneInventory
                   
-                  // values.sceneInventory
-                  console.log(this.getFormData('sceneInventory'))
                 }
 
                 postAction('/bytedance/batch/create/creative', {