Ver Fonte

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_app into V0.0.2

coys há 1 ano atrás
pai
commit
c6c9c52608

+ 22 - 1
src/components/dateCell/index.vue

@@ -7,6 +7,8 @@
       </template>
     </van-cell>
     <van-popup v-model="showPicker" round  position="bottom" :close-on-popstate="true" get-container="#app">
+      <!--格式化日期-->
+      <!--:formatter="formatter"-->
       <van-datetime-picker
         v-bind="$attrs"
         show-toolbar
@@ -17,6 +19,7 @@
         @confirm="pickerConfirm"
         confirm-button-text="确定"
       />
+
     </van-popup>
   </div>
 </template>
@@ -80,7 +83,7 @@ export default {
           this.selected = null;
           this.label = '';
         }else{
-          this.selected = val;
+          this.selected = dayjs(val).toDate();
           this.label = formatDate(val,this.type[this.dateType].value);
         }
       },
@@ -92,6 +95,24 @@ export default {
     this.selected = new Date();
   },
   methods:{
+    formatter(type, val) {
+      if (type === 'year') {
+        return val + '年';
+      }
+      if (type === 'month') {
+        return val + '月';
+      }
+      if (type === 'day') {
+        return val + '日';
+      }
+      if (type === 'hour') {
+        return val + '时';
+      }
+      if (type === 'minute') {
+        return val + '分';
+      }
+      return val;
+    },
     cancelPicker(){
       this.showPicker = false;
     },

+ 2 - 1
src/components/selectCell/index.vue

@@ -132,7 +132,8 @@ export default {
       this.label = val[this.prop.label];
       console.log(this.label,'label')
       this.showPicker = false;
-      this.$emit('change',val[this.prop.value])
+      this.$emit('change',val[this.prop.value]);
+      this.$emit('itemInfo',val)
     },
     clickItem(){
       this.showPicker = true;

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

@@ -284,13 +284,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',
@@ -302,7 +302,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}
       },
       
     ],

+ 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>

+ 63 - 42
src/views/menu/visitCheck/index.vue

@@ -2,7 +2,7 @@
   <div class="visitCheck">
     <NavBar />
     <div class="page-container">
-      <van-search v-model="query.reasons" class="van-hairline--bottom" placeholder="请输入来访事由"  @change="refreshData"/>
+      <van-search v-model="query.reasons" class="van-hairline--bottom" placeholder="请输入出入事由"  @change="refreshData"/>
       <div class="search-flex">
         <select-cell
           style="border-right: 1px solid #f5f5f5;"
@@ -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>

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

