Commit 36939150 by tangjiale

手机号校验

parent 40ce4791
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-02 15:02:39 * @Date: 2022-06-02 15:02:39
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-28 11:43:26 * @LastEditTime: 2022-07-05 09:51:59
--> -->
<template> <template>
<div> <div>
...@@ -111,6 +111,19 @@ export default { ...@@ -111,6 +111,19 @@ export default {
this.$message.error('至少输入一个手机号') this.$message.error('至少输入一个手机号')
return return
} }
if(that.param.fatherPhone.length && !that.isTel(that.param.fatherPhone)){
this.$message.error('请输入正确手机号')
return
}
if(that.param.motherPhone.length && !that.isTel(that.param.motherPhone)){
this.$message.error('请输入正确手机号')
return
}
if(that.param.otherPhone.length && !that.isTel(that.param.otherPhone)){
this.$message.error('请输入正确手机号')
return
}
if(that.param.schIds && that.param.schIds.length){ if(that.param.schIds && that.param.schIds.length){
that.param.schIds = that.param.schIds.join(',') that.param.schIds = that.param.schIds.join(',')
} }
...@@ -125,7 +138,10 @@ export default { ...@@ -125,7 +138,10 @@ export default {
}) })
} }
}) })
} },
isTel(tel) {
return /^1[0-9]{10}$/.test(tel);
},
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment