Ver código fonte

处理判断问题

lex-xin 4 anos atrás
pai
commit
d40b49443c
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      src/views/buildVip/index.vue

+ 4 - 4
src/views/buildVip/index.vue

@@ -817,7 +817,7 @@ export default {
         this.giveNum = giveNum || 0;
 
         return parseInt(offline) + parseInt(online) + "+" + giveNum || "";
-      } else if(this.hotType == 'DISCOUNT' && this.attribute3) {
+      } else if(this.hotType == 'DISCOUNT' && this.attribute3  && this.attribute3 > 0) {
         return parseInt(this.attribute3)
       }
       return parseInt(offline) + parseInt(online) || "";
@@ -871,9 +871,9 @@ export default {
     onCourseNumChange(type) {
       let centerForm = this.centerForm
       // 折扣类型,并且设置的排课数有值
-      if(this.hotType == 'DISCOUNT' && this.attribute3) {
+      if(this.hotType == 'DISCOUNT' && this.attribute3 && this.attribute3 > 0) {
         // 判断线上或线下总和等于排课次数
-        console.log((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)), this.attribute3)
+        // console.log((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)), this.attribute3)
         if((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)) > this.attribute3) {
           if(type == 'online') {
             this.$message.error('线上课数加线下课数必须等于待排课数')
@@ -1658,7 +1658,7 @@ export default {
         if (vali) {
 
           let centerForm = this.centerForm
-          if(this.hotType == 'DISCOUNT' && this.attribute3) {
+          if(this.hotType == 'DISCOUNT' && this.attribute3 && this.attribute3 > 0) {
             // 判断线上或线下总和大于排课次数
             if((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)) != this.attribute3) {
               this.$message.error('线上课数加线下课数必须等于待排课数')