瀏覽代碼

大扫描标本建单

seimin 2 年之前
父節點
當前提交
03970213be
共有 2 個文件被更改,包括 314 次插入127 次删除
  1. 123 120
      components/bigScreen/bigScreen.vue
  2. 191 7
      pages/scanning_B/scanning_B.vue

+ 123 - 120
components/bigScreen/bigScreen.vue

@@ -6,68 +6,71 @@
6 6
 </template>
7 7
 
8 8
 <script>
9
-import { post, SM } from "../../http/http.js";
10
-export default {
11
-  data(){
12
-    return {
13
-      SMFlag:true,
14
-    }
15
-  },
16
-  methods: {
17
-    // 底部扫描
18
-    Scanning() {
19
-      if (!this.SMFlag) {
20
-        return;
9
+  import {
10
+    post,
11
+    SM
12
+  } from "../../http/http.js";
13
+  export default {
14
+    data() {
15
+      return {
16
+        SMFlag: true,
21 17
       }
22
-      this.SMFlag = false;
23
-      SM().then((content) => {
24
-        uni.showLoading({
25
-          title: "加载中",
26
-          mask: true,
27
-        });
28
-        //检验二维码的有效性(扫码前必须验证)
29
-        post("/dept/scanning", {
30
-          content,
31
-        })
32
-          .then((result) => {
33
-            this.SMFlag = true;
34
-            // 200检测通过,201没有有效期也通过。
35
-            if (result.state == 200 || result.state == 201) {
36
-              let data = {
37
-                code: result.code, //二维码
38
-              };
39
-              //微信—大扫描(科室码,患者码,标本码,快捷建单码,药包码)
40
-              post("/workerOrder/scanCode", data)
41
-                .then((res) => {
42
-                  uni.hideLoading();
43
-                  if (res.status == 200) {
44
-                    // 扫描标本码
45
-                    if (res.type == "specimen") {
46
-                      let infoDATA = {
47
-                        stype: res.data.stype,
48
-                        scode: res.data.scode,
49
-                        patientName: res.data.patientName,
50
-                        sickRoom: res.data.sickRoom
51
-                          ? res.data.sickRoom.dept
52
-                          : "-",
53
-                        checkDept: res.data.checkDept
54
-                          ? res.data.checkDept.dept
55
-                          : "-",
56
-                        bedNum: res.data.bedNum,
57
-                      };
58
-                      uni.navigateTo({
59
-                        url: `../scanning_B/scanning_B?status=${
60
-                          res.status
61
-                        }&msg=${res.msg}&infoDATA=${encodeURIComponent(
18
+    },
19
+    methods: {
20
+      // 底部扫描
21
+      Scanning() {
22
+        if (!this.SMFlag) {
23
+          return;
24
+        }
25
+        this.SMFlag = false;
26
+        SM().then((content) => {
27
+          uni.showLoading({
28
+            title: "加载中",
29
+            mask: true,
30
+          });
31
+          //检验二维码的有效性(扫码前必须验证)
32
+          post("/dept/scanning", {
33
+              content,
34
+            })
35
+            .then((result) => {
36
+              this.SMFlag = true;
37
+              // 200检测通过,201没有有效期也通过。
38
+              if (result.state == 200 || result.state == 201) {
39
+                let data = {
40
+                  code: result.code, //二维码
41
+                };
42
+                //微信—大扫描(科室码,患者码,标本码,快捷建单码,药包码)
43
+                post("/workerOrder/scanCode", data)
44
+                  .then((res) => {
45
+                    uni.hideLoading();
46
+                    if (res.status == 200) {
47
+                      // 扫描标本码
48
+                      if (res.type == "specimen") {
49
+                        let infoDATA = {
50
+                          stype: res.data.stype,
51
+                          scode: res.data.scode,
52
+                          patientName: res.data.patientName,
53
+                          sickRoom: res.data.sickRoom ?
54
+                            res.data.sickRoom.dept :
55
+                            "-",
56
+                          checkDept: res.data.checkDept ?
57
+                            res.data.checkDept.dept :
58
+                            "-",
59
+                          bedNum: res.data.bedNum,
60
+                        };
61
+                        uni.navigateTo({
62
+                          url: `../scanning_B/scanning_B?res=${encodeURIComponent(
63
+                          JSON.stringify(res)
64
+                        )}&infoDATA=${encodeURIComponent(
62 65
                           JSON.stringify(infoDATA)
63 66
                         )}`,
64
-                      });
65
-                    } else if (res.type == "patient") {
66
-                      //如果是患者腕带码
67
-                      // code: data.code //二维码
68
-                      res.workOrder = res.workOrder ? res.workOrder : []; //liao
69
-                      uni.navigateTo({
70
-                        url: `../scanning_ins/scanning_ins?code=${
67
+                        });
68
+                      } else if (res.type == "patient") {
69
+                        //如果是患者腕带码
70
+                        // code: data.code //二维码
71
+                        res.workOrder = res.workOrder ? res.workOrder : []; //liao
72
+                        uni.navigateTo({
73
+                          url: `../scanning_ins/scanning_ins?code=${
71 74
                           data.code
72 75
                         }&infoDATA=${encodeURIComponent(
73 76
                           JSON.stringify(res.data)
@@ -76,80 +79,80 @@ export default {
76 79
                         )}&patientOrders=${encodeURIComponent(
77 80
                           JSON.stringify(res.patientOrders)
78 81
                         )}`,
79
-                      });
80
-                    } else if (res.type == "quickOrder") {
81
-                      //快捷建单
82
-                      uni.navigateTo({
83
-                        url: `../shortcutbuildOrders/shortcutbuildOrders?infoDATA=${encodeURIComponent(
82
+                        });
83
+                      } else if (res.type == "quickOrder") {
84
+                        //快捷建单
85
+                        uni.navigateTo({
86
+                          url: `../shortcutbuildOrders/shortcutbuildOrders?infoDATA=${encodeURIComponent(
84 87
                           JSON.stringify(res.data)
85 88
                         )}`,
86
-                      });
87
-                    } else if (res.type == "dept") {
88
-                      // 扫描科室码
89
-                      // code: data.code //二维码
90
-                      let infoDATA = res.data;
91
-                      uni.navigateTo({
92
-                        url: `../scanning_all/scanning_all?infoDATA=${encodeURIComponent(
89
+                        });
90
+                      } else if (res.type == "dept") {
91
+                        // 扫描科室码
92
+                        // code: data.code //二维码
93
+                        let infoDATA = res.data;
94
+                        uni.navigateTo({
95
+                          url: `../scanning_all/scanning_all?infoDATA=${encodeURIComponent(
93 96
                           JSON.stringify(infoDATA)
94 97
                         )}&code=${data.code}`,
95
-                      });
96
-                    }else if(res.type == 'drugsBag'){
97
-                      //扫药包码
98
+                        });
99
+                      } else if (res.type == 'drugsBag') {
100
+                        //扫药包码
101
+                        uni.navigateTo({
102
+                          url: `/pages/scanning_drug/scanning_drug?drugsBagId=${res.drugsBagId}`,
103
+                        });
104
+                      }
105
+                    } else {
98 106
                       uni.navigateTo({
99
-                        url: `/pages/scanning_drug/scanning_drug?drugsBagId=${res.drugsBagId}`,
107
+                        url: `../scanning_Result/scanning_Result?status=${res.status}&msg=${res.msg}`,
100 108
                       });
101 109
                     }
102
-                  } else {
103
-                    uni.navigateTo({
104
-                      url: `../scanning_Result/scanning_Result?status=${res.status}&msg=${res.msg}`,
105
-                    });
106
-                  }
110
+                  });
111
+              } else {
112
+                uni.hideLoading();
113
+                uni.showToast({
114
+                  icon: "none",
115
+                  title: '请求失败',
107 116
                 });
108
-            } else {
109
-              uni.hideLoading();
110
-              uni.showToast({
111
-                icon: "none",
112
-                title: '请求失败',
113
-              });
114
-            }
115
-          })
116
-      }).catch(err=>{
117
-        this.SMFlag = true;
118
-      });
117
+              }
118
+            })
119
+        }).catch(err => {
120
+          this.SMFlag = true;
121
+        });
122
+      },
119 123
     },
