|
|
@@ -1,55 +1,61 @@
|
|
|
<template>
|
|
|
- <div class="intro-add">
|
|
|
+ <div class="record-detail">
|
|
|
<nav-bar></nav-bar>
|
|
|
<div class="page-container">
|
|
|
<!-- 基本信息 -->
|
|
|
<div class="card">
|
|
|
- <van-panel title="来访信息" >
|
|
|
- <template #header>
|
|
|
- <van-cell title="状态">
|
|
|
- <template #extra>
|
|
|
- <span :style="{color:getState(getDictLabel(visitInfo.status,'out_in_approve_status'))}">
|
|
|
- {{getDictLabel(visitInfo.status,'out_in_approve_status') }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- </template>
|
|
|
+ <van-panel >
|
|
|
+ <template #header>
|
|
|
+ <span></span>
|
|
|
+ </template>
|
|
|
<div class="panel-box">
|
|
|
- <van-cell title="来访类型" :value="getDictLabel(visitInfo.type,'out_in_type')"></van-cell>
|
|
|
- <van-cell title="到访机构" :value="visitInfo.orgName"></van-cell>
|
|
|
- <van-cell title="来访事由" :value="visitInfo.reasons"></van-cell>
|
|
|
- <van-cell title="访问日期" :value="visitInfo.startTimeStr"></van-cell>
|
|
|
- <van-cell title="结束日期" :value="visitInfo.endTimeStr"></van-cell>
|
|
|
- <div class="upload-box">
|
|
|
- <span>介绍信文件</span>
|
|
|
- <van-cell v-if="visitInfo.letterFile">
|
|
|
+ <van-cell title="出入人员" :value="selectedUser.userName"></van-cell>
|
|
|
+ <van-cell title="证件号码" :value="selectedUser.idCard"></van-cell>
|
|
|
+ <div class="upload-box" v-if="selectedUser.imgFile && selectedUser.imgFile.length > 0">
|
|
|
+ <span>证件照</span>
|
|
|
+ <van-cell >
|
|
|
<div
|
|
|
class="nfc-img van-hairline--surround"
|
|
|
- v-for="(v, i) in visitInfo.letterFile"
|
|
|
- :key="v.imgPath"
|
|
|
- @click="preView(v.imgPath)">
|
|
|
- <img :src="imgUrl(v.imgPath)" alt="" />
|
|
|
+ v-for="(v, i) in selectedUser.imgFile"
|
|
|
+ :key="v"
|
|
|
+ @click="preView(v)">
|
|
|
+ <img :src="imgUrl(v)" alt="" />
|
|
|
</div>
|
|
|
- <!-- <img class="nfc-img" v-for="v in item.imgData" :src="imgUrl(v.imgPath)" alt="" :key="v.id">-->
|
|
|
</van-cell>
|
|
|
</div>
|
|
|
- <van-cell title="备注信息" :value="visitInfo.description"></van-cell>
|
|
|
- </div>
|
|
|
- </van-panel>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 人员列表 -->
|
|
|
- <div class="card" v-for="(v,i) in userInfos" :key="i">
|
|
|
- <div class="goods-card">
|
|
|
- <div class="card-img-box" v-if="v.imgFile && v.imgFile.length > 0" @click="preView(v.imgFile)">
|
|
|
- <img :src="imgUrl(v.imgFile[0])" alt="">
|
|
|
+ <van-cell title="单位" :value="selectedUser.companyName"></van-cell>
|
|
|
+ <van-cell title="出入事由" :value="selectedUser.reasons"></van-cell>
|
|
|
+ <div class="upload-box" v-if="selectedUser.letterFile && selectedUser.letterFile.length > 0">
|
|
|
+ <span>介绍信</span>
|
|
|
+ <van-cell >
|
|
|
+ <div
|
|
|
+ class="nfc-img van-hairline--surround"
|
|
|
+ v-for="(v, i) in selectedUser.letterFile"
|
|
|
+ :key="v.url"
|
|
|
+ @click="preView(v.url)">
|
|
|
+ <img :src="imgUrl(v.url)" alt="" />
|
|
|
+ </div>
|
|
|
+ </van-cell>
|
|
|
+ </div>
|
|
|
+ <van-cell title="出入类型" :value="getDictLabel(selectedUser.type,'out_in_type')"></van-cell>
|
|
|
+ <van-cell title="陪同人员" :value="selectedUser.accompanyingPerson"></van-cell>
|
|
|
+ <div class="upload-box" >
|
|
|
+ <span>核验结果</span>
|
|
|
+ <div
|
|
|
+ class="nfc-img van-hairline--surround"
|
|
|
+ v-for="(v, i) in selectedUser.checkImage"
|
|
|
+ :key="v"
|
|
|
+ @click="preView(v)">
|
|
|
+ <img :src="imgUrl(v)" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <date-cell required title="到达时间" :is-row="true" v-model="selectedUser.arrivalTime" date-type="datetime" />
|
|
|
+ <date-cell required title="离开时间" :is-row="true" v-model="selectedUser.departureTime" date-type="datetime" />
|
|
|
</div>
|
|
|
- <div class="card-cell-box">
|
|
|
- <van-cell title="出入人员" :value="v.userName"></van-cell>
|
|
|
- <van-cell title="身份证" :value="v.idCard"></van-cell>
|
|
|
- <van-cell title="单位" :value="v.companyName"></van-cell>
|
|
|
+ <div class="big-btn-box" >
|
|
|
+ <van-button type="info" size="large" @click="onSubmit">确认登记</van-button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </van-panel>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
@@ -64,19 +70,24 @@ import {formatDate} from "@/filters/filter";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import {imgUrl} from "@/utils";
|
|
|
import { ImagePreview } from 'vant'
|
|
|
-import {userDetails} from './api'
|
|
|
+import {userDetails, userDepart} from './api'
|
|
|
export default {
|
|
|
components: {Uploader, DateCell},
|
|
|
data(){
|
|
|
return {
|
|
|
visitId:null,
|
|
|
- activeNames:['1'],
|
|
|
- visitInfo: {},
|
|
|
- userInfos:[],
|
|
|
- reformData: {
|
|
|
- reformDate: null,
|
|
|
- description: null,
|
|
|
- images: null,
|
|
|
+ userList:[],
|
|
|
+ selectedUser:{},
|
|
|
+ prop:{
|
|
|
+ label:'userName',
|
|
|
+ value:'id'
|
|
|
+ },
|
|
|
+ formData:{
|
|
|
+ letterUserId:null,
|
|
|
+ arrivalTime:null,
|
|
|
+ departureTime:null,
|
|
|
+ accompanyingPerson:null,
|
|
|
+ checkImage:null,
|
|
|
},
|
|
|
dicts:['out_in_approve_status','out_in_type']
|
|
|
}
|
|
|
@@ -85,39 +96,39 @@ export default {
|
|
|
...mapGetters(['orgId','id','dictionary'])
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.visitId = this.$route.query.id
|
|
|
- this.getInfo();
|
|
|
+ this.visitId = this.$route.query.id;
|
|
|
+ this.getUserInfo();
|
|
|
},
|
|
|
methods:{
|
|
|
imgUrl,formatDate,
|
|
|
- getState(state){
|
|
|
- console.log(state,'state')
|
|
|
- switch (state){
|
|
|
- case '待审批':
|
|
|
- return '#008cd6';
|
|
|
- case '不同意':
|
|
|
- return '#bc9f71';
|
|
|
- case '同意':
|
|
|
- return '#009240';
|
|
|
- case '已逾期':
|
|
|
- return '#D7000F';
|
|
|
+ onSubmit(){
|
|
|
+ let data = {
|
|
|
+ ...this.formData,
|
|
|
+ letterId:this.selectedUser.letterId,
|
|
|
+ checkImage:this.formData.checkImage.map(v=>{return v.imgPath}).toString(','),
|
|
|
+ letterUserId:this.selectedUser.id,
|
|
|
+ orgId:this.orgId,
|
|
|
}
|
|
|
+ alert(JSON.stringify(data))
|
|
|
+ userDepart(data).then(res=>{
|
|
|
+ this.$toast.success('提交成功');
|
|
|
+ this.$router.replace({
|
|
|
+ path:'/visitRecord',
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
- getInfo(){
|
|
|
+ getUserInfo(){
|
|
|
+
|
|
|
userDetails(this.visitId).then(res=>{
|
|
|
- this.visitInfo = res.data;
|
|
|
- if(res.data.letterFile){
|
|
|
- let imgArr = res.data.letterFile.map(v=>{
|
|
|
- return JSON.parse(v)
|
|
|
- })
|
|
|
- this.visitInfo.letterFile = imgArr;
|
|
|
- }
|
|
|
- let users = res.data.userInfos.map(v=>{
|
|
|
- v.imgFile = v.imgFile.split(',');
|
|
|
- return v
|
|
|
- });
|
|
|
- console.log(users,'users')
|
|
|
- this.userInfos = users;
|
|
|
+ let checkImage = res.data.checkImage.split(',');
|
|
|
+ let imgFile = res.data.imgFile.split(',');
|
|
|
+ let letterFile = res.data.letterFile.map(v=>{
|
|
|
+ return JSON.parse(v)
|
|
|
+ })
|
|
|
+ this.selectedUser = res.data;
|
|
|
+ this.selectedUser.checkImage = checkImage;
|
|
|
+ this.selectedUser.imgFile = imgFile;
|
|
|
+ this.selectedUser.letterFile = letterFile;
|
|
|
})
|
|
|
},
|
|
|
preView(val) {
|
|
|
@@ -127,7 +138,7 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-.intro-add{
|
|
|
+.record-detail{
|
|
|
.van-card{
|
|
|
padding: 20px;
|
|
|
}
|
|
|
@@ -150,7 +161,7 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style scoped lang="scss">
|
|
|
-.intro-add{
|
|
|
+.record-detail{
|
|
|
height: 100%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
@@ -209,6 +220,12 @@ export default {
|
|
|
color: #ee0a24;
|
|
|
}
|
|
|
}
|
|
|
+ .required::before{
|
|
|
+ content: '*';
|
|
|
+ color: #ee0a24;
|
|
|
+ position: absolute;
|
|
|
+ left: 14px;
|
|
|
+ }
|
|
|
}
|
|
|
.goods-card{
|
|
|
width: 100%;
|
|
|
@@ -229,7 +246,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.big-btn-box{
|
|
|
- padding-bottom: 20px;
|
|
|
+ padding: 20px;
|
|
|
}
|
|
|
.nfc-img {
|
|
|
display: inline-block;
|