| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <div class="record-detail">
- <nav-bar></nav-bar>
- <div class="page-container">
- <!-- 基本信息 -->
- <div class="card">
- <van-panel >
- <template #header>
- <span></span>
- </template>
- <div class="panel-box">
- <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 selectedUser.imgFile"
- :key="v"
- @click="preView(selectedUser.imgFile)">
- <img :src="imgUrl(v)" alt="" />
- </div>
- </van-cell>
- </div>
- <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.imgPath)">
- <img :src="imgUrl(v.imgPath)" 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" v-if="selectedUser.checkImage && selectedUser.checkImage.length > 0">
- <span>核验结果</span>
- <van-cell >
- <div
- class="nfc-img van-hairline--surround"
- v-for="(v, i) in selectedUser.checkImage"
- :key="v"
- @click="preView(selectedUser.checkImage)">
- <img :src="imgUrl(v)" alt="" />
- </div>
- </van-cell>
- </div>
- <van-cell title="到达时间" v-if="selectedUser.arrivalTime" :value="selectedUser.arrivalTime"></van-cell>
- <date-cell v-else required title="到达时间" :max-date="maxData" :is-row="true" v-model="formData.arrivalTime" date-type="datetime" />
- <van-cell title="离开时间" v-if="selectedUser.departureTime" :value="selectedUser.departureTime"></van-cell>
- <date-cell v-else required title="离开时间" :max-date="maxData" :is-row="true" v-model="formData.departureTime" date-type="datetime" />
- </div>
- <div v-if="!selectedUser.departureTime" class="big-btn-box" >
- <van-button type="info" size="large" @click="onSubmit">确认登记</van-button>
- </div>
- </van-panel>
- </div>
- </div>
- </div>
- </template>
- <script>
- import DateCell from "@/components/dateCell/index.vue";
- import Uploader from "@/components/upload/gxuploader.vue";
- import {formatDate} from "@/filters/filter";
- import {mapGetters} from "vuex";
- import {imgUrl} from "@/utils";
- import { ImagePreview } from 'vant'
- import {userDetails, userDepart} from './api'
- export default {
- components: {Uploader, DateCell},
- data(){
- return {
- maxData:new Date(),
- visitId:null,
- userList:[],
- selectedUser:{},
- prop:{
- label:'userName',
- value:'id'
- },
- formData:{
- arrivalTime:null,
- departureTime:null,
- },
- dicts:['out_in_approve_status','out_in_type']
- }
- },
- computed:{
- ...mapGetters(['orgId','id','dictionary'])
- },
- mounted(){
- this.visitId = this.$route.query.id;
- this.getUserInfo();
- },
- methods:{
- imgUrl,formatDate,
- onSubmit(){
- let {departureTime} = this.formData;
- if(!departureTime){
- this.$toast('请选择离开时间');
- return
- }
- let data = {
- id:this.selectedUser.id,
- arrivalTime:this.selectedUser.arrivalTime,
- departureTime,
- }
- //alert(JSON.stringify(data))
- userDepart(data).then(res=>{
- this.$toast.success('提交成功');
- this.$router.replace({
- name:'visitRecord',
- path:'/visitRecord',
- params:{event:'refresh'},
- });
- })
- },
- getUserInfo(){
- userDetails(this.visitId).then(res=>{
- let checkImage = res.data.checkImage.split(',');
- let imgFile = res.data.imgFile.split(',');
- let letterFile = [];
- if(res.data.letterFile && res.data.letterFile.length > 0){
- 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) {
- if(Array.isArray(val)){
- let arr = val.map(v=>{
- return imgUrl(v);
- })
- ImagePreview(arr);
- }else {
- ImagePreview([imgUrl(val)]);
- }
- },
- }
- }
- </script>
- <style lang="scss">
- .record-detail{
- .van-card{
- padding: 20px;
- }
- .card-cell-box{
- width: 70%;
- .van-cell{
- padding: 10px;
- &::after{
- left:10px;
- right:10px;
- }
- }
- .van-cell__title{
- flex:.25;
- }
- .van-cell__value{
- flex:.75;
- }
- }
- }
- </style>
- <style scoped lang="scss">
- .record-detail{
- height: 100%;
- overflow: hidden;
- }
- .page-container{
- height: calc(100vh - 94px);
- overflow: auto;
- padding: 20px;
- }
- .flex-box{
- display: flex;
- justify-content: space-between;
- align-items: center;
- >span{
- margin: 0 20px;
- }
- }
- .card{
- margin-bottom: 20px;
- box-shadow: 0 10px 10px #eaeaea;
- }
- .card:last-child{
- margin-bottom: 0;
- }
- .panel-box{
- -padding:0 20px;
- }
- .panel-box-item{
- height: 36px;
- line-height: 36px;
- }
- .item-label{
- width: 100%;
- display: flex;
- justify-content: right;
- align-items: center;
- }
- .item-value{
- width: 100%;
- display: flex;
- justify-content: left;
- align-items: center;
- }
- .upload-box{
- padding: 20px 30px;
- display: flex;
- >span{
- display: inline-block;
- height: 160px;
- width: 200px;
- line-height: 160px;
- font-size: 28px;
- color:#999;
- >i{
- font-style: normal;
- color: #ee0a24;
- }
- }
- .required::before{
- content: '*';
- color: #ee0a24;
- position: absolute;
- left: 14px;
- }
- }
- .goods-card{
- width: 100%;
- display: flex;
- align-items: center;
- padding: 10px;
- background-color: #fff;
- .card-img-box{
- width: 200px;
- height: 200px;
- margin-right: 10px;
- >img{
- width: 100%;
- height: 100%;
- object-fit: cover;
- border-radius: 10px;
- }
- }
- }
- .big-btn-box{
- padding: 20px;
- }
- .nfc-img {
- display: inline-block;
- width: 140px;
- height: 140px;
- margin: 0 10px;
- position: relative;
- > img {
- width: 100%;
- height: 100%;
- border: none;
- }
- > span {
- position: absolute;
- padding: 0 10px;
- bottom: 0;
- left: 0;
- display: block;
- width: 100%;
- background-color: rgba(0, 0, 0, 0.2);
- color: #eaeaea;
- font-size: 20px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- line-height: 30px;
- height: 30px;
- }
- }
- </style>
|