120
-  },
121
-  onShow(){
122
-    this.SMFlag = true;
123
-  }
124
-};
124
+    onShow() {
125
+      this.SMFlag = true;
126
+    }
127
+  };
125 128
 </script>
126 129
 
127 130
 <style lang="less">
128
-// 底部扫一扫
129
-.toolbar {
130
-  position: fixed;
131
-  left: 0;
132
-  right: 0;
133
-  bottom: 0;
134
-  z-index: 999;
135
-  height: 88rpx;
136
-  display: flex;
137
-  justify-content: center;
138
-  align-items: center;
139
-  box-sizing: border-box;
140
-  border-radius: 4rpx;
141
-  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.24);
142
-  background-color: #e5e9ed;
131
+  // 底部扫一扫
132
+  .toolbar {
133
+    position: fixed;
134
+    left: 0;
135
+    right: 0;
136
+    bottom: 0;
137
+    z-index: 999;
138
+    height: 88rpx;
139
+    display: flex;
140
+    justify-content: center;
141
+    align-items: center;
142
+    box-sizing: border-box;
143
+    border-radius: 4rpx;
144
+    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.24);
145
+    background-color: #e5e9ed;
143 146
 
144
-  .toolbar-icon {
145
-    font-size: 52rpx;
146
-    margin-right: 16rpx;
147
-    color: #07863c;
148
-  }
147
+    .toolbar-icon {
148
+      font-size: 52rpx;
149
+      margin-right: 16rpx;
150
+      color: #07863c;
151
+    }
149 152
 
