浏览代码

支助人员建送患者回病房单时需要扫描科室码

seimin 3 年之前
父节点
当前提交
59dcf9d23a
共有 2 个文件被更改,包括 247 次插入6 次删除
  1. 121 1
      pages/patientInformationList/patientInformationList.vue
  2. 126 5
      pages/scanning_ins/scanning_ins.vue

+ 121 - 1
pages/patientInformationList/patientInformationList.vue

@@ -44,7 +44,7 @@
44
               </view>
44
               </view>
45
               <view class="send_wrap">
45
               <view class="send_wrap">
46
                 <view class="sendBack">
46
                 <view class="sendBack">
47
-                  <button @click="sendBack(item)">送回病房</button>
47
+                  <button @click="scanDept(item)">送回病房</button>
48
                 </view>
48
                 </view>
49
               </view>
49
               </view>
50
             </view>
50
             </view>
@@ -70,6 +70,9 @@
70
     <!-- 送回病房建单弹窗 -->
70
     <!-- 送回病房建单弹窗 -->
71
     <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
71
     <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
72
       :operate="models2.operate" @ok="ok2" @cancel="cancel2"></showModel>
72
       :operate="models2.operate" @ok="ok2" @cancel="cancel2"></showModel>
73
+    <!-- 送回病房建单弹窗-扫描科室 -->
74
+    <showModel :title="models3.title" :icon="models3.icon" :disjunctor="models3.disjunctor" :content="models3.content"
75
+      :operate="models3.operate" @ok="ok3" @cancel="cancel3"></showModel>
73
   </view>
76
   </view>
74
 </template>
77
 </template>
75
 <script>
78
 <script>
@@ -77,6 +80,7 @@
77
   import {
80
   import {
78
     get,
81
     get,
79
     post,
82
     post,
83
+    SM,
80
     deleteIt,
84
     deleteIt,
81
     webHandle
85
     webHandle
82
   } from "../../http/http.js";
86
   } from "../../http/http.js";
@@ -94,6 +98,10 @@
94
         models2: {
98
         models2: {
95
           disjunctor: false,
99
           disjunctor: false,
96
         },
100
         },
101
+        // 送回病房建单弹窗model-扫描科室
102
+        models3: {
103
+          disjunctor: false,
104
+        },
97
         scrollYY: 0, //滚动条滚动的距离
105
         scrollYY: 0, //滚动条滚动的距离
98
         options: {},
106
         options: {},
99
         wechatFocusSwitch: 0,
107
         wechatFocusSwitch: 0,
@@ -111,6 +119,7 @@
111
         freshing: false, //上拉加载开关
119
         freshing: false, //上拉加载开关
112
         scroll_top: 0, //距离顶部的距离
120
         scroll_top: 0, //距离顶部的距离
113
         scroll_refresher_enabled: true, //是否开启自定义下拉刷新
121
         scroll_refresher_enabled: true, //是否开启自定义下拉刷新
122
+        currentStartDept: {}, //扫描的起点科室
114
       };
123
       };
115
     },
124
     },
116
     components: {
125
     components: {
@@ -160,6 +169,48 @@
160
       cancel2() {
169
       cancel2() {
161
         this.models2.disjunctor = false;
170
         this.models2.disjunctor = false;
162
       },
171
       },
172
+      ok3() {
173
+        this.models3.disjunctor = false;
174
+        uni.showLoading({
175
+          mask: true,
176
+          title: '加载中'
177
+        })
178
+        let userId = uni.getStorageSync("userData").user.id;
179
+        let postData = {
180
+          "workOrder": {
181
+            sourceId: 4,
182
+            "hosId": this.hosId,
183
+            "startDept": {
184
+              "id": this.currentStartDept.id
185
+            },
186
+            "createDept": this.currentStartDept.id,
187
+            "patient": {
188
+              "patientCode": this.currentItem.patientCode
189
+            },
190
+            "worker": {
191
+              "id": userId
192
+            }
193
+          }
194
+        };
195
+        console.log(postData)
196
+        post("/workerOrder/returnSickRoom", postData).then((res) => {
197
+          uni.hideLoading();
198
+          if (res.status == 200) {
199
+            uni.showToast({
200
+              icon: 'success',
201
+              title: '建单成功',
202
+            });
203
+          } else {
204
+            uni.showToast({
205
+              icon: "none",
206
+              title: "请求失败!",
207
+            });
208
+          }
209
+        })
210
+      },
211
+      cancel3() {
212
+        this.models3.disjunctor = false;
213
+      },
163
       // 送回病房-建单
214
       // 送回病房-建单
164
       sendBuild() {
215
       sendBuild() {
165
         let currentItem = JSON.parse(this.options.currentItem);
216
         let currentItem = JSON.parse(this.options.currentItem);
@@ -174,6 +225,75 @@
174
           },
225
           },
175
         };
226
         };
