Browse Source

修改创建校验

朱鑫波 3 years ago
parent
commit
a61062a108
1 changed files with 37 additions and 13 deletions
  1. 37 13
      src/views/modules/autoLaunch/configProject/creatConfig.vue

+ 37 - 13
src/views/modules/autoLaunch/configProject/creatConfig.vue

@@ -2477,7 +2477,7 @@ export default {
                         } else {
                             data.cpaBid = data.cpaBid / 1000 + ''
                         }
-                        console.log(data.deepConversionBid,data.deepConversionType)
+                        console.log(data.deepConversionBid, data.deepConversionType)
                         this.formOptimize.setFieldsValue(
                             pick(data, 'bidType', 'ocpxActionType', 'deepConversionType', 'cpaBid', 'deepConversionBid')
                         )
@@ -2625,7 +2625,11 @@ export default {
             })
             Promise.all([formProjectData, formInformationData, formOptimizeData, formMaterialData])
                 .then(res => {
-                    if (!this.showCreativeData || this.checkPerson.length === 0 || this.multipleBidData.length === 0) {
+                    if (
+                        !this.showCreativeData ||
+                        this.showCheckPerson.length === 0 ||
+                        this.multipleBidData.length === 0
+                    ) {
                         this.$message.error('请填写完整')
                         return
                     }
@@ -2688,7 +2692,9 @@ export default {
                     params.appIdArray = this.multipleBidData.map(res => {
                         return res.apptemId
                     })
-                    params.templateIdArray = this.checkPerson
+                    params.templateIdArray = this.showCheckPerson.map(item => {
+                        return item.id
+                    })
                     params.description = JSON.stringify(
                         this.descriptionList.map(item => {
                             return item.value
@@ -2701,12 +2707,28 @@ export default {
                     if (this.$route.query.id) {
                         params.id = this.$route.query.id
                     }
-                    this.postDataAction('/kuaishouProjectStrategy/createProjectStrategy', params).then(res => {
-                        if (res.success) {
-                            this.sumbitLoading = false
-                            window.close()
+                    this.getAction('/kuaishouProjectStrategy/checkProjectisOpen', { projectId: params.projectId }).then(
+                        res => {
+                            if (res.success) {
+                                if (res.result === 1) {
+                                    this.postDataAction('/kuaishouProjectStrategy/createProjectStrategy', params).then(
+                                        res => {
+                                            if (res.success) {
+                                                this.sumbitLoading = false
+                                                window.close()
+                                            } else {
+                                                this.sumbitLoading = false
+                                                this.$message.error('创建失败')
+                                            }
+                                        }
+                                    )
+                                } else {
+                                    this.$message.error('此项目有开启的配置,无法新建配置')
+                                    this.sumbitLoading = false
+                                }
+                            }
                         }
-                    })
+                    )
                 })
                 .catch(err => {
                     this.$message.error('请填写完整')
@@ -3264,12 +3286,14 @@ export default {
                 }
             )
             this.$nextTick(() => {
-                if (this.showCreativeData.unitType === 7) {
-                    this.imageCntMax = 8
-                } else {
-                    this.imageCntMax = 15
+                if (this.showCreativeData) {
+                    if (this.showCreativeData.unitType === 7) {
+                        this.imageCntMax = 8
+                    } else {
+                        this.imageCntMax = 15
+                    }
+                    this.formOriginality.setFieldsValue(this.showCreativeData)
                 }
-                this.formOriginality.setFieldsValue(this.showCreativeData)
             })
         },
         //设置通配符