master
lion 1 month ago
parent f526818fef
commit deb1630f1d

@ -30,26 +30,26 @@
</div>
</div>
</template>
<template v-slot:time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>到访时间
</div>
<div class="xy-table-item-content">
<template v-slot:time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>到访时间
</div>
<div class="xy-table-item-content">
<el-time-picker
v-model="form.time"
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '08:30',
step: '00:30',
end: '17:00'
value-format="HH:mm"
:picker-options="{
start: '08:30',
step: '00:30',
end: '17:00'
}"
placeholder="选择到访时间">
</el-time-picker>
</div>
</div>
</el-time-picker>
</div>
</div>
</template>
<template v-slot:visit_time_id>
<div class="xy-table-item">
@ -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>
@ -389,7 +389,7 @@
// type: 1,
visitinfo: "",
date: "",
end_date:'',
end_date:'',
time:'',
visit_time_id: "",
visit_area_id: "",
@ -617,7 +617,7 @@
this.form = {
visitinfo: "",
date: res?.date,
end_date: res?.end_date,
end_date: res?.end_date,
time:res?.time,
visit_time_id: res?.visit_time_id,
visit_area_id: res?.visit_area_id,
@ -701,7 +701,7 @@
this.adminList.map(e=>{
if(e.id==item){
this.form.accept_admin_id = e.id
this.form.accpet_department_id = e.department_id
this.form.accpet_department_id = e.department_id
this.form.accompany_id = e.id
// if(this.visitAreaText==''){
// this.form.accompany_id = e.id
@ -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