176
       },
227
       },
228
+      // 送回病房-扫描科室
229
+      scanDept(item) {
230
+        this.currentItem = item;
231
+        let code = "";
232
+        SM().then((ress1) => {
233
+          uni.showLoading({
234
+            title: "加载中",
235
+            mask: true,
236
+          });
237
+          //检验二维码的有效性
238
+          post("/dept/scanning", {
239
+            content: ress1,
240
+          }).then((result) => {
241
+            if (result.state == 200 || result.state == 201) {
242
+              let ress = result.code;
243
+              if (ress) {
244
+                code = ress;
245
+                // 科室扫描
246
+                let postData = {
247
+                  "idx": 0,
248
+                  "sum": 1,
249
+                  "department": {
250
+                    "hospital": {
251
+                      "id": this.hosId
252
+                    },
253
+                    "qrcode": code
254
+                  }
255
+                };
256
+                post("/data/fetchDataList/department", postData).then((res) => {
257
+                  uni.hideLoading();
258
+                  if (res.status == 200) {
259
+                    if (res.totalNum > 0) {
260
+                      this.currentStartDept = res.list[0];
261
+                      this.models3 = {
262
+                        disjunctor: true,
263
+                        title: "提示",
264
+                        content: `您选择的起点科室为【${this.currentStartDept.dept}】,您将从【${this.currentStartDept.dept}】把【${this.currentItem.patientName}】送回【${this.currenDept.dept}】,如您确认请点击“确认建单”。`,
265
+                        icon: "warn",
266
+                        operate: {
267
+                          ok: "确认建单",
268
+                          cancel: "取消",
269
+                        },
270
+                      };
271
+                    } else {
272
+                      uni.hideLoading();
273
+                      uni.showToast({
274
+                        icon: "none",
275
+                        title: "请扫描正确的科室码!",
276
+                      });
277
+                    }
278
+                  } else {
279
+                    uni.hideLoading();
280
+                    uni.showToast({
281
+                      icon: "none",
282
+                      title: "请求失败!",
283
+                    });
284
+                  }
285
+                });
286
+              }
287
+            } else {
288
+              uni.hideLoading();
289
+              uni.showToast({
290
+                icon: "none",
291
+                title: "请求失败!",
292
+              });
293
+            }
294
+          });
295
+        });
296
+      },
177
       // 送回病房-选择起点科室
297
       // 送回病房-选择起点科室
