朱鑫波 4 years ago
parent
commit
5998b133fd

+ 1 - 0
src/components/formComponents/toutiaoTime.vue

@@ -46,6 +46,7 @@ export default {
   },
   data() {
     return {
+      changeDataElse: ['1'],
       show: false,
       numData: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
       dateTime: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],

+ 9 - 1
src/views/modules/earlyWarningRules/ruleModule.vue

@@ -123,6 +123,7 @@
                       </a-select>
 
                       <!-- <p v-else-if="value.modelType == 'timeRange'">{{value.threshold}}</p> -->
+
                       <scheduleTime
                         style="width: 100%"
                         :scheduleTime.sync="value.threshold"
@@ -978,7 +979,10 @@ export default {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           // this.form.rulesList=this.rulesList;
-
+          var str = ''
+          for (let i = 0; i < 7 * 24; i++) {
+            str += '0'
+          }
           var datas = []
           datas = this.form.ruleList.map((item) => {
             return {
@@ -1003,6 +1007,10 @@ export default {
                             })
                           )
                         : JSON.stringify(end.threshold)
+                      : end.modelType == 'scheduleTime'
+                      ? end.threshold == str
+                        ? ''
+                        : end.threshold
                       : end.threshold,
                   }
                 }

+ 49 - 30
src/views/modules/kuaishouapp/batchCreation/creat/creatUnit.vue

@@ -447,17 +447,16 @@
             v-decorator="[
             'bid',
             {
-              rules: [{ required: true, message: '出价必填' }],
+              rules: [{ required: true, message: '出价必填' }, {validator: bidCheck}],
             },
           ]"
-            @change="showTip(index)"
             :style="{ borderColor: item.showTipCheck ? 'red' : '#d9d9d9' }"
             style="width: 100%"
           >
           </a-input-number>
-          <span style="color: red" v-if="item.showTipCheck && item.ocpxActionType == 180"
+          <!-- <span style="color: red" v-if="item.showTipCheck && item.ocpxActionType == 180"
             >不得低于0.2元,不得高于项目最高出价{{ maxBid }}元</span
-          >
+          > -->
         </a-form-item>
         <a-form-item
           label="目标成本"
@@ -471,20 +470,20 @@
             v-decorator="[
             'cpaBid',
             {
-              rules: [{ required: true, message: '目标成本必填' }],
+              rules: [{ required: true, message: '目标成本必填' }, {validator: cpaBidCheck}],
             },]"
-            @change="showTip(index)"
+          
             style="width: 100%"
           >
           </a-input-number>
-          <span style="color: red" v-if="item.showTipCheck">{{
+          <!-- <span style="color: red" v-if="item.showTipCheck">{{
             item.bidType == 1
               ? '不得低于1元,不得高于项目最高出价' + maxBid + '元'
               : '不得低于1元,不得高于项目最高出价' + maxBid + '元'
-          }}</span>
+          }}</span> -->
           <span
             style="color: red; font-weight: 700"
-            v-else-if="item.ocpxActionType == 2 && getData('cpaBid') && getData('cpaBid') > 1"
+            v-if="item.ocpxActionType == 2 && getData('cpaBid') && getData('cpaBid') > 1"
           >
             行为出价大于1元,请注意!!!
           </span>
@@ -519,7 +518,7 @@
           <a-input  v-decorator="[
             'unitName',
             {
-              rules: [{ required: true, message: '广告组必填' }],
+              rules: [{ required: true, message: '广告组必填' }, {validator: handleConfirmValue}],
             },]" @change="checkGroup($event, index)"></a-input>
           <span style="color: red" v-if="item.unitNameCheck">广告组名称重复</span>
         </a-form-item>
@@ -1949,12 +1948,18 @@ export default {
       })
     },
     resData(index) {
-      this.allForm.group[index].bid = ''
-      this.allForm.group[index].cpaBid = ''
+      // this.allForm.group[index].bid = ''
+      // this.allForm.group[index].cpaBid = ''
       this.allForm.group[index].showTipCheck = false
       this.allForm.group[index].deepConversionBidCheck = false
       this.allForm.group[index].deepConversionType = ''
       this.allForm.group[index].deepConversionBid = ''
+      this.form.setFieldsValue({
+        bid: undefined,
+      })
+      this.form.setFieldsValue({
+        cpaBid: undefined,
+      })
     },
     removeGroup(index) {
       this.allForm.group.splice(index, 1)
@@ -2018,24 +2023,38 @@ export default {
     getData(className) {
       return this.form.getFieldValue(className)
     },
-
+    bidCheck(rule, value, callback) {
+      if (value < 0.2 || value > this.maxBid) {
+        callback('不得低于0.2元,不得高于项目最高出价' + this.maxBid + '元')
+      } else {
+        callback()
+      }
+    },
+    cpaBidCheck(rule, value, callback) {
+      if (value < 1 || value > this.maxBid) {
+        callback('不得低于1元,不得高于项目最高出价' + this.maxBid + '元')
+      } else {
+        callback()
+      }
+    },
     handleConfirmValue(rule, value, callback) {
-      if (this.campaignType == 3) {
-        if (value == '') {
-          callback('请填写链接')
-        }
-      } else if (this.campaignType == 4) {
-        if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '' && value.length < 10000) {
-          callback()
-        } else {
-          callback('链接不能为空且开头为http://或https://,并且长度小于10000')
-        }
-      } else if (this.campaignType == 5) {
-        if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '' && value.length < 10000) {
-          callback()
-        } else {
-          callback('链接不能为空且开头为http://或https://,并且长度小于10000')
-        }
+      if (value != '' && value != undefined) {
+        getAction('/kuaishou/batch/checkUnitName', {
+          campaignId: localStorage.getItem('campaignList'),
+          unitName: value + '_0',
+        }).then((res) => {
+          if (res.success) {
+            if (!res.result) {
+              callback('广告组名称重复')
+            } else {
+              callback()
+            }
+          } else {
+            callback()
+          }
+        })
+      } else {
+        callback()
       }
     },
     budgetValue(rule, value, callback) {
@@ -2153,7 +2172,7 @@ export default {
           ? this.$message.error('选择的素材不能小于创建条数')
           : this.$message.error('选择的素材不能小于创建条数*15')
       } else {
-        this.form.validateFields((err, values) => {
+        this.form.validateFieldsAndScroll((err, values) => {
           if (!err) {
             this.loading = true
             var groupArr = this.allForm.group.map((item) => {

+ 2 - 2
vue.config.js

@@ -70,14 +70,14 @@ module.exports = {
       '/jeecg-boot': {
         //  target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
-        target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目  英豪
+        // target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.43:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8888', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
-        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目