mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 21:26:43 +08:00
姓名录入校验修改
This commit is contained in:
@@ -59,16 +59,19 @@ Validator.extend('email', {
|
|||||||
Validator.extend('name', {
|
Validator.extend('name', {
|
||||||
getMessage: () => '姓名长度为2-120个字符之内,只能输入汉字或者英文',
|
getMessage: () => '姓名长度为2-120个字符之内,只能输入汉字或者英文',
|
||||||
validate: value => {
|
validate: value => {
|
||||||
|
return value
|
||||||
// return /^[\u4e00-\u9fa5·]{1,15}$/.test(value)
|
// return /^[\u4e00-\u9fa5·]{1,15}$/.test(value)
|
||||||
return /^[a-zA-Z\.\s\u4e00-\u9fa5]{2,120}$/.test(value);
|
// return /^[a-zA-Z\.\s\u4e00-\u9fa5]{2,120}$/.test(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//sale 投保名字 2个汉字,4个字母
|
//sale 投保名字 2个汉字,4个字母
|
||||||
Validator.extend('salename', {
|
Validator.extend('salename', {
|
||||||
getMessage: () => '亲,请确认您录入的姓名是否正确哦~',
|
getMessage: () => '亲,请确认您录入的姓名是否正确哦~',
|
||||||
validate: value => {
|
validate: value => {
|
||||||
|
return value
|
||||||
// return /^[\u4e00-\u9fa5·]{1,15}$/.test(value)
|
// return /^[\u4e00-\u9fa5·]{1,15}$/.test(value)
|
||||||
return /^[\u4e00-\u9fa5·]{2,120}$|^[a-zA-Z\s]{4,120}$/.test(value);
|
// return /^[a-zA-Z\.\s\u4e00-\u9fa5]{2,120}$/.test(value);
|
||||||
|
// return /^[\u4e00-\u9fa5·]{2,120}$|^[a-zA-Z\s]{4,120}$/.test(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// sale - 详细地址 - 详细地址须同时包含汉字和数字,
|
// sale - 详细地址 - 详细地址须同时包含汉字和数字,
|
||||||
|
|||||||
@@ -310,10 +310,10 @@ export default {
|
|||||||
if(this.appntDTO.name == name){
|
if(this.appntDTO.name == name){
|
||||||
this.appntDTO.name = ''
|
this.appntDTO.name = ''
|
||||||
}
|
}
|
||||||
let ageRule = /^[a-zA-Z0-9\.\s\u4e00-\u9fa5]{2,120}$/
|
// let ageRule = /^[a-zA-Z\.\s\u4e00-\u9fa5]{2,120}$/
|
||||||
if (this.appntDTO.name && !ageRule.test(this.appntDTO.name)) {
|
// if (this.appntDTO.name && !ageRule.test(this.appntDTO.name)) {
|
||||||
return Toast.fail('姓名长度为2-120个字符之内,只能输入汉字、数字或者英文')
|
// return Toast.fail('姓名长度为2-120个字符之内,只能输入汉字或者英文')
|
||||||
}
|
// }
|
||||||
this.appntDTO.age = String(this.appntDTO.age)
|
this.appntDTO.age = String(this.appntDTO.age)
|
||||||
this.$validator.validate().then(valid => {
|
this.$validator.validate().then(valid => {
|
||||||
if (true === valid) {
|
if (true === valid) {
|
||||||
|
|||||||
@@ -339,10 +339,10 @@ export default {
|
|||||||
let localSex = this.insured.sex
|
let localSex = this.insured.sex
|
||||||
let relation = this.localInfo.relationToAppnt
|
let relation = this.localInfo.relationToAppnt
|
||||||
let resultSex = checkSex(cacheSex, localSex, relation)
|
let resultSex = checkSex(cacheSex, localSex, relation)
|
||||||
let ageRule = /^[a-zA-Z0-9\.\s\u4e00-\u9fa5]{2,120}$/
|
// let ageRule = /^[a-zA-Z0-9\.\s\u4e00-\u9fa5]{2,120}$/
|
||||||
if (this.insured.name && !ageRule.test(this.insured.name)) {
|
// if (this.insured.name && !ageRule.test(this.insured.name)) {
|
||||||
return Toast.fail('姓名长度为2-120个字符之内,只能输入汉字、数字或者英文')
|
// return Toast.fail('姓名长度为2-120个字符之内,只能输入汉字、数字或者英文')
|
||||||
}
|
// }
|
||||||
if (!resultSex) {
|
if (!resultSex) {
|
||||||
return Toast.fail('被保险人性别有误')
|
return Toast.fail('被保险人性别有误')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user