seimin 3 weeks ago
parent
commit
d4633e1121

+ 8 - 0
main.js

@@ -54,6 +54,14 @@ Vue.filter('filterSecondDate', function(dateStr){
54 54
     return dateStr;
55 55
   }
56 56
 })
57
+// 多个名称显示
58
+Vue.filter('filterNames', function(arr, fieldName){
59
+  if(Array.isArray((arr))){
60
+    return arr.map(v => v[fieldName]).toString();
61
+  }else{
62
+    return '';
63
+  }
64
+})
57 65
 App.mpType = 'app'
58 66
 
59 67
 const app = new Vue({

+ 16 - 18
pages/patientInspectLog/components/patientInspectLogListFilter.vue

@@ -4,10 +4,10 @@
4 4
       <view class="container_form">
5 5
         <view class="head">
6 6
           <text class="name">状态</text>
7
-          <text class="status">{{searchData.state ? searchData.state.name : ''}}</text>
7
+          <text class="status">{{getStateNames()}}</text>
8 8
         </view>
9 9
         <view class="statusList">
10
-          <view class="statusItem" :class="{ active: searchData.state.id == item.id }" v-for="item in pageData.stateList" :key="item.id" @click="searchData.state = item;">{{item.name}}<text class="newicon newicon-xuanzejiaobiao" v-if="searchData.state.id == item.id"></text></view>
10
+          <view class="statusItem" :class="{ active: item.checked }" v-for="item in searchData.stateList" :key="item.id" @click="item.checked = !item.checked;">{{item.name}}<text class="newicon newicon-xuanzejiaobiao" v-if="item.checked"></text></view>
11 11
         </view>
12 12
         <view class="category" @click="clickPageRouter('department')">
13 13
           <text class="name">科室</text>
@@ -131,22 +131,16 @@
131 131
       }
132 132
     },
133 133
     methods: {
134
+      getStateNames(){
135
+        if(Array.isArray(this.searchData.stateList)){
136
+          return this.searchData.stateList.filter(v => v.checked).map(v => v.name).toString();
137
+        }else{
138
+          return '';
139
+        }
140
+      },
134 141
       // 获取状态列表
135 142
       getStateList(){
136
-        let postData = {
137
-          "type": "list",
138
-          "key": "patient_inspect_state",
139
-        };
140
-        post("/common/common/getDictionary", postData).then(res => {
141
-          this.pageData.stateList = res || [];
142
-          if(this.evt.state.id){
143
-            this.searchData.state = this.evt.state;
144
-          }else{
145
-            // 默认出科陪检中
146
-            let state4 = this.pageData.stateList.find(v => v.value == 4);
147
-            this.searchData.state = state4 || {};
148
-          }
149
-        })
143
+        this.searchData.stateList = this.evt.stateList || [];
150 144
       },
151 145
       departmentInput(event) {
152 146
           this.departmentKeyWord = event.detail.value;
@@ -182,8 +176,9 @@
182 176
           this.searchData.inspectUser = {id: 0, name: '全部'};
183 177
         }
184 178
         this.searchData.department = {id: 0, dept: '全部'};
185
-        let state4 = this.pageData.stateList.find(v => v.value == 4);
186
-        this.searchData.state = state4 || {};
179
+        this.searchData.stateList.forEach(v => {
180
+          v.checked = v.value == 4;
181
+        });
187 182
       },
188 183
       // 确认
189 184
       confirm(){
@@ -206,16 +201,19 @@
206 201
       },
207 202
       // 点击科室
208 203
       clickDepartment(department){
204
+        this.departmentKeyWord = '';
209 205
         this.pageData.pageRouter = 'default';
210 206
         this.searchData.department = department;
211 207
       },
212 208
       // 点击签到人
213 209
       clickSignUser(signUser){
210
+        this.signUserKeyWord = '';
214 211
         this.pageData.pageRouter = 'default';
215 212
         this.searchData.signUser = signUser;
216 213
       },
217 214
       // 点击出科陪检人
218 215
       clickInspectUser(inspectUser){
216
+        this.inspectUserKeyWord = '';
219 217
         this.pageData.pageRouter = 'default';
220 218
         this.searchData.inspectUser = inspectUser;
221 219
       },

+ 3 - 195
pages/patientInspectLog/patientInspectLogDetail.vue

@@ -46,7 +46,7 @@
46 46
           </view>
47 47
           <view class="deital_item">
48 48
             <text class="name">携带设备:</text>
49
-            <text class="value">{{dataInfo.patientInspectLogData.goodsNames}}</text>
49
+            <text class="value">{{dataInfo.patientInspectLogData.goodsList | filterNames('name')}}</text>
50 50
           </view>
51 51
           <view class="deital_item">
52 52
             <text class="name">出科时间:</text>
