|
@@ -33,6 +33,10 @@
|
33
|
33
|
<view class="btn2" @click="createOrder">确认数量并建单</view>
|
34
|
34
|
<view class="btn2" @click="goto()">知道了</view>
|
35
|
35
|
</view>
|
|
36
|
+ <!-- 修改标本数量弹窗 -->
|
|
37
|
+ <changeSpeNum v-if="changeSpeModels.disjunctor" :operate="{ok:'确认数量',check:'详细核对',cancel:'取消'}" :title="changeSpeModels.title" :content="changeSpeModels.content"
|
|
38
|
+ :disjunctor="changeSpeModels.disjunctor" @ok="changeSpeOk" @check="changeSpeCheck" @cancel="changeSpeCancel" :num="speNumChange">
|
|
39
|
+ </changeSpeNum>
|
36
|
40
|
</view>
|
37
|
41
|
</template>
|
38
|
42
|
<script>
|
|
@@ -46,9 +50,269 @@
|
46
|
50
|
return {
|
47
|
51
|
list: [],
|
48
|
52
|
msg: {}, //页面展示信息
|
|
53
|
+ // 修改标本数量弹窗model
|
|
54
|
+ changeSpeModels: {
|
|
55
|
+ disjunctor: false,
|
|
56
|
+ },
|
|
57
|
+ speNumChange: 0,
|
|
58
|
+ changeSpeObj: {},
|
49
|
59
|
};
|
50
|
60
|
},
|
51
|
61
|
methods: {
|
|
62
|
+ // 数量核对 start
|
|
63
|
+ // 修改标本数量-核对
|
|
64
|
+ changeSpeCheck(){
|
|
65
|
+ this.changeSpeModels.disjunctor = false;
|
|
66
|
+ uni.navigateTo({
|
|
67
|
+ url: `../../pages/specimenCheckingDetail/specimenCheckingDetail?infoDATA=${encodeURIComponent(JSON.stringify(this.changeSpeObj.infoDATA))}&id=${this.changeSpeObj.id}&endDepts=${this.changeSpeObj.endDepts}`,
|
|
68
|
+ });
|
|
69
|
+ },
|
|
70
|
+ // 修改标本数量-确认
|
|
71
|
+ changeSpeOk(data) {
|
|
72
|
+ console.log(data);
|
|
73
|
+ const pathUrl = uni.getStorageSync("path");
|
|
74
|
+ const {
|
|
75
|
+ speNum,
|
|
76
|
+ reason,
|
|
77
|
+ imageValue
|
|
78
|
+ } = data;
|
|
79
|
+ this.changeSpeModels.disjunctor = false;
|
|
80
|
+ uni.showLoading({
|
|
81
|
+ mask: true,
|
|
82
|
+ title: "加载中",
|
|
83
|
+ });
|
|
84
|
+ let postData = {
|
|
85
|
+ checkDept: this.changeSpeObj.endDepts, //终点科室
|
|
86
|
+ transDeptId: this.changeSpeObj.infoDATA.startDept,
|
|
87
|
+ gdId: this.changeSpeObj.infoDATA.uuid,
|
|
88
|
+ deptId: this.changeSpeObj.id == "undefined" ?
|
|
89
|
+ this.changeSpeObj.infoDATA.startDept : this.changeSpeObj.id,
|
|
90
|
+ specimensNum: speNum,
|
|
91
|
+ modifyReason: reason,
|
|
92
|
+ };
|
|
93
|
+ post("/api/updateCheckDeptSpecimensNum", postData).then((res) => {
|
|
94
|
+ if (res.status == 200) {
|
|
95
|
+ console.log(imageValue);
|
|
96
|
+ if (!imageValue.length) {
|
|
97
|
+ uni.hideLoading();
|
|
98
|
+ uni.showModal({
|
|
99
|
+ title: "提示",
|
|
100
|
+ content: "修改成功!",
|
|
101
|
+ showCancel: false,
|
|
102
|
+ success: (result) => {
|
|
103
|
+ if (result.confirm) {
|
|
104
|
+ console.log("用户点击确定");
|
|
105
|
+ if (this.changeSpeObj.t == "big") {
|
|
106
|
+ if (this.changeSpeObj.gdState == 4) {
|
|
107
|
+ // 待到达
|
|
108
|
+ uni.navigateTo({
|
|
109
|
+ url: `../../pages/receiptpage/receiptpage`,
|
|
110
|
+ });
|
|
111
|
+ } else if (this.changeSpeObj.gdState == 5) {
|
|
112
|
+ // 待送达
|
|
113
|
+ if (res.type1 === "plan-spe-ddd-2") {} else {
|
|
114
|
+ let content = `本工单已签到<strong class="red">${
|
|
115
|
+ res.scanSet ? res.scanSet.join("、") : ""
|
|
116
|
+ }</strong>,剩余需签到科室<strong class="red">${
|
|
117
|
+ res.notScanSet ? res.notScanSet.join("、") : ""
|
|
118
|
+ }</strong>,您确定完成工单吗?`;
|
|
119
|
+ uni.navigateTo({
|
|
120
|
+ url: `../scanning/scanning?type=${res.type}&type1=${
|
|
121
|
+ res.type1
|
|
122
|
+ }&id=${encodeURIComponent(
|
|
123
|
+ JSON.stringify([res.gdid])
|
|
124
|
+ )}&content=${content}`,
|
|
125
|
+ });
|
|
126
|
+ }
|
|
127
|
+ }
|
|
128
|
+ } else if (this.changeSpeObj.t == "small") {
|
|
129
|
+ if (this.changeSpeObj.id == "undefined") {
|
|
130
|
+ //快捷建单建单进入
|
|
131
|
+ uni.navigateTo({
|
|
132
|
+ url: `../../pages/receiptpage/receiptpage`,
|
|
133
|
+ });
|
|
134
|
+ } else {
|
|
135
|
+ if (this.changeSpeObj.gdState == 4) {
|
|
136
|
+ // 待到达
|
|
137
|
+ uni.navigateTo({
|
|
138
|
+ url: `../../pages/receiptpage/receiptpage`,
|
|
139
|
+ });
|
|
140
|
+ } else if (this.changeSpeObj.gdState == 5) {
|
|
141
|
+ // 待送达
|
|
142
|
+ if (res.type1 === "plan-spe-ddd-2") {} else {
|
|
143
|
+ let content = `本工单已签到<strong class="red">${
|
|
144
|
+ res.scanSet ? res.scanSet.join("、") : ""
|
|
145
|
+ }</strong>,剩余需签到科室<strong class="red">${
|
|
146
|
+ res.notScanSet ? res.notScanSet.join("、") : ""
|
|
147
|
+ }</strong>,您确定完成工单吗?`;
|
|
148
|
+ uni.navigateTo({
|
|
149
|
+ url: `../scanning/scanning?type=${res.type}&type1=${
|
|
150
|
+ res.type1
|
|
151
|
+ }&id=${encodeURIComponent(
|
|
152
|
+ JSON.stringify([res.gdid])
|
|
153
|
+ )}&content=${content}`,
|
|
154
|
+ });
|
|
155
|
+ }
|
|
156
|
+ }
|
|
157
|
+ }
|
|
158
|
+ } else {
|
|
159
|
+ uni.navigateTo({
|
|
160
|
+ url: `../../pages/specimenChecking/specimenChecking?infoDATA=${encodeURIComponent(
|
|
161
|
+ JSON.stringify(this.changeSpeObj.infoDATA)
|
|
162
|
+ )}`,
|
|
163
|
+ });
|
|
164
|
+ }
|
|
165
|
+ } else if (result.cancel) {
|
|
166
|
+ console.log("用户点击取消");
|
|
167
|
+ }
|
|
168
|
+ },
|
|
169
|
+ });
|
|
170
|
+ return;
|
|
171
|
+ }
|
|
172
|
+ let n = 0;
|
|
173
|
+ imageValue.forEach((v) => {
|
|
174
|
+ // 图片上传 start
|
|
175
|
+ console.log("压缩前");
|
|
176
|
+ let canvasWidth = v.image.width; //图片原始长宽
|
|
177
|
+ let canvasHeight = v.image.height;
|
|
178
|
+ let img = new Image();
|
|
179
|
+ img.src = v.path;
|
|
180
|
+ let canvas = document.createElement("canvas");
|
|
181
|
+ let ctx = canvas.getContext("2d");
|
|
182
|
+ canvas.width = canvasWidth;
|
|
183
|
+ canvas.height = canvasHeight;
|
|
184
|
+ ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight);
|
|
185
|
+ canvas.toBlob(
|
|
186
|
+ (fileSrc) => {
|
|
187
|
+ let tp = window.URL.createObjectURL(fileSrc);
|
|
188
|
+ console.log("压缩后");
|
|
189
|
+ n++;
|
|
190
|
+ uni.uploadFile({
|
|
191
|
+ url: pathUrl +
|
|
192
|
+ "/common/common/uploadAttachment/specimenPhotos/" +
|
|
193
|
+ res.deptSpecimensNumId +
|
|
194
|
+ "/666",
|
|
195
|
+ filePath: tp,
|
|
196
|
+ name: "file",
|
|
197
|
+ formData: {
|
|
198
|
+ filename: v.cloudPath,
|
|
199
|
+ },
|
|
200
|
+ success: (uploadFileRes) => {
|
|
201
|
+ console.log(uploadFileRes);
|
|
202
|
+ if (--n === 0) {
|
|
203
|
+ uni.hideLoading();
|
|
204
|
+ uni.showModal({
|
|
205
|
+ title: "提示",
|
|
206
|
+ content: "修改成功!",
|
|
207
|
+ showCancel: false,
|
|
208
|
+ success: (result) => {
|
|
209
|
+ if (result.confirm) {
|
|
210
|
+ console.log("用户点击确定", this.changeSpeObj.t);
|
|
211
|
+ if (this.changeSpeObj.t == "big") {
|
|
212
|
+ if (this.changeSpeObj.gdState == 4) {
|
|
213
|
+ // 待到达
|
|
214
|
+ uni.navigateTo({
|
|
215
|
+ url: `../../pages/receiptpage/receiptpage`,
|
|
216
|
+ });
|
|
217
|
+ } else if (this.changeSpeObj.gdState == 5) {
|
|
218
|
+ // 待送达
|
|
219
|
+ if (res.type1 === "plan-spe-ddd-2") {} else {
|
|
220
|
+ let content = `本工单已签到<strong class="red">${
|
|
221
|
+ res.scanSet ? res.scanSet.join("、") : ""
|
|
222
|
+ }</strong>,剩余需签到科室<strong class="red">${
|
|
223
|
+ res.notScanSet ? res.notScanSet.join("、") : ""
|
|
224
|
+ }</strong>,您确定完成工单吗?`;
|
|
225
|
+ uni.navigateTo({
|
|
226
|
+ url: `../scanning/scanning?type=${res.type}&type1=${
|
|
227
|
+ res.type1
|
|
228
|
+ }&id=${encodeURIComponent(
|
|
229
|
+ JSON.stringify([res.gdid])
|
|
230
|
+ )}&content=${content}`,
|
|
231
|
+ });
|
|
232
|
+ }
|
|
233
|
+ }
|
|
234
|
+ } else if (this.changeSpeObj.t == "small") {
|
|
235
|
+ if (this.changeSpeObj.id == "undefined") {
|
|
236
|
+ //快捷建单建单进入
|
|
237
|
+ uni.navigateTo({
|
|
238
|
+ url: `../../pages/receiptpage/receiptpage`,
|
|
239
|
+ });
|
|
240
|
+ } else {
|
|
241
|
+ if (this.changeSpeObj.gdState == 4) {
|
|
242
|
+ // 待到达
|
|
243
|
+ uni.navigateTo({
|
|
244
|
+ url: `../../pages/receiptpage/receiptpage`,
|
|
245
|
+ });
|
|
246
|
+ } else if (this.changeSpeObj.gdState == 5) {
|
|
247
|
+ // 待送达
|
|
248
|
+ if (res.type1 === "plan-spe-ddd-2") {} else {
|
|
249
|
+ let content = `本工单已签到<strong class="red">${
|
|
250
|
+ res.scanSet ? res.scanSet.join("、") : ""
|
|
251
|
+ }</strong>,剩余需签到科室<strong class="red">${
|
|
252
|
+ res.notScanSet ? res.notScanSet.join("、") : ""
|
|
253
|
+ }</strong>,您确定完成工单吗?`;
|
|
254
|
+ uni.navigateTo({
|
|
255
|
+ url: `../scanning/scanning?type=${res.type}&type1=${
|
|
256
|
+ res.type1
|
|
257
|
+ }&id=${encodeURIComponent(
|
|
258
|
+ JSON.stringify([res.gdid])
|
|
259
|
+ )}&content=${content}`,
|
|
260
|
+ });
|
|
261
|
+ }
|
|
262
|
+ }
|
|
263
|
+ }
|
|
264
|
+ } else {
|
|
265
|
+ uni.navigateTo({
|
|
266
|
+ url: `../../pages/specimenChecking/specimenChecking?infoDATA=${encodeURIComponent(
|
|
267
|
+ JSON.stringify(this.changeSpeObj.infoDATA)
|
|
268
|
+ )}`,
|
|
269
|
+ });
|
|
270
|
+ }
|
|
271
|
+ } else if (result.cancel) {
|
|
272
|
+ console.log("用户点击取消");
|
|
273
|
+ }
|
|
274
|
+ },
|
|
275
|
+ });
|
|
276
|
+ }
|
|
277
|
+ },
|
|
278
|
+ fail: (err) => {
|
|
279
|
+ n--;
|
|
280
|
+ console.error(err);
|
|
281
|
+ uni.hideLoading();
|
|
282
|
+ uni.showToast({
|
|
283
|
+ icon: "none",
|
|
284
|
+ title: "上传失败",
|
|
285
|
+ duration: 2000,
|
|
286
|
+ });
|
|
287
|
+ },
|
|
288
|
+ });
|
|
289
|
+ },
|
|
290
|
+ "image/jpeg",
|
|
291
|
+ 0.3
|
|
292
|
+ );
|
|
293
|
+ // 图片上传 end
|
|
294
|
+ });
|
|
295
|
+ } else {
|
|
296
|
+ uni.hideLoading();
|
|
297
|
+ uni.showToast({
|
|
298
|
+ icon: "none",
|
|
299
|
+ title: "请求失败!",
|
|
300
|
+ });
|
|
301
|
+ }
|
|
302
|
+ });
|
|
303
|
+ },
|
|
304
|
+ // 修改标本数量-取消
|
|
305
|
+ changeSpeCancel() {
|
|
306
|
+ this.changeSpeModels.disjunctor = false;
|
|
307
|
+ },
|
|
308
|
+ // 修改标本数量弹窗
|
|
309
|
+ showChangeSpe() {
|
|
310
|
+ this.changeSpeModels = {
|
|
311
|
+ title: "修改标本数量",
|
|
312
|
+ disjunctor: true,
|
|
313
|
+ };
|
|
314
|
+ },
|
|
315
|
+ // 数量核对 end
|
52
|
316
|
// 获取列表
|
53
|
317
|
getList() {
|
54
|
318
|
uni.showLoading({
|
|
@@ -75,9 +339,13 @@
|
75
|
339
|
},
|
76
|
340
|
// 跳转到详情页
|
77
|
341
|
gotoDetail(item) {
|
78
|
|
- uni.navigateTo({
|
79
|
|
- url: `../../pages/specimenCheckingDetail/specimenCheckingDetail?infoDATA=${encodeURIComponent(JSON.stringify(this.msg))}&id=${item[0]}&endDepts=${this.msg.targetDept}`,
|
80
|
|
- });
|
|
342
|
+ this.speNumChange = item[2];
|
|
343
|
+ this.changeSpeObj = {
|
|
344
|
+ infoDATA: this.msg,
|
|
345
|
+ id: item[0],
|
|
346
|
+ endDepts:this.msg.targetDept,
|
|
347
|
+ }
|
|
348
|
+ this.showChangeSpe();
|
81
|
349
|
},
|
82
|
350
|
// 知道了
|
83
|
351
|
goto() {
|