|
@@ -37,17 +37,28 @@
|
37
|
37
|
<changeSpeNum v-if="changeSpeModels.disjunctor" :operate="{ok:'确认数量',check:'详细核对',cancel:'取消'}" :title="changeSpeModels.title" :content="changeSpeModels.content"
|
38
|
38
|
:disjunctor="changeSpeModels.disjunctor" @ok="changeSpeOk" @check="changeSpeCheck" @cancel="changeSpeCancel" :num="speNumChange">
|
39
|
39
|
</changeSpeNum>
|
|
40
|
+ <!-- 弹窗 -->
|
|
41
|
+ <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
|
|
42
|
+ @ok="ok" @no="no" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
|
40
|
43
|
</view>
|
41
|
44
|
</template>
|
42
|
45
|
<script>
|
|
46
|
+ import showModel from "../../components/showModel/showModel.vue";
|
43
|
47
|
import {
|
44
|
48
|
get,
|
45
|
49
|
post,
|
46
|
50
|
webHandle
|
47
|
51
|
} from "../../http/http.js";
|
48
|
52
|
export default {
|
|
53
|
+ components: {
|
|
54
|
+ showModel,
|
|
55
|
+ },
|
49
|
56
|
data() {
|
50
|
57
|
return {
|
|
58
|
+ // 弹窗model
|
|
59
|
+ models: {
|
|
60
|
+ disjunctor: false,
|
|
61
|
+ },
|
51
|
62
|
list: [],
|
52
|
63
|
msg: {}, //页面展示信息
|
53
|
64
|
// 修改标本数量弹窗model
|
|
@@ -59,6 +70,52 @@
|
59
|
70
|
};
|
60
|
71
|
},
|
61
|
72
|
methods: {
|
|
73
|
+ //确认数量并建单-知道了
|
|
74
|
+ know() {
|
|
75
|
+ this.models.disjunctor = false;
|
|
76
|
+ },
|
|
77
|
+ //确认数量并建单-确定
|
|
78
|
+ ok() {
|
|
79
|
+ this.models.disjunctor = false;
|
|
80
|
+ const speNumNot0Depts = this.list.filter(v => v.speNum !== 0);
|
|
81
|
+ const speNumNot0DeptsStr = speNumNot0Depts.map(v => v.deptId).toString();
|
|
82
|
+ uni.showLoading({
|
|
83
|
+ mask: true,
|
|
84
|
+ title: '加载中'
|
|
85
|
+ })
|
|
86
|
+ post(`/workerOrder/createQuickOrder`, {
|
|
87
|
+ id: this.msg.id,
|
|
88
|
+ notEmptyEndDeptIds: speNumNot0DeptsStr || undefined,
|
|
89
|
+ }).then((res) => {
|
|
90
|
+ uni.hideLoading();
|
|
91
|
+ if (res.status == 200) {
|
|
92
|
+ if (res.type === 'plan-spe-ddd-2') {
|
|
93
|
+ //需要扫描标本
|
|
94
|
+ uni.navigateTo({
|
|
95
|
+ url: `../../pages/scanning_code/scanning_code?type=${res.associationTypeName}&type1=${res.type}&id=${res.id}&deptCode=${res.deptCode}&dept=${res.deptName}&accountObj=undefined&endDepts=${this.msg.targetDept}&deptId=${res.deptId}`,
|
|
96
|
+ });
|
|
97
|
+ } else {
|
|
98
|
+ uni.navigateTo({
|
|
99
|
+ url: "../receiptpage/receiptpage",
|
|
100
|
+ });
|
|
101
|
+ }
|
|
102
|
+ } else {
|
|
103
|
+ uni.showToast({
|
|
104
|
+ icon: "none",
|
|
105
|
+ title: "请求失败!",
|
|
106
|
+ });
|
|
107
|
+ }
|
|
108
|
+ });
|
|
109
|
+ },
|
|
110
|
+ //确认数量并建单-否
|
|
111
|
+ no() {
|
|
112
|
+ this.models.disjunctor = false;
|
|
113
|
+ this.createOrderFun();
|
|
114
|
+ },
|
|
115
|
+ //确认数量并建单-取消
|
|
116
|
+ cancel() {
|
|
117
|
+ this.models.disjunctor = false;
|
|
118
|
+ },
|
62
|
119
|
// 数量核对 start
|
63
|
120
|
// 修改标本数量-核对
|
64
|
121
|
changeSpeCheck(){
|
|
@@ -341,45 +398,84 @@
|
341
|
398
|
url: `../../pages/receiptpage/receiptpage`,
|
342
|
399
|
});
|
343
|
400
|
},
|
344
|
|
- // 确认数量并建单
|
345
|
|
- createOrder() {
|
346
|
|
- uni.showModal({
|
347
|
|
- title: '提示',
|
348
|
|
- content: "您确认建单吗?",
|
349
|
|
- success: (res) => {
|
350
|
|
- if (res.confirm) {
|
351
|
|
- console.log('用户点击确定');
|
352
|
|
- uni.showLoading({
|
353
|
|
- mask: true,
|
354
|
|
- title: '加载中'
|
355
|
|
- })
|
356
|
|
- get(`/workerOrder/createQuickOrder/${this.msg.id}`, {}).then((res) => {
|
357
|
|
- console.log(res)
|
358
|
|
- uni.hideLoading();
|
359
|
|
- if (res.status == 200) {
|
360
|
|
- if (res.type === 'plan-spe-ddd-2') {
|
361
|
|
- //需要扫描标本
|
362
|
|
- uni.navigateTo({
|
363
|
|
- url: `../../pages/scanning_code/scanning_code?type=${res.associationTypeName}&type1=${res.type}&id=${res.id}&deptCode=${res.deptCode}&dept=${res.deptName}&accountObj=undefined&endDepts=${this.msg.targetDept}&deptId=${res.deptId}`,
|
364
|
|
- });
|
365
|
|
- } else {
|
366
|
|
- uni.navigateTo({
|
367
|
|
- url: "../receiptpage/receiptpage",
|
368
|
|
- });
|
369
|
|
- }
|
370
|
|
- } else {
|
371
|
|
- uni.showToast({
|
372
|
|
- icon: "none",
|
373
|
|
- title: "请求失败!",
|
374
|
|
- });
|
375
|
|
- }
|
|
401
|
+ // 确认数量并建单-方法
|
|
402
|
+ createOrderFun(){
|
|
403
|
+ uni.showLoading({
|
|
404
|
+ mask: true,
|
|
405
|
+ title: '加载中'
|
|
406
|
+ })
|
|
407
|
+ post(`/workerOrder/createQuickOrder`, {
|
|
408
|
+ id: this.msg.id,
|
|
409
|
+ }).then((res) => {
|
|
410
|
+ console.log(res)
|
|
411
|
+ uni.hideLoading();
|
|
412
|
+ if (res.status == 200) {
|
|
413
|
+ if (res.type === 'plan-spe-ddd-2') {
|
|
414
|
+ //需要扫描标本
|
|
415
|
+ uni.navigateTo({
|
|
416
|
+ url: `../../pages/scanning_code/scanning_code?type=${res.associationTypeName}&type1=${res.type}&id=${res.id}&deptCode=${res.deptCode}&dept=${res.deptName}&accountObj=undefined&endDepts=${this.msg.targetDept}&deptId=${res.deptId}`,
|
|
417
|
+ });
|
|
418
|
+ } else {
|
|
419
|
+ uni.navigateTo({
|
|
420
|
+ url: "../receiptpage/receiptpage",
|
376
|
421
|
});
|
377
|
|
- } else if (res.cancel) {
|
378
|
|
- console.log('用户点击取消');
|
379
|
422
|
}
|
|
423
|
+ } else {
|
|
424
|
+ uni.showToast({
|
|
425
|
+ icon: "none",
|
|
426
|
+ title: "请求失败!",
|
|
427
|
+ });
|
380
|
428
|
}
|
381
|
429
|
});
|
382
|
430
|
},
|
|
431
|
+ // 确认数量并建单
|
|
432
|
+ createOrder() {
|
|
433
|
+ console.log(this.list);
|
|
434
|
+ const speNum0Depts = this.list.filter(v => v.speNum === 0);
|
|
435
|
+ const speNumNot0Depts = this.list.filter(v => v.speNum !== 0);
|
|
436
|
+ if(!speNumNot0Depts.length){
|
|
437
|
+ uni.showModal({
|
|
438
|
+ title: '提示',
|
|
439
|
+ content: "您所有科室本轮配送均无标本,无法建单!",
|
|
440
|
+ showCancel: false,
|
|
441
|
+ success: (res) => {
|
|
442
|
+ if (res.confirm) {
|
|
443
|
+ console.log('用户点击确定');
|
|
444
|
+ } else if (res.cancel) {
|
|
445
|
+ console.log('用户点击取消');
|
|
446
|
+ }
|
|
447
|
+ }
|
|
448
|
+ });
|
|
449
|
+ }else{
|
|
450
|
+ if(speNum0Depts.length){
|
|
451
|
+ const speNum0DeptsName = speNum0Depts.map(v => v.deptName).toString();
|
|
452
|
+ this.models = {
|
|
453
|
+ disjunctor: true,
|
|
454
|
+ title: "提示",
|
|
455
|
+ content: `您有科室本轮配送无标本,是否清除。科室分别为:<span class="red">${speNum0DeptsName}</span>`,
|
|
456
|
+ icon: "warn",
|
|
457
|
+ operate: {
|
|
458
|
+ ok: "是",
|
|
459
|
+ no: '否',
|
|
460
|
+ cancel: "取消",
|
|
461
|
+ },
|
|
462
|
+ };
|
|
463
|
+ }else{
|
|
464
|
+ uni.showModal({
|
|
465
|
+ title: '提示',
|
|
466
|
+ content: "您确认建单吗?",
|
|
467
|
+ success: (res) => {
|
|
468
|
+ if (res.confirm) {
|
|
469
|
+ console.log('用户点击确定');
|
|
470
|
+ this.createOrderFun();
|
|
471
|
+ } else if (res.cancel) {
|
|
472
|
+ console.log('用户点击取消');
|
|
473
|
+ }
|
|
474
|
+ }
|
|
475
|
+ });
|
|
476
|
+ }
|
|
477
|
+ }
|
|
478
|
+ },
|
383
|
479
|
},
|
384
|
480
|
onLoad(options) {
|
385
|
481
|
console.log(options, "快捷建单");
|