Browse Source

feature_20251009_金牌店档案填写校验

sunny 1 tháng trước cách đây
mục cha
commit
ca93644dba

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

@@ -53,7 +53,7 @@
           :error-message="totalSalesAmountMsg"
           label="门店24年总进货额(含所有品牌品类,单位:万元)" />
         <van-field v-model="detail.performanceRatio" type="number" :error-message="performanceRatioMsg" label="门店立邦业绩占比(单位:%)" />
-        <van-field v-model="detail.mainBrand" autosize type="textarea" :error-message="mainBrandMsg" label="门店主营TOP3品牌(请填写具体品牌名称,非产品名称,比如:立邦,品牌之间用;隔开)" />
+        <van-field v-model="detail.mainBrand" autosize type="textarea" :error-message="mainBrandMsg" label="门店主营TOP3品牌" />
         <van-field label="是否有工地资源(支持工地配送,承接工地双包等)">
           <template #input>
             <van-radio-group
@@ -69,6 +69,7 @@
           v-if="detail.constructionResource == '是'"
           v-model="detail.constructionYearNum"
           type="number"
+          :error-message="constructionYearNumMsg"
           label="年工地数量" />
         <van-field label="是否有双包能力">
           <template #input>
@@ -134,6 +135,7 @@ export default {
       totalSalesAmountMsg: '',
       performanceRatioMsg: '',
       mainBrandMsg: '',
+      constructionYearNumMsg:'',
       detail: null,
       time: null, //计时
       timeNum: 60,
@@ -156,6 +158,7 @@ export default {
     this.totalSalesAmountMsg = '';
     this.performanceRatioMsg = '';
     this.mainBrandMsg = '';
+    this.constructionYearNumMsg = '';
     this.detail = null;
     this.verificationVal = '';
     if (this.time) clearInterval(this.time);
@@ -292,7 +295,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;
       }
@@ -316,6 +319,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;
@@ -357,6 +379,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"