@@ -0,0 +1,314 @@
+<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
+              @itemInfo="getItemInfo"
+              v-model="selectedUser.id"
+              :data-list="userList"
+              required>
+            </select-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(v)">
+                  <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.url)">
+                  <img :src="imgUrl(v.url)" alt="" />
+                </div>
+              </van-cell>
+            </div>
+            <van-cell title="出入类型" :value="getDictLabel(selectedUser.type,'out_in_type')"></van-cell>
+            <van-field
+              v-model="formData.accompanyingPerson"
+              required
+              rows="1"
+              autosize
+              :maxlength="200"
+              placeholder="请输入"
+              label="陪同人员"></van-field>
+            <div class="upload-box" >
+              <span class="required">核验结果</span>
+              <uploader :maxCount="2" v-model="formData.checkImage"/>
+            </div>
+            <date-cell required title="到达时间"  v-model="formData.arrivalTime" date-type="datetime" />
+            <date-cell title="离开时间"  v-model="formData.departureTime" date-type="datetime" />
+          </div>
+          <div 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 {userList, userRegister} from './api'
+export default {
+  components: {Uploader, DateCell},
+  data(){
+    return {
+      visitId: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']
+    }
+  },
+  computed:{
+    ...mapGetters(['orgId','id','dictionary'])
+  },
+  mounted(){
+    this.getUserList();
+  },
+  methods:{
+    imgUrl,formatDate,
+    onSubmit(){
+      if(!this.selectedUser.id){
+        this.$toast('请选择出入人员');
+        return
+      }
+      if(!this.formData.accompanyingPerson){
+        this.$toast('请输入陪同人员');
+        return
+      }
+      if(!this.formData.checkImage){
+        this.$toast('请上传审核结果');
+        return
+      }
+      if(!this.formData.arrivalTime){
+        this.$toast('请选择到访时间');
+        return
+      }
+      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))
+      userRegister(data).then(res=>{
+        this.$toast.success('提交成功');
+        this.$router.replace({
+          path:'/visitRecord',
+        });
+      })
+    },
+    getItemInfo(item){
+      this.selectedUser = item;
+    },
+    getUserList(){
+      let data = {
+        orgId:this.orgId,
+        arrivalTime:formatDate(new Date(),'YYYY-MM-DD')
+      }
+      userList(data).then(res=>{
+        this.userList = res.data.map(v=>{
+          v.imgFile = v.imgFile.split(',');
+          v.letterFile = v.letterFile.map(str=>{
+            return JSON.parse(str)
+          })
+          return v
+        })
+        console.log(this.userList,'list')
+      })
+    },
+    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;
+    }
+  }
+  .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>

+ 18 - 21
src/views/menu/visitRecord/api.js

@@ -2,46 +2,43 @@ import request from "@/utils/request";
 //获取列表
 export function dataList(data) {
   return request({
-    url: "/core/question/list",
+    url: "/core/outinrecord/list",
     method: "get",
     params: data,
   });
 }
 
