You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

653 lines
20 KiB

3 years ago
<template>
<div>
3 years ago
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" type="form" :title="`${form.type_text}`"
:form="formData">
<template v-slot:logs>
<el-timeline :reverse="true">
<el-timeline-item v-for="(item, index) in form.logs" :key="index" :timestamp="item.created_at">
{{item.remark}}
</el-timeline-item>
</el-timeline>
</template>
<template v-slot:checkcode v-if="formDataType=='coderecord'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-size: 32px;width: 230px!important;">
核销码
</div>
<div class="xy-table-item-content">
<div style="font-size: 32px;padding: 25px;width:400px">
{{form.code}}
</div>
</div>
</div>
3 years ago
</template>
<template v-slot:codeType v-if="formDataType=='coderecord'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-size: 32px;width: 280px!important;">
核销状态
</div>
<div class="xy-table-item-content">
3 years ago
<div style="font-size: 32px;padding: 25px;width:400px">
<div v-for="item in codeTypeList">
<div v-if="item.id == codeForm.type">
{{item.value}}
</div>
</div>
<!-- <el-radio-group v-model="codeForm.type">
<el-radio :label="item.id" >{{item.value}}</el-radio>
</el-radio-group> -->
3 years ago
<!-- {{form.audit_status_text}} -->
</div>
</div>
</div>
3 years ago
</template>
<template v-slot:person_no v-if="formDataType=='coderecord'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-size: 32px;width: 230px!important;">
入场牌
</div>
<div class="xy-table-item-content">
3 years ago
<!-- <el-input style="font-size: 32px;padding: 25px;width:400px" v-model="codeForm.person_no"
placeholder="请输入入场牌"></el-input> -->
3 years ago
<xy-table style="width: 600px" :height="260" :is-page="false" :list="codeForm.person_no"
3 years ago
:table-item="codefollowTable">
<template v-slot:btns>
</template>
</xy-table>
3 years ago
</div>
</div>
</template>
<template v-slot:car_no v-if="formDataType=='coderecord'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-size: 32px;width: 230px!important;">
停车牌
</div>
<div class="xy-table-item-content">
3 years ago
<!-- <el-input style="font-size: 32px;padding: 25px;width:400px" v-model="codeForm.car_no"
placeholder="请输入停车牌"></el-input> -->
3 years ago
<xy-table style="width: 600px" :height="260" :is-page="false" :list="codeForm.car_no"
3 years ago
:table-item="carfollowTable">
<template v-slot:btns>
</template>
</xy-table>
3 years ago
</div>
</div>
3 years ago
</template>
3 years ago
<template v-slot:visitinfo>
<div style="width:600px">
拜访信息
</div>
</template>
<template v-slot:date>
<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">
{{form.date}}
</div>
</div>
</template>
<template v-slot:visit_time_id>
<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">
{{form.visit_time?form.visit_time.start_time:''}}{{form.visit_time?form.visit_time.end_time:''}}
</div>
</div>
</template>
<template v-slot:visit_area_id>
<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">
{{form.visit_area?form.visit_area.name:''}}
</div>
</div>
</template>
<template v-slot:reason v-if="form.type==1">
<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">
{{form.reason}}
</div>
</div>
</template>
<template v-slot:workRange v-if="form.type==2">
<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">
{{form.work_start_time}}{{form.work_end_time}}
</div>
</div>
</template>
<template v-slot:plate v-if="form.type==3">
<div class="xy-table-item">
<div class="xy-table-item-label">
3 years ago
车辆类型
3 years ago
</div>
<div class="xy-table-item-content">
{{form.plate}}
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
{{form.remark}}
</div>
</div>
</template>
<template v-slot:visitorinfo>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:400px">
拜访人信息
</div>
</div>
</template>
<template v-slot:name>
<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">
{{form.name}}
</div>
</div>
</template>
<template v-slot:mobile>
<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">
{{form.mobile}}
</div>
</div>
</template>
<template v-slot:credent>
<div class="xy-table-item">
<div class="xy-table-item-label">证件类型
</div>
<div class="xy-table-item-content">
{{form.credent==1?'身份证':'护照'}}
</div>
</div>
</template>
<template v-slot:idcard>
<div class="xy-table-item">
<div class="xy-table-item-label">
证件号码
</div>
<div class="xy-table-item-content">
{{form.idcard}}
</div>
</div>
</template>
<template v-slot:company_name>
<div class="xy-table-item">
<div class="xy-table-item-label">
单位名称
</div>
<div class="xy-table-item-content">
{{form.company_name}}
</div>
</div>
</template>
<template v-slot:cars>
<div class="xy-table-item">
<div class="xy-table-item-label">
到访车辆
</div>
<div class="xy-table-item-content">
3 years ago
{{form.cars?form.cars.join(','):''}}
3 years ago
</div>
</div>
</template>
<template v-slot:follw_people v-if="form.type==1||form.type==2">
<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">
<xy-table style="width: 620px" :height="260" :is-page="false" :list="form.follw_people"
:table-item="followTable">
<template v-slot:btns>
</template>
</xy-table>
</div>
</div>
</template>
<template v-slot:long_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" style="width:620px">
{{form.long_time==0?'否':'是'}}
<div v-if="form.long_time==1" style="display: inline-block;vertical-align: middle;margin-left:10px">
{{form.start_date}}{{form.end_date}}
</div>
</div>
</div>
</template>
<template v-slot:visitorinfos>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:400px">
被访人信息
</div>
</div>
</template>
<template v-slot:accept_admin_id>
<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">
{{form.accept_admin?form.accept_admin.name:''}}
</div>
</div>
</template>
<template v-slot:accept_goods_admin_id v-if="form.type==3">
<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">
{{form.accept_goods_admin?form.accept_goods_admin.name:''}}
</div>
</div>
3 years ago
</template>
<!-- 审核 -->
<template v-slot:checkRecord v-if="formDataType=='checkrecord'">
<div style="width:600px">
审核
</div>
</template>
3 years ago
<template v-slot:checkForm v-if="form.audit_status==0&&isCheck">
3 years ago
<el-form-item prop='checkForm.status' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">状态
</div>
<div class="xy-table-item-content">
<el-select v-model="checkForm.status" placeholder="请选择" style="width:200px">
<el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</el-form-item>
<el-form-item prop='checkForm.reason' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="checkForm.reason" placeholder="请输入备注" style="width:300px"></el-input>
</div>
</div>
</el-form-item>
</template>
3 years ago
<template v-slot:checkText v-if="form.audit_status==0&&!isCheck">
<div class="checkforms dbitem" style="padding:30rpx">
{{checkText}}
</div>
</template>
3 years ago
3 years ago
<template v-slot:footerContent>
<div>
<Button ghost type="primary" @click="reset"></Button>
<Button v-if="formDataType=='checkrecord'&&isCheck" type="primary" @click="checkSubmit"></Button>
<Button v-if="formDataType=='coderecord'" type="primary" @click="codeSubmit"></Button>
</div>
3 years ago
</template>
3 years ago
</xy-dialog>
</div>
</template>
3 years ago
<script>
import {
save
3 years ago
} from "@/api/visit/check.js"
import {
show
3 years ago
} from "@/api/visit/record.js"
3 years ago
import {
cancelCode
3 years ago
} from "@/api/gate"
3 years ago
import {
getInfo
3 years ago
} from '@/api/user.js'
import Cookies from 'js-cookie'
3 years ago
export default {
components: {},
data() {
return {
isShow: false,
3 years ago
id: '',
userId: '',
formDataType: '',
3 years ago
formData: {
3 years ago
checkcode: '',
3 years ago
codeType: "",
3 years ago
person_no: '',
3 years ago
car_no: '',
3 years ago
3 years ago
visitinfo: "",
date: "",
visit_time_id: "",
visit_area_id: "",
workRange: "",
reason: "",
plate: "",
remark: "",
visitorinfo: "",
name: "",
mobile: "",
credent: 1,
idcard: "",
company_name: "",
cars: "",
follw_people: [],
long_time: 0,
longrange: "",
visitorinfos: "",
accpet_department_id: "",
accept_admin_id: "",
3 years ago
accept_goods_admin_id: "",
checkRecord: '',
3 years ago
checkForm: {},
checkText: ''
3 years ago
},
3 years ago
form: {},
3 years ago
checkForm: {
status: 1
3 years ago
}, //审核
3 years ago
codeForm: {
type: 1,
3 years ago
car_no: [],
person_no: []
3 years ago
}, // 核验
3 years ago
codeTypeList: [{
id:0,
value:'请提醒被访人签字'
},{
3 years ago
id: 1,
value: '入场'
}, {
id: 2,
value: '离场'
3 years ago
}],
3 years ago
gateAdminId: '',
3 years ago
check_admin_name: "",
carfollowTable: [{
label: "车牌",
prop: "car",
width: 200
},{
label: "停车牌",
prop: "car_no",
3 years ago
width: 400,
3 years ago
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写停车牌"
v-model={row.car_no}>
</el-input>
)
}
}],
codefollowTable: [{
label: "姓名",
prop: "name",
width: 200
},{
label: "入场牌",
prop: "person_no",
3 years ago
width: 400,
3 years ago
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写入场牌"
v-model={row.person_no}>
</el-input>
)
}
}],
3 years ago
followTable: [{
label: "姓名",
prop: "name",
width: 200
},
{
label: "联系电话",
prop: "mobile",
width: 200
},
{
label: "证件类型",
3 years ago
// width: 180,
prop: 'credent',
width: 200,
formatter(cell, data, val) {
return val == 1 ? '身份证' : '护照'
3 years ago
}
3 years ago
}, {
label: "证件号码",
prop: "idcard",
width: 200
}
],
3 years ago
statusList: [{
3 years ago
id: 1,
value: "通过"
},
{
id: 2,
value: "驳回"
},
3 years ago
],
checkLevel: [{
id: 1,
value: '请等待一级审核完成'
}, {
id: 2,
value: '请等待二级审核完成'
}, {
id: 3,
value: '请等待三级审核完成'
}],
checkText: '',
isCheck: false
3 years ago
}
},
created() {
// this.getVisitTime()
},
watch: {
isShow(newVal) {
3 years ago
if (newVal) {
let that = this
if (this.formDataType == 'checkrecord') {
3 years ago
this.checkForm.visit_id = this.id
3 years ago
this.getUserId()
3 years ago
this.getDetail()
3 years ago
}
3 years ago
if (this.formDataType == 'coderecord') {
console.log("123")
console.log(this.form)
3 years ago
this.codeForm.code = this.form.code
3 years ago
this.codeForm.admin_id = parseInt(this.gateAdminId)
3 years ago
this.codeForm.type = this.form.audit_status == 1 ? 1 : (this.form.audit_status == 3 && this.form.accept_admin_sign ? 2 : 0)
3 years ago
if(this.codeForm.type==1){
this.codeForm.person_no.push({name:this.form.name,person_no:''})
for(var k of this.form.follw_people){
this.codeForm.person_no.push({name:k.name,person_no:''})
}
for(var m of this.form.cars){
this.codeForm.car_no.push({car:m,car_no:''})
}
}else{
for(var k of this.form.person_no){
this.codeForm.person_no.push(JSON.parse(k))
}
for(var m of this.form.car_no){
this.codeForm.car_no.push(JSON.parse(m))
}
3 years ago
3 years ago
}
3 years ago
3 years ago
}
3 years ago
} else {
this.reset()
}
}
},
methods: {
3 years ago
selectLevel(val) {
this.form.audit.map(item => {
if (item.level == val) {
this.checkForm.level = item.level
this.checkForm.id = item.id
this.checkForm.audit_admin_id = item.audit_admin_id
this.check_admin_name = item.audit_admin ? item.audit_admin.name : ''
}
})
},
async getUserId() {
const res = await getInfo()
this.userId = res.id
3 years ago
},
3 years ago
async getDetail() {
const res = await show({
id: this.id
3 years ago
})
3 years ago
let that = this
3 years ago
this.form = res
for (let item of that.form.audit) {
if (item.status == 0) {
if (item.audit_admin_id == that.userId) {
that.checkForm.level = item.level
that.checkForm.id = item.id
that.checkForm.audit_admin_id = item.audit_admin_id
that.isCheck = true
return
3 years ago
} else {
that.checkText = "请等待"+item.audit_admin.name+"审核"
// that.checkLevel.map(item1 => {
// if (item.level == item1.id) {
// that.checkText = item1.value
// }else{
// }
// })
3 years ago
that.isCheck = false
return
}
} else {
that.isCheck = false
}
}
3 years ago
3 years ago
},
3 years ago
reset() {
this.id = ''
3 years ago
this.formDataType = ''
this.checkForm = {}
this.check_admin_name = ''
3 years ago
this.codeForm = {
type: 1,
car_no: [],
person_no: []
}
3 years ago
this.codeType = ''
this.gateAdminId = ''
this.isShow = false
this.$refs['dialog'].reset()
},
checkSubmit() {
console.log(this.checkForm)
// return
let that = this
// this.form.id = this.id
save({
...that.checkForm
}).then(res => {
this.$successMessage('审核成功')
this.isShow = false
this.$emit('refresh')
})
},
codeSubmit() {
let that = this
3 years ago
console.log(this.codeForm)
3 years ago
console.log(this.codeForm.person_no)
if(this.codeForm.type==0){
this.$successMessage('请提醒被访人签字','','warning')
this.isShow = false
return
}
3 years ago
cancelCode({
...that.codeForm
}).then(res => {
this.$successMessage('核销成功')
this.isShow = false
this.$emit('refresh')
})
3 years ago
}
}
}
</script>
3 years ago
<style scoped>
3 years ago
.xy-table-item-label {
width: 180px !important;
}
.xy-table-item-content {
width: 100%
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
3 years ago
/deep/ .el-radio__input {
vertical-align: super;
}
/deep/ .el-radio__label {
font-size: 32px;
}
3 years ago
</style>