150
-  .toolbar-sao {
151
-    font-size: 36rpx;
152
-    color: #333;
153
+    .toolbar-sao {
154
+      font-size: 36rpx;
155
+      color: #333;
156
+    }
153 157
   }
154
-}
155 158
 </style>

+ 191 - 7
pages/scanning_B/scanning_B.vue

@@ -29,21 +29,203 @@
29 29
     </view>
30 30
     <view class="foot_btn">
31 31
       <view class="btn3" @click="showAlert()">知道了</view>
32
+      <block v-if="res.scanCodeSpecimenOrderSign==1">
33
+        <view class="btn3" @click="orderSign(res.workOrder)" v-if="res.workOrder">工单签到</view>
34
+        <view class="btn3" @click="buildAndOrderSign(res.data.id)" v-if="!res.workOrder && res.data">建单并签到</view>
35
+      </block>
32 36
     </view>
37
+    <!-- 填写交接人账号弹窗 -->
38
+    <selectAccount v-if="hosModels.disjunctor" :title="hosModels.title" :disjunctor="hosModels.disjunctor" @ok="hosOk"
39
+      @cancel="hosCancel">
40
+    </selectAccount>
33 41
   </view>
34 42
 </template>
35 43
 <script>
36 44
   import {
45
+    post,
37 46
     webHandle
38 47
   } from '../../http/http.js'
