Переглянути джерело

feature_20250926_数字题型&单行文本题型

zhujindu 1 місяць тому
батько
коміт
d365f38d46
1 змінених файлів з 9 додано та 9 видалено
  1. 9 9
      src/views/deviceWithin/addStoreVisit.vue

+ 9 - 9
src/views/deviceWithin/addStoreVisit.vue

@@ -3512,6 +3512,7 @@ export default {
       maxDate: new Date(),
       currentDate: new Date(1945, 0, 1),
       continuousShoot: '0',
+      validatorFlag: true, //是否验证通过
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -4000,6 +4001,7 @@ export default {
             this.$set(itemData, 'ruleMessage', '最大值为:' + maxValue);
             // this.$set(itemData, 'answerValue', '');
             // this.$toast('输入内容不合法');
+            this.validatorFlag = false;
             return;
           }
         }
@@ -4010,6 +4012,7 @@ export default {
             this.$set(itemData, 'ruleMessage', '最小值为:' + minValue);
             // this.$set(itemData, 'answerValue', '');
             // this.$toast('输入内容不合法');
+            this.validatorFlag = false;
             return;
           }
         }
@@ -4038,6 +4041,7 @@ export default {
             // this.$set(itemData, 'answerValue', '');
             this.$set(itemData, 'ruleMessage', '最大字数为:' + maxValue);
             // this.$toast('输入内容不合法');
+            this.validatorFlag = false;
             return;
           }
         }
@@ -4048,6 +4052,7 @@ export default {
             // this.$set(itemData, 'answerValue', '');
             this.$set(itemData, 'ruleMessage', '最小字数为:' + minValue);
             // this.$toast('输入内容不合法');
+            this.validatorFlag = false;
             return;
           }
         }
@@ -4058,6 +4063,7 @@ export default {
             // this.$set(itemData, 'answerValue', '');
             this.$set(itemData, 'ruleMessage', '至少有一个汉字');
             // this.$toast('输入内容不合法,至少有一个汉字');
+            this.validatorFlag = false;
             return;
           }
         }
@@ -5139,6 +5145,7 @@ export default {
       }
     },
     onSubmit() {
+      this.validatorFlag = true;
       var checkUnManage = 'Y';
       var formData = {};
       if (this.checked) {
@@ -5226,14 +5233,6 @@ export default {
               }
             });
           }
-          // // dhwb 初始化内容校验
-          // if (this.collectionItemList[b].answerType == 'dhwb') {
-          //   this.DHWBsizeComparison(this.collectionItemList[b], 'A');
-          // }
-          // // sz 初始化内容校验
-          // if (this.collectionItemList[b].answerType == 'sz') {
-          //   this.SZsizeComparison(this.collectionItemList[b], 'A');
-          // }
         }
         for (let f = 0; f < this.collectionItemList.length; f++) {
           if (this.collectionItemList[f].answerType == 'dx') {
@@ -5665,7 +5664,8 @@ export default {
           }
         }
       }
-      return;
+      // 特殊题型判断是否通过
+      if (!this.validatorFlag) return;
       // 调色机扫码是否正确
       if (!this.filterFormData(formData)) {
         this.$dialog.alert({