178
       sendBack(item) {
298
       sendBack(item) {
179
         this.currentItem = item;
299
         this.currentItem = item;

+ 126 - 5
pages/scanning_ins/scanning_ins.vue

@@ -20,7 +20,8 @@
20
           </view>
20
           </view>
21
           <view>患者编号 : {{ infoDATA.patientCode || "-" }}</view>
21
           <view>患者编号 : {{ infoDATA.patientCode || "-" }}</view>
22
           <view>住院科室 :
22
           <view>住院科室 :
23
-            {{ infoDATA.department ? infoDATA.department.dept : "-" }}</view>
23
+            {{ infoDATA.department ? infoDATA.department.dept : "-" }}
24
+          </view>
24
         </view>
25
         </view>
25
       </view>
26
       </view>
26
       <!-- ------------------未完成工单 start----------------- -->
27
       <!-- ------------------未完成工单 start----------------- -->
@@ -198,7 +199,7 @@
198
 
199
 
199
       <view class="foot_btn2" v-if="workData && workData.length > 0 && isShow">
200
       <view class="foot_btn2" v-if="workData && workData.length > 0 && isShow">
200
         <view class="btn1" @click="allStart(typeData)">一键操作</view>
201
         <view class="btn1" @click="allStart(typeData)">一键操作</view>
201
-        <view class="btn1" @click="sendBack()">送回病房</view>
202
+        <view class="btn1" @click="scanDept()">送回病房</view>
202
         <view class="btn2" @click="showAlert">知道了</view>
203
         <view class="btn2" @click="showAlert">知道了</view>
203
       </view>
204
       </view>
204
       <view class="foot_btn2" v-if="
205
       <view class="foot_btn2" v-if="
@@ -207,11 +208,11 @@
207
         <view class="btn1" @click="help">{{
208
         <view class="btn1" @click="help">{{
208
           infoDATA.focusPatient == 1 ? "无需帮助" : "需要帮助"
209
           infoDATA.focusPatient == 1 ? "无需帮助" : "需要帮助"
209
         }}</view>
210
         }}</view>
210
-        <view class="btn1" @click="sendBack()">送回病房</view>
211
+        <view class="btn1" @click="scanDept()">送回病房</view>
211
         <view class="btn2" @click="showAlert">知道了</view>
212
         <view class="btn2" @click="showAlert">知道了</view>
212
       </view>
213
       </view>
213
       <view class="foot_btn2" v-if="!isShow">
214
       <view class="foot_btn2" v-if="!isShow">
214
-        <view class="btn1" @click="sendBack()">送回病房</view>
215
+        <view class="btn1" @click="scanDept()">送回病房</view>
215
         <view class="btn2" @click="showAlert">知道了</view>
216
         <view class="btn2" @click="showAlert">知道了</view>
216
       </view>
217
       </view>
217
     </view>
218
     </view>
@@ -224,6 +225,9 @@
224
     <!-- 送回病房建单弹窗 -->
225
     <!-- 送回病房建单弹窗 -->
225
     <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
226
     <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
226
       :operate="models2.operate" @ok="ok2" @cancel="cancel2"></showModel>
227
       :operate="models2.operate" @ok="ok2" @cancel="cancel2"></showModel>
228
+    <!-- 送回病房建单弹窗-扫描科室 -->
229
+    <showModel :title="models3.title" :icon="models3.icon" :disjunctor="models3.disjunctor" :content="models3.content"
230
+      :operate="models3.operate" @ok="ok3" @cancel="cancel3"></showModel>
227
   </view>
231
   </view>
228
 </template>
232
 </template>
229
 <script>
233
 <script>
@@ -252,6 +256,10 @@
252
         models2: {
256
         models2: {
253
           disjunctor: false,
257
           disjunctor: false,
254
         },
258
         },
259
+        // 送回病房建单弹窗model-扫描科室
260
+        models3: {
261
+          disjunctor: false,
262
+        },
255
         infoDATA: {},
263
         infoDATA: {},
256
         workData: [],
264
         workData: [],
257
         patientOrders: [],
265
         patientOrders: [],
@@ -266,6 +274,7 @@
266
         code: "",
274
         code: "",
267
         animationData: {}, //动画
275
         animationData: {}, //动画
268
         isShow: true, //是否显示“一键操作”
276
         isShow: true, //是否显示“一键操作”
277
+        currentStartDept: {}, //扫描的起点科室
269
       };
278
       };
270
     },
279
     },