39 48
   export default {
40 49
     data() {
41 50
       return {
42 51
         infoDATA: {},
43
-        res: {}
52
+        res: {},
53
+        // 填写交接人账号弹窗model
54
+        hosModels: {
55
+          disjunctor: false,
56
+        },
57
+        currentCode: ''
44 58
       };
45 59
     },
46 60
     methods: {
61
+      // 如果不是患者陪检或患者转运或其他
62
+      // 科室签到
63
+      nextDeptOrder_s(data, accountObj) {
64
+        console.log(data, accountObj)
65
+        let ids = [];
66
+        let id = data.id;
67
+        ids.push(id);
68
+        let code = "";
69
+        let postData = {
70
+          ids
71
+        };
72
+        if (accountObj) {
73
+          postData.handover = [accountObj.accountId];
74
+        }
75
+        if (this.currentCode) {
76
+          code = this.currentCode;
77
+          // 科室签到
78
+          post("/workerOrder/orderSign/" + code, postData).then((res) => {
79
+            uni.hideLoading();
80
+            if (res.status == 200) {
81
+              // 跳转到扫描科室
82
+              // type1: res.type, //type类型
83
+              // id: data.id, //工单ID
84
+              // deptCode: code, //二维码
85
+              // dept: res.dept //科室名称
86
+              uni.navigateTo({
87
+                url: `/pages/scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}&deptId=${res.deptId}`,
88
+              });
89
+            } else {
90
+              uni.navigateTo({
91
+                url: `/pages/scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&isKs=1`,
92
+              });
93
+            }
94
+          });
95
+        }
96
+      },
97
+      // 工单签到
98
+      orderSign(workOrder) {
99
+        uni.showLoading({
100
+          title: "加载中",
101
+          mask: true,
102
+        });
103
+        let postData = {
104
+          content: workOrder.startDept.qrcode,
105
+          taskTypeId: workOrder.taskType.id,
106
+          gdState: workOrder.gdState.id,
107
+        };
108
+        //检验二维码的有效性
109
+        post("/dept/scanning", postData).then((result) => {
110
+          this.currentCode = result.code;
111
+          if (result.state == 200 || result.state == 201) {
112
+            if (result.account) {
113
+              this.nextDeptOrder_s(workOrder, {
114
+                account: result.account,
115
+                accountName: result.name,
116
+                accountId: result.id,
117
+              });
118
+            } else {
119
+              this.nextDeptOrder_s(workOrder);
120
+            }
121
+          } else if (result.state == '0000') {
122
+            uni.hideLoading();
123
+            this.showSelectAccount();
124
+          } else {
125
+            uni.hideLoading();
126
+            uni.showToast({
127
+              icon: "none",
128
+              title: "请求失败!",
129
+            });
130
+          }
131
+        });
132
+      },
133
+      // 建单并签到
134
+      buildAndOrderSign(speId) {
135
+        uni.showLoading({
136
+          title: "加载中",
137
+          mask: true,
138
+        });
139
+        post("/workerOrder/specimenCreateAndSign", {
140
+          speId
141
+        }).then((res) => {
142
+          if (res.state == 200 || res.state == 201) {
143
+            uni.hideLoading();
144
+            if (res.status == 200) {
145
+              // 跳转到扫描科室
146
+              // type1: res.type, //type类型
147
+              // id: data.id, //工单ID
148
+              // deptCode: code, //二维码
149
+              // dept: res.dept //科室名称
150
+              uni.navigateTo({
151
+                url: `/pages/scanning_code/scanning_code?type=${res.workOrder.taskType.associationType.value}&type1=${res.type}&id=${res.workOrder.id}&deptCode=${this.currentCode}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(undefined))}&deptId=${res.deptId}`,
152
+              });
153
+            } else {
154
+              uni.navigateTo({
155
+                url: `/pages/scanning_Result/scanning_Result?type=${res.workOrder.taskType.associationType.value}&type1=${res.type}&id=${res.workOrder.id}&status=600&msg=${res.msg}&isKs=1`,
156
+              });
157
+            }
158
+          } else if (res.state == '0000') {
159
+            uni.hideLoading();
160
+            this.currentCode = res.code;
161
+            this.res.workOrder = res.workOrder;
162
+            this.showSelectAccount();
163
+          } else {
164
+            uni.hideLoading();
165
+            uni.showToast({
166
+              icon: "none",
167
+              title: "请求失败!",
168
+            });
169
+          }
170
+        })
171
+      },
172
+      // 填写交接人账号-确认
173
+      hosOk(data) {
174
+        console.log(data);
175
+        const {
176
+          accountName,
177
+          account,
178
+          accountId
179
+        } = data;
180
+        if (!accountName && !account) {
181
+          //没有填写交接人
182
+          uni.showModal({
183
+            title: '提示',
184
+            content: "请填写交接人账号!",
185
+            showCancel: false,
186
+            success: function(res) {
187
+              if (res.confirm) {
188
+                console.log('用户点击确定');
189
+              } else if (res.cancel) {
190
+                console.log('用户点击取消');
191
+              }
192
+            }
193
+          });
194
+          return;
195
+        } else if (!accountName && account || accountName && !account) {
196
+          //没有填写交接人
197
+          uni.showModal({
198
+            title: '提示',
199
+            content: "请填写正确的交接人账号!",
200
+            showCancel: false,
201
+            success: function(res) {
202
+              if (res.confirm) {
203
+                console.log('用户点击确定');
204
+              } else if (res.cancel) {
205
+                console.log('用户点击取消');
206
+              }
207
+            }
208
+          });
209
+          return;
210
+        }
211
+        this.hosModels.disjunctor = false;
212
+        uni.showLoading({
213
+          title: "加载中",
214
+          mask: true,
215
+        });
216
+        this.nextDeptOrder_s(this.res.workOrder, data);
217
+      },
218
+      // 填写交接人账号-取消
219
+      hosCancel() {
220
+        this.hosModels.disjunctor = false;
221
+      },
222
+      // 填写交接人账号弹窗
223
+      showSelectAccount() {
224
+        this.hosModels = {
225
+          title: '填写交接人账号',
226
+          disjunctor: true,
227
+        }
228
+      },
47 229
       // 知道了
48 230
       showAlert() {
49 231
         uni.navigateTo({
@@ -52,10 +234,9 @@
52 234
       }
53 235
     },
54 236
     onLoad(options) {
237
+      this.res = JSON.parse(options.res);
55 238
       this.infoDATA = JSON.parse(options.infoDATA); //详细信息
56 239
       console.log(this.infoDATA)
57
-      this.res["status"] = options.status; //状态码
58
-      this.res["msg"] = options.msg; //返回的信息
59 240
       // #ifdef APP-PLUS
60 241
       webHandle('no', 'app')
61 242
       // #endif
@@ -124,20 +305,23 @@
124 305
       line-height: 88rpx;
125 306
       height: 100rpx;
126 307
       margin-top: 40rpx;
308
+      display: flex;
309
+      justify-content: center;
127 310
 
128 311
       .btn3 {
312
+        flex: 1;
129 313
         height: 88rpx;
130
-        width: 45%;
131 314
         background-image: linear-gradient(to right, #72c172, #3bb197);
132 315
         color: #fff;
133 316
         border-radius: 8rpx;
134 317
         font-size: 32rpx;
135 318
         margin-top: 16rpx;
319
+        margin-right: 16rpx;
136 320
         text-align: center;
137
-      }
138 321
 
139
-      .btn3 {
140
-        margin: 0 auto;
322
+        &:last-of-type {
323
+          margin-right: 0;
324
+        }
141 325
       }
142 326
     }
143 327
   }