|
@@ -34,6 +34,7 @@
|
34
|
34
|
</template>
|
35
|
35
|
|
36
|
36
|
<script>
|
|
37
|
+ import * as commonFun from '../../tools/commonFun.js';
|
37
|
38
|
import {
|
38
|
39
|
pathUrl
|
39
|
40
|
} from "../../tools/photograph.js";
|
|
@@ -70,108 +71,18 @@
|
70
|
71
|
};
|
71
|
72
|
},
|
72
|
73
|
methods: {
|
73
|
|
- // 完成工单
|
74
|
|
- postWorkerOrder(data, accountObj){
|
75
|
|
- let isKs = 0;
|
76
|
|
- let ids = [];
|
77
|
|
- let id = data.id;
|
78
|
|
- ids.push(id);
|
79
|
|
- let list = {
|
80
|
|
- code: "",
|
81
|
|
- ids: ids,
|
82
|
|
- };
|
83
|
|
- let code = "";
|
84
|
|
- let type = "";
|
85
|
|
- let gdStateValue = data.gdState.value; //工单状态value
|
86
|
|
- let associationTypeValue = data.taskType.associationType.value; //关联类型value
|
87
|
|
-
|
88
|
|
- // 其他临床服务,并且工单状态是待到达||工单状态待送达
|
89
|
|
- if (
|
90
|
|
- (associationTypeValue == "other" &&
|
91
|
|
- gdStateValue == "4") ||
|
92
|
|
- gdStateValue == "5"
|
93
|
|
- ) {
|
94
|
|
- code = this.currentCode;
|
95
|
|
- type = "orderSign/" + code;
|
96
|
|
- list = {
|
97
|
|
- ids
|
98
|
|
- };
|
99
|
|
- if (accountObj) {
|
100
|
|
- list.handover = [accountObj.accountId];
|
101
|
|
- }
|
102
|
|
- isKs = 1;
|
103
|
|
- }
|
104
|
|
- post("/workerOrder/" + type, list).then((res) => {
|
105
|
|
- console.log(res);
|
106
|
|
- uni.hideLoading();
|
107
|
|
- if (res) {
|
108
|
|
- if (res.status == 200) {
|
109
|
|
- if (
|
110
|
|
- gdStateValue == "4" &&
|
111
|
|
- associationTypeValue == "other"
|
112
|
|
- ) {
|
113
|
|
- uni.navigateTo({
|
114
|
|
- url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
|
115
|
|
- });
|
116
|
|
- }
|
117
|
|
- if (gdStateValue == "5") {
|
118
|
|
- uni.navigateTo({
|
119
|
|
- url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
|
120
|
|
- });
|
121
|
|
- }
|
122
|
|
- } else {
|
123
|
|
- uni.navigateTo({
|
124
|
|
- url: `../../pages/scanning_Result/scanning_Result?type=${
|
125
|
|
- associationTypeValue
|
126
|
|
- }&type1=${res.type}&id=${data.id}&status=600&msg=${
|
127
|
|
- res.msg
|
128
|
|
- }&isKs=${isKs}&model=${encodeURIComponent(
|
129
|
|
- JSON.stringify(res)
|
130
|
|
- )}&qrcode=${this.currentCode}`,
|
131
|
|
- });
|
132
|
|
- }
|
133
|
|
- } else {
|
134
|
|
- uni.navigateTo({
|
135
|
|
- url: `../../pages/scanning_Result/scanning_Result?id=${data.id}&status=600&msg=扫码失败!请扫描正确的二维码!&isKs=${isKs}&qrcode=${this.currentCode}`,
|
136
|
|
- });
|
137
|
|
- }
|
138
|
|
- });
|
139
|
|
- },
|
140
|
|
- // 如果不是静配,药配,标本配送,标本轮巡
|
141
|
|
- // 科室签到(小扫描)-拍照
|
142
|
|
- nextDeptOrder_ss(data, accountObj) {
|
143
|
|
- console.log(this.currentCode);
|
144
|
|
- if (this.currentCode) {
|
145
|
|
- // 动作
|
146
|
|
- let actions = this.actions.filter(v => v.checked);
|
147
|
|
- let actionRemarks = actions.map(v => v.name).toString();
|
148
|
|
- uni.showLoading({
|
149
|
|
- title: "加载中",
|
150
|
|
- mask: true,
|
151
|
|
- });
|
152
|
|
- if(actionRemarks){
|
153
|
|
- post("/workerOrder/addOtherRemarks", {
|
154
|
|
- orderId: data.id,
|
155
|
|
- actionRemarks: actionRemarks,
|
156
|
|
- }).then((result1) => {
|
157
|
|
- if(result1.state == 200){
|
158
|
|
- this.postWorkerOrder(data, accountObj);
|
159
|
|
- }else{
|
160
|
|
- uni.hideLoading();
|
161
|
|
- uni.showToast({
|
162
|
|
- icon: "none",
|
163
|
|
- title: "请求失败!",
|
164
|
|
- });
|
165
|
|
- }
|
166
|
|
- });
|
167
|
|
- }else{
|
168
|
|
- this.postWorkerOrder(data, accountObj);
|
169
|
|
- }
|
|
74
|
+ // 其他临床服务-运输过程-终点科室是否开通备注填写
|
|
75
|
+ isOpenTransportationProcessRemarks(data, accountObj, funName){
|
|
76
|
+ const tasktype = data.taskType;
|
|
77
|
+ console.log(tasktype, data);
|
|
78
|
+ if(tasktype.associationType.value === 'other' && tasktype.carryingCourses[1].logSwitch && data.gdState.value == 5){
|
|
79
|
+ uni.navigateTo({
|
|
80
|
+ url: `../../pages/transportationProcessRemarks/transportationProcessRemarks?data=${data ? encodeURIComponent(JSON.stringify(data)) : ''}&accountObj=${accountObj ? encodeURIComponent(JSON.stringify(accountObj)) : ''}¤tCode=${this.currentCode}&funName=${funName}&actions=${this.actions ? encodeURIComponent(JSON.stringify(this.actions)) : ''}&imageValue=${this.imageValue ? encodeURIComponent(JSON.stringify(this.imageValue)) : ''}`
|
|
81
|
+ })
|
170
|
82
|
}else{
|
171
|
|
- uni.hideLoading();
|
|
83
|
+ commonFun[funName](this, data, accountObj);
|
172
|
84
|
}
|
173
|
85
|
},
|
174
|
|
-
|
175
|
86
|
// 填写交接人账号-确认
|
176
|
87
|
hosOk(data) {
|
177
|
88
|
console.log(data);
|
|
@@ -215,13 +126,13 @@
|
215
|
126
|
let associationTypeValue = this.currentData.taskType.associationType.value;
|
216
|
127
|
console.log(associationTypeValue)
|
217
|
128
|
if(this.actionPhotoSwitch && this.actionConfirmSwitch){
|
218
|
|
- this.uploadToOther(this.currentData, data, 'end');
|
|
129
|
+ this.isOpenTransportationProcessRemarks(this.currentData, data, 'uploadToOther');
|
219
|
130
|
}else if(this.actionConfirmSwitch){
|
220
|
131
|
// 动作
|
221
|
|
- this.nextDeptOrder_ss(this.currentData, data, 'end');
|
|
132
|
+ this.isOpenTransportationProcessRemarks(this.currentData, data, 'nextDeptOrder_ss');
|
222
|
133
|
}else if(this.actionPhotoSwitch){
|
223
|
134
|
// 拍照
|
224
|
|
- this.uploadToOther(this.currentData, data, 'end');
|
|
135
|
+ this.isOpenTransportationProcessRemarks(this.currentData, data, 'uploadToOther');
|
225
|
136
|
}
|
226
|
137
|
},
|
227
|
138
|
// 填写交接人账号-取消
|
|
@@ -283,13 +194,13 @@
|
283
|
194
|
}
|
284
|
195
|
|
285
|
196
|
if(this.actionPhotoSwitch && this.actionConfirmSwitch){
|
286
|
|
- this.uploadToOther(data, accountObj, type);
|
|
197
|
+ this.isOpenTransportationProcessRemarks(data, accountObj, 'uploadToOther');
|
287
|
198
|
}else if(this.actionConfirmSwitch){
|
288
|
199
|
// 动作
|
289
|
|
- this.nextDeptOrder_ss(data, accountObj, type);
|
|
200
|
+ this.isOpenTransportationProcessRemarks(data, accountObj, 'nextDeptOrder_ss');
|
290
|
201
|
}else if(this.actionPhotoSwitch){
|
291
|
202
|
// 拍照
|
292
|
|
- this.uploadToOther(data, accountObj, type);
|
|
203
|
+ this.isOpenTransportationProcessRemarks(data, accountObj, 'uploadToOther');
|
293
|
204
|
}
|
294
|
205
|
} else if (result.state == '0000') {
|
295
|
206
|
uni.hideLoading();
|
|
@@ -303,126 +214,6 @@
|
303
|
214
|
}
|
304
|
215
|
});
|
305
|
216
|
},
|
306
|
|
- // 完成工单
|
307
|
|
- uploadToOther(data, accountObj, type){
|
308
|
|
- let imageValue = this.imageValue;
|
309
|
|
- // 完成工单
|
310
|
|
- post('/workerOrder/findRecordInfoByOrderId', {
|
311
|
|
- orderId: this.orderId,
|
312
|
|
- gdOperate: 22,
|
313
|
|
- }).then(result => {
|
314
|
|
- if (result.state == 200) {
|
315
|
|
- uni.showLoading({
|
316
|
|
- mask: true,
|
317
|
|
- title: '加载中'
|
318
|
|
- });
|
319
|
|
- let n = 0;
|
320
|
|
- //#ifdef H5
|
321
|
|
- imageValue.forEach((v) => {
|
322
|
|
- // 图片上传 start
|
323
|
|
- console.log("压缩前");
|
324
|
|
- let canvasWidth = v.image.width; //图片原始长宽
|
325
|
|
- let canvasHeight = v.image.height;
|
326
|
|
- let img = new Image();
|
327
|
|
- img.src = v.path;
|
328
|
|
- let canvas = document.createElement("canvas");
|
329
|
|
- let ctx = canvas.getContext("2d");
|
330
|
|
- canvas.width = canvasWidth;
|
331
|
|
- canvas.height = canvasHeight;
|
332
|
|
- ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight);
|
333
|
|
- canvas.toBlob(
|
334
|
|
- (fileSrc) => {
|
335
|
|
- let tp = window.URL.createObjectURL(fileSrc);
|
336
|
|
- console.log("压缩后");
|
337
|
|
- n++;
|
338
|
|
- uni.uploadFile({
|
339
|
|
- url: pathUrl +
|
340
|
|
- "/common/common/uploadAttachment/orderEndPhoto/" +
|
341
|
|
- this.orderId +
|
342
|
|
- "/" + result.recordId,
|
343
|
|
- filePath: tp,
|
344
|
|
- name: "file",
|
345
|
|
- formData: {
|
346
|
|
- filename: v.name,
|
347
|
|
- },
|
348
|
|
- success: (uploadFileRes) => {
|
349
|
|
- console.log(uploadFileRes);
|
350
|
|
- if (--n === 0) {
|
351
|
|
- this.nextDeptOrder_ss(data, accountObj, type);
|
352
|
|
- }
|
353
|
|
- },
|
354
|
|
- fail: (err) => {
|
355
|
|
- n--;
|
356
|
|
- console.error(err);
|
357
|
|
- uni.showToast({
|
358
|
|
- icon: "none",
|
359
|
|
- title: "上传失败",
|
360
|
|
- duration: 2000,
|
361
|
|
- });
|
362
|
|
- },
|
363
|
|
- });
|
364
|
|
- },
|
365
|
|
- "image/jpeg",
|
366
|
|
- 0.1
|
367
|
|
- );
|
368
|
|
- // 图片上传 end
|
369
|
|
- });
|
370
|
|
- //#endif
|
371
|
|
- //#ifdef APP-PLUS
|
372
|
|
- imageValue.forEach((v) => {
|
373
|
|
- // 图片上传 start
|
374
|
|
- uni.compressImage({
|
375
|
|
- src: v.path,
|
376
|
|
- quality: 30,
|
377
|
|
- success: (res) => {
|
378
|
|
- console.log('压缩前', res)
|
379
|
|
- let tp = res.tempFilePath;
|
380
|
|
- console.log("压缩后");
|
381
|
|
- n++;
|
382
|
|
- uni.uploadFile({
|
383
|
|
- url: pathUrl +
|
384
|
|
- "/common/common/uploadAttachment/orderEndPhoto/" +
|
385
|
|
- this.orderId +
|
386
|
|
- "/" + result.recordId,
|
387
|
|
- filePath: tp,
|
388
|
|
- name: "file",
|
389
|
|
- formData: {
|
390
|
|
- filename: v.name,
|
391
|
|
- },
|
392
|
|
- success: (uploadFileRes) => {
|
393
|
|
- console.log(uploadFileRes);
|
394
|
|
- if (--n === 0) {
|
395
|
|
- this.nextDeptOrder_ss(data, accountObj, type);
|
396
|
|
- }
|
397
|
|
- },
|
398
|
|
- fail: (err) => {
|
399
|
|
- n--;
|
400
|
|
- console.error(err);
|
401
|
|
- uni.showToast({
|
402
|
|
- icon: "none",
|
403
|
|
- title: "上传失败",
|
404
|
|
- duration: 2000,
|
405
|
|
- });
|
406
|
|
- },
|
407
|
|
- });
|
408
|
|
- },
|
409
|
|
- fail: function () {
|
410
|
|
- uni.hideLoading();
|
411
|
|
- uni.showToast({
|
412
|
|
- icon: 'none',
|
413
|
|
- title: '上传失败',
|
414
|
|
- duration: 2000
|
415
|
|
- });
|
416
|
|
- }
|
417
|
|
- })
|
418
|
|
- // 图片上传 end
|
419
|
|
- });
|
420
|
|
- //#endif
|
421
|
|
- }else{
|
422
|
|
- uni.hideLoading();
|
423
|
|
- }
|
424
|
|
- })
|
425
|
|
- },
|
426
|
217
|
// 返回
|
427
|
218
|
goBack() {
|
428
|
219
|
uni.navigateBack();
|