-//获取详情
-export function taskDetails(orgId){
+//用户列表
+export function userList(query) {
   return request({
-    url: "/core/question/info/"+orgId,
+    url: "/core/letter/approved/person",
     method: "get",
+    query
   });
 }
 
-// 问题确认
-export function confirm(data) {
+//获取详情
+export function userDetails(id){
   return request({
-    url: "/core/question/confirm/" + data.id,
-    method: "put",
-    data,
-    showLoading: true,
+    url: "/core/outinrecord/"+id,
+    method: "get",
   });
 }
 
-// 异议审批
-export function confirmDissent(data) {
+//人员登记
+export function userRegister(data){
   return request({
-    url: "/core/question/confirmDissent/" + data.id,
-    method: "put",
-    data,
-    showLoading: true,
+    url: "/core/outinrecord",
+    method: "post",
+    data
   });
 }
 
-// 整改
-export function reform(data) {
+//登记离开
+export function userDepart(data){
   return request({
-    url: "/core/question/reform/" + data.id,
+    url: "/core/outinrecord",
     method: "put",
-    data,
+    data
   });
 }
-

+ 141 - 107
src/views/menu/visitRecord/detail.vue

@@ -1,144 +1,144 @@
 <template>
-  <div class="intro-add">
+  <div class="record-detail">
     <nav-bar></nav-bar>
     <div class="page-container">
       <!--   基本信息   -->
-      <div class="card" v-if="taskInfo">
-        <van-panel title="来访信息">
+      <div class="card">
+        <van-panel >
+            <template #header>
+              <span></span>
+            </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" />
+            <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(v)">
+                  <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.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><i>*</i> 原件上传</span>
-              <uploader :maxCount="5" v-model="reformData.images"/>
+              <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>
-            <van-field
-              v-model="reformData.description"
-              rows="1"
-              autosize
-              :maxlength="200"
-              label="备注信息"
-              type="textarea"
-              placeholder="请输入"/>
+            <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>
-        </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="big-btn-box" >
+            <van-button  type="info" size="large" @click="onSubmit">确认登记</van-button>
           </div>
-          <template #right>
-            <van-button style="height: 100%;" square text="删除" type="danger" class="delete-button" />
-          </template>
-        </van-swipe-cell>
+        </van-panel>
       </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>
-        </van-collapse-item>
-      </van-collapse>
-
     </div>
   </div>
 </template>
 
 <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 {userDetails, userDepart} from './api'
+export default {
   components: {Uploader, DateCell},
   data(){
     return {
-      activeNames:[1],
-      checked:false,
-      taskInfo:[],
-      //整改
-      reformData: {
-        reformDate: null,
-        description: null,
-        images: null,
+      visitId: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']
     }
   },
   computed:{
     ...mapGetters(['orgId','id','dictionary'])
   },
+  mounted(){
+    this.visitId = this.$route.query.id;
+    this.getUserInfo();
+  },
   methods:{
-    formatDate,
-    preViewNFC(url) {
-      // this.preViewImages.images = this.nfcImage.map(v => imgUrl(v.img))
-      // this.preViewImages.startPosition = i
-      ImagePreview(url)
+    imgUrl,formatDate,
+    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',
+        });
+      })
+    },
+    getUserInfo(){
+
+      userDetails(this.visitId).then(res=>{
+        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) {
+      ImagePreview(val);
     },
   }
-})
+}
 </script>
 <style lang="scss">
-.intro-add{
+.record-detail{
   .van-card{
     padding: 20px;
   }
@@ -155,13 +155,13 @@ export default defineComponent({
       flex:.25;
     }
     .van-cell__value{
-     flex:.75;
+      flex:.75;
     }
   }
 }
 </style>
 <style scoped lang="scss">
-.intro-add{
+.record-detail{
   height: 100%;
   overflow: hidden;
 }
@@ -220,6 +220,12 @@ export default defineComponent({
       color: #ee0a24;
     }
   }
+  .required::before{
+    content: '*';
+    color: #ee0a24;
+    position: absolute;
+    left: 14px;
+  }
 }
 .goods-card{
   width: 100%;
@@ -240,6 +246,34 @@ export default defineComponent({
   }
 }
 .big-btn-box{
-  padding-bottom: 20px;
+  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>

+ 75 - 58
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'){
@@ -151,10 +153,10 @@ export default {
         }
       })
     },
-    clickItem(id,type){
+    clickItem(id){
       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>

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

@@ -25,7 +25,7 @@
               :label="formData.orgName">
             </van-cell>
             <van-field
-              label="来访事由"
+              label="出入事由"
               required
               rows="1"
               autosize
@@ -243,7 +243,7 @@ export default {
       }
 
       if(!this.formData.reasons){
-        this.$toast('请输入来访事由');
+        this.$toast('请输入出入事由');
         return;
       }
       if(!this.formData.range){
@@ -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',
         });
       })

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

@@ -17,7 +17,7 @@
           <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.reasons"></van-cell>
             <van-cell title="访问日期" :value="visitInfo.startTimeStr"></van-cell>
             <van-cell title="结束日期" :value="visitInfo.endTimeStr"></van-cell>
             <div class="upload-box">
@@ -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>

+ 11 - 10
src/views/menu/visitRegister/index.vue

@@ -2,7 +2,7 @@
   <div class="visitRegister">
     <NavBar />
     <div class="page-container">
-      <van-search v-model="query.reasons" class="van-hairline--bottom" placeholder="请输入来访事由" @change="refreshData" />
+      <van-search v-model="query.reasons" class="van-hairline--bottom" placeholder="请输入出入事由" @change="refreshData" />
       <select-cell
         style="border-right: 1px solid #f5f5f5;"
         title="出入类型"
@@ -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">
@@ -41,7 +41,7 @@
                       <div class="item-value">{{v.startTime}}~{{v.endTime}}</div>
                     </div>
                     <div class="info-item">
-                      <div class="item-label">来访事由:</div>
+                      <div class="item-label">出入事由:</div>
                       <div class="item-value">
                           {{v.reasons}}
                       </div>
@@ -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}