【电投流程对姓名校验空格问题】去掉替换空格和validator.js正则表达式与客户管理页面校验一致

This commit is contained in:
liyuetong
2021-12-22 16:54:59 +08:00
parent ef5d693499
commit e23f352f02
2 changed files with 4 additions and 3 deletions

View File

@@ -68,7 +68,8 @@ Validator.extend('salename', {
getMessage: () => '亲,请确认您录入的姓名是否正确哦~',
validate: 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 - 详细地址 - 详细地址须同时包含汉字和数字,

View File

@@ -102,8 +102,8 @@ export default {
},
methods: {
onChange(value) {
let regExp = /\s+/
value = value.replace(regExp, '')
// let regExp = /\s+/
// value = value.replace(regExp, '')
this.name = value
this.$emit('input', value)
},