魏志佳 4 gadi atpakaļ
vecāks
revīzija
b2919d66af
1 mainītis faili ar 23 papildinājumiem un 6 dzēšanām
  1. 23 6
      src/views/modules/BatchCreate/newCreate.vue

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

@@ -239,8 +239,8 @@
             </div>
             <div class="input-item">
               <a-form-item>
-                <a-cascader :options="createOptions" :fieldNames="fieldNames" v-decorator="['thirdIndustryId']"
-                  placeholder="请选择创意分类" />
+                <a-cascader :options="createOptions" :fieldNames="fieldNames"
+                  placeholder="请选择创意分类" @change="createChange" />
               </a-form-item>
             </div>
           </div>
@@ -431,7 +431,8 @@
           label: 'name',
           value: 'id',
           children: 'children'
-        }
+        },
+        thirdIndustryId:undefined,
       }
     },
     components: {
@@ -477,6 +478,16 @@
       addCreate() {
 
       },
+      createChange(value){
+        console.log(value);
+        this.thirdIndustryId=value[2]
+        //  this.form.getFieldDecorator('thirdIndustryId')
+         
+        //  this.form.setFieldsValue({
+        //    thirdIndustryId:value[2]
+        // });
+        console.log(this.form.getFieldsValue())
+      },
       // //获取表单的某一个属性值
       getFormData(className) {
         return this.form.getFieldValue(className)
@@ -508,6 +519,7 @@
       initFormValue() {
         this.form.getFieldDecorator('inventoryType')
         this.form.getFieldDecorator('smartInventory')
+        this.form.getFieldDecorator('thirdIndustryId')
         // this.form.getFieldDecorator('sceneInventory')
       },
       // 验证网址
@@ -571,7 +583,8 @@
               var params = {
                 ...values
               }
-              params.thirdIndustryId = params.thirdIndustryId.pop()
+
+              // params.thirdIndustryId = params.thirdIndustryId.pop()
               var dataCreatives = this.$refs.material.HorizontalLargeImageListBig.concat(
                 this.$refs.material.HorizontalLargeImageListHeng,
                 this.$refs.material.HorizontalLargeImageListShu,
@@ -585,15 +598,19 @@
                 //   params.titles = this.titleData
                 params.titles = this.$refs.material.titleData
               }
+              values.thirdIndustryId=this.thirdIndustryId
                 postAction('/bytedance/batch/create/creative', {
-                  accountId: '1649600126891015',
+                  accountId:this.accountInfo.value,
                   adIds: ["1673732908509245"],
                   ...values,
                   creatives: dataCreatives
                 }).then((res) => {
                   console.log(res)
                   if (res.success) {
-                    if (res.code == 0) {} else {
+                     console.log(res)
+                    if (res.code == 0) {
+                     
+                    } else {
                       this.$message.error(res.message)
                     }