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.

549 lines
16 KiB

3 years ago
<template>
2 weeks ago
<page-meta :page-style="'overflow:'+(showCodes?'hidden':'visible')"></page-meta>
3 years ago
<view class="containers">
<view class="db">
<view class="dblist">
<view>
<view class="dbitem">
<text class="dbtype">{{info.type_text}}</text>
<view class="dbstatus bm">
<view>{{info.audit_status_text}}</view>
<view>
1 month ago
<view class="label-with-en-inline">
<view>访问日期{{info.date}}{{ info.end_date?'至'+info.end_date:'' }}</view>
<view class="en-text">Visit Date: {{info.date}}{{ info.end_date?' to '+info.end_date:'' }}</view>
2 weeks ago
</view>
<view class="label-with-en-inline">
<view>访问时间{{info.time?info.time:''}}</view>
<view class="en-text">Visit Time: {{info.time?info.time:''}}</view>
1 month ago
</view>
2 weeks ago
<!-- <view class="label-with-en-inline">
1 month ago
<view>访问时间{{info.visit_time.start_time}}{{info.visit_time.end_time}}</view>
<view class="en-text">Visit Time: {{info.visit_time.start_time}} to {{info.visit_time.end_time}}</view>
2 weeks ago
</view> -->
1 month ago
</view>
<view v-if="info.type=='2'" class="label-with-en-inline">
<view>施工时段{{info.work_start_time}}{{info.work_end_time}}</view>
<view class="en-text">Work Time: {{info.work_start_time}} to {{info.work_end_time}}</view>
3 years ago
</view>
3 years ago
</view>
3 years ago
<view class="dbinfo justify-left">
<view>
1 month ago
<view class="label-with-en-inline">
<view>被访人<text>{{info.accept_admin.name}}</text></view>
<view class="en-text">Host: <text>{{info.accept_admin.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>部门<text>{{info.accept_admin.department.name}}</text></view>
<view class="en-text">Department: <text>{{info.accept_admin.department.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>访问区域<text>{{info.visit_area.name}}</text></view>
<view class="en-text">Visit Area: <text>{{info.visit_area.name}}</text></view>
</view>
3 years ago
</view>
<view>
1 month ago
<view class="label-with-en-inline">
<view>拜访人<text>{{info.name}}</text></view>
<view class="en-text">Visitor: <text>{{info.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>电话{{info.mobile}}</view>
<view class="en-text">Phone: {{info.mobile}}</view>
</view>
<view v-if="info.type=='1'" class="label-with-en-inline">
<view>事由<text>{{info.reason?info.reason:''}}</text></view>
<view class="en-text">Reason: <text>{{info.reason?info.reason:''}}</text></view>
</view>
<view v-else-if="info.type=='3'" class="label-with-en-inline">
<view>车辆<text>{{info.plate}}</text></view>
<view class="en-text">Vehicle: <text>{{info.plate}}</text></view>
</view>
3 years ago
</view>
1 month ago
</view>
<view class="company">
1 month ago
<view class="label-with-en-inline">
<view>拜访公司<text>{{info.company_name?info.company_name:''}}</text></view>
<view class="en-text">Company: <text>{{info.company_name?info.company_name:''}}</text></view>
1 month ago
</view>
3 years ago
</view>
<!-- <view class="dblong">
3 years ago
<view>长期访客申请<text>{{info.long_time==0?'否':'是'}}</text></view>
2 years ago
<view v-if="info.long_time==1">访{{info.start_date?info.start_date:''}} {{info.end_date?info.end_date:''}}</view>
</view> -->
3 years ago
</view>
</view>
<template v-if="info.type!='3'">
1 month ago
<view class="dbtext label-with-en-inline">
<view>随访人员</view>
<view class="en-text">Accompanying Personnel</view>
</view>
3 years ago
<view class="dbitem sfyritem">
2 years ago
<template v-if="info.follw_people && info.follw_people.length>0">
1 month ago
<view class="dbinfo justify-left" v-for="(people, idx) in info.follw_people" :key="idx">
3 years ago
<view>
1 month ago
<view class="label-with-en-inline">
<view>随访人<text>{{people.name}}</text></view>
<view class="en-text">Accompanying Person: <text>{{people.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>证件类型<text>{{people.credent==1?'身份证':'护照'}}</text></view>
<view class="en-text">ID Type: <text>{{people.credent==1?'ID Card':'Passport'}}</text></view>
</view>
<view class="label-with-en-inline">
<view>证件号<text>{{people.idcard}}</text></view>
<view class="en-text">ID Number: <text>{{people.idcard}}</text></view>
3 years ago
</view>
</view>
1 month ago
<view class="label-with-en-inline">
<view>电话<text>{{people.mobile}}</text></view>
<view class="en-text">Phone: <text>{{people.mobile}}</text></view>
3 years ago
</view>
</view>
</template>
<template v-else>
1 month ago
<view class="dbinfo justify-left label-with-en-inline">
<view></view>
<view class="en-text">None</view>
3 years ago
</view>
</template>
</view>
</template>
3 years ago
<template>
1 month ago
<view class="dbtext label-with-en-inline">
<view>到访车辆</view>
<view class="en-text">Visit Vehicles</view>
</view>
3 years ago
<view class="dbitem sfyritem">
1 month ago
<view class="dbinfo dbcars" v-if="info.cars && info.cars.length>0">
1 month ago
<view class="onechild label-with-en-inline" v-for="(item, idx) in info.cars" :key="idx">
<view>车牌<text>{{item?item:'无'}}</text></view>
<view class="en-text">License Plate: <text>{{item?item:'None'}}</text></view>
1 month ago
</view>
</view>
<view class="dbinfo dbcars" v-else>
1 month ago
<view class="onechild label-with-en-inline">
<view></view>
<view class="en-text">None</view>
1 month ago
</view>
3 years ago
</view>
3 years ago
</view>
3 years ago
</template>
<template v-if="info.type=='3'">
1 month ago
<view class="dbtext label-with-en-inline">
<view>收货人</view>
<view class="en-text">Consignee</view>
</view>
3 years ago
<view class="dbitem sfyritem">
<view class="dbinfo justify-left">
1 month ago
<view class="label-with-en-inline">
<view>部门<text>{{info.accept_goods_admin.department.name}}</text></view>
<view class="en-text">Department: <text>{{info.accept_goods_admin.department.name}}</text></view>
3 years ago
</view>
1 month ago
<view class="label-with-en-inline">
<view>人员<text>{{info.accept_goods_admin.name}}</text></view>
<view class="en-text">Personnel: <text>{{info.accept_goods_admin.name}}</text></view>
3 years ago
</view>
</view>
</view>
</template>
1 month ago
<view class="dbtext label-with-en-inline">
<view>被访人员</view>
<view class="en-text">Visited Personnel</view>
</view>
3 years ago
<view class="dbitem sfyritem">
<view class="dbinfo justify-left">
1 month ago
<view class="label-with-en-inline">
<view>部门<text>{{info.accept_admin.department.name}}</text></view>
<view class="en-text">Department: <text>{{info.accept_admin.department.name}}</text></view>
3 years ago
</view>
1 month ago
<view class="label-with-en-inline">
<view>人员<text>{{info.accept_admin.name}}</text></view>
<view class="en-text">Personnel: <text>{{info.accept_admin.name}}</text></view>
3 years ago
</view>
</view>
1 month ago
</view>
2 weeks ago
<!-- <block v-if="info.visit_area.name=='生产区'">
1 month ago
<view class="dbtext label-with-en-inline">
<view>陪同人员</view>
<view class="en-text">Escort Personnel</view>
</view>
1 month ago
<view class="dbitem sfyritem">
<view class="dbinfo justify-left">
1 month ago
<view class="label-with-en-inline">
<view>部门<text>{{info.accompany.department.name}}</text></view>
<view class="en-text">Department: <text>{{info.accompany.department.name}}</text></view>
1 month ago
</view>
1 month ago
<view class="label-with-en-inline">
<view>人员<text>{{info.accompany.name}}</text></view>
<view class="en-text">Personnel: <text>{{info.accompany.name}}</text></view>
1 month ago
</view>
</view>
</view>
2 weeks ago
</block> -->
1 month ago
<!-- <template v-if="info.accept_admin_sign">
<view class="dbtext">签字</view>
<view class="dbitem sfyritem">
<view class="dbinfo justify-left">
<image style="width:100%" :src="info.accept_admin_sign_file.url" mode=""></image>
</view>
</view>
</template> -->
3 years ago
3 years ago
1 month ago
<!-- 审核 -->
1 month ago
<view class="dbtext label-with-en-inline" v-if="info.audit_status==0">
<view>审核</view>
<view class="en-text">Review</view>
</view>
1 month ago
<view class="checkforms dbitem" style="padding-top:30rpx" v-if="info.audit_status==0&&isCheck">
1 month ago
<uni-forms ref="formdata" :model="checkForm" :rules="rules" labelWidth="140px" >
<uni-forms-item required name="status">
<template slot="label">
<view class="label-with-en-inline">
<view>状态</view>
<view class="en-text">Status</view>
</view>
</template>
1 month ago
<uni-data-checkbox v-model="checkForm.status" :localdata="statusList"/>
</uni-forms-item>
1 month ago
<uni-forms-item>
<template slot="label">
<view class="label-with-en-inline">
<view>备注</view>
<view class="en-text">Remarks</view>
</view>
</template>
<uni-easyinput type="textarea" v-model="checkForm.reason" placeholder="请输入备注 / Please enter remarks" />
1 month ago
</uni-forms-item>
</uni-forms>
1 month ago
<button type="primary" style="background-color: #4f607e;" @click="checkSubmit" class="button-with-en">
1 month ago
<view>审核/Review</view>
1 month ago
</button>
1 month ago
</view>
1 month ago
<view class="checkforms dbitem label-with-en-inline" style="padding-top:30rpx" v-if="info.audit_status==0&&!isCheck">
<view>{{checkText}}</view>
<view class="en-text">{{checkTextEn}}</view>
3 years ago
</view>
3 years ago
2 weeks ago
<!-- 出示二维码按钮 -->
<view class="justify-between cancelcode" v-if="info.audit_status==1||info.audit_status==3">
<button :class="info.audit_status==3?'wd100 codebtn':'codebtn'" @click="createdCode"
type="primary" class="button-with-en">
<view>出示二维码/Show QR Code</view>
</button>
</view>
3 years ago
</view>
3 years ago
3 years ago
</view>
2 weeks ago
<!-- 二维码弹窗 -->
<u-popup class="codepop" :show="showCodes" mode="center" closeable="true" @close="closeshowCodes">
<view class="userBox" style="padding:0 120rpx 0rpx 120rpx;">
<view class="userInfoContent" style="padding: 40rpx;font-size: 28rpx;">
<view class="label-with-en-inline">
<text>核销码{{info.code}}</text>
<text class="en-text">Verification Code: {{info.code}}</text>
</view>
</view>
<view class="qrcode">
<canvas canvas-id='qrcode' style="width: 170px;height:170px;margin: 0 auto;">
</canvas>
</view>
</view>
</u-popup>
3 years ago
</view>
</template>
<script>
3 years ago
import '@/static/css/bd.css'
2 weeks ago
import uQRCode from "@/utils/qrcode.js"
3 years ago
export default {
1 month ago
data() {
3 years ago
return {
id: "",
1 month ago
info: {},
2 weeks ago
showCodes: false,
1 month ago
checkText:'',
1 month ago
checkTextEn:'',
1 month ago
checkLevel:[{
id:1,
value:'请等待一级审核完成'
},{
id:2,
value:'请等待二级审核完成'
},{
id:3,
value:'请等待三级审核完成'
3 years ago
}],
3 years ago
checkForm: {
level: "",
status: "",
1 month ago
audit_admin_id: "",
visit_id:"",
3 years ago
reason:""
},
rules: {
status: {
rules: [{
required: true,
1 month ago
errorMessage: '请选择状态 / Please select status'
3 years ago
}]
3 years ago
}
3 years ago
},
3 years ago
statusList: [
3 years ago
{
value: 1,
1 month ago
text: "通过/Approve",
1 month ago
textEn: "Approve"
3 years ago
},
{
value: 2,
1 month ago
text: "驳回/Reject",
1 month ago
textEn: "Reject"
3 years ago
},
],
1 month ago
check_admin_name: "",
userId:'',
3 years ago
isCheck:false,
3 years ago
}
},
onReady() {
3 years ago
3 years ago
},
onLoad(options) {
1 month ago
this.id = options.id
3 years ago
this.userId = uni.getStorageSync('userInfo_Bd').id
3 years ago
this.checkForm.visit_id = parseInt(options.id)
this.loadDetail()
},
methods: {
2 weeks ago
closeshowCodes() {
this.showCodes = false
},
createdCode(code) {
var id = "qrcode";
this.showCodes = true
uQRCode.make({
canvasId: id,
componentInstance: this,
text: this.info.code,
size: 170,
// margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
success: res => {
}
})
},
1 month ago
checkSubmit() {
3 years ago
let that = this
1 month ago
console.log(that.checkForm)
this.$refs['formdata'].validate().then(res => {
this.util.request({
api: '/api/admin/visit_audit/save',
method: "POST",
requestType:'bd',
data: that.checkForm,
utilSuccess: function(res) {
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
// uni.removeStorageSync('formData')
uni.redirectTo({
url:'/pages/bd/record?type=mycheck'
})
},
utilFail: function(res) {
uni.showToast({
title: res,
duration: 2000,
icon: 'none'
})
}
})
}).catch(err => {
console.log('err', err);
})
3 years ago
3 years ago
},
loadDetail() {
let that = this
this.util.request({
api: '/api/admin/visit/show',
method: "get",
requestType: 'bd',
data: {
id: that.id
},
utilSuccess: function(res) {
1 month ago
that.info = res
for (let item of res.audit) {
if(item.status==0){
if(that.userId==item.audit_admin_id){
that.checkForm.level = item.level
that.checkForm.id = item.id
that.checkForm.audit_admin_id = item.audit_admin_id
that.isCheck = true
return
}else{
that.checkText = "请等待"+item.audit_admin.name+"审核"
1 month ago
that.checkTextEn = "Please wait for "+item.audit_admin.name+" review"
1 month ago
// that.checkLevel.map(item1=>{
// if(item.level==item1.id){
// that.checkText = item1.value
// }
// })
that.isCheck = false
return
}
}else{
that.isCheck = false
}
3 years ago
}
},
utilFail: function(res) {
uni.showToast({
3 years ago
title: res,
3 years ago
duration: 2000,
icon: 'none'
})
}
})
},
isnull(p) {
if (p == '' || p == undefined || p == null || p == 'undefined' || p == 'null') {
return ""
} else {
return p
}
}
}
3 years ago
}
</script>
3 years ago
<style scoped>
.containers {
background-color: #eceefe;
min-height: 100vh;
padding-top: 20rpx;
}
.dbtext {
padding-top: 10rpx;
margin-bottom: 30rpx;
color: #303639;
font-size: 40rpx;
padding-left: 30rpx
}
1 month ago
.dbcars>view{
width:100%;
padding-left:0
3 years ago
}
3 years ago
.sfyritem {
padding-bottom: 10rpx
}
.dbinfo>view text {
color: #8f9596;
3 years ago
}
1 month ago
.company{
padding-bottom:30rpx;
margin-top:-10rpx;
}
.company text{
color: #8f9596;
}
1 month ago
.label-with-en-inline {
display: flex;
flex-direction: column;
2 weeks ago
align-items: flex-start;
1 month ago
margin-right: 15rpx;
1 month ago
}
.en-text {
font-size: 20rpx;
color: #8f9596;
margin-top: 4rpx;
opacity: 0.8;
}
.dbtext.label-with-en-inline {
display: flex;
flex-direction: column;
align-items: flex-start;
padding-left: 30rpx;
}
.button-with-en {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.button-with-en .en-text {
font-size: 18rpx;
margin-top: 4rpx;
}
/deep/ .uni-forms-item__label {
width: 140px;
min-width: 140px;
}
2 weeks ago
/deep/ .u-popup__content {
background: #fff;
}
.cancelcode {
margin: 60rpx 0;
background-color: #eceefe;
}
.cancelcode button {
width: 100%
}
.cancelcode button.codebtn {
background: #4f607e;
border: none;
color: #fff
}
.cancelcode button.wd100 {
width: 100%;
}
.userInfoContent .label-with-en-inline {
text-align: center;
}
.userInfoContent .label-with-en-inline .en-text {
font-size: 22rpx;
margin-top: 8rpx;
}
1 month ago
</style>