@@ -54,7 +54,7 @@
54 54
           </view>
55 55
           <view class="deital_item">
56 56
             <text class="name">出科人:</text>
57
-            <text class="value">{{dataInfo.patientInspectLogData.backDeptUserDTO ? dataInfo.patientInspectLogData.backDeptUserDTO.name : ''}}</text>
57
+            <text class="value">{{dataInfo.patientInspectLogData.outDeptUserDTO ? dataInfo.patientInspectLogData.outDeptUserDTO.name : ''}}</text>
58 58
           </view>
59 59
         </view>
60 60
         
@@ -121,7 +121,7 @@
121 121
     </scroll-view>
122 122
     <view class="foot_common_btns">
123 123
       <button @click="toList()" type="default" class="primaryButton btn">返回</button>
124
-      <button v-if="dataInfo.patientInspectLogData.state.value === '4'" @click="tagClick(dataInfo.patientInspectLogData)" type="default" class="primaryButton btn">标记回科</button>
124
+      <button v-if="dataInfo.patientInspectLogData.state && dataInfo.patientInspectLogData.state.value === '4'" @click="tagClick(dataInfo.patientInspectLogData)" type="default" class="primaryButton btn">标记回科</button>
125 125
     </view>
126 126
     <!-- 弹窗 -->
127 127
     <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content" @ok="ok" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
