Explorar o código

feature_20250722_金牌店档案收集

zhujindu hai 4 meses
pai
achega
d0eec84774
Modificáronse 1 ficheiros con 14 adicións e 3 borrados
  1. 14 3
      src/views/storeManagement/JPattributeEditor.vue

+ 14 - 3
src/views/storeManagement/JPattributeEditor.vue

@@ -68,7 +68,11 @@
           v-model="detail.emergencyContactBirthday"
           label="紧急联系人出生日期"
           @click="getNyr('emergencyContactBirthday', detail.emergencyContactBirthday)" />
-        <van-field v-model="detail.emergencyContactMobile" type="number" label="紧急联系人电话" />
+        <van-field
+          v-model="detail.emergencyContactMobile"
+          type="number"
+          @blur="emergencyContactBlur(detail.emergencyContactMobile)"
+          label="紧急联系人电话" />
       </van-form>
     </div>
     <div class="footer-btn">
@@ -148,7 +152,8 @@ export default {
             : [];
           this.detail = res.data;
           // mobileStatus 1是 是否验证通过
-          if (this.mobileStatus == '1') this.verificationPassedPhoneNum = this.detail.ownerMobile;
+          if (res.data.mobileStatus == '1')
+            this.verificationPassedPhoneNum = this.detail.ownerMobile;
         }
       });
     },
@@ -231,6 +236,12 @@ export default {
         this.$toast('请验证手机号');
         return;
       }
+      if (this.detail.emergencyContactMobile != '') {
+        if (!/^1[3456789]\d{9}$/.test(this.detail.emergencyContactMobile)) {
+          this.$toast('紧急联系人电话格式错误');
+          return;
+        }
+      }
       this.toastLoading(0, '加载中...', true);
       let params = JSON.parse(JSON.stringify(this.detail));
       params.mainProductCategorys = params.mainProductCategorys.join(',');
@@ -247,7 +258,7 @@ export default {
     },
     emergencyContactBlur(val) {
       if (!/^1[3456789]\d{9}$/.test(val)) {
-        this.$toast('格式错误');
+        this.$toast('紧急联系人电话格式错误');
       }
     },
     onClickLeft() {