Browse Source

修复出入管理bug

凉纪 1 year ago
parent
commit
2d317e713f

+ 1 - 1
src/utils/globalMixins.js

@@ -64,7 +64,7 @@ export default {
     },
     //调用预览和pdf(内网银行)
     openFilePreview(item) {
-      let system = this.isAndroidOrIos()
+      let system = this.isAndroidOrIos();
       const parms = {
         url: imgUrl(item.url),
         name: item.name

+ 17 - 11
src/views/menu/visitCheck/detail.vue

@@ -20,18 +20,15 @@
             <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" v-if="visitInfo.letterFile">
-              <span>介绍信文件</span>
-              <van-cell >
-                <div
-                  class="nfc-img van-hairline--surround"
-                  v-for="(v, i) in visitInfo.letterFile"
-                  :key="v.url"
-                  @click="preView(v.imgPath)">
-                  <img :src="imgUrl(v.imgPath)" alt="" />
+            <van-cell title="介绍信"  v-if="visitInfo.letterFile && visitInfo.letterFile.length > 0">
+              <template #right-icon>
+                <div class="file-box">
+                  <p class="van-ellipsis" v-for="(v, i) in visitInfo.letterFile"
+                     :key="v.url"
+                     @click="previewFile(v.url)">{{v.name}}</p>
                 </div>
-              </van-cell>
-            </div>
+              </template>
+            </van-cell>
             <van-cell v-if="visitInfo.description" title="备注信息" :value="visitInfo.description"></van-cell>
           </div>
         </van-panel>
@@ -181,6 +178,9 @@ export default {
         this.userInfos = users;
       })
     },
+    previewFile(file){
+      this.openFilePreview(file);
+    },
     preView(val) {
       if(Array.isArray(val)){
         let arr = val.map(v=>{
@@ -299,6 +299,12 @@ export default {
 .big-btn-box{
   padding-bottom: 20px;
 }
+.file-box{
+  width: 70%;
+  display: flex;
+  justify-content: flex-end;
+  color:#008cd6;
+}
 .nfc-img {
   display: inline-block;
   width: 140px;

+ 1 - 1
src/views/menu/visitCheck/index.vue

@@ -253,7 +253,7 @@ export default {
   justify-content: space-between;
   font-size: 26px;
   .item-label{
-    flex:.27;
+    flex:.29;
     text-align: left;
     color:#333;
   }

+ 17 - 11
src/views/menu/visitRecord/detail.vue

@@ -25,18 +25,15 @@
             </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="" />
+            <van-cell title="介绍信"  v-if="selectedUser.letterFile && selectedUser.letterFile.length > 0">
+              <template #right-icon>
+                <div class="file-box">
+                  <p class="van-ellipsis" v-for="(v, i) in selectedUser.letterFile"
+                     :key="v.url"
+                     @click="previewFile(v.url)">{{v.name}}</p>
                 </div>
-              </van-cell>
-            </div>
+              </template>
+            </van-cell>
             <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">
@@ -140,6 +137,9 @@ export default {
         this.selectedUser.letterFile = letterFile;
       })
     },
+    previewFile(file){
+      this.openFilePreview(file);
+    },
     preView(val) {
       if(Array.isArray(val)){
         let arr = val.map(v=>{
@@ -264,6 +264,12 @@ export default {
 .big-btn-box{
   padding: 20px;
 }
+.file-box{
+  width: 70%;
+  display: flex;
+  justify-content: flex-end;
+  color:#008cd6;
+}
 .nfc-img {
   display: inline-block;
   width: 140px;

+ 3 - 5
src/views/menu/visitRecord/index.vue

@@ -26,11 +26,9 @@
             :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 #extra>
+                <van-button v-if="!v.departureTime" type="info" size="mini">登记离开时间</van-button>
+              </template>
             <template #label>
               <div class="info-box">
                 <div class="info-item">

+ 0 - 5
src/views/menu/visitRegister/add.vue

@@ -120,7 +120,6 @@
               autosize
               :maxlength="20"
               label="证件号码"
-              :rules="[{ pattern:/^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{4}([0-9]|X)$/, message: '请输入正确身份证号码' }]"
               placeholder="请输入"/>
             <van-field
               required
@@ -308,10 +307,6 @@ export default {
         this.$toast('请完善人员信息');
         return;
       }
-      if(this.personnel.imgFile.length < 2) {
-        this.$toast('请上传证件照正反面');
-        return;
-      }
       let strObj = JSON.parse(JSON.stringify(this.personnel));
       let index = this.pList.findIndex(v=>{return v.idCard === strObj.idCard});
       this.pList.splice(index,1,strObj);