Browse Source

Merge branch 'feature_20251009_金牌店档案填写校验' into uat(dev)

# Conflicts:
#	src/views/storeManagement/JPattributeEditor.vue
zhujindu 1 month ago
parent
commit
584506ce97

+ 27 - 2
src/views/storeManagement/JPattributeEditor.vue

@@ -62,7 +62,7 @@
           autosize
           type="textarea"
           :error-message="mainBrandMsg"
-          label="门店主营TOP3品牌(请填写具体品牌名称,非产品名称,比如:立邦,品牌之间用;隔开)" />
+          label="门店主营TOP3品牌" />
         <van-field label="是否有工地资源(支持工地配送,承接工地双包等)">
           <template #input>
             <van-radio-group
@@ -78,6 +78,7 @@
           v-if="detail.constructionResource == '是'"
           v-model="detail.constructionYearNum"
           type="number"
+          :error-message="constructionYearNumMsg"
           label="年工地数量" />
         <van-field label="是否有双包能力">
           <template #input>
@@ -143,6 +144,7 @@ export default {
       totalSalesAmountMsg: '',
       performanceRatioMsg: '',
       mainBrandMsg: '',
+      constructionYearNumMsg: '',
       detail: null,
       time: null, //计时
       timeNum: 60,
@@ -166,6 +168,7 @@ export default {
     this.totalSalesAmountMsg = '';
     this.performanceRatioMsg = '';
     this.mainBrandMsg = '';
+    this.constructionYearNumMsg = '';
     this.detail = null;
     this.verificationVal = '';
     if (this.time) clearInterval(this.time);
@@ -302,7 +305,7 @@ export default {
         this.ownerNameMsg = '至少一个汉字';
         return true;
       }
-      if (/[^a-zA-Z0-9\u4e00-\u9fa5]/.test(ownerName)) {
+      if (!/^[\u4e00-\u9fa5a-zA-Z0-9·]+$/.test(ownerName)) {
         this.ownerNameMsg = '不可输入特殊符号';
         return true;
       }
@@ -326,6 +329,25 @@ export default {
       }
       return false;
     },
+
+    isConstructionYearNum() {
+      this.constructionYearNumMsg = '';
+      let constructionYearNum = this.detail.constructionYearNum;
+      const value = parseFloat(constructionYearNum);
+      if (isNaN(value)) {
+        this.constructionYearNumMsg = '请输入数字';
+        return true;
+      }
+      if (value < 1) {
+        this.constructionYearNumMsg = '最小值1';
+        return true;
+      }
+      if (value > 100) {
+        this.constructionYearNumMsg = '最大值100';
+        return true;
+      }
+      return false;
+    },
     isPerformanceRatio() {
       this.performanceRatioMsg = '';
       let performanceRatio = this.detail.performanceRatio;
@@ -370,6 +392,9 @@ export default {
       if (this.isValidTotalSalesAmount()) return;
       if (this.isPerformanceRatio()) return;
       if (this.isValidMainBrand()) return;
+      if (this.detail.constructionResource == '是') {
+        if (this.isConstructionYearNum()) return;
+      }
       if (this.detail.emergencyContactMobile != '') {
         if (!/^1[123456789]\d{9}$/.test(this.detail.emergencyContactMobile)) {
           this.$toast('紧急联系人电话格式错误');

+ 1 - 1
src/views/storeManagement/storeDetail.vue

@@ -365,7 +365,7 @@
                 autosize
                 type="textarea"
                 v-model="list.storeArchives.mainBrand"
-                label="门店主营TOP3品牌(请填写具体品牌名称,非产品名称,比如:立邦,品牌之间用;隔开)" />
+                label="门店主营TOP3品牌" />
               <van-field
                 readonly
                 v-model="list.storeArchives.constructionResource"