Browse Source

多个血袋号

seimin 2 years ago
parent
commit
a8e5a2467f

+ 10 - 3
components/bigScreen/bigScreen.vue

@@ -283,9 +283,16 @@
283 283
                         });
284 284
                       } else if (res.type == 'blood') {
285 285
                         //扫血制品
286
-                        uni.navigateTo({
287
-                          url: `/pages/scanning_blood/scanning_blood?qrcode=${data.code}`,
288
-                        });
286
+                        // 判断size,多个则进入新页面选择
287
+                        if(res.size > 1){
288
+                          uni.navigateTo({
289
+                            url: `/pages/bloodSelect/bloodSelect?qrcode=${data.code}&navigateTo=scanning_blood`,
290
+                          });
291
+                        } else {
292
+                          uni.navigateTo({
293
+                            url: `/pages/scanning_blood/scanning_blood?qrcode=${data.code}`,
294
+                          });
295
+                        }
289 296
                       }
290 297
                     } else {
291 298
                       uni.navigateTo({

+ 1 - 0
components/showModel/showModel.vue

@@ -272,6 +272,7 @@ export default {
272 272
 
273 273
       .showModel__content {
274 274
         font-size: 36rpx;
275
+        word-break: break-all;
275 276
       }
276 277
 
277 278
       .showModel__info {

+ 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.18');
7
+console.info('v2.4.19');
8 8
 Vue.prototype.wx = wx //声明扫码
9 9
 Vue.prototype.audios = [] //待播放的语音集合
10 10
 // #endif

+ 8 - 0
pages.json

@@ -187,6 +187,14 @@
187 187
       }
188 188
     },
189 189
     {
190
+      "path": "pages/bloodSelect/bloodSelect", //选择血制品
191
+      "style": {
192
+        "h5": {
193
+          "titleNView": false
194
+        }
195
+      }
196
+    },
197
+    {
190 198
       "path": "pages/inspectList/inspectList", //检查信息列表
191 199
       "style": {
192 200
         "h5": {

+ 490 - 0
pages/bloodSelect/bloodSelect.vue

@@ -0,0 +1,490 @@
1
+<template>
2
+  <view class="patientInformationList">
3
+    <view class="page_tab">
4
+      <view class="page_tab_bar active">
5
+        <view class="tab_dept">血制品选择页面</view>
6
+      </view>
7
+    </view>
8
+    <view v-if="zxzData.length == 0" class="zwsj">
9
+      <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
10
+      <view class="zwsj-txt">暂无数据</view>
11
+    </view>
12
+    <view v-if="zxzData.length" class="page_items">
13
+      <scroll-view class="page_items_scroll" scroll-y :refresher-enabled="scroll_refresher_enabled"
14
+        :refresher-triggered="triggered" @refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore"
15
+        @scrolltolower="scrolltolower" :scroll-top="scroll_top" @refresherabort="refresherabort" @scroll="scroll"
16
+        refresher-background="transport">
17
+        <view class="page_item_wrap" v-for="(item, index) of zxzData" :key="index" @click="itemInfo(item)">
18
+          <view class="page_item">
19
+            <view class="L"></view>
20
+            <view class="R"></view>
21
+            <view class="page_item_top">
22
+              <view class="page_item_top_L">
23
+                <text>{{ item.bloodCode }}<text v-if="item.productCode">({{ item.productCode }})</text></text>
24
+              </view>
25
+              <view class="send_wrap"></view>
26
+            </view>
27
+            <view class="page_item_cont">
28
+              <view class="page_item_conts">
29
+                <view>{{ item.patientName }}({{ item.patientNo }})</view>
30
+              </view>
31
+            </view>
32
+          </view>
33
+          <view class="L-l"></view>
34
+          <view class="R-l"></view>
35
+        </view>
36
+      </scroll-view>
37
+    </view>
38
+    <!-- 弹窗 -->
39
+    <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
40
+      :operate="models1.operate" @ok="ok1" @cancel="cancel1"></showModel>
41
+  </view>
42
+</template>
43
+<script>
44
+  import {
45
+    get,
46
+    post,
47
+    SM,
48
+    deleteIt,
49
+    webHandle
50
+  } from "../../http/http.js";
51
+  export default {
52
+    data() {
53
+      return {
54
+        SMFlag:true,
55
+        hosId: uni.getStorageSync("userData").user.currentHospital.id,
56
+        // 选中的患者项
57
+        currentItem: {},
58
+        // 弹窗model
59
+        models1: {
60
+          disjunctor: false,
61
+        },
62
+        scrollYY: 0, //滚动条滚动的距离
63
+        options: {},
64
+        //列表数据
65
+        zxzData: [],
66
+        //分页页码
67
+        idx: 0,
68
+        // 列表项总数
69
+        totalNum: -1,
70
+        triggered: false, //下拉刷新状态
71
+        freshing: false, //上拉加载开关
72
+        scroll_top: 0, //距离顶部的距离
73
+        scroll_refresher_enabled: true, //是否开启自定义下拉刷新
74
+      };
75
+    },
76
+    methods: {
77
+      ok1() {
78
+        this.models1.disjunctor = false;
79
+        if(this.options.navigateTo === 'scanning_blood_process'){
80
+          uni.showLoading({
81
+            title: "加载中",
82
+            mask: true,
83
+          });
84
+          post("/transflow/scanBind", {type: 'blood',orderId: this.options.orderId, id: this.currentItem.id}).then((ress) => {
85
+            uni.hideLoading();
86
+            if (ress.state == 200 && ress.data.state != 400) {
87
+              //todo
88
+              uni.redirectTo({
89
+                url: `../scanning_blood_process/scanning_blood_process?orderId=${this.options.orderId}&bloodDTO=${encodeURIComponent(JSON.stringify(ress.data.dto))}&scanCount=${ress.data.scanCount}&status=200&scanOrHand=${this.options.scanOrHand}&isSelect=1`,
90
+              });
91
+            } else {
92
+              uni.redirectTo({
93
+                url: `../scanning_blood_process/scanning_blood_process?orderId=${this.options.orderId}&status=500&scanOrHand=${this.options.scanOrHand}&qrcode=${this.options.qrcode}`,
94
+              });
95
+            }
96
+          });
97
+        }else{
98
+          uni.navigateTo({
99
+            url: `../${this.options.navigateTo}/${this.options.navigateTo}?id=${this.currentItem.id}`,
100
+          });
101
+        }
102
+      },
103
+      cancel1() {
104
+        this.models1.disjunctor = false;
105
+      },
106
+      // 进入详情页
107
+      itemInfo(item) {
108
+        // #ifdef H5
109
+        document.body.removeEventListener("touchmove", this.stop, {
110
+          passive: false,
111
+        });
112
+        // #endif
113
+        console.log(item)
114
+        this.currentItem = item;
115
+        this.models1 = {
116
+          disjunctor: true,
117
+          title: "提示",
118
+          content: `您确认是此血袋号【${item.bloodCode}】;产品码【${item.productCode}】;患者【${item.patientName}】吗?`,
119
+          icon: "warn",
120
+          operate: {
121
+            ok: "确认",
122
+            cancel: "取消",
123
+          },
124
+        };
125
+      },
126
+      //血制品列表数据获取
127
+      waitingOrders(idx) {
128
+        if (this.zxzData.length == this.totalNum) {
129
+          uni.showToast({
130
+            icon: "none",
131
+            title: "没有更多数据了!",
132
+          });
133
+          this.freshing = true;
134
+          return;
135
+        }
136
+        uni.showLoading({
137
+          title: "加载中",
138
+          mask: true,
139
+        });
140
+        // 请求列表数据
141
+        post("/transflow/scanCheckList", {
142
+          type: 'blood',
143
+          code: this.options.qrcode,
144
+        }).then((res) => {
145
+          uni.hideLoading();
146
+          if (res.state == 200) {
147
+            this.triggered = false;
148
+            this.freshing = true;
149
+            this.totalNum = res.data ? res.data.length : 0;
150
+            if (idx === 0) {
151
+              this.zxzData = res.data;
152
+            } else {
153
+              this.zxzData.push(...res.data);
154
+            }
155
+          } else {
156
+            uni.showToast({
157
+              icon: "none",
158
+              title: "请求失败!",
159
+            });
160
+          }
161
+        });
162
+      },
163
+      //刷新
164
+      refresherrefresh() {
165
+        if (this.triggered) {
166
+          return;
167
+        }
168
+        console.log("下拉刷新");
169
+        this.triggered = true;
170
+        this.idx = 0;
171
+        this.totalNum = -1;
172
+        this.waitingOrders(0);
173
+      },
174
+      // 下拉刷新复位
175
+      refresherrestore() {
176
+        this.triggered = false;
177
+        console.log("下拉刷新复位");
178
+      },
179
+      //下拉刷新中止
180
+      refresherabort() {
181
+        this.triggered = false;
182
+        console.log("下拉刷新中止");
183
+      },
184
+      //分页,上拉加载
185
+      scrolltolower() {
186
+        if (this.freshing) {
187
+          console.log("上拉加载");
188
+          this.freshing = false;
189
+          // this.waitingOrders(++this.idx);
190
+        }
191
+      },
192
+      // 滚动
193
+      scroll(e) {
194
+        this.scrollYY = e.detail.scrollTop;
195
+        if (e.detail.scrollTop < 20) {
196
+          this.scroll_refresher_enabled = true;
197
+        } else {
198
+          this.scroll_refresher_enabled = false;
199
+        }
200
+      },
201
+      // 阻止浏览器滑动
202
+      stop(e) {
203
+        e.preventDefault();
204
+      },
205
+    },
206
+    onLoad(options) {
207
+      console.log(options);
208
+      this.options = options;
209
+      //滚动条位置设置
210
+      if (options.scrollYY !== undefined) {
211
+        this.scroll_top = options.scrollYY;
212
+      }
213
+      this.waitingOrders(0);
214
+      // #ifdef APP-PLUS
215
+      webHandle("no", "app");
216
+      // #endif
217
+      // #ifdef H5
218
+      webHandle("no", "wx");
219
+      // #endif
220
+    },
221
+    onShow() {
222
+      this.SMFlag = true;
223
+      // #ifdef H5
224
+      document.body.addEventListener("touchmove", this.stop, {
225
+        passive: false,
226
+      });
227
+      // #endif
228
+    },
229
+    onHide() {
230
+      // #ifdef H5
231
+      document.body.removeEventListener("touchmove", this.stop, {
232
+        passive: false,
233
+      });
234
+      // #endif
235
+    },
236
+  };
237
+</script>
238
+<style lang="less">
239
+  .patientInformationList {
240
+    width: 100%;
241
+    height: 100%;
242
+    position: relative;
243
+
244
+    .icon_transport {
245
+      color: #49b856;
246
+      font-size: 50rpx;
247
+
248
+      &.colorRed {
249
+        color: red;
250
+        font-size: 40rpx;
251
+      }
252
+    }
253
+
254
+    .page_tab {
255
+      width: 100%;
256
+      height: 96rpx;
257
+      display: flex;
258
+      position: fixed;
259
+      left: 0;
260
+      top: 0;
261
+      z-index: 999;
262
+
263
+      .page_tab_bar {
264
+        flex: 1;
265
+        font-size: 36rpx;
266
+        background: #fff;
267
+        display: flex;
268
+        justify-content: center;
269
+        align-items: center;
270
+        position: relative;
271
+
272
+        &:after {
273
+          content: "";
274
+          position: absolute;
275
+          left: 0;
276
+          bottom: 0;
277
+          height: 2rpx;
278
+          width: 100%;
279
+          background-color: transparent;
280
+        }
281
+
282
+        .tab_dept {
283
+          position: relative;
284
+
285
+          .changeDept {
286
+            white-space: nowrap;
287
+            margin: 0;
288
+            position: absolute;
289
+            right: 0;
290
+            top: 50%;
291
+            transform: translate(105%, -50%);
292
+            padding: 0 0.5em;
293
+            line-height: 2;
294
+          }
295
+        }
296
+
297
+        &.active {
298
+          color: #49b856;
299
+
300
+          &:after {
301
+            background-color: #49b856;
302
+          }
303
+        }
304
+      }
305
+    }
306
+
307
+    .zwsj {
308
+      position: absolute;
309
+      left: 50%;
310
+      top: 180rpx;
311
+      transform: translateX(-50%);
312
+
313
+      .zwsj-img {
314
+        width: 560rpx;
315
+      }
316
+
317
+      .zwsj-txt {
318
+        font-size: 36rpx;
319
+        font-weight: 700;
320
+        margin-top: 20rpx;
321
+        text-align: center;
322
+      }
323
+    }
324
+
325
+    .page_items {
326
+      // height: calc(100vh - 184rpx);
327
+      height: calc(100vh - 96rpx);
328
+      padding: 0 20rpx;
329
+      padding-top: 96rpx;
330
+
331
+      .page_items_scroll {
332
+        height: 100%;
333
+
334
+        .page_item_wrap {
335
+          position: relative;
336
+          margin-bottom: 32rpx;
337
+
338
+          .page_item {
339
+            margin-bottom: 16rpx;
340
+            // height: 276rpx;
341
+            height: 200rpx;
342
+            background: #fff;
343
+            border-radius: 8rpx;
344
+            overflow: hidden;
345
+            border: 2rpx solid #e5e9ed;
346
+            display: flex;
347
+            flex-direction: column;
348
+            justify-content: space-between;
349
+
350
+            .L {
351
+              width: 40rpx;
352
+              height: 40rpx;
353
+              border-radius: 50%;
354
+              background: #f9fafb;
355
+              position: absolute;
356
+              left: -24rpx;
357
+              top: 68rpx;
358
+              border: 2rpx solid #e5e9ed;
359
+            }
360
+
361
+            .R {
362
+              width: 40rpx;
363
+              height: 40rpx;
364
+              border-radius: 50%;
365
+              background: #f9fafb;
366
+              position: absolute;
367
+              float: right;
368
+              right: -24rpx;
369
+              top: 68rpx;
370
+              border: 2rpx solid #e5e9ed;
371
+            }
372
+
373
+            .page_item_top {
374
+              height: 86rpx;
375
+              border-bottom: 2rpx dashed #e5e9ed;
376
+              padding: 0 16rpx;
377
+              display: flex;
378
+              align-items: center;
379
+              justify-content: space-between;
380
+
381
+              .send_wrap {
382
+                display: flex;
383
+                justify-content: space-between;
384
+                align-items: center;
385
+              }
386
+
387
+              .sendBack {
388
+                button {
389
+                  font-size: 28rpx;
390
+                  height: 52rpx;
391
+                  line-height: 52rpx;
392
+                  margin: 0;
393
+                  color: rgb(7, 134, 60);
394
+                }
395
+              }
396
+
397
+              .page_item_top_L {
398
+                height: 100%;
399
+                float: left;
400
+                display: flex;
401
+                align-items: center;
402
+                line-height: 88rpx;
403
+
404
+                .L_time {
405
+                  color: #6cc076;
406
+                  font-size: 32rpx;
407
+                }
408
+              }
409
+
410
+              .page_item_top_R {
411
+                height: 40rpx;
412
+                float: right;
413
+                line-height: 40rpx;
414
+                font-size: 24rpx;
415
+                padding: 0 8rpx;
416
+                background-color: red;
417
+                color: #fff;
418
+              }
419
+            }
420
+
421
+            .page_item_cont {
422
+              min-height: 100rpx;
423
+              max-height: 344rpx;
424
+              padding: 0 16rpx;
425
+              text-align: left;
426
+              position: relative;
427
+
428
+              .page_item_conts {
429
+                color: rgb(102, 102, 102);
430
+                font-size: 28rpx;
431
+                display: flex;
432
+                align-items: center;
433
+                min-height: 100rpx;
434
+                max-height: 344rpx;
435
+
436
+                view {
437
+                  margin-bottom: 10rpx;
438
+                  margin-left: 40rpx;
439
+
440
+                  &:first-of-type {
441
+                    margin-left: 0;
442
+                  }
443
+                }
444
+
445
+                text {
446
+                  color: #49b856;
447
+                }
448
+
449
+                .num {
450
+                  float: right;
451
+                }
452
+              }
453
+            }
454
+
455
+            .page_item_btn {
456
+              height: 88rpx;
457
+              background-image: linear-gradient(to right, #72c172, #3bb197);
458
+              border-radius: 8rpx;
459
+              line-height: 88rpx;
460
+              color: #fff;
461
+              font-size: 36rpx;
462
+              font-weight: 700;
463
+              text-align: center;
464
+            }
465
+          }
466
+
467
+          .L-l {
468
+            width: 2rpx;
469
+            height: 40rpx;
470
+            background: #f9fafb;
471
+            position: absolute;
472
+            left: 20rpx;
473
+            top: 72rpx;
474
+            display: none;
475
+          }
476
+
477
+          .R-l {
478
+            width: 2rpx;
479
+            height: 40rpx;
480
+            background: #f9fafb;
481
+            position: absolute;
482
+            right: 20rpx;
483
+            top: 72rpx;
484
+            display: none;
485
+          }
486
+        }
487
+      }
488
+    }
489
+  }
490
+</style>

+ 7 - 4
pages/scanning_blood/scanning_blood.vue

@@ -209,7 +209,7 @@
209 209
         });
210 210
       },
211 211
       //获取血制品信息及其关联的工单信息
212
-      scanInfo(qrcode) {
212
+      scanInfo(value, type) {
213 213
         uni.showLoading({
214 214
           title: "加载中",
215 215
           mask: true,
@@ -217,7 +217,7 @@
217 217
         post("/common/common/getDictionary", {"type":"list","key":"ttconfig_sign_type"}).then((res1) => {
218 218
           post("/transflow/scanInfo", {
219 219
             type: 'blood',
220
-            code: qrcode,
220
+            [type]: value,
221 221
           }).then((res) => {
222 222
             uni.hideLoading();
223 223
             if (res.state == 200) {
@@ -255,10 +255,13 @@
255 255
     onLoad(options) {
256 256
       console.log(options);
257 257
       let {
258
-        qrcode
258
+        qrcode,
259
+        id
259 260
       } = options;
260 261
       if (qrcode) {
261
-        this.scanInfo(qrcode);
262
+        this.scanInfo(qrcode, 'code');
263
+      }else if (id) {
264
+        this.scanInfo(id, 'id');
262 265
       }
263 266
       // #ifdef APP-PLUS
264 267
       webHandle("no", "app");

+ 45 - 16
pages/scanning_blood_process/scanning_blood_process.vue

@@ -120,25 +120,47 @@
120 120
           if (result.state == 200 || result.state == 201) {
121 121
             let codes = result.code;
122 122
             if (codes) {
123
-              post("/transflow/scanBind", {type: 'blood',orderId: this.queryObj.orderId, code: ress1}).then((ress) => {
124
-                uni.hideLoading();
125
-                if (ress.state == 200 && ress.data.state != 400) {
126
-                  //扫描标本后会自动调用摄像头,继续扫描,直到status不是200
127
-                  setTimeout(()=>{
128
-                    if (type === 'scan') {
129
-                      this.Scanning_again();
130
-                    }
131
-                  },500)
132
-                  //todo
133
-                  uni.redirectTo({
134
-                    url: `../scanning_blood_process/scanning_blood_process?orderId=${this.queryObj.orderId}&bloodDTO=${encodeURIComponent(JSON.stringify(ress.data.dto))}&scanCount=${ress.data.scanCount}&status=200&scanOrHand=${type}`,
135
-                  });
123
+              // 判断是否有多个血袋号 start
124
+              post("/transflow/scanCheckList", {
125
+                type: 'blood',
126
+                code: codes,
127
+              }).then((res) => {
128
+                if (res.state == 200) {
129
+                  res.data = res.data || [];
130
+                  if(res.data.length > 1){
131
+                    uni.navigateTo({
132
+                      url: `/pages/bloodSelect/bloodSelect?qrcode=${codes}&navigateTo=scanning_blood_process&orderId=${this.queryObj.orderId}&scanOrHand=${type}`,
133
+                    });
134
+                  }else{
135
+                    post("/transflow/scanBind", {type: 'blood',orderId: this.queryObj.orderId, code: ress1}).then((ress) => {
136
+                      uni.hideLoading();
137
+                      if (ress.state == 200 && ress.data.state != 400) {
138
+                        //扫描标本后会自动调用摄像头,继续扫描,直到status不是200
139
+                        setTimeout(()=>{
140
+                          if (type === 'scan') {
141
+                            this.Scanning_again();
142
+                          }
143
+                        },500)
144
+                        //todo
145
+                        uni.redirectTo({
146
+                          url: `../scanning_blood_process/scanning_blood_process?orderId=${this.queryObj.orderId}&bloodDTO=${encodeURIComponent(JSON.stringify(ress.data.dto))}&scanCount=${ress.data.scanCount}&status=200&scanOrHand=${type}`,
147
+                        });
148
+                      } else {
149
+                        uni.redirectTo({
150
+                          url: `../scanning_blood_process/scanning_blood_process?orderId=${this.queryObj.orderId}&status=500&scanOrHand=${type}&qrcode=${ress1}`,
151
+                        });
152
+                      }
153
+                    });
154
+                  }
136 155
                 } else {
137
-                  uni.redirectTo({
138
-                    url: `../scanning_blood_process/scanning_blood_process?orderId=${this.queryObj.orderId}&status=500&scanOrHand=${type}&qrcode=${ress1}`,
156
+                  uni.hideLoading();
157
+                  uni.showToast({
158
+                    icon: "none",
159
+                    title: "请求失败!",
139 160
                   });
140 161
                 }
141 162
               });
163
+              // 判断是否有多个血袋号 end
142 164
             } else {
143 165
               uni.hideLoading();
144 166
             }
@@ -176,9 +198,16 @@
176 198
     },
177 199
     onLoad(options) {
178 200
       console.log(options, "result");
179
-      if (options.status == 200&&options.scanOrHand === 'hand') {
201
+      if (options.status == 200 && options.scanOrHand === 'hand') {
180 202
         this.hand_again();
181 203
       }
204
+      if (options.status == 200 && options.scanOrHand === 'scan' && options.isSelect == 1) {
205
+        //扫描标本后会自动调用摄像头,继续扫描,直到status不是200
206
+        // isSelect是多血袋选择后自动调用
207
+        setTimeout(()=>{
208
+          this.Scanning_again();
209
+        },500)
210
+      }
182 211
       this.queryObj = options;
183 212
       if (options.bloodDTO) {
184 213
         this.bloodDTO = JSON.parse(options.bloodDTO);