|
@@ -34,15 +34,23 @@
|
34
|
34
|
<view class="foot_btn">
|
35
|
35
|
<view class="btn3" @click="showAlert()">知道了</view>
|
36
|
36
|
<block v-if="res.scanCodeSpecimenOrderSign == 1">
|
37
|
|
- <view class="btn3" @click="buildAndOrderSign(res.data.id,res.workOrder.id)" v-if="res.workOrder&&(res.workOrder.gdState.value == 2||res.workOrder.gdState.value == 4)">接单并签到</view>
|
38
|
|
- <view class="btn3" @click="orderSign(res.workOrder)" v-if="res.workOrder&&res.workOrder.gdState.value != 2&&res.workOrder.gdState.value != 4">执行工单</view>
|
|
37
|
+ <view class="btn3" @click="buildAndOrderSign(res.data.id,res.workOrder.id)"
|
|
38
|
+ v-if="res.workOrder&&(res.workOrder.gdState.value == 2||res.workOrder.gdState.value == 4)">接单并签到</view>
|
|
39
|
+ <view class="btn3" @click="orderSign(res.workOrder)"
|
|
40
|
+ v-else-if="res.workOrder&&res.workOrder.gdState.value != 2&&res.workOrder.gdState.value != 4">执行工单</view>
|
39
|
41
|
<view class="btn3" @click="buildAndOrderSign(res.data.id)" v-if="!res.workOrder && res.data">建单并签到</view>
|
40
|
42
|
</block>
|
|
43
|
+ <view class="btn3" @click="back(res.data,res.workOrder)"
|
|
44
|
+ v-if="res.data.speState&&(res.data.speState.value == 2||res.data.speState.value == 3||res.data.speState.value == 4||res.data.speState.value == 5)">
|
|
45
|
+ 退回</view>
|
41
|
46
|
</view>
|
42
|
47
|
<!-- 填写交接人账号弹窗 -->
|
43
|
48
|
<selectAccount v-if="hosModels.disjunctor" :title="hosModels.title" :disjunctor="hosModels.disjunctor" @ok="hosOk"
|
44
|
49
|
@cancel="hosCancel">
|
45
|
50
|
</selectAccount>
|
|
51
|
+ <!-- 弹窗 -->
|
|
52
|
+ <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
|
|
53
|
+ :operate="models.operate" @know="know"></showModel>
|
46
|
54
|
</view>
|
47
|
55
|
</template>
|
48
|
56
|
<script>
|
|
@@ -53,6 +61,12 @@
|
53
|
61
|
export default {
|
54
|
62
|
data() {
|
55
|
63
|
return {
|
|
64
|
+ // 弹窗model
|
|
65
|
+ models: {
|
|
66
|
+ disjunctor: false,
|
|
67
|
+ },
|
|
68
|
+ backSpecimen: {},
|
|
69
|
+ backStatus: '',
|
56
|
70
|
infoDATA: {},
|
57
|
71
|
res: {},
|
58
|
72
|
// 填写交接人账号弹窗model
|
|
@@ -109,101 +123,208 @@
|
109
|
123
|
});
|
110
|
124
|
}
|
111
|
125
|
},
|
|
126
|
+ // 退回
|
|
127
|
+ back(specimen, workOrder) {
|
|
128
|
+ this.backSpecimen = specimen;
|
|
129
|
+ this.backStatus = 'back';
|
|
130
|
+ uni.showModal({
|
|
131
|
+ title: '提示',
|
|
132
|
+ content: '是否退回?',
|
|
133
|
+ success: (res) => {
|
|
134
|
+ if (res.confirm) {
|
|
135
|
+ console.log('用户点击确定');
|
|
136
|
+ let postData = {
|
|
137
|
+ "idx": 0,
|
|
138
|
+ "sum": 1,
|
|
139
|
+ "hospitalConfig": {
|
|
140
|
+ "hosId": uni.getStorageSync("userData").user.currentHospital.id,
|
|
141
|
+ "key": "returnSpecimenWhetherHandover"
|
|
142
|
+ }
|
|
143
|
+ };
|
|
144
|
+ uni.showLoading({
|
|
145
|
+ title: "加载中",
|
|
146
|
+ mask: true,
|
|
147
|
+ });
|
|
148
|
+ post('/simple/data/fetchDataList/hospitalConfig', postData).then((result) => {
|
|
149
|
+ uni.hideLoading();
|
|
150
|
+ if (result.status == 200) {
|
|
151
|
+ if (result.list[0].value == 1) {
|
|
152
|
+ this.showSelectAccount();
|
|
153
|
+ } else {
|
|
154
|
+ this.backHandler(this.backSpecimen, workOrder);
|
|
155
|
+ }
|
|
156
|
+ } else {
|
|
157
|
+ uni.showToast({
|
|
158
|
+ icon: "none",
|
|
159
|
+ title: "请求失败!",
|
|
160
|
+ });
|
|
161
|
+ }
|
|
162
|
+ })
|
|
163
|
+ } else if (res.cancel) {
|
|
164
|
+ console.log('用户点击取消');
|
|
165
|
+ }
|
|
166
|
+ }
|
|
167
|
+ });
|
|
168
|
+ },
|
112
|
169
|
// 执行工单
|
113
|
170
|
orderSign(workOrder) {
|
114
|
171
|
this.type = 'orderSign';
|
115
|
|
- uni.showLoading({
|
116
|
|
- title: "加载中",
|
117
|
|
- mask: true,
|
118
|
|
- });
|
119
|
|
- let postData = {
|
120
|
|
- content: workOrder.startDept.qrcode,
|
121
|
|
- taskTypeId: workOrder.taskType.id,
|
122
|
|
- gdState: workOrder.gdState.id,
|
123
|
|
- };
|
124
|
|
- //检验二维码的有效性
|
125
|
|
- post("/dept/scanning", postData).then((result) => {
|
126
|
|
- this.currentCode = result.code;
|
127
|
|
- if (result.state == 200 || result.state == 201) {
|
128
|
|
- if (result.account) {
|
129
|
|
- this.nextDeptOrder_s(workOrder, {
|
130
|
|
- account: result.account,
|
131
|
|
- accountName: result.name,
|
132
|
|
- accountId: result.id,
|
|
172
|
+ uni.showModal({
|
|
173
|
+ title: '提示',
|
|
174
|
+ content: '是否执行工单?',
|
|
175
|
+ success: (res) => {
|
|
176
|
+ if (res.confirm) {
|
|
177
|
+ console.log('用户点击确定');
|
|
178
|
+ uni.showLoading({
|
|
179
|
+ title: "加载中",
|
|
180
|
+ mask: true,
|
133
|
181
|
});
|
134
|
|
- } else {
|
135
|
|
- this.nextDeptOrder_s(workOrder);
|
|
182
|
+ let postData = {
|
|
183
|
+ content: workOrder.startDept.qrcode,
|
|
184
|
+ taskTypeId: workOrder.taskType.id,
|
|
185
|
+ gdState: workOrder.gdState.id,
|
|
186
|
+ };
|
|
187
|
+ //检验二维码的有效性
|
|
188
|
+ post("/dept/scanning", postData).then((result) => {
|
|
189
|
+ this.currentCode = result.code;
|
|
190
|
+ if (result.state == 200 || result.state == 201) {
|
|
191
|
+ if (result.account) {
|
|
192
|
+ this.nextDeptOrder_s(workOrder, {
|
|
193
|
+ account: result.account,
|
|
194
|
+ accountName: result.name,
|
|
195
|
+ accountId: result.id,
|
|
196
|
+ });
|
|
197
|
+ } else {
|
|
198
|
+ this.nextDeptOrder_s(workOrder);
|
|
199
|
+ }
|
|
200
|
+ } else if (result.state == "0000") {
|
|
201
|
+ uni.hideLoading();
|
|
202
|
+ this.showSelectAccount();
|
|
203
|
+ } else {
|
|
204
|
+ uni.hideLoading();
|
|
205
|
+ uni.showToast({
|
|
206
|
+ icon: "none",
|
|
207
|
+ title: "请求失败!",
|
|
208
|
+ });
|
|
209
|
+ }
|
|
210
|
+ });
|
|
211
|
+ } else if (res.cancel) {
|
|
212
|
+ console.log('用户点击取消');
|
136
|
213
|
}
|
137
|
|
- } else if (result.state == "0000") {
|
138
|
|
- uni.hideLoading();
|
139
|
|
- this.showSelectAccount();
|
140
|
|
- } else {
|
141
|
|
- uni.hideLoading();
|
142
|
|
- uni.showToast({
|
143
|
|
- icon: "none",
|
144
|
|
- title: "请求失败!",
|
145
|
|
- });
|
146
|
214
|
}
|
147
|
215
|
});
|
148
|
216
|
},
|
149
|
217
|
// 接单并签到或建单并签到
|
150
|
|
- buildAndOrderSign(speId,orderId) {
|
|
218
|
+ buildAndOrderSign(speId, orderId) {
|
151
|
219
|
this.type = 'buildAndOrderSign';
|
152
|
|
- if(orderId){
|
|
220
|
+ if (orderId) {
|
153
|
221
|
// 接单并签到
|
154
|
222
|
this.type = 'specimenAssignAndSign';
|
155
|
|
- }else{
|
|
223
|
+ } else {
|
156
|
224
|
// 建单并签到
|
157
|
225
|
this.type = 'buildAndOrderSign';
|
158
|
226
|
}
|
159
|
|
- uni.showLoading({
|
160
|
|
- title: "加载中",
|
161
|
|
- mask: true,
|
162
|
|
- });
|
163
|
|
- let postData = {
|
164
|
|
- speId
|
165
|
|
- }
|
166
|
|
- if(orderId){
|
167
|
|
- // 接单并签到
|
168
|
|
- postData.orderId = orderId;
|
169
|
|
- }
|
170
|
|
- post("/workerOrder/specimenCreateAndSign", postData).then((res) => {
|
171
|
|
- if (res.state == 200 || res.state == 201) {
|
172
|
|
- uni.hideLoading();
|
173
|
|
- if (res.status == 200) {
|
174
|
|
- // 跳转到扫描科室
|
175
|
|
- // type1: res.type, //type类型
|
176
|
|
- // id: data.id, //工单ID
|
177
|
|
- // deptCode: code, //二维码
|
178
|
|
- // dept: res.dept //科室名称
|
179
|
|
- uni.navigateTo({
|
180
|
|
- url: `/pages/scanning_code/scanning_code?type=${
|
181
|
|
- res.workOrder.taskType.associationType.value
|
182
|
|
- }&type1=${res.type}&id=${res.workOrder.id}&deptCode=${
|
183
|
|
- this.currentCode
|
184
|
|
- }&dept=${res.dept}&accountObj=${encodeURIComponent(
|
185
|
|
- JSON.stringify(undefined)
|
186
|
|
- )}&deptId=${res.deptId}`,
|
|
227
|
+ uni.showModal({
|
|
228
|
+ title: '提示',
|
|
229
|
+ content: `是否${this.type == 'specimenAssignAndSign'?'接单并签到':'建单并签到'}?`,
|
|
230
|
+ success: (res) => {
|
|
231
|
+ if (res.confirm) {
|
|
232
|
+ console.log('用户点击确定');
|
|
233
|
+ uni.showLoading({
|
|
234
|
+ title: "加载中",
|
|
235
|
+ mask: true,
|
187
|
236
|
});
|
188
|
|
- } else {
|
189
|
|
- uni.navigateTo({
|
190
|
|
- 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`,
|
|
237
|
+ let postData = {
|
|
238
|
+ speId
|
|
239
|
+ }
|
|
240
|
+ if (orderId) {
|
|
241
|
+ // 接单并签到
|
|
242
|
+ postData.orderId = orderId;
|
|
243
|
+ }
|
|
244
|
+ post("/workerOrder/specimenCreateAndSign", postData).then((res) => {
|
|
245
|
+ if (res.state == 200 || res.state == 201) {
|
|
246
|
+ uni.hideLoading();
|
|
247
|
+ if (res.status == 200) {
|
|
248
|
+ // 跳转到扫描科室
|
|
249
|
+ // type1: res.type, //type类型
|
|
250
|
+ // id: data.id, //工单ID
|
|
251
|
+ // deptCode: code, //二维码
|
|
252
|
+ // dept: res.dept //科室名称
|
|
253
|
+ uni.navigateTo({
|
|
254
|
+ url: `/pages/scanning_code/scanning_code?type=${
|
|
255
|
+ res.workOrder.taskType.associationType.value
|
|
256
|
+ }&type1=${res.type}&id=${res.workOrder.id}&deptCode=${
|
|
257
|
+ this.currentCode
|
|
258
|
+ }&dept=${res.dept}&accountObj=${encodeURIComponent(
|
|
259
|
+ JSON.stringify(undefined)
|
|
260
|
+ )}&deptId=${res.deptId}`,
|
|
261
|
+ });
|
|
262
|
+ } else {
|
|
263
|
+ uni.navigateTo({
|
|
264
|
+ 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`,
|
|
265
|
+ });
|
|
266
|
+ }
|
|
267
|
+ } else if (res.state == "0000") {
|
|
268
|
+ uni.hideLoading();
|
|
269
|
+ this.currentCode = res.code;
|
|
270
|
+ this.res.workOrder = res.workOrder;
|
|
271
|
+ this.showSelectAccount();
|
|
272
|
+ } else {
|
|
273
|
+ uni.hideLoading();
|
|
274
|
+ uni.showToast({
|
|
275
|
+ icon: "none",
|
|
276
|
+ title: res.msg || "请求失败!",
|
|
277
|
+ });
|
|
278
|
+ }
|
191
|
279
|
});
|
|
280
|
+ } else if (res.cancel) {
|
|
281
|
+ console.log('用户点击取消');
|
192
|
282
|
}
|
193
|
|
- } else if (res.state == "0000") {
|
194
|
|
- uni.hideLoading();
|
195
|
|
- this.currentCode = res.code;
|
196
|
|
- this.res.workOrder = res.workOrder;
|
197
|
|
- this.showSelectAccount();
|
198
|
|
- } else {
|
199
|
|
- uni.hideLoading();
|
200
|
|
- uni.showToast({
|
201
|
|
- icon: "none",
|
202
|
|
- title: res.msg || "请求失败!",
|
203
|
|
- });
|
204
|
283
|
}
|
205
|
284
|
});
|
206
|
285
|
},
|
|
286
|
+ know() {
|
|
287
|
+ this.models.disjunctor = false;
|
|
288
|
+ if (this.models.icon === 'success') {
|
|
289
|
+ uni.navigateTo({
|
|
290
|
+ url: "../receiptpage/receiptpage",
|
|
291
|
+ });
|
|
292
|
+ }
|
|
293
|
+ },
|
|
294
|
+ // 退回
|
|
295
|
+ backHandler(specimen, workorder, data) {
|
|
296
|
+ console.log(specimen);
|
|
297
|
+ uni.showLoading({
|
|
298
|
+ title: '加载中',
|
|
299
|
+ mask: true
|
|
300
|
+ })
|
|
301
|
+ let postData = {
|
|
302
|
+ scode: specimen.scode,
|
|
303
|
+ hosId: uni.getStorageSync("userData").user.currentHospital.id,
|
|
304
|
+ speState: specimen.speState ? specimen.speState.id : undefined,
|
|
305
|
+ handoverId: data ? data.accountId : undefined,
|
|
306
|
+ handoverName: data ? data.accountName : undefined,
|
|
307
|
+ gdId: workorder ? workorder.id : undefined,
|
|
308
|
+ }
|
|
309
|
+ post('/workerOrder/returnSpecimen', postData).then(res => {
|
|
310
|
+ uni.hideLoading();
|
|
311
|
+ if (res.state == 200) {
|
|
312
|
+ this.models = {
|
|
313
|
+ disjunctor: true,
|
|
314
|
+ title: "提示",
|
|
315
|
+ content: `标本退回成功`,
|
|
316
|
+ icon: "success",
|
|
317
|
+ };
|
|
318
|
+ } else {
|
|
319
|
+ this.models = {
|
|
320
|
+ disjunctor: true,
|
|
321
|
+ title: "提示",
|
|
322
|
+ content: `标本退回失败`,
|
|
323
|
+ icon: "error",
|
|
324
|
+ };
|
|
325
|
+ }
|
|
326
|
+ })
|
|
327
|
+ },
|
207
|
328
|
// 填写交接人账号-确认
|
208
|
329
|
hosOk(data) {
|
209
|
330
|
console.log(data);
|
|
@@ -248,7 +369,12 @@
|
248
|
369
|
title: "加载中",
|
249
|
370
|
mask: true,
|
250
|
371
|
});
|
251
|
|
- this.nextDeptOrder_s(this.res.workOrder, data);
|
|
372
|
+ if (this.backStatus = 'back') {
|
|
373
|
+ // 退回
|
|
374
|
+ this.backHandler(this.backSpecimen, this.res.workOrder, data);
|
|
375
|
+ } else {
|
|
376
|
+ this.nextDeptOrder_s(this.res.workOrder, data);
|
|
377
|
+ }
|
252
|
378
|
},
|
253
|
379
|
// 填写交接人账号-取消
|
254
|
380
|
hosCancel() {
|