Pārlūkot izejas kodu

feature_20251009_金牌店档案填写校验

zhujindu 1 mēnesi atpakaļ
vecāks
revīzija
28c07c7ba9
1 mainītis faili ar 31 papildinājumiem un 22 dzēšanām
  1. 31 22
      src/views/storeManagement/JPattributeEditor.vue

+ 31 - 22
src/views/storeManagement/JPattributeEditor.vue

@@ -52,8 +52,17 @@
           type="number"
           :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.performanceRatio"
+          type="number"
+          :error-message="performanceRatioMsg"
+          label="门店立邦业绩占比(单位:%)" />
+        <van-field
+          v-model="detail.mainBrand"
+          autosize
+          type="textarea"
+          :error-message="mainBrandMsg"
+          label="门店主营TOP3品牌" />
         <van-field label="是否有工地资源(支持工地配送,承接工地双包等)">
           <template #input>
             <van-radio-group
@@ -135,7 +144,7 @@ export default {
       totalSalesAmountMsg: '',
       performanceRatioMsg: '',
       mainBrandMsg: '',
-      constructionYearNumMsg:'',
+      constructionYearNumMsg: '',
       detail: null,
       time: null, //计时
       timeNum: 60,
@@ -279,14 +288,14 @@ export default {
       //   this.detail.ownerBirthday = this.parseTime(time, '{y}-{m}-{d}');
       this.datetimeShowPicker = false;
     },
-    isValidOwnerName(){
+    isValidOwnerName() {
       this.ownerNameMsg = '';
       let ownerName = this.detail.ownerName;
-      if(ownerName.length < 2){
+      if (ownerName.length < 2) {
         this.ownerNameMsg = '最短字数2';
         return true;
       }
-       if(ownerName.length > 20){
+      if (ownerName.length > 20) {
         this.ownerNameMsg = '最长字数20';
         return true;
       }
@@ -301,7 +310,7 @@ export default {
       }
       return false;
     },
-    isValidTotalSalesAmount(){
+    isValidTotalSalesAmount() {
       this.totalSalesAmountMsg = '';
       let totalSalesAmount = this.detail.totalSalesAmount;
       const value = parseFloat(totalSalesAmount);
@@ -312,15 +321,15 @@ export default {
       if (value < 1) {
         this.totalSalesAmountMsg = '最小值1';
         return true;
-      } 
-      if (value > 1000) {
-        this.totalSalesAmountMsg = '最大值1000';
+      }
+      if (value > 10000) {
+        this.totalSalesAmountMsg = '最大值10000';
         return true;
       }
       return false;
     },
-    
-    isConstructionYearNum(){
+
+    isConstructionYearNum() {
       this.constructionYearNumMsg = '';
       let constructionYearNum = this.detail.constructionYearNum;
       const value = parseFloat(constructionYearNum);
@@ -331,14 +340,14 @@ export default {
       if (value < 1) {
         this.constructionYearNumMsg = '最小值1';
         return true;
-      } 
+      }
       if (value > 100) {
         this.constructionYearNumMsg = '最大值100';
         return true;
       }
       return false;
     },
-    isPerformanceRatio(){
+    isPerformanceRatio() {
       this.performanceRatioMsg = '';
       let performanceRatio = this.detail.performanceRatio;
       const value = parseFloat(performanceRatio);
@@ -349,14 +358,14 @@ export default {
       if (value < 1) {
         this.performanceRatioMsg = '最小值1';
         return true;
-      } 
+      }
       if (value > 100) {
         this.performanceRatioMsg = '最大值100';
         return true;
       }
       return false;
     },
-    isValidMainBrand(){
+    isValidMainBrand() {
       this.mainBrandMsg = '';
       let mainBrand = this.detail.mainBrand;
       const chineseChars = mainBrand.match(/[\u4e00-\u9fa5]/g) || [];
@@ -375,12 +384,12 @@ export default {
         this.$toast('请验证手机号');
         return;
       }
-      if(this.isValidOwnerName()) return;
-      if(this.isValidTotalSalesAmount()) return;
-      if(this.isPerformanceRatio()) return;
-      if(this.isValidMainBrand()) return;
-      if(this.detail.constructionResource == '是'){
-        if(this.isConstructionYearNum()) return;
+      if (this.isValidOwnerName()) return;
+      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)) {