소스 검색

手机号校验

@dongkboy 3 년 전
부모
커밋
a7ae63668d
1개의 변경된 파일25개의 추가작업 그리고 1개의 파일을 삭제
  1. 25 1
      src/views/Letter/Letter.vue

+ 25 - 1
src/views/Letter/Letter.vue

@@ -245,7 +245,7 @@
           </el-col>
           <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell">
             <el-form-item label="车主手机号:" prop="mobile">
-              <el-input v-model="ownerInfo.mobile" placeholder="请输入车主手机号" maxlength="11" type="text"
+              <el-input v-model="ownerInfo.mobile" placeholder="请输入车主手机号"  type="text"
                 show-word-limit></el-input>
             </el-form-item>
           </el-col>
@@ -2870,6 +2870,30 @@ export default {
       },
       deep: true
     },
+    "ownerInfo.mobile":{
+      handler(val) {
+        if (val) {
+          this.ownerInfo.mobile = val.replace(/\s/g, "");
+        }
+      },
+      deep: true
+    },
+    "policyHolderInfo.mobile":{
+      handler(val) {
+        if (val) {
+          this.policyHolderInfo.mobile = val.replace(/\s/g, "");
+        }
+      },
+      deep: true
+    },
+    "insuredPersonInfo.mobile":{
+      handler(val) {
+        if (val) {
+          this.insuredPersonInfo.mobile = val.replace(/\s/g, "");
+        }
+      },
+      deep: true
+    },
     "carInfo.engineNo": {
       handler(val) {
         if (val) {