Przeglądaj źródła

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

seimin 3 lat temu
rodzic
commit
59dcf9d23a

+ 121 - 1
pages/patientInformationList/patientInformationList.vue

@@ -44,7 +44,7 @@
44 44
               </view>
45 45
               <view class="send_wrap">
46 46
                 <view class="sendBack">
47
-                  <button @click="sendBack(item)">送回病房</button>
47
+                  <button @click="scanDept(item)">送回病房</button>
48 48
                 </view>
49 49
               </view>
50 50
             </view>
@@ -70,6 +70,9 @@
70 70
     <!-- 送回病房建单弹窗 -->
71 71
     <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
72 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 76
   </view>
74 77
 </template>
75 78
 <script>
@@ -77,6 +80,7 @@
77 80
   import {
78 81
     get,
79 82
     post,
83
+    SM,
80 84
     deleteIt,
81 85
     webHandle
82 86
   } from "../../http/http.js";
@@ -94,6 +98,10 @@
94 98
         models2: {
95 99
           disjunctor: false,
96 100
         },
101
+        // 送回病房建单弹窗model-扫描科室
102
+        models3: {
103
+          disjunctor: false,
104
+        },
97 105
         scrollYY: 0, //滚动条滚动的距离
98 106
         options: {},
99 107
         wechatFocusSwitch: 0,
@@ -111,6 +119,7 @@
111 119
         freshing: false, //上拉加载开关
112 120
         scroll_top: 0, //距离顶部的距离
113 121
         scroll_refresher_enabled: true, //是否开启自定义下拉刷新
122
+        currentStartDept: {}, //扫描的起点科室
114 123
       };
115 124
     },
116 125
     components: {
@@ -160,6 +169,48 @@
160 169
       cancel2() {
161 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 215
       sendBuild() {
165 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 298
       sendBack(item) {
179 299
         this.currentItem = item;

+ 126 - 5
pages/scanning_ins/scanning_ins.vue

@@ -20,7 +20,8 @@
20 20
           </view>
21 21
           <view>患者编号 : {{ infoDATA.patientCode || "-" }}</view>
22 22
           <view>住院科室 :
23
-            {{ infoDATA.department ? infoDATA.department.dept : "-" }}</view>
23
+            {{ infoDATA.department ? infoDATA.department.dept : "-" }}
24
+          </view>
24 25
         </view>
25 26
       </view>
26 27
       <!-- ------------------未完成工单 start----------------- -->
@@ -198,7 +199,7 @@
198 199
 
199 200
       <view class="foot_btn2" v-if="workData && workData.length > 0 && isShow">
200 201
         <view class="btn1" @click="allStart(typeData)">一键操作</view>
201
-        <view class="btn1" @click="sendBack()">送回病房</view>
202
+        <view class="btn1" @click="scanDept()">送回病房</view>
202 203
         <view class="btn2" @click="showAlert">知道了</view>
203 204
       </view>
204 205
       <view class="foot_btn2" v-if="
@@ -207,11 +208,11 @@
207 208
         <view class="btn1" @click="help">{{
208 209
           infoDATA.focusPatient == 1 ? "无需帮助" : "需要帮助"
209 210
         }}</view>
210
-        <view class="btn1" @click="sendBack()">送回病房</view>
211
+        <view class="btn1" @click="scanDept()">送回病房</view>
211 212
         <view class="btn2" @click="showAlert">知道了</view>
212 213
       </view>
213 214
       <view class="foot_btn2" v-if="!isShow">
214
-        <view class="btn1" @click="sendBack()">送回病房</view>
215
+        <view class="btn1" @click="scanDept()">送回病房</view>
215 216
         <view class="btn2" @click="showAlert">知道了</view>
216 217
       </view>
217 218
     </view>
@@ -224,6 +225,9 @@
224 225
     <!-- 送回病房建单弹窗 -->
225 226
     <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
226 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 231
   </view>
228 232
 </template>
229 233
 <script>
@@ -252,6 +256,10 @@
252 256
         models2: {
253 257
           disjunctor: false,
254 258
         },
259
+        // 送回病房建单弹窗model-扫描科室
260
+        models3: {
261
+          disjunctor: false,
262
+        },
255 263
         infoDATA: {},
256 264
         workData: [],
257 265
         patientOrders: [],
@@ -266,6 +274,7 @@
266 274
         code: "",
267 275
         animationData: {}, //动画
268 276
         isShow: true, //是否显示“一键操作”
277
+        currentStartDept: {}, //扫描的起点科室
269 278
       };
270 279
     },
271 280
     methods: {
@@ -311,6 +320,48 @@
311 320
       cancel2() {
312 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 366
       sendBuild() {
316 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 449
       sendBack() {
330 450
         let infoDATA = JSON.parse(this.options.infoDATA);
@@ -712,7 +832,8 @@
712 832
             font-size: 48rpx;
713 833
             text-align: center;
714 834
           }
715
-          .success_tips{
835
+
836
+          .success_tips {
716 837
             color: red;
717 838
             font-size: 30rpx;
718 839
           }