Browse Source

完善出入管理页面

凉纪 1 year ago
parent
commit
84416c7344

+ 9 - 3
src/router/router.config.js

@@ -278,13 +278,13 @@ export let routers = [
         path: '/visitCheck',
         name: 'visitCheck',
         component: () => import('@/views/menu/visitCheck/index.vue'),
-        meta: { title: '出入事项审批', keepAlive: false ,hideTabBar:false}
+        meta: { title: '出入审批', keepAlive: false ,hideTabBar:false}
       },
       {
         path: '/visitCheckDetail',
         name: 'visitCheckDetail',
         component: () => import('@/views/menu/visitCheck/detail.vue'),
-        meta: { title: '事项审批', keepAlive: false ,hideTabBar:true}
+        meta: { title: '审批详情', keepAlive: false ,hideTabBar:true}
       },
       {
         path: '/visitRecord',
@@ -296,7 +296,13 @@ export let routers = [
         path: '/visitRecordDetail',
         name: 'visitRecordDetail',
         component: () => import('@/views/menu/visitRecord/detail.vue'),
-        meta: { title: '出入人员登记', keepAlive: false ,hideTabBar:true}
+        meta: { title: '登记详情', keepAlive: false ,hideTabBar:true}
+      },
+      {
+        path: '/visitUserRecord',
+        name: 'visitUserRecord',
+        component: () => import('@/views/menu/visitRecord/add.vue'),
+        meta: { title: '人员登记', keepAlive: false ,hideTabBar:true}
       },
       {
         path: '/cockpit',

+ 6 - 25
src/views/menu/visitCheck/api.js

@@ -1,4 +1,5 @@
 import request from "@/utils/request";
+
 //获取列表
 export function dataList(params) {
   return request({
@@ -9,37 +10,17 @@ export function dataList(params) {
 }
 
 //获取详情
-export function taskDetails(orgId){
+export function visitDetails(id){
   return request({
-    url: "/core/question/info/"+orgId,
+    url: "/core/letter/"+id,
     method: "get",
   });
 }
 
-// 问题确认
-export function confirm(data) {
-  return request({
-    url: "/core/question/confirm/" + data.id,
-    method: "put",
-    data,
-    showLoading: true,
-  });
-}
-
-// 异议审批
-export function confirmDissent(data) {
-  return request({
-    url: "/core/question/confirmDissent/" + data.id,
-    method: "put",
-    data,
-    showLoading: true,
-  });
-}
-
-// 整改
-export function reform(data) {
+// 审批
+export function visitCheck(data) {
   return request({
-    url: "/core/question/reform/" + data.id,
+    url: "/core/letter/approve",
     method: "put",
     data,
   });

+ 163 - 73
src/views/menu/visitCheck/detail.vue

@@ -4,120 +4,177 @@
     <div class="page-container">
       <!--   基本信息   -->
       <div class="card">
-        <van-panel title="来访信息">
+        <van-panel title="来访信息" >
+          <template #header>
+            <van-cell title="状态">
+              <template #extra>
+                  <span :style="{color:getState(approveStatus)}">
+                    {{getDictLabel(approveStatus,'out_in_approve_status') }}
+                  </span>
+              </template>
+            </van-cell>
+          </template>
           <div class="panel-box">
-            <van-cell title="来访类型" :value="visitType"></van-cell>
+            <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.description"></van-cell>
-            <van-cell title="访问日期" :value="visitInfo.submitTime"></van-cell>
-            <van-cell title="结束日期" :value="visitInfo.questionDesc"></van-cell>
-            <van-cell title="介绍信上传" :value="visitInfo.images"></van-cell>
-            <van-cell title="备注信息" :value="visitInfo.description"></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">
+                <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="" />
+                </div>
+                <!--                      <img class="nfc-img" v-for="v in item.imgData" :src="imgUrl(v.imgPath)" alt="" :key="v.id">-->
+              </van-cell>
+            </div>
+            <van-cell v-if="visitInfo.description" title="备注信息" :value="visitInfo.description"></van-cell>
           </div>
         </van-panel>
       </div>
 
-      <!--  人员列表   -->
-      <div class="card" v-for="(v,i) in pList" :key="i">
-          <div class="goods-card">
-           <div class="card-img-box" @click="preView('https://img01.yzcdn.cn/vant/cat.jpeg')">
-             <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
-           </div>
-           <div class="card-cell-box">
-            <van-cell title="出入人员" value="出入人员"></van-cell>
-            <van-cell title="身份证" value="123456789012345678"></van-cell>
-            <van-cell title="单位" value="高新兴讯美科技有限公司"></van-cell>
-           </div>
-          </div>
-      </div>
-      <div class="card" v-for="(v,i) in pList" :key="i">
+      <!--  人员列表  -->
+      <div class="card" v-for="(v,i) in userInfos" :key="i">
         <div class="goods-card">
-          <div class="card-img-box" @click="preView('https://img01.yzcdn.cn/vant/cat.jpeg')">
-            <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
+          <div class="card-img-box" v-if="v.imgFile && v.imgFile.length > 0" @click="preView(v.imgFile)">
+            <img :src="imgUrl(v.imgFile[0])" alt="">
           </div>
           <div class="card-cell-box">
-            <van-cell title="出入人员" value="出入人员"></van-cell>
-            <van-cell title="身份证" value="123456789012345678"></van-cell>
-            <van-cell title="单位" value="高新兴讯美科技有限公司"></van-cell>
+            <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>
         </div>
       </div>
-      <div class="flex-box">
-        <van-button type="default" style="width: 48%" plain @click="refuse">拒绝</van-button>
+      <div v-show="showInput" class="input-box">
+        <van-field
+          v-model="formData.description"
+          rows="1"
+          autosize
+          :maxlength="200"
+          label="审批说明"
+          type="textarea"
+          placeholder="请输入"/>
+      </div>
+      <div v-if="approveRemark" class="input-box">
+        <van-cell title="审批说明" :value="approveRemark"></van-cell>
+      </div>
+      <div v-if="approveStatus == 0" class="flex-box">
+        <van-button type="info" style="width: 48%" plain @click="refuse">拒绝</van-button>
         <van-button type="info" style="width: 48%" @click="accredit">同意</van-button>
       </div>
     </div>
-
-    <org-picker
-      :show="showPicker"
-      @cancel="cancelPicker"
-      @confirm="changeOrg">
-    </org-picker>
   </div>
 </template>
 
 <script>
 
-import {defineComponent} from "vue";
-import SelectCell from "@/components/selectCell/index.vue";
 import DateCell from "@/components/dateCell/index.vue";
 import Uploader from "@/components/upload/gxuploader.vue";
-import OrgPicker from "@/components/OrgPicker/index.vue";
 import {formatDate} from "@/filters/filter";
 import {mapGetters} from "vuex";
 import {imgUrl} from "@/utils";
 import { ImagePreview } from 'vant'
-export default defineComponent({
-  components: {SelectCell,Uploader,DateCell,OrgPicker},
+import {visitDetails,visitCheck} from './api'
+export default {
+  components: {Uploader, DateCell},
   data(){
     return {
-      activeNames:[1],
-      checked:false,
+      visitId:null,
+      approveStatus:null,
+      approveRemark:null,
+      activeNames:['1'],
       visitInfo: {},
-      formData:{},
-      //人员的单词:
-      prop:{
-        label:'name',
-        value:'value'
+      userInfos:[],
+      formData:{
+
       },
-      visitType:1,
-      typeList:[
-        {
-          name:'职能部门来访',
-          value:1
-        },
-        {
-          name:'临时来访',
-          value:2
-        },
-        {
-          name:'紧急来访',
-          value:3
-        }
-      ],
-      personnel:{},
-      pList:[{}],
-      showPicker:false,
+      showInput:false,
+      dicts:['out_in_approve_status','out_in_type']
     }
   },
   computed:{
     ...mapGetters(['orgId','id','dictionary'])
   },
+  mounted(){
+    this.visitId = this.$route.query.id;
+    console.log(this.visitId,'idddddddd')
+    this.getInfo();
+  },
   methods:{
-    formatDate,
+    imgUrl,formatDate,
+    // 拒绝
     refuse(){
-
+      if(this.showInput){
+        let data = {
+          approveStatus:2,
+          approveRemark:this.formData.description,
+          id:this.visitInfo.approveLog.id
+        }
+        visitCheck(data).then(res=>{
+          this.$toast('操作成功');
+          this.$router.replace({
+            path:'/visitCheck',
+          });
+        })
+      }
+      this.showInput = true;
     },
+    // 同意
     accredit(){
-
+      let data = {
+        approveStatus:1,
+        id:this.visitInfo.approveLog.id
+      }
+      visitCheck(data).then(res=>{
+        this.$toast('操作成功');
+        this.$router.replace({
+          path:'/visitCheck',
+        });
+      })
     },
-    preView(url) {
-      // this.preViewImages.images = this.nfcImage.map(v => imgUrl(v.img))
-      // this.preViewImages.startPosition = i
-      ImagePreview(url)
+    getState(state){
+      console.log(state,'state')
+      switch (state){
+        case 0:
+          return '#008cd6';
+        case 1:
+          return '#009240';
+        case 2:
+          return '#bc9f71';
+        case 3:
+          return '#D7000F';
+      }
+    },
+    getInfo(){
+      visitDetails(this.visitId).then(res=>{
+        this.visitInfo = res.data;
+        this.approveStatus = this.visitInfo.approveLog.approveStatus;
+        this.approveRemark = this.visitInfo.approveLog.approveRemark;
+        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;
+      })
+    },
+    preView(val) {
+      ImagePreview(val);
     },
   }
-})
+}
 </script>
 <style lang="scss">
 .intro-add{
@@ -137,7 +194,7 @@ export default defineComponent({
       flex:.25;
     }
     .van-cell__value{
-     flex:.75;
+      flex:.75;
     }
   }
 }
@@ -151,6 +208,7 @@ export default defineComponent({
   height: calc(100vh - 94px);
   overflow: auto;
   padding: 20px;
+
 }
 .flex-box{
   display: flex;
@@ -223,4 +281,36 @@ export default defineComponent({
 .big-btn-box{
   padding-bottom: 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;
+  }
+
+}
+.input-box{
+  margin-bottom: 20px;
+}
 </style>

+ 62 - 41
src/views/menu/visitCheck/index.vue

@@ -29,26 +29,35 @@
           :pullup="pullup">
           <empty  v-if="!dataList || dataList.length === 0" />
           <card v-else v-for="(v,i) in dataList" :key="v.id">
-              <van-cell :title="v.orgName">
-                <template #extra>
-                  <van-button
-                    style="display: block;width: 60px;"
-                    hairline
-                    size="mini"
-                    type="info"
-                    @click.stop="clickItem(v.id,'detail')">
-                    详情
-                  </van-button>
-                </template>
-                <template #label>
-                  <div class="info-box">
-                    <div class="info-desc">创建机构:<span>{{v.questionDesc}}</span></div>
-                    <div class="info-desc">接待机构:<span>{{v.questionDesc}}</span></div>
-                    <div class="info-item">介绍信有效期:<span>{{v.submitTime}}~{{v.submitTime}}</span></div>
+            <van-cell
+              :title-style="{color:v.type == 3?'#D7000F':''}"
+              :title="getDictLabel(v.type,'out_in_type')"
+              @click="clickItem(v.id)">
+              <template #extra>
+                  <span :style="{color:getState(getDictLabel(v.approveStatus,'out_in_approve_status'))}">
+                    {{getDictLabel(v.approveStatus,'out_in_approve_status') }}
+                  </span>
+              </template>
+              <template #label>
+                <div class="info-box">
+                  <div v-if="v.type == 2" class="info-item">
+                    <div class="item-label">介绍信编号:</div>
+                    <div class="item-value"> {{v.letterNo}}</div>
                   </div>
-                </template>
-              </van-cell>
-            </card>
+                  <div class="info-item">
+                    <div class="item-label">有效期:</div>
+                    <div class="item-value">{{v.startTime}}~{{v.endTime}}</div>
+                  </div>
+                  <div class="info-item">
+                    <div class="item-label">来访事由:</div>
+                    <div class="item-value">
+                      {{v.reasons}}
+                    </div>
+                  </div>
+                </div>
+              </template>
+            </van-cell>
+          </card>
         </Scroll>
       </div>
     </div>
@@ -82,25 +91,6 @@ export default {
         pageSize:10,
         pageNum:1,
       },
-      planList:[],
-      loading:false,
-      finished:false,
-      columns:[
-        {
-          field: "index",
-          key: "index",
-          title: "序号",
-          width: 50,
-          align: "center",
-          renderBodyCell: ({ row, column, rowIndex }, h) => {
-            return ++rowIndex;
-          },
-        },
-        { field: "orgName", key: "a", title: "单位名称",align: "center"},
-        { field: "shouldFinish", key: "b", title: "应完成数", align: "center" },
-        { field: "finish", key: "c", title: "已完成数",align: "center" },
-        { field: "finishRate", key: "d", title: "完成率", align: "center" },
-      ],
       dataList:[],
       pullup:false,
       dicts:['out_in_approve_status','out_in_type']
@@ -113,6 +103,18 @@ export default {
     ...mapGetters(['orgId','id','dictionary']),
   },
   methods: {
+    getState(state){
+      switch (state){
+        case '待审批':
+          return '#008cd6';
+        case '不同意':
+          return '#bc9f71';
+        case '同意':
+          return '#009240';
+        case '已逾期':
+          return '#D7000F';
+      }
+    },
     clickAdd(){
       this.$router.push({
         path:'/introAdd',
@@ -156,10 +158,10 @@ export default {
         }
       })
     },
-    clickItem(id,type){
+    clickItem(id){
       this.$router.push({
         path:'/visitCheckDetail',
-        query:{id,type}
+        query:{id}
       });
     }
   }
@@ -240,6 +242,25 @@ export default {
   }
 }
 .info-item{
-
+  display: flex;
+  justify-content: space-between;
+  font-size: 26px;
+  .item-label{
+    flex:.25;
+    text-align: left;
+    color:#333;
+  }
+  .item-value{
+    flex:.75;
+    color:#666;
+    min-height: 50px;
+    line-height: 36px;
+    max-height: 250px;
+    display: -webkit-box;
+    -webkit-line-clamp: 3; /* 限制显示为3行 */
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
 }
 </style>

+ 267 - 0
src/views/menu/visitRecord/add.vue

@@ -0,0 +1,267 @@
+<template>
+  <div class="intro-add">
+    <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>-->
+          <div class="panel-box">
+            <select-cell
+              title="出入人员"
+              :prop="prop"
+              is-row
+              v-model="selectedUser"
+              :data-list="userList"
+              required>
+            </select-cell>
+            <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.orgName"></van-cell>
+            <van-cell title="陪同人员" :value="visitInfo.orgName"></van-cell>
+            <div class="upload-box">
+              <span>证件照</span>
+              <van-cell v-if="visitInfo.letterFile">
+                <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="" />
+                </div>
+              </van-cell>
+            </div>
+            <div class="upload-box">
+              <span>介绍信</span>
+              <van-cell v-if="visitInfo.letterFile">
+                <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="" />
+                </div>
+              </van-cell>
+            </div>
+          </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="">
+          </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>
+        </div>
+      </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 {userList} from './api'
+export default {
+  components: {Uploader, DateCell},
+  data(){
+    return {
+      visitId:null,
+      activeNames:['1'],
+      visitInfo: {},
+      userInfos:[],
+      userList:[],
+      selectedUser:{},
+      prop:{
+        label:'userName',
+        value:'id'
+      },
+      reformData: {
+        reformDate: null,
+        description: null,
+        images: null,
+      },
+      dicts:['out_in_approve_status','out_in_type']
+    }
+  },
+  computed:{
+    ...mapGetters(['orgId','id','dictionary'])
+  },
+  mounted(){
+    this.visitId = this.$route.query.id
+    this.getUserList();
+  },
+  methods:{
+    imgUrl,formatDate,
+    getUserList(){
+      let data = {
+        orgId:this.orgId,
+        arrivalTime:formatDate(new Date(),'YYYY-MM-DD')
+      }
+      userList(data).then(res=>{
+        this.userList = res.data;
+        console.log(res,'ressssssss')
+      })
+    },
+    preView(val) {
+      ImagePreview(val);
+    },
+  }
+}
+</script>
+<style lang="scss">
+.intro-add{
+  .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">
+.intro-add{
+  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;
+    }
+  }
+}
+.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-bottom: 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>

+ 5 - 6
src/views/menu/visitRecord/api.js

@@ -2,7 +2,7 @@ import request from "@/utils/request";
 //获取列表
 export function dataList(data) {
   return request({
-    url: "/core/question/list",
+    url: "/core/outinrecord/list",
     method: "get",
     params: data,
   });
@@ -17,12 +17,11 @@ export function taskDetails(orgId){
 }
 
 // 问题确认
-export function confirm(data) {
+export function userList(query) {
   return request({
-    url: "/core/question/confirm/" + data.id,
-    method: "put",
-    data,
-    showLoading: true,
+    url: "/core/letter/approved/person",
+    method: "get",
+    query
   });
 }
 

+ 114 - 97
src/views/menu/visitRecord/detail.vue

@@ -3,98 +3,54 @@
     <nav-bar></nav-bar>
     <div class="page-container">
       <!--   基本信息   -->
-      <div class="card" v-if="taskInfo">
-        <van-panel title="来访信息">
+      <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>
           <div class="panel-box">
-            <van-field
-              label="介绍信名称"
-              required
-              v-model="reformData.description"
-              placeholder="请输入"
-              :maxlength="20"
-              :v-model="taskInfo.orgName" />
-            <van-field
-              label="接待机构"
-              required
-              placeholder="请输入"
-              v-model="reformData.description"
-              :maxlength="20"
-              :v-model="taskInfo.checkItem" />
-            <date-cell required title="到达日期" :label="taskInfo.submitTime" />
-            <date-cell required title="离开日期" :label="taskInfo.questionDesc" />
-            <div class="upload-box" >
-              <span><i>*</i> 原件上传</span>
-              <uploader :maxCount="5" v-model="reformData.images"/>
+            <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">
+                <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="" />
+                </div>
+                <!--                      <img class="nfc-img" v-for="v in item.imgData" :src="imgUrl(v.imgPath)" alt="" :key="v.id">-->
+              </van-cell>
             </div>
-            <van-field
-              v-model="reformData.description"
-              rows="1"
-              autosize
-              :maxlength="200"
-              label="备注信息"
-              type="textarea"
-              placeholder="请输入"/>
+            <van-cell title="备注信息" :value="visitInfo.description"></van-cell>
           </div>
         </van-panel>
       </div>
 
-      <!--  人员列表   -->
-      <div class="card" >
-        <van-swipe-cell>
-          <div class="goods-card">
-           <div class="card-img-box">
-             <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
-           </div>
-           <div class="card-cell-box">
-            <van-cell title="出入人员" value="出入人员"></van-cell>
-            <van-cell title="身份证" value="123456789012345678"></van-cell>
-            <van-cell title="单位" value="高新兴讯美科技有限公司高新兴讯"></van-cell>
-           </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="">
           </div>
-          <template #right>
-            <van-button style="height: 100%;" square text="删除" type="danger" class="delete-button" />
-          </template>
-        </van-swipe-cell>
-      </div>
-
-      <!--  添加人员信息    -->
-      <van-collapse v-show="checked" v-model="activeNames">
-        <van-collapse-item title="添加人员" name="1">
-          <div class="panel-box">
-            <van-field
-              required
-              v-model="reformData.description"
-              rows="1"
-              autosize
-              :maxlength="20"
-              label="出入人员"
-              placeholder="请输入"/>
-            <van-field
-              required
-              v-model="reformData.description"
-              rows="1"
-              autosize
-              :maxlength="20"
-              label="证件号码"
-              placeholder="请输入"/>
-            <van-field
-              required
-              v-model="reformData.description"
-              rows="1"
-              autosize
-              :maxlength="20"
-              label="单位"
-              placeholder="请输入"/>
-            <div class="upload-box" >
-              <span>证件上传</span>
-              <uploader :maxCount="2" v-model="reformData.images"/>
-            </div>
-            <div class="big-btn-box" >
-              <van-button  type="info" size="large"  @click="onSubmit('整改')">添加</van-button>
-            </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>
-        </van-collapse-item>
-      </van-collapse>
+        </div>
+      </div>
 
     </div>
   </div>
@@ -102,40 +58,73 @@
 
 <script>
 
-import {defineComponent} from "vue";
 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'
-export default defineComponent({
+import {visitDetails} from './api'
+export default {
   components: {Uploader, DateCell},
   data(){
     return {
-      activeNames:[1],
-      checked:false,
-      taskInfo:[],
-      //整改
+      visitId:null,
+      activeNames:['1'],
+      visitInfo: {},
+      userInfos:[],
       reformData: {
         reformDate: null,
         description: null,
         images: null,
       },
+      dicts:['out_in_approve_status','out_in_type']
     }
   },
   computed:{
     ...mapGetters(['orgId','id','dictionary'])
   },
+  mounted(){
+    this.visitId = this.$route.query.id
+    this.getInfo();
+  },
   methods:{
-    formatDate,
-    preViewNFC(url) {
-      // this.preViewImages.images = this.nfcImage.map(v => imgUrl(v.img))
-      // this.preViewImages.startPosition = i
-      ImagePreview(url)
+    imgUrl,formatDate,
+    getState(state){
+      console.log(state,'state')
+      switch (state){
+        case '待审批':
+          return '#008cd6';
+        case '不同意':
+          return '#bc9f71';
+        case '同意':
+          return '#009240';
+        case '已逾期':
+          return '#D7000F';
+      }
+    },
+    getInfo(){
+      visitDetails(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;
+      })
+    },
+    preView(val) {
+      ImagePreview(val);
     },
   }
-})
+}
 </script>
 <style lang="scss">
 .intro-add{
@@ -155,7 +144,7 @@ export default defineComponent({
       flex:.25;
     }
     .van-cell__value{
-     flex:.75;
+      flex:.75;
     }
   }
 }
@@ -242,4 +231,32 @@ export default defineComponent({
 .big-btn-box{
   padding-bottom: 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>

+ 74 - 57
src/views/menu/visitRecord/index.vue

@@ -2,17 +2,17 @@
   <div class="visitRecord">
     <NavBar />
     <div class="page-container">
-      <van-search v-model="query.searchKey" class="van-hairline--bottom" placeholder="请输入人员姓名" />
+      <van-search v-model="query.userName" class="van-hairline--bottom" placeholder="请输入人员姓名"  @change="refreshData"/>
       <div class="search-flex">
         <select-cell
           style="border-right: 1px solid #f5f5f5;"
           title="出入类型"
           :isAll="true"
           :border="false"
-          v-model="query.confirmStatus"
-          :data-list="getDictItem('question_confirm_status')"
+          v-model="query.type"
+          :data-list="getDictItem('out_in_type')"
           @change="refreshData"/>
-        <date-cell title="日期"  v-model="query.taskTime" date-type="date" @change="refreshData"/>
+        <date-cell title="日期"  v-model="query.arrivalTime" date-type="date" @change="refreshData"/>
       </div>
       <div class="card-list">
         <Scroll
@@ -20,31 +20,53 @@
           @refresh="refreshData"
           @loadMore="getDataList"
           :pullup="pullup">
-          <empty  v-if="!dataList || dataList.length === 0" />
+          <empty  v-if="!dataList || dataList.length === 0"/>
           <card v-else v-for="(v,i) in dataList" :key="v.id">
-              <van-cell :title="v.orgName">
-                <template #extra>
-                  <van-button
-                    style="display: block;width: 60px;"
-                    hairline
-                    size="mini"
-                    type="info"
-                    @click.stop="clickItem(v.id,'detail')">
-                    详情
-                  </van-button>
-                </template>
-                <template #label>
-                  <div class="info-box">
-                    <div class="info-desc">创建机构:<span>{{v.questionDesc}}</span></div>
-                    <div class="info-desc">接待机构:<span>{{v.questionDesc}}</span></div>
-                    <div class="info-item">介绍信有效期:<span>{{v.submitTime}}~{{v.submitTime}}</span></div>
+            <van-cell
+            :title-style="{color:v.type == 3?'#D7000F':''}"
+            :title="getDictLabel(v.type,'out_in_type')"
+            @click="clickItem(v.id)">
+              <template #extra>
+                <span :style="{color:getState(getDictLabel(v.approveStatus,'out_in_approve_status'))}">
+                  {{getDictLabel(v.approveStatus,'out_in_approve_status') }}
+                </span>
+              </template>
+            <template #label>
+              <div class="info-box">
+                <div class="info-item">
+                  <div class="item-label">人员姓名:</div>
+                  <div class="item-value"> {{v.userName}}</div>
+                </div>
+                <div class="info-item">
+                  <div class="item-label">证件号:</div>
+                  <div class="item-value">{{v.idCard}}</div>
+                </div>
+                <div class="info-item">
+                  <div class="item-label">到访时间:</div>
+                  <div class="item-value">
+                    {{v.arrivalTime}}
                   </div>
-                </template>
-              </van-cell>
-            </card>
+                </div>
+                <div class="info-item">
+                  <div class="item-label">离开时间:</div>
+                  <div class="item-value">
+                    {{v.departureTime}}
+                  </div>
+                </div>
+                <div class="info-item">
+                  <div class="item-label">来访事由:</div>
+                  <div class="item-value">
+                    {{v.reasons}}
+                  </div>
+                </div>
+              </div>
+            </template>
+          </van-cell>
+          </card>
         </Scroll>
       </div>
     </div>
+    <drag-button @btnClick="clickAdd"></drag-button>
   </div>
 </template>
 <script>
@@ -57,8 +79,10 @@ import selectCell from '@/components/selectCell/index.vue'
 import {dataList} from './api'
 import {mapGetters} from "vuex";
 import {formatDate} from "@/filters/filter";
+import DragButton from "@/components/DragButton/index.vue";
 export default {
   components: {
+    DragButton,
     NavBar,
     OrgTree,
     Scroll,
@@ -69,34 +93,14 @@ export default {
   data() {
     return {
       query:{
-        taskTime:`${formatDate(new Date(),'YYYY-MM-DD')}`,
-        orgId:null,
-        confirmStatus:null,
+        arrivalTime:`${formatDate(new Date(),'YYYY-MM-DD')}`,
+        userName:null,
         pageSize:10,
         pageNum:1,
       },
-      planList:[],
-      loading:false,
-      finished:false,
-      columns:[
-        {
-          field: "index",
-          key: "index",
-          title: "序号",
-          width: 50,
-          align: "center",
-          renderBodyCell: ({ row, column, rowIndex }, h) => {
-            return ++rowIndex;
-          },
-        },
-        { field: "orgName", key: "a", title: "单位名称",align: "center"},
-        { field: "shouldFinish", key: "b", title: "应完成数", align: "center" },
-        { field: "finish", key: "c", title: "已完成数",align: "center" },
-        { field: "finishRate", key: "d", title: "完成率", align: "center" },
-      ],
       dataList:[],
       pullup:false,
-      dicts:['question_confirm_status','question_reform_status']
+      dicts:['out_in_type']
     }
   },
   mounted() {
@@ -108,8 +112,7 @@ export default {
   methods: {
     clickAdd(){
       this.$router.push({
-        path:'/introAdd',
-        query:{type:'add'}
+        path:'/visitUserRecord',
       });
     },
     refreshData(){
@@ -121,13 +124,11 @@ export default {
     },
     //初始化数据
     initData(){
-      this.query.orgId = this.orgId;
-      this.query.submitTime = formatDate(new Date(),'YYYY-MM-DD');
+      this.query.arrivalTime = formatDate(new Date(),'YYYY-MM-DD');
       this.getDataList();
     },
     //获取数据列表
     getDataList(){
-      if(!this.query.orgId) return this.$toast('请选择机构');
       if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
         this.pullup = false;
         this.$toast('已加载完毕');
@@ -135,6 +136,7 @@ export default {
       }
       let data = {
         ...this.query,
+        orgId:this.orgId
       }
       dataList(data).then(res=>{
         if(res.total === '0'){
@@ -154,7 +156,7 @@ export default {
     clickItem(id,type){
       this.$router.push({
         path:'/visitRecordDetail',
-        query:{id,type}
+        query:{id}
       });
     }
   }
@@ -235,10 +237,25 @@ export default {
   }
 }
 .info-item{
-  height: 50px;
-  line-height: 50px;
-  >span{
-    color:#999;
+  display: flex;
+  justify-content: space-between;
+  font-size: 26px;
+  .item-label{
+    flex:.25;
+    text-align: left;
+    color:#333;
+  }
+  .item-value{
+    flex:.75;
+    color:#666;
+    min-height: 50px;
+    line-height: 36px;
+    max-height: 250px;
+    display: -webkit-box;
+    -webkit-line-clamp: 3; /* 限制显示为3行 */
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
   }
 }
 </style>

+ 1 - 1
src/views/menu/visitRegister/add.vue

@@ -275,7 +275,7 @@ export default {
       alert(JSON.stringify(data))
       visitAdd(data).then(res=>{
         this.$toast.success('提交成功');
-        this.$router.push({
+        this.$router.replace({
           path:'/visitRegister',
         });
       })

+ 1 - 1
src/views/menu/visitRegister/detail.vue

@@ -33,7 +33,7 @@
                 <!--                      <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>
+            <van-cell v-if="visitInfo.description" title="备注信息" :value="visitInfo.description"></van-cell>
           </div>
         </van-panel>
       </div>

+ 9 - 8
src/views/menu/visitRegister/index.vue

@@ -20,16 +20,16 @@
           @loadMore="getDataList"
           :pullup="pullup">
           <empty  v-if="!dataList || dataList.length === 0" />
-          <card v-else v-for="(v,i) in dataList" :key="v.id">
+          <card v-else v-for="(v,i) in dataList" :key="v.id"  >
               <van-cell
                 :title-style="{color:v.type == 3?'#D7000F':''}"
                 :title="getDictLabel(v.type,'out_in_type')"
-                @click.stop="clickItem(v.id,'detail')">
-                <template #extra>
-                  <span :style="{color:getState(getDictLabel(v.status,'out_in_approve_status'))}">
-                    {{getDictLabel(v.status,'out_in_approve_status') }}
-                  </span>
-                </template>
+                @click="clickItem(v.id)">
+<!--                <template #extra>-->
+<!--                  <span :style="{color:getState(getDictLabel(v.approveStatus,'out_in_approve_status'))}">-->
+<!--                    {{getDictLabel(v.approveStatus,'out_in_approve_status') }}-->
+<!--                  </span>-->
+<!--                </template>-->
                 <template #label>
                   <div class="info-box">
                     <div v-if="v.type == 2" class="info-item">
@@ -49,7 +49,7 @@
                   </div>
                 </template>
               </van-cell>
-            </card>
+          </card>
         </Scroll>
       </div>
     </div>
@@ -168,6 +168,7 @@ export default {
       });
     },
     clickItem(id){
+      console.log(id,'idddddddd')
       this.$router.push({
         path:'/visitDetail',
         query: {id}