271
     methods: {
280
     methods: {
@@ -311,6 +320,48 @@
311
       cancel2() {
320
       cancel2() {
312
         this.models2.disjunctor = false;
321
         this.models2.disjunctor = false;
313
       },
322
       },
323
+      ok3() {
324
+        this.models3.disjunctor = false;
325
+        uni.showLoading({
326
+          mask: true,
327
+          title: '加载中'
328
+        })
329
+        let userId = uni.getStorageSync("userData").user.id;
330
+        let postData = {
331
+          "workOrder": {
332
+            sourceId: 4,
333
+            "hosId": this.hosId,
334
+            "startDept": {
335
+              "id": this.currentStartDept.id
336
+            },
337
+            "createDept": this.currentStartDept.id,
338
+            "patient": {
339
+              "patientCode": this.options.code
340
+            },
341
+            "worker": {
342
+              "id": userId
343
+            }
344
+          }
345
+        };
346
+        post("/workerOrder/returnSickRoom", postData).then((res) => {
347
+          console.log(res)
348
+          uni.hideLoading();
349
+          if (res.status == 200) {
350
+            uni.showToast({
351
+              icon: 'success',
352
+              title: '建单成功',
353
+            });
354
+          } else {
355
+            uni.showToast({
356
+              icon: "none",
357
+              title: "请求失败!",
358
+            });
359
+          }
360
+        })
361
+      },
362
+      cancel3() {
363
+        this.models3.disjunctor = false;
364
+      },
314
       // 送回病房-建单
365
       // 送回病房-建单
315
       sendBuild() {
366
       sendBuild() {
316
         let infoDATA = JSON.parse(this.options.infoDATA);
367
         let infoDATA = JSON.parse(this.options.infoDATA);
@@ -325,6 +376,75 @@
325
           },
376
           },
326
         };
377
         };
327
       },
378
       },
379
+      // 送回病房-扫描科室
380
+      scanDept() {
381
+        let infoDATA = JSON.parse(this.options.infoDATA);
382
+        let code = "";
383
+        SM().then((ress1) => {
384
+          uni.showLoading({
385
+            title: "加载中",
386
+            mask: true,
387
+          });
388
+          //检验二维码的有效性
389
+          post("/dept/scanning", {
390
+            content: ress1,
391
+          }).then((result) => {
392
+            if (result.state == 200 || result.state == 201) {
393
+              let ress = result.code;
394
+              if (ress) {
395
+                code = ress;
396
+                // 科室扫描
397
+                let postData = {
398
+                  "idx": 0,
399
+                  "sum": 1,
400
+                  "department": {
401
+                    "hospital": {
402
+                      "id": this.hosId
403
+                    },
404
+                    "qrcode": code
405
+                  }
406
+                };
407
+                post("/data/fetchDataList/department", postData).then((res) => {
408
+                  uni.hideLoading();
409
+                  if (res.status == 200) {
410
+                    if(res.totalNum > 0){
411
+                      this.currentStartDept = res.list[0]; //baba
412
+                      this.models3 = {
413
+                        disjunctor: true,
414
+                        title: "提示",
415
+                        content: `您选择的起点科室为【${this.currentStartDept.dept}】,您将从【${this.currentStartDept.dept}】把【${infoDATA.patientName}】送回【${infoDATA.department.dept}】,如您确认请点击“确认建单”。`,
416
+                        icon: "warn",
417
+                        operate: {
418
+                          ok: "确认建单",
419
+                          cancel: "取消",
420
+                        },
421
+                      };
422
+                    }else{
423
+                      uni.hideLoading();
424
+                      uni.showToast({
425
+                        icon: "none",
426
+                        title: "请扫描正确的科室码!",
427
+                      });
428
+                    }
429
+                  } else {
430
+                    uni.hideLoading();
431
+                    uni.showToast({
432
+                      icon: "none",
433
+                      title: "请求失败!",
434
+                    });
435
+                  }
436
+                });
437
+              }
438
+            } else {
439
+              uni.hideLoading();
440
+              uni.showToast({
441
+                icon: "none",
442
+                title: "请求失败!",
443
+              });
444
+            }
445
+          });
446
+        });
447
+      },
328
       // 送回病房-选择起点科室
448
       // 送回病房-选择起点科室
329
       sendBack() {
449
       sendBack() {
330
         let infoDATA = JSON.parse(this.options.infoDATA);
450
         let infoDATA = JSON.parse(this.options.infoDATA);
@@ -712,7 +832,8 @@
712
             font-size: 48rpx;
832
             font-size: 48rpx;
713
             text-align: center;
833
             text-align: center;
714
           }
834
           }
715
-          .success_tips{
835
+
836
+          .success_tips {
716
             color: red;
837
             color: red;
717
             font-size: 30rpx;
838
             font-size: 30rpx;
718
           }
839
           }