Explorar o código

修改bug,需求变更

凉纪 hai 1 ano
pai
achega
f6f4823862

+ 10 - 5
src/utils/globalMixins.js

@@ -65,12 +65,17 @@ export default {
       })
     },
     //调用预览和pdf(内网银行)
-    openFilePreview(item) {
+    openFilePreview(file) {
       const parms = {
-        url: item.url.indexOf('http') > -1 ? item.url : imgUrl(item.url),
-        name: item.name
+        url: file.url.indexOf('http') > -1 ?   file.url : imgUrl(file.url),
+        name: file.name
       }
+      console.log(parms.url,'parms')
       let system = this.isAndroidOrIos();
+      if(system === 3) {
+        this.$toast('请在app内打开');
+        return
+      }
       if (system === 1) {
         //android
         // 判断当前环境是是否存在 js桥 'sap'
@@ -95,7 +100,7 @@ export default {
     },
     //调用NFC
     useNFC() {
-      
+
       let system = this.isAndroidOrIos()
       const parms = {
         "iOS_SessionType": "0"
@@ -124,7 +129,7 @@ export default {
     },
     //调用相机和相册
     useCamera(actionType) {
-      
+
       window.openCameraCallBack = null
       window.openCameraCallBack = this.openCameraCallBack
       let parms = {}

+ 0 - 1
src/utils/index.js

@@ -106,7 +106,6 @@ export function param2Obj(url) {
 //根据当前环境拼接图片地址
 export function imgUrl(url){
   if(!url) return "";
-  // return window.origin + url;
   return  process.env.NODE_ENV === "development"
     ?  config.baseUrl + url
     :  window.origin + url;

+ 2 - 1
src/views/home/menu.vue

@@ -8,8 +8,9 @@
         <card v-else class="menu-list-item" v-for="(v, i) in menuList" :key="i">
           <p>{{ v.meta.title }}</p>
           <div style="border-left: 1px solid #f4f4f4;">
-            <van-grid border :column-num="3">
+            <van-grid :clickable="true" border :column-num="3">
               <van-grid-item
+                clickable
                 v-for="(item, index) in v.children"
                 :key="index"
                 :icon="item.meta.icon"

+ 54 - 7
src/views/menu/safetyBook/detail.vue

@@ -1,36 +1,63 @@
 <template>
   <div class="detail">
     <nav-bar></nav-bar>
-    <div class="info">
+    <div class="page-container">
       <van-cell-group>
         <van-cell class="item-cell" title="签署类型" :value="getDictLabel(dataInfo.type,'safety_book_type')" >
         </van-cell>
-        <van-cell class="item-cell" title="签署人" :value="dataInfo.userName" >
+        <van-cell class="item-cell" title="签署人所在机构" :value="dataInfo.userName" >
         </van-cell>
-        <van-cell class="item-cell" title="签署时间" :value="dataInfo.createTime">
+        <van-cell class="item-cell" title="所属年度" :value="`${dataInfo.year}年`" >
+        </van-cell>
+        <van-cell class="item-cell" title="添加时间" :value="dataInfo.createTime">
         </van-cell>
       </van-cell-group>
+      <div class="book-list">
+        <div class="card" v-for="(v,i) in bookList" :key="v.id">
+          <van-cell  title="签署人" :value="v.userName"></van-cell>
+          <van-cell  title="签署时间" :value="v.time"></van-cell>
+          <van-cell v-if="v.files && v.files.length > 0"  title="签署文件" >
+            <template #label>
+              <div class="file-list">
+                <div class="file-item" v-for="(file,index) in v.files" :key="index">
+                  <span style="color: #1989fa;" @click="preview(file)"  :key="file.name">{{file.name}}</span>
+                </div>
+              </div>
+            </template>
+          </van-cell>
+        </div>
+      </div>
     </div>
   </div>
 </template>
 <script>
 import NavBar from '@/components/NavBar'
 import { detail } from './api.js'
-
+import {mapGetters} from 'vuex'
 export default {
   data() {
     return {
+      activeNames: [],
       dataInfo: {},
+      bookList:[],
+      dicts:['safety_book_type']
     }
   },
   components: { NavBar },
+  computed:{
+    ...mapGetters(['orgId','dictionary'])
+  },
   mounted() {
     this.getInfo();
   },
   methods: {
+    preview(file){
+      this.openFilePreview(file);
+    },
     async getInfo() {
       let res = await detail(this.$route.query.id);
       this.dataInfo = res.data;
+      this.bookList = res.data.bookUsers;
     },
   }
 }
@@ -39,9 +66,29 @@ export default {
 .detail {
 
 }
-.info{
-}
-.history {
+.page-container {
 
 }
+.book-list{
+  height: calc(100vh - 446px);
+  overflow: auto;
+  padding: 20px;
+}
+.card {
+  margin-bottom: 20px;
+  box-shadow: 0 10px 10px #eaeaea;
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+.file-list{
+  width: 100%;
+  min-height: 40px;
+  padding: 20px 0;
+  >div{
+    line-height: 40px;
+    height: 40px;
+    padding-left: 20px;
+  }
+}
 </style>

+ 2 - 4
src/views/menu/safetyBook/index.vue

@@ -15,9 +15,9 @@
           <card class="list-item" v-else v-for="(v,i) in dataList" :key="i">
             <p class="item-title">{{v.orgName}}</p>
             <div :title="v.orgName" @click="clickItem(v)">
-              <van-cell class="item-cell" title="签署类型" :value="getDictLabel(v.type,'safety_book_type')" >
+              <van-cell class="item-cell" title="所属年度" :value="`${v.year} 年`" >
               </van-cell>
-              <van-cell class="item-cell" title="签署人" :value="v.userName" >
+              <van-cell class="item-cell" title="签署类型" :value="getDictLabel(v.type,'safety_book_type')" >
               </van-cell>
               <van-cell class="item-cell" title="签署时间" :value="v.createTime">
               </van-cell>
@@ -47,12 +47,10 @@ export default {
     Card
   },
   data(){
-    let year = new Date().getFullYear();
     return {
       pullup:true,
       query:{
         orgId:null,
-        year:year,
         pageNum:1,
         pageSize:10,
       },

+ 11 - 8
src/views/menu/visitRegister/detail.vue

@@ -9,8 +9,8 @@
           <div class="panel-box">
             <van-cell title="状态">
               <template #extra>
-                  <span :style="{color:getState(getDictLabel(visitInfo.status,'out_in_approve_status'))}">
-                    {{getDictLabel(visitInfo.status,'out_in_approve_status') }}
+                  <span :style="{color:getState(approveStatus)}">
+                    {{getDictLabel(approveStatus,'out_in_approve_status') }}
                   </span>
               </template>
             </van-cell>
@@ -69,6 +69,8 @@ export default {
       activeNames:['1'],
       visitInfo: {},
       userInfos:[],
+      approveStatus:null,
+      approveRemark:null,
       reformData: {
         reformDate: null,
         description: null,
@@ -87,21 +89,22 @@ export default {
   methods:{
     imgUrl,formatDate,
     getState(state){
-      console.log(state,'state')
       switch (state){
-        case '待审批':
+        case 0:
           return '#008cd6';
-        case '不同意':
-          return '#bc9f71';
-        case '同意':
+        case 1:
           return '#009240';
-        case '未审批':
+        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)