|
|
|
|
@ -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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|