From 38780c5d414107f248d435699be8680d9d00df8a Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 23 Aug 2022 17:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/plugins/rent/renthouseForm.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/modules/plugins/rent/renthouseForm.vue b/src/views/modules/plugins/rent/renthouseForm.vue index 698eb824d..3d1711742 100644 --- a/src/views/modules/plugins/rent/renthouseForm.vue +++ b/src/views/modules/plugins/rent/renthouseForm.vue @@ -520,11 +520,12 @@ export default { async addRoom () { const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X - if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false) { + const regPassport = /^[a-zA-Z]{2}\d{7}$|^[a-zA-Z]{1}\d{8}$/; //护照号,1字母8数字或2字母7数字 + if (this.dataForm.ownerIdCard && regCard.test(this.dataForm.ownerIdCard) === false && regPassport.test(this.dataForm.ownerIdCard) === false) { this.btnDisable = false this.$message({ type: 'warning', - message: '请输入正确的身份证号码' + message: '请输入正确的证件号' }) return false; }