diff --git a/src/views/system/patientArchives/index.vue b/src/views/system/patientArchives/index.vue index 9e5d6f5..3e7e90f 100644 --- a/src/views/system/patientArchives/index.vue +++ b/src/views/system/patientArchives/index.vue @@ -243,14 +243,20 @@ export default { } cb(new Error("请输入正确的联系电话")); }; + var checkMobile2 = (rule, value, cb) => { // 验证手机号的正则表达式 const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/; - if (regMobile.test(value)) { + if (!value) { //所以当没有值的时候,我们直接callback,让他不校验直接执行下一步 + return cb() + }else{ + if (regMobile.test(value)) { return cb(); + }else{ + cb(new Error("请输入正确的紧急联系电话")); } - cb(new Error("请输入正确的紧急联系电话")); + } }; //验证身份证 @@ -367,7 +373,7 @@ export default { // { required: true, message: "紧急联系人不能为空", trigger: "blur" } // ], urgentContactPhone: [ - { validator: checkMobile2,message: "", trigger: "blur" } + { validator: checkMobile2,trigger: "blur"} ], // homeLongitude: [ // { required: true, message: "居住地址经度不能为空", trigger: "blur" } diff --git a/src/views/system/station/index.vue b/src/views/system/station/index.vue index 94791d4..d3039bb 100644 --- a/src/views/system/station/index.vue +++ b/src/views/system/station/index.vue @@ -1010,7 +1010,7 @@ export default { }, //点击区县城 clickarea(item) { - // this.value3 = ""; + this.value3 = ""; console.log(item); getSecondaryLevelInfo(item.id).then((res) => { console.log(res); @@ -1020,7 +1020,7 @@ export default { //点击市 clickcity(item) { this.value2 = ""; - // this.value3 = ""; + this.value3 = ""; console.log(item); getSecondaryLevelInfo(item.id).then((res) => { console.log(res);