Browse Source

送回病房增加选择陪检方式

seimin 2 years ago
parent
commit
cffd4a43c4
3 changed files with 227 additions and 104 deletions
  1. 1 1
      main.js
  2. 100 35
      pages/patientInformationList/patientInformationList.vue
  3. 126 68
      pages/scanning_ins/scanning_ins.vue

+ 1 - 1
main.js

@@ -4,7 +4,7 @@ import App from './App'
4 4
 import wx from 'weixin-jsapi'
5 5
 // import VConsole from 'vconsole';
6 6
 // new VConsole();
7
-console.info('v2.4.20');
7
+console.info('v2.4.21');
8 8
 Vue.prototype.wx = wx //声明扫码
9 9
 Vue.prototype.audios = [] //待播放的语音集合
10 10
 // #endif

+ 100 - 35
pages/patientInformationList/patientInformationList.vue

@@ -73,6 +73,11 @@
73 73
     <!-- 送回病房建单弹窗-扫描科室 -->
74 74
     <showModel :title="models3.title" :icon="models3.icon" :disjunctor="models3.disjunctor" :content="models3.content"
75 75
       :operate="models3.operate" @ok="ok3" @cancel="cancel3"></showModel>
76
+    <!-- 弹窗 -->
77
+    <showModel :title="models4.title" :icon="models4.icon" :disjunctor="models4.disjunctor"
78
+      :radioInspectionDistanceItem="models4.radioInspectionDistanceItem" @ok="ok4" @cancel="cancel4"
79
+      @radioChange="radioChange4" :operate="models4.operate">
80
+    </showModel>
76 81
   </view>
77 82
 </template>
78 83
 <script>
