魏志佳 4 years ago
parent
commit
794b4b4a61

+ 3 - 3
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -684,9 +684,9 @@ export default {
         //跳转到批量页面
         goBatch(){
             this.$router.push('/modules/BatchCreate/newGroup')
-            if(this.tabkey=='idea'){
-                 this.$router.push('/modules/BatchCreate/newCreate')
-            }
+            // if(this.tabkey=='idea'){
+            //      this.$router.push('/modules/BatchCreate/newCreate')
+            // }
         },
         //状态改变
         statusChange(value){

+ 2 - 1
src/views/modules/BatchCreate/newCreate.vue

@@ -656,10 +656,11 @@
                     //   this.$message.error(item.message)
                     // })
                   } else {
-
+                    this.loading=false;
                   }
                 })
             } else {
+
               console.log(err)
             }
           })

+ 22 - 7
src/views/modules/BatchCreate/newGroup.vue

@@ -44,7 +44,7 @@
                                 </a-radio-group>
                             </a-form-item>
                             <a-form-item v-if="getFormData('budgetMode')=='BUDGET_MODE_DAY'" label="日预算" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-                                <a-input-number  :max="9999999.99" :step="0.1"  v-decorator="['budget',{initialValue:1000 }]" @change="budgetChange" @blur='budgetBlur' />
+                                <a-input-number  :max="9999999.99" :step="1"  v-decorator="['budget',{initialValue:1000 }]" @change="budgetChange" @blur='budgetBlur' />
                                 <span class="tip" v-if="getFormData('budget')<1000">预算不少于1000.00元,不超过9999999.99元,请正确输入</span>
                             </a-form-item>
                             <a-form-item label="广告主名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
@@ -231,10 +231,24 @@ export default {
         },
         //预算改变
         budgetChange(val){
-            // console.log(val)           
+            console.log(val)  
+            var strRegex = /^[0-9](.)+$/
+            var re = new RegExp(strRegex)
+            // console.log(re.test(res))
+            if (re.test(val)) {
+                return true
+            } else {
+                // return false
+                this.$message.error('请勿输入非数字!')
+                // let num = val.splice(val.length-2,1)
+                // this.form.setFieldsValue({
+                //     budget:1000
+                // })
+            }          
         },
         budgetBlur(e){
-            console.log(e.target)
+            console.log(e.target.value)
+
             if(e.target.value==0){
                 this.form.setFieldsValue({
                     budget:1000.0
@@ -257,15 +271,16 @@ export default {
                                 console.log(res)
                                 if(res.success){
                                     this.nextLoading=false;
-                                    this.$message.success('广告组创建成功,2s后将跳转到新建计划页面');
+                                    this.$message.success('广告组创建成功,1s后将跳转到新建计划页面');
                                     values.id=res.campaign_id;
                                     values.accountId=this.accountID
                                     let groupInfo=JSON.stringify(values)
                                     localStorage.setItem('groupInfo',groupInfo)
                                     setTimeout(() => {
-                                        this.$router.replace(`/modules/BatchCreate/newPlan`)
-                                    },2000);                                
+                                        this.$router.push('/modules/BatchCreate/newPlan')
+                                    },1000);                                
                                 }else{
+                                    this.nextLoading=false;
                                     this.$message.error(res.message) 
                                 }
                             })
@@ -280,7 +295,7 @@ export default {
             
         },
         goback(){
-            this.$router.replace('/modules/BatchCreate/TouTiaoBatch')
+            this.$router.push('/modules/BatchCreate/TouTiaoBatch')
             this.$bus.$emit('remove', '/modules/BatchCreate/newGroup')
         },
 

+ 10 - 1
src/views/modules/BatchCreate/newPlan.vue

@@ -1066,6 +1066,13 @@ export default {
               values.externalAction=this.externalAction
               values.startTime=this.dateRange[0].format('YYYY-MM-DD HH:mm');
               values.endTime= this.dateRange[1].format('YYYY-MM-DD HH:mm');
+               if(this.getFormData('launchTarget')=='CLICK_AMOUNT'){                
+                    values.pricing='PRICING_CPC'
+              }else if(val.target.value=='SHOW_AMOUNT'){               
+                    values.pricing='PRICING_CPM'
+              }else if(val.target.value=='CONVERT_AMOUNT'){             
+                    values.pricing='PRICING_OCPM'                 
+              }
               postAction('/ctop/byteDanceAdvertisePlan/add', {
                 names: this.names,
                 landingType: this.groupInfo.landingType,
@@ -1091,6 +1098,7 @@ export default {
                   }
                  
                 } else {
+                   this.goPlanShowloading=false;
                   this.$message.error('网络开小差了,等会再试试')
                 }
               })
@@ -1152,7 +1160,7 @@ export default {
                       this.$router.replace(`/modules/BatchCreate/newCreate`)
                     },2000)
                   }else{
-                    if(res.message='convert_id is required'){
+                    if(res.message=='convert_id is required'){
                         this.$message.error('转化方式必须选择!')
                     }else{
                       this.$message.error(res.message)
@@ -1161,6 +1169,7 @@ export default {
                   }
                  
                 } else {
+                   this.goNextloading=false;
                   this.$message.error('网络开小差了,等会再试试')
                 }
               })