// 银行账户信息 银行账号验证
validateNum() {
console.log(this.special_advance.bank_number)
// 验证清空空格
this.special_advance.bank_number = this.special_advance.bank_number.replace(/\s/g, "");
// 验证四位一空格
this.special_advance.bank_number = this.special_advance.bank_number.replace(/....(?!$)/g, '$& ');
// this.tempBank.bank_number = this.tempBank.bank_number.replace(/[^\d^\-]+/g, '').replace(/....(?!$)/g, '$& ');
},
正则只允许输入正则和空格
let percent = /^[\d-\ ]+[\s\S]*[\d-\ ]+$/;
let validatePass2 = (rule, value, callback) => {
if (!percent.test(value)) {
return callback(new Error('请输入正确格式'))
} else {
callback()
}
}