@@ -87,6 +92,11 @@
87 92
   export default {
88 93
     data() {
89 94
       return {
95
+        selectRadio: [], //单选框选中的数据,第一项是qrcode,第二项是名称
96
+        // 单选框弹窗model
97
+        models4: {
98
+          disjunctor: false,
99
+        },
90 100
         SMFlag:true,
91 101
         hosId: uni.getStorageSync("userData").user.currentHospital.id,
92 102
         // 选中的患者项
@@ -127,41 +137,71 @@
127 137
       bigScreen,
128 138
     },
129 139
     methods: {
130
-      ok2() {
131
-        console.log(this.options)
132
-        this.models2.disjunctor = false;
133
-        let currentItem = JSON.parse(this.options.currentItem);
140
+      // 获取是否需要选择陪检方式
141
+      getInspectAndPatientTransformSend() {
142
+        const postData = {
143
+          "idx": 0,
144
+          "sum": 1,
145
+          "taskTypeConfig": {
146
+            "taskTypeDTO": {
147
+              "hosId": {
148
+                "id": this.hosId
149
+              },
150
+              "associationType": {
151
+                "key": "association_types",
152
+                "value": "inspect",
153
+              },
154
+            },
155
+          },
156
+        };
134 157
         uni.showLoading({
135 158
           mask: true,
136 159
           title: '加载中'
137 160
         })
138
-        let userId = uni.getStorageSync("userData").user.id;
139
-        let postData = {
140
-          "workOrder": {
141
-            sourceId: 4,
142
-            "hosId": this.hosId,
143
-            "startDept": {
144
-              "id": this.options.did
145
-            },
146
-            "createDept": this.options.did,
147
-            "patient": {
148
-              "patientCode": this.currentItem.patientCode
149
-            },
150
-            "worker": {
151
-              "id": userId
152
-            }
153
-          }
154
-        };
155
-        console.log(postData)
156
-        // return;
157
-        post("/workerOrder/returnSickRoom", postData).then((res) => {
158
-          uni.hideLoading();
161
+        post("/simple/data/fetchDataList/taskTypeConfig", postData).then((res) => {
162
+          console.log(res)
159 163
           if (res.status == 200) {
160
-            uni.showToast({
161
-              icon: 'success',
162
-              title: '建单成功',
163
-            });
164
+            res.list = res.list || [];
165
+            if (res.list[0].signTypeIds) {
166
+              // 如果开启
167
+              const postData = {
168
+                "idx": 0,
169
+                "sum": 9999,
170
+                "workOrderInspectScore": {
171
+                  "hosId": this.hosId,
172
+                },
173
+              };
174
+              post("/simple/data/fetchDataList/workOrderInspectScore", postData).then((res) => {
175
+                console.log(res)
176
+                uni.hideLoading();
177
+                if (res.status == 200) {
178
+                  res.list = res.list || [];
179
+                  let radioInspectionDistanceItem = res.list.map(v => ({
180
+                    id: v.id + "__" + v.inspectMode,
181
+                    inspectMode: v.inspectMode
182
+                  }));
183
+                  this.models4 = {
184
+                    disjunctor: true,
185
+                    title: "请选择陪检方式",
186
+                    radioInspectionDistanceItem,
187
+                    icon: "",
188
+                    operate: {
189
+                      ok: "确定",
190
+                      cancel: "取消",
191
+                    },
192
+                  };
193
+                } else {
194
+                  uni.showToast({
195
+                    icon: "none",
196
+                    title: "请求失败!",
197
+                  });
198
+                }
199
+              })
200
+            } else {
201
+              this.ok3Result();
202
+            }
164 203
           } else {
204
+            uni.hideLoading();
165 205
             uni.showToast({
166 206
               icon: "none",
167 207
               title: "请求失败!",
@@ -169,12 +209,32 @@
169 209
           }
170 210
         })
171 211
       },
212
+      // 选中单选框
213
+      radioChange4(item) {
214
+        console.log(item);
215
+        this.selectRadio = item.split("__");
216
+      },
217
+      // 确定
218
+      ok4() {
219
+        console.log(this.selectRadio);
220
+        if (!this.selectRadio.length) {
221
+          return;
222
+        }
223
+        this.models4.disjunctor = false;
224
+        this.ok3Result();
225
+      },
226
+      cancel4() {
227
+        this.models4.disjunctor = false;
228
+      },
229
+      ok2() {
230
+        this.models2.disjunctor = false;
231
+        this.getInspectAndPatientTransformSend();
232
+      },
172 233
       cancel2() {
173 234
         this.models2.disjunctor = false;
174 235
       },
175
-      ok3() {
236
+      ok3Result() {
176 237
         console.log(this.currentItem)
177
-        this.models3.disjunctor = false;
178 238
         uni.showLoading({
179 239
           mask: true,
180 240
           title: '加载中'
@@ -185,16 +245,17 @@
185 245
             sourceId: 4,
186 246
             "hosId": this.hosId,
187 247
             "startDept": {
188
-              "id": this.currentStartDept.id
248
+              "id": this.options.did || this.currentStartDept.id
189 249
             },
190
-            "createDept": this.currentStartDept.id,
250
+            "createDept": this.options.did || this.currentStartDept.id,
191 251
             "patient": {
192 252
               "patientCode": this.currentItem.patientCode
193 253
             },
194 254
             "worker": {
195 255
               "id": userId
196
-            }
197
-          }
256
+            },
257
+          },
258
+          "inspectMode": this.selectRadio.length > 0 ? this.selectRadio[0] : undefined,
198 259
         };
199 260
         console.log(postData);
200 261
         // return;
@@ -213,6 +274,10 @@
213 274
           }
214 275
         })
215 276
       },
277
+      ok3() {
278
+        this.models3.disjunctor = false;
279
+        this.getInspectAndPatientTransformSend();
280
+      },
216 281
       cancel3() {
217 282
         this.models3.disjunctor = false;
218 283
       },

+ 126 - 68
pages/scanning_ins/scanning_ins.vue

@@ -236,7 +236,8 @@
236 236
       :operate="models3.operate" @ok="ok3" @cancel="cancel3"></showModel>
237 237
     <!-- 弹窗 -->
238 238
     <showModel :title="models4.title" :icon="models4.icon" :disjunctor="models4.disjunctor"
239
-      :radioInspectionDistanceItem="models4.radioInspectionDistanceItem" @ok="ok4" @cancel="cancel4" @radioChange="radioChange4" :operate="models4.operate">
239
+      :radioInspectionDistanceItem="models4.radioInspectionDistanceItem" @ok="ok4" @cancel="cancel4"
240
+      @radioChange="radioChange4" :operate="models4.operate">
240 241
     </showModel>
241 242
   </view>
242 243
 </template>
@@ -251,13 +252,14 @@
251 252
   export default {
252 253
     data() {
253 254
       return {
255
+        isInspectAndPatientTransform: false, //是否是一键操作
254 256
         selectRadio: [], //单选框选中的数据,第一项是qrcode,第二项是名称
255 257
         // 单选框弹窗model1
256 258
         models4: {
257 259
           disjunctor: false,
258 260
         },
259 261
         currentCode: '', //当前小扫描的科室二维码
260
-        SMFlag:true,
262
+        SMFlag: true,
261 263
         options: {},
262 264
         // wechatFocusSwitch: 0,
263 265
         hosId: "",
@@ -296,18 +298,94 @@
296 298
     },
297 299
     methods: {
298 300
       // 获取是否需要选择陪检方式
299
-      getInspectAndPatientTransform(){
301
+      getInspectAndPatientTransformSend() {
302
+        let infoDATA = JSON.parse(this.options.infoDATA);
303
+        const postData = {
304
+          "idx": 0,
305
+          "sum": 1,
306
+          "taskTypeConfig": {
307
+            "taskTypeDTO": {
308
+              "hosId": {
309
+                "id": this.hosId
310
+              },
311
+              "associationType": {
312
+                "key": "association_types",
313
+                "value": "inspect",
314
+              },
315
+            },
316
+          },
317
+        };
318
+        uni.showLoading({
319
+          mask: true,
320
+          title: '加载中'
321
+        })
322
+        post("/simple/data/fetchDataList/taskTypeConfig", postData).then((res) => {
323
+          console.log(res)
324
+          if (res.status == 200) {
325
+            res.list = res.list || [];
326
+            if (res.list[0].signTypeIds) {
327
+              // 如果开启
328
+              const postData = {
329
+                "idx": 0,
330
+                "sum": 9999,
331
+                "workOrderInspectScore": {
332
+                  "hosId": this.hosId,
333
+                },
334
+              };
335
+              post("/simple/data/fetchDataList/workOrderInspectScore", postData).then((res) => {
336
+                console.log(res)
337
+                uni.hideLoading();
338
+                if (res.status == 200) {
339
+                  res.list = res.list || [];
340
+                  let radioInspectionDistanceItem = res.list.map(v => ({
341
+                    id: v.id + "__" + v.inspectMode,
342
+                    inspectMode: v.inspectMode
343
+                  }));
344
+                  this.models4 = {
345
+                    disjunctor: true,
346
+                    title: "请选择陪检方式",
347
+                    radioInspectionDistanceItem,
348
+                    icon: "",
349
+                    operate: {
350
+                      ok: "确定",
351
+                      cancel: "取消",
352
+                    },
353
+                  };
354
+                } else {
355
+                  uni.showToast({
356
+                    icon: "none",
357
+                    title: "请求失败!",
358
+                  });
359
+                }
360
+              })
361
+            } else {
362
+              this.ok3Result();
363
+            }
364
+          } else {
365
+            uni.hideLoading();
366
+            uni.showToast({
367
+              icon: "none",
368
+              title: "请求失败!",
369
+            });
370
+          }
371
+        })
372
+      },
373
+      // 获取是否需要选择陪检方式
374
+      getInspectAndPatientTransform() {
375
+        this.isInspectAndPatientTransform = true;
300 376
         console.log(this.typeData);
301
-        if(this.typeData){
377
+        if (this.typeData) {
302 378
           const postData = {
303
-            "idx":0,
304
-            "sum":1,
305
-            "taskTypeConfig":{
306
-              "taskTypeDTO":{
307
-                "hosId": {"id": this.hosId},
379
+            "idx": 0,
380
+            "sum": 1,
381
+            "taskTypeConfig": {
382
+              "taskTypeDTO": {
383
+                "hosId": {
384
+                  "id": this.hosId
385
+                },
308 386
                 "associationType": {
309 387
                   "key": "association_types",
310
-                  "value":"inspect",
388
+                  "value": "inspect",
311 389
                 },
312 390
               },
313 391
             },
@@ -320,12 +398,12 @@
320 398
             console.log(res)
321 399
             if (res.status == 200) {
322 400
               res.list = res.list || [];
323
-              if(res.list[0].signTypeIds && this.typeData.gdState.value == 4){
401
+              if (res.list[0].signTypeIds && this.typeData.gdState.value == 4) {
324 402
                 // 如果开启并且工单状态是待到达
325 403
                 const postData = {
326
-                  "idx":0,
327
-                  "sum":9999,
328
-                  "workOrderInspectScore":{
404
+                  "idx": 0,
405
+                  "sum": 9999,
406
+                  "workOrderInspectScore": {
329 407
                     "hosId": this.hosId,
330 408
                   },
331 409
                 };
@@ -334,7 +412,10 @@
334 412
                   uni.hideLoading();
335 413
                   if (res.status == 200) {
336 414
                     res.list = res.list || [];
337
-                    let radioInspectionDistanceItem = res.list.map(v => ({id: v.id + "__" + v.inspectMode, inspectMode: v.inspectMode}));
415
+                    let radioInspectionDistanceItem = res.list.map(v => ({
416
+                      id: v.id + "__" + v.inspectMode,
417
+                      inspectMode: v.inspectMode
418
+                    }));
338 419
                     this.models4 = {
339 420
                       disjunctor: true,
340 421
                       title: "请选择陪检方式",
@@ -352,7 +433,7 @@
352 433
                     });
353 434
                   }
354 435
                 })
355
-              }else{
436
+              } else {
356 437
                 this.allStart(this.typeData);
357 438
               }
358 439
             } else {
@@ -363,7 +444,7 @@
363 444
               });
364 445
             }
365 446
           })
366
-        }else{
447
+        } else {
367 448
           this.models = {
368 449
             disjunctor: true,
369 450
             content: "请选择工单",
@@ -386,55 +467,24 @@
386 467
           return;
387 468
         }
388 469
         this.models4.disjunctor = false;
389
-        this.allStart(this.typeData);
470
+        // 判断是一键操作还是送回病房
471
+        if(this.isInspectAndPatientTransform){
472
+          this.allStart(this.typeData);
473
+        }else{
474
+          this.ok3Result();
475
+        }
390 476
       },
391 477
       cancel4() {
392 478
         this.models4.disjunctor = false;
393 479
       },
394 480
       ok2() {
395 481
         this.models2.disjunctor = false;
396
-        uni.showLoading({
397
-          mask: true,
398
-          title: '加载中'
399
-        })
400
-        let userId = uni.getStorageSync("userData").user.id;
401
-        let postData = {
402
-          "workOrder": {
403
-            sourceId: 4,
404
-            "hosId": this.hosId,
405
-            "startDept": {
406
-              "id": this.options.id
407
-            },
408
-            "createDept": this.options.id,
409
-            "patient": {
410
-              "patientCode": this.infoDATA.patientCode
411
-            },
412
-            "worker": {
413
-              "id": userId
414
-            }
415
-          }
416
-        };
417
-        post("/workerOrder/returnSickRoom", postData).then((res) => {
418
-          console.log(res)
419
-          uni.hideLoading();
420
-          if (res.status == 200) {
421
-            uni.showToast({
422
-              icon: 'success',
423
-              title: '建单成功',
424
-            });
425
-          } else {
426
-            uni.showToast({
427
-              icon: "none",
428
-              title: "请求失败!",
429
-            });
430
-          }
431
-        })
482
+        this.getInspectAndPatientTransformSend();
432 483
       },
433 484
       cancel2() {
434 485
         this.models2.disjunctor = false;
435 486
       },
436
-      ok3() {
437
-        this.models3.disjunctor = false;
487
+      ok3Result() {
438 488
         uni.showLoading({
439 489
           mask: true,
440 490
           title: '加载中'
@@ -445,16 +495,17 @@
445 495
             sourceId: 4,
446 496
             "hosId": this.hosId,
447 497
             "startDept": {
448
-              "id": this.currentStartDept.id
498
+              "id": this.options.id || this.currentStartDept.id
449 499
             },
450
-            "createDept": this.currentStartDept.id,
500
+            "createDept": this.options.id || this.currentStartDept.id,
451 501
             "patient": {
452 502
               "patientCode": this.infoDATA.patientCode
453 503
             },
454 504
             "worker": {
455 505
               "id": userId
456
-            }
457
-          }
506
+            },
507
+          },
508
+          "inspectMode": this.selectRadio.length > 0 ? this.selectRadio[0] : undefined,
458 509
         };
459 510
         post("/workerOrder/returnSickRoom", postData).then((res) => {
460 511
           console.log(res)
@@ -472,6 +523,10 @@
472 523
           }
473 524
         })
474 525
       },
526
+      ok3() {
527
+        this.models3.disjunctor = false;
528
+        this.getInspectAndPatientTransformSend();
529
+      },
475 530
       cancel3() {
476 531
         this.models3.disjunctor = false;
477 532
       },
@@ -491,6 +546,7 @@
491 546
       },
492 547
       // 送回病房-扫描科室
493 548
       scanDept() {
549
+        this.isInspectAndPatientTransform = false;
494 550
         if (!this.SMFlag) {
495 551
           return;
496 552
         }
@@ -525,8 +581,8 @@
525 581
                 post("/data/fetchDataList/department", postData).then((res) => {
526 582
                   uni.hideLoading();
527 583
                   if (res.status == 200) {
528
-                    if(res.totalNum > 0){
529
-                      this.currentStartDept = res.list[0]; //baba
584
+                    if (res.totalNum > 0) {
585
+                      this.currentStartDept = res.list[0];
530 586
                       this.models3 = {
531 587
                         disjunctor: true,
532 588
                         title: "提示",
@@ -536,8 +592,8 @@
536 592
                           ok: "确认建单",
537 593
                           cancel: "取消",
538 594
                         },
539
-                      };
540
-                    }else{
595
+                      };                      
596
+                    } else {
541 597
                       uni.hideLoading();
542 598
                       uni.showToast({
543 599
                         icon: "none",
@@ -561,7 +617,7 @@
561 617
               });
562 618
             }
563 619
           });
564
-        }).catch(err=>{
620
+        }).catch(err => {
565 621
           this.SMFlag = true;
566 622
         });
567 623
       },
@@ -696,7 +752,9 @@
696 752
                     var ids = [];
697 753
                     ids.push(data.id);
698 754
                     type = "orderSign/" + ress;
699
-                    list = {ids};
755
+                    list = {
756
+                      ids
757
+                    };
700 758
                     // 科室签到
701 759
                     post("/workerOrder/" + type, list).then((res) => {
702 760
                       uni.hideLoading();
@@ -730,7 +788,7 @@
730 788
                 }
731 789
               });
732 790
               // ------------------------------
733
-            }).catch(err=>{
791
+            }).catch(err => {
734 792
               this.SMFlag = true;
735 793
             });
736 794
           } else {
@@ -860,7 +918,7 @@
860 918
         this.patientOrders = JSON.parse(options.patientOrders);
861 919
       }
862 920
       this.code = options.code;
863
-      
921
+
864 922
       // #ifdef APP-PLUS
865 923
       webHandle("no", "app");
866 924
       // #endif