@@ -276,9 +276,7 @@
276 276
          if(res.status == 200){
277 277
            this.dataInfo.patientInspectLogData = res.data || {};
278 278
            this.dataInfo.logList = this.dataInfo.patientInspectLogData.logList || [];
279
-           
280 279
            this.dataInfo.tabActiveValue = this.dataInfo.tabs[0].value;
281
-           console.log(this.dataInfo.tabActiveValue)
282 280
            this.initData()
283 281
          }else{
284 282
            uni.showToast({
@@ -300,196 +298,6 @@
300 298
       this.getDetail();
301 299
     }
302 300
   }
303
- //  import chunk from 'lodash-es/chunk'
304
- //  import { ref, reactive } from 'vue'
305
- //  import { onLoad } from '@dcloudio/uni-app'
306
- //  import { api_listAttachment, api_inspectionTaskDetail, api_inspectionFormValues } from "@/http/api.js"
307
- //  import { defaultColor } from '@/static/js/theme.js'
308
- //  import { useSetTitle } from '@/share/useSetTitle.js'
309
- //  import { filterFormatDate } from '@/filters/filterFormatDate.js'
310
-
311
- //  useSetTitle();
312
- //  const { formatDate }  = filterFormatDate();
313
-
314
- //  // 主题颜色
315
- //  const primaryColor = ref(defaultColor)
316
-	
317
- //  // 数据
318
- //  const dataInfo = reactive({
319
- //    tabs: [
320
- //      {id: 1, name: '基础信息', value: '1', num: ''},
321
- //      // {id: 2, name: '巡检信息', value: '2', num: ''},
322
- //      {id: 3, name: '流程图', value: '3', num: ''},
323
- //    ],
324
- //    tabActiveValue: 0,//当前选择的tab
325
- //    patientInspectLogId: undefined,//巡检执行ID
326
- //    patientInspectLogData: {},//巡检执行对象
327
- //    inspectionTaskImgs: [],//巡检图片
328
- //    valueList: [],//巡检信息
329
- //    logList: [],//流程图
330
- //  })
331
-  
332
- //  function getValuex(value){
333
- //    return value.formItemConfigList ? value.formItemConfigList.map(v => v.valuex).toString() : value.valuex;
334
- //  }
335
-
336
- //  // 获取巡检信息
337
- //  function getValue(){
338
- //    uni.showLoading({
339
- //      title: "加载中",
340
- //      mask: true,
341
- //    });
342
- //    let postData = {
343
- //        "idx": 0,
344
- //        "sum": 9999,
345
- //        "inspectionFormValues": {
346
- //          taskId: dataInfo.patientInspectLogId,
347
- //        }
348
- //    };
349
- //    api_inspectionFormValues(postData).then(res => {
350
- //      uni.hideLoading();
351
- //      if(res.status == 200){
352
- //        let valueList = res.list || [];
353
- //        let imgFlag = valueList.some(v => v.inspectionFormItemDTO.type.value == 7);
354
-
355
- //        if(imgFlag){
356
- //          valueList.forEach(v => {
357
- //            if(v.inspectionFormItemDTO.type.value == 7){
358
- //              v.valuex = [];
359
- //            }
360
- //          })
361
- //        }
362
-
363
- //        dataInfo.valueList = chunk(valueList, 3);
364
-
365
- //        if(imgFlag){
366
- //          getInspectionImgs();
367
- //        }
368
- //      }else{
369
- //        uni.showToast({
370
- //          icon: 'none',
371
- //          title: res.msg || '请求数据失败!'
372
- //        });
373
- //      }
374
- //    })
375
- //  }
376
-
377
- //  // 预览图片
378
- //  function previewImg(index, type, imgList){
379
- //    uni.previewImage({
380
- //      current: index,
381
- //      urls: imgList.map(v => v.previewUrl),
382
- //      longPressActions: {
383
- //        itemList: ['发送给朋友', '保存图片', '收藏'],
384
- //        success: function(data) {
385
- //          console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
386
- //        },
387
- //        fail: function(err) {
388
- //          console.log(err.errMsg);
389
- //        }
390
- //      }
391
- //    });
392
- //  }
393
-
394
- //  // 初始化表单
395
- //  function initData(){
396
- //    if(dataInfo.tabActiveValue === '1'){
397
-      
398
- //    }else if(dataInfo.tabActiveValue === '2'){
399
- //      getValue();
400
- //    }else if(dataInfo.tabActiveValue === '3'){
401
-      
402
- //    }
403
- //  }
404
-
405
- //  // 点击tab
406
- //  function clickTab(tabValue){
407
- //    if(dataInfo.tabActiveValue == tabValue){
408
- //      return;
409
- //    }
410
- //    dataInfo.tabActiveValue = tabValue;
411
- //    initData()
412
- //  }
413
-
414
- //  // 获取巡检执行详情
415
- //  function getDetail(){
416
- //    uni.showLoading({
417
- //      title: "加载中",
418
- //      mask: true,
419
- //    });
420
-
421
- //    api_inspectionTaskDetail(dataInfo.patientInspectLogId).then(res => {
422
- //      uni.hideLoading();
423
- //      if(res.status == 200){
424
- //        dataInfo.patientInspectLogData = res.data || {};
425
- //        dataInfo.logList = dataInfo.patientInspectLogData.logList || [];
426
-        
427
- //        // 巡检信息
428
- //        if(dataInfo.patientInspectLogData.status.value === '2'){
429
- //          let flag = dataInfo.tabs.some(v => v.value === '2');
430
- //          !flag && dataInfo.tabs.splice(1, 0, {id: 2, name: '巡检信息', value: '2', num: ''});
431
- //        }
432
-        
433
- //        dataInfo.tabActiveValue = dataInfo.tabs[0].value;
434
- //        initData()
435
- //      }else{
436
- //        uni.showToast({
437
- //          icon: 'none',
438
- //          title: res.msg || '请求数据失败!'
439
- //        });
440
- //      }
441
- //    })
442
- //  }
443
-	
444
- //  // 获取巡检图片
445
- //  function getInspectionImgs(){
446
- //    uni.showLoading({
447
- //      title: "加载中",
448
- //      mask: true,
449
- //    });
450
- //    api_listAttachment('inspection', dataInfo.patientInspectLogId).then(res => {
451
- //      uni.hideLoading();
452
- //      res.data = res.data || [];
453
- //      res.data.forEach(v => {
454
- //        v.previewUrl = location.origin + "/file" + v.relativeFilePath;
455
- //        v.thumbFilePath = location.origin + "/file" + v.thumbFilePath;
456
- //      })
457
-      
458
- //      let imgList = res.data || [];
459
- //      dataInfo.valueList.forEach(v => {
460
- //        v.forEach(vv => {
461
- //          imgList.forEach(item => {
462
- //            if(vv.itemId == item.recordId){
463
- //              if(vv.valuex && vv.valuex.length){
464
- //                vv.valuex.push(item)
465
- //              }else{
466
- //                vv.valuex = [item];
467
- //              }
468
- //            }
469
- //          })
470
- //        })
471
- //      })
472
- //    })
473
- //  }
474
-
475
- //  // 返回巡检列表
476
- //  function toList(){
477
- //    uni.reLaunch({
478
- //      url: `/pages/inspection/inspectionExecute/inspectionExecute`
479
- //    })
480
- //  }
481
-  
482
- //  // 查看故障单
483
- //  function viewIncidentDetail(incidentId){
484
- //    uni.navigateTo({
485
- //      url: `/pages/incidentDetail/incidentDetail?incidentId=${incidentId}`
486
- //    })
487
- //  }
488
-
489
- //  onLoad((option) => {
490
- //    dataInfo.patientInspectLogId = option.patientInspectLogId;
491
-	// 	getDetail();
492
- //  })
493 301
 </script>
494 302
 
495 303
 <style lang="scss" scoped>

+ 34 - 9
pages/patientInspectLog/patientInspectLogList.vue

@@ -20,7 +20,7 @@
20 20
         <view class="body_item_content">
21 21
           <view class="body_item_content_p">
22 22
             <text class="name ellipsis">住院号:{{data.patientCode}}</text>
23
-            <text>{{(data.patientDTO && data.patientDTO.gender) ? data.patientDTO.gender.name : ''}}<text v-if="data.age !== undefined" class="ml24">{{data.age}}</text></text>
23
+            <text>{{(data.patientDTO && data.patientDTO.gender) ? data.patientDTO.gender.name : ''}}<text v-if="data.age !== undefined" class="ml24">{{data.age}}<text v-if="data.age !== undefined">岁</text></text></text>
24 24
           </view>
25 25
           <view class="body_item_content_p">
26 26
             <text class="name ellipsis">患者科室:{{ data.deptDTO ? data.deptDTO.dept : '' }}</text>
@@ -88,12 +88,32 @@
88 88
             signUser: {id: 0, name: '全部'},
89 89
             inspectUser: {id: 0, name: '全部'},
90 90
             department: {id: 0, dept: '全部'},
91
-            state: {},
91
+            stateList: [],
92 92
           },//筛选框数据
