master
lion 1 month ago
parent f526818fef
commit deb1630f1d

@ -167,7 +167,7 @@
<template v-slot:idcard>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>证件号
<span v-if="visitType==2||visitType==3" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content">
<el-input v-model="form.idcard" placeholder="请输入证件号码"></el-input>
@ -728,17 +728,27 @@
},
submit() {
let that = this
if(that.form.credent==1){
const isIdcardRequired = that.visitType == 2 || that.visitType == 3
const hasIdcard = !!that.form.idcard
//
if (isIdcardRequired && !hasIdcard) {
this.$successMessage('证件号码不能为空', '', 'warning')
return
}
// 访
if (hasIdcard && that.form.credent == 1) {
const regtest = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
if(!regtest.test(that.form.idcard)){
this.$successMessage('身份证格式错误', '','warning')
if (!regtest.test(that.form.idcard)) {
this.$successMessage('身份证格式错误', '', 'warning')
return
}
}
if(that.form.credent==2){
if (hasIdcard && that.form.credent == 2) {
const regtest = /^([a-zA-z]|[0-9]){5,17}$/
if(!regtest.test(that.form.idcard)){
this.$successMessage('护照格式错误', '','warning')
if (!regtest.test(that.form.idcard)) {
this.$successMessage('护照格式错误', '', 'warning')
return
}
}

Loading…
Cancel
Save