3 Commity d149b2ac6d ... 91734be06f

Autor SHA1 Správa Dátum
  sunny 91734be06f feature_20251009_金牌店档案填写校验 1 mesiac pred
  zhujindu 343d11fdfd feature_20250904_调色机识别结果提示 2 mesiacov pred
  zhujindu 177254084b 手机号接口验证提示内容修改 2 mesiacov pred

+ 3 - 1
src/components/imageAIVerifyErr.vue

@@ -192,7 +192,9 @@ export default {
       this.lastVisitUrl = imageAIVerifyData.lastVisitUrl || ''; //	上次拜访时店招
       this.storeIDCardUrl = imageAIVerifyData.storeIDCardUrl || ''; //	门店身份证
       this.tsjErrorMsg = imageAIVerifyData.tsjErrorMsg || ''; //	调色机识别结果
-      this.deliveryCode = this.npkpiData.colorantDispenserInfo.deliveryCode || ''; //AI识别投放编号
+      this.deliveryCode = this.npkpiData.colorantDispenserInfo
+        ? this.npkpiData.colorantDispenserInfo.deliveryCode
+        : ''; //AI识别投放编号
       // 先判断照片作弊情况,然后是否合格,然后是否和历史照片一致
       // 作弊和不合格记录识别次数,超过两次弹框提醒
       if (this.npkpiData.checkInfo) {

+ 1 - 1
src/utils/index.js

@@ -312,7 +312,7 @@ export function validatePhone(telephone) {
         if (res.code == 200) {
           resolve();
         } else {
-          Toast('手机号格式错误');
+          Toast(res.msg);
           reject();
         }
       });

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

@@ -28,7 +28,7 @@
           type="number"
           @blur="verification(verificationVal)"
           v-if="!verifyMobile" />
-        <van-field v-model="detail.ownerName" label="主经营者姓名" />
+        <van-field v-model="detail.ownerName" :error-message="ownerNameMsg" label="主经营者姓名" />
         <van-field
           v-model="detail.ownerBirthday"
           label="主经营者出生日期"
@@ -50,9 +50,10 @@
         <van-field
           v-model="detail.totalSalesAmount"
           type="number"
+          :error-message="totalSalesAmountMsg"
           label="门店24年总进货额(含所有品牌品类)" />
         <van-field v-model="detail.performanceRatio" type="number" label="门店立邦业绩占比(%)" />
-        <van-field v-model="detail.mainBrand" autosize type="textarea" label="门店主营TOP3品牌" />
+        <van-field v-model="detail.mainBrand" autosize type="textarea" :error-message="mainBrandMsg" label="门店主营TOP3品牌" />
         <van-field label="是否有工地资源(支持工地配送,承接工地双包等)">
           <template #input>
             <van-radio-group
@@ -129,6 +130,9 @@ export default {
   name: 'JPattributeEditor',
   data() {
     return {
+      ownerNameMsg: '',
+      totalSalesAmountMsg: '',
+      mainBrandMsg: '',
       detail: null,
       time: null, //计时
       timeNum: 60,
@@ -268,8 +272,59 @@ export default {
       //   this.detail.ownerBirthday = this.parseTime(time, '{y}-{m}-{d}');
       this.datetimeShowPicker = false;
     },
+    isValidOwnerName(){
+      this.ownerNameMsg = '';
+      let ownerName = this.detail.ownerName;
+      if(ownerName.length < 2){
+        this.ownerNameMsg = '最短字数2';
+        return;
+      }
+       if(ownerName.length > 20){
+        this.ownerNameMsg = '最长字数20';
+        return;
+      }
+      const chineseChars = ownerName.match(/[\u4e00-\u9fa5]/g) || [];
+      if (chineseChars.length < 1) {
+        this.ownerNameMsg = '至少一个汉字';
+        return;
+      }
+      if (/[^a-zA-Z0-9\u4e00-\u9fa5]/.test(ownerName)) {
+        this.ownerNameMsg = '不可输入特殊符号';
+        return;
+      }
+     
+    },
+    isValidTotalSalesAmount(){
+      this.totalSalesAmountMsg = '';
+      let totalSalesAmount = this.detail.totalSalesAmount;
+      const value = parseFloat(totalSalesAmount);
+      if (isNaN(value)) {
+        this.totalSalesAmountMsg = '请输入数字';
+        return;
+      }
+      if (value < 1) {
+        this.totalSalesAmountMsg = '最小值1';
+        return;
+      } 
+      if (value > 1000) {
+        this.totalSalesAmountMsg = '最大值1000';
+        return;
+      }
+    },
+    isValidMainBrand(){
+      this.mainBrandMsg = '';
+      let mainBrand = this.detail.mainBrand;
+      const chineseChars = mainBrand.match(/[\u4e00-\u9fa5]/g) || [];
+      if (chineseChars.length < 1) {
+        this.mainBrandMsg = '至少一个汉字';
+        return;
+      }
+    },
     // 保存
     confirmShare() {
+      this.isValidOwnerName();
+      this.isValidTotalSalesAmount();
+      this.isValidMainBrand();
       if (
         this.verificationPassedPhoneNum == '' ||
         this.detail.ownerMobile != this.verificationPassedPhoneNum