Browse Source

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

# Conflicts:
#	src/views/deviceOutside/rangeStore.vue
#	src/views/storeManagement/JPattributeEditor.vue
zhujindu 2 months ago
parent
commit
d0c538f8bf

+ 14 - 7
src/views/deviceOutside/rangeStore.vue

@@ -323,13 +323,20 @@
                     <van-icon :name="Network" size="26" />
                   </div>
                 </el-popover>
-                <el-popover popper-class="zpover" placement="bottom" width="120" trigger="click"
-                          content="调色机当月未调色">
-                          <div v-if="info.storeLabels.stopColorMixerMonth" class="visitStoreIco"
-                            style="background-color: #fff" slot="reference">
-                            <van-icon :name="WiFi" size="26" />
-                          </div>
-                        </el-popover>
+                <el-popover
+                  popper-class="zpover"
+                  placement="bottom"
+                  width="120"
+                  trigger="click"
+                  content="调色机当月未调色">
+                  <div
+                    v-if="info.storeLabels.stopColorMixerMonth"
+                    class="visitStoreIco"
+                    style="background-color: #fff"
+                    slot="reference">
+                    <van-icon :name="WiFi" size="26" />
+                  </div>
+                </el-popover>
                 <el-popover
                   popper-class="zpover"
                   placement="top"

+ 26 - 16
src/views/storeManagement/JPattributeEditor.vue

@@ -53,7 +53,12 @@
           :error-message="totalSalesAmountMsg"
           label="门店24年总进货额(含所有品牌品类)" />
         <van-field v-model="detail.performanceRatio" type="number" 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
@@ -272,53 +277,55 @@ 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;
+        return true;
       }
-       if(ownerName.length > 20){
+      if (ownerName.length > 20) {
         this.ownerNameMsg = '最长字数20';
-        return;
+        return true;
       }
       const chineseChars = ownerName.match(/[\u4e00-\u9fa5]/g) || [];
       if (chineseChars.length < 1) {
         this.ownerNameMsg = '至少一个汉字';
-        return;
+        return true;
       }
       if (/[^a-zA-Z0-9\u4e00-\u9fa5]/.test(ownerName)) {
         this.ownerNameMsg = '不可输入特殊符号';
-        return;
+        return true;
       }
-     
+      return false;
     },
-    isValidTotalSalesAmount(){
+    isValidTotalSalesAmount() {
       this.totalSalesAmountMsg = '';
       let totalSalesAmount = this.detail.totalSalesAmount;
       const value = parseFloat(totalSalesAmount);
       if (isNaN(value)) {
         this.totalSalesAmountMsg = '请输入数字';
-        return;
+        return true;
       }
       if (value < 1) {
         this.totalSalesAmountMsg = '最小值1';
-        return;
-      } 
+        return true;
+      }
       if (value > 1000) {
         this.totalSalesAmountMsg = '最大值1000';
-        return;
+        return true;
       }
+      return false;
     },
-    isValidMainBrand(){
+    isValidMainBrand() {
       this.mainBrandMsg = '';
       let mainBrand = this.detail.mainBrand;
       const chineseChars = mainBrand.match(/[\u4e00-\u9fa5]/g) || [];
       if (chineseChars.length < 1) {
         this.mainBrandMsg = '至少一个汉字';
-        return;
+        return true;
       }
+      return false;
     },
     // 保存
     confirmShare() {
@@ -332,6 +339,9 @@ export default {
         this.$toast('请验证手机号');
         return;
       }
+      if (this.isValidOwnerName()) return;
+      if (this.isValidTotalSalesAmount()) return;
+      if (this.isValidMainBrand()) return;
       if (this.detail.emergencyContactMobile != '') {
         if (!/^1[123456789]\d{9}$/.test(this.detail.emergencyContactMobile)) {
           this.$toast('紧急联系人电话格式错误');