93 93
         }
94 94
       }
95 95
     },
96 96
     methods: {
97
+      // 获取状态列表
98
+      getStateList(isStorage = false){
99
+        let postData = {
100
+          "type": "list",
101
+          "key": "patient_inspect_state",
102
+        };
103
+        post("/common/common/getDictionary", postData).then(res => {
104
+          let stateList = res || [];
105
+          
106
+          if(isStorage){
107
+            this.dataInfo.evtFilter = uni.getStorageSync('patientInspectLogEvtFilter');
108
+            this.dataInfo.tabActiveId = +uni.getStorageSync('patientInspectLogTabActiveId');
109
+          }else{
110
+            // 默认出科陪检中
111
+            this.dataInfo.evtFilter.stateList = stateList.map(v => ({...v, checked: v.value == 4}));
112
+          }
113
+          
114
+          this.getList(0);
115
+        })
116
+      },
97 117
       // 扫一扫
98 118
       scan(isFlag = false) {
99 119
         if (!this.SMFlag) {
@@ -146,12 +166,12 @@
146 166
         });
147 167
       },
148 168
       // 初始化
149
-      onLoadFn(){
150
-        this.getTabs();
169
+      onLoadFn(isStorage = false){
170
+        this.getTabs(isStorage);
151 171
       },
152 172
       // 获取tab选项
153
-      getTabs(){
154
-        this.getList(0);
173
+      getTabs(isStorage = false){
174
+        this.getStateList(isStorage);
155 175
       },
156 176
       // 获取列表信息
157 177
       getList(idx){
@@ -200,8 +220,11 @@
200 220
           postData.patientInspectLog.deptId = this.dataInfo.evtFilter.department.id;
201 221
         }
202 222
         
203
-        if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.state && this.dataInfo.evtFilter.state.id){
204
-          postData.patientInspectLog.state = this.dataInfo.evtFilter.state;
223
+        if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.stateList && this.dataInfo.evtFilter.stateList.length){
224
+          let values = this.dataInfo.evtFilter.stateList.filter(v => v.checked).map(v => v.value).toString();
225
+          postData.patientInspectLog.state = values ? {
226
+            value: values
227
+          } : undefined;
205 228
         }
206 229
       
207 230
         post("/simple/data/fetchDataList/patientInspectLog", postData).then(res => {
@@ -297,6 +320,8 @@
297 320
       },
298 321
       // 确认筛选
299 322
       conformFilter(evtFilter){
323
+        uni.setStorageSync('patientInspectLogEvtFilter', evtFilter);//缓存
324
+        uni.setStorageSync('patientInspectLogTabActiveId', this.dataInfo.tabActiveId);//缓存
300 325
         this.dataInfo.evtFilter = evtFilter;
301 326
         this.dataInfo.isFilter = false;
302 327
         this.getList(0);
@@ -307,7 +332,7 @@
307 332
       },
308 333
     },
309 334
     onLoad(options){
310
-      this.onLoadFn();
335
+      this.onLoadFn(uni.getStorageSync('patientInspectLogEvtFilter') && uni.getStorageSync('patientInspectLogTabActiveId'));
311 336
     },
312 337
     onTabItemTap(){
313 338
       this.onLoadFn();

+ 2 - 0
pages/receiptpage/receiptpage.vue

@@ -2231,6 +2231,8 @@
2231 2231
             url: "/pages/transferWorkOrder/transferWorkOrderUser",
2232 2232
           });
2233 2233
         } else if (e.item.text === "陪检闭环") {
2234
+          uni.removeStorageSync('patientInspectLogEvtFilter');//清除缓存
2235
+          uni.removeStorageSync('patientInspectLogTabActiveId');//清除缓存
2234 2236
           uni.navigateTo({
2235 2237
             url: "/pages/patientInspectLog/patientInspectLogList",
2236 2238
           });