Kaynağa Gözat

拉取代码

maotao 1 hafta önce
ebeveyn
işleme
77736f6c29

+ 5 - 5
components/showModel/showModel.vue

@@ -12,7 +12,7 @@
12 12
           :class="[
13 13
             'showModel__icon--' + icon,
14 14
             { 'newicon-duigou': icon === 'success' },
15
-            { 'newicon-shibai': icon === 'error' },
15
+            // { 'newicon-shibai': icon === 'error' },
16 16
             { 'newicon-wenhao': icon === 'warn' },
17 17
           ]"
18 18
         ></text>
@@ -98,16 +98,16 @@
98 98
 export default {
99 99
   data() {
100 100
     return {
101
-      time: 5, //5秒后自动关闭
101
+      time: 3, //5秒后自动关闭
102 102
       timer: null, //5秒后自动关闭,定时器
103
-      timerFlag: true, //是否显示取消自动关闭按钮
103
+      timerFlag: false, //是否显示取消自动关闭按钮
104 104
     };
105 105
   },
106 106
   watch: {
107 107
     disjunctor(newValue) {
108 108
       if (newValue && this.operate.know == "知道了") {
109
-        this.time = 5;
110
-        this.timerFlag = true;
109
+        this.time = 3;
110
+        // this.timerFlag = true;
111 111
         this.timer = setInterval(() => {
112 112
           this.time--;
113 113
           if (this.time <= 0) {

+ 191 - 3
pages/receiptpage/receiptpage.vue

@@ -1179,10 +1179,198 @@
1179 1179
           return;
1180 1180
         }
1181 1181
         this.drugbagModels.disjunctor = false;
1182
-        uni.navigateTo({
1183
-          url: `/pages/scanning_drug/scanning_drug?drugsBagId=${data.id}`,
1184
-        });
1182
+				if ( data.drugsBagType && (data.drugsBagType.value == 'drugsJpbag' || data.drugsBagType.value == 'drugsWestern' || data.drugsBagType.value == 'drugsReturn' || data.drugsBagType.value == 'drugsPoison' || data.drugsBagType.value == 'drugsHerbal')) {
1183
+				  //新药品-扫静配|西药|退药|毒麻|中草药
1184
+				  if(data.gdId){
1185
+				    // 有工单
1186
+				    this.getInfo(data, data.packid);
1187
+				  }else{
1188
+				    // 没有工单,进入起点科室流程
1189
+				    uni.navigateTo({
1190
+				      url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${data.drugsBagType.value}&drugsBagId=${data.id}&type=build`,
1191
+				    });
1192
+				  }
1193
+				}else{
1194
+				  //扫药包码
1195
+				  uni.navigateTo({
1196
+				    url: `/pages/scanning_drug/scanning_drug?drugsBagId=${data.id}&drugsBagBatchNo=${data.batchNo}`,
1197
+				  });
1198
+				}
1199
+        // uni.navigateTo({
1200
+        //   url: `/pages/scanning_drug/scanning_drug?drugsBagId=${data.id}`,
1201
+        // });
1185 1202
       },
1203
+			//获取药包信息
1204
+			getInfo(responeseData, code){
1205
+			  console.log(responeseData);
1206
+			  uni.showLoading({
1207
+			    title: "加载中",
1208
+			    mask: true,
1209
+			  });
1210
+			
1211
+			  post(`/transflow/scanInfo`, {type: responeseData.drugsBagType.value, id: responeseData.id, orderStateValue: responeseData.drugsState.value}).then(res => {
1212
+			    uni.hideLoading();
1213
+			    if(res.state == 200){
1214
+			      if(res.data){
1215
+			        let drugsBag = res.data.dto || {};
1216
+			        let orderId = responeseData.gdId;
1217
+			        let config = res.data.taskTypeConfig || {};
1218
+			        console.log(res);
1219
+			        if(responeseData.drugsState.value == 2 || responeseData.drugsState.value == 3 || (responeseData.drugsState.value == 4 && responeseData.workOrderDTO.worker.id == uni.getStorageSync('userData').user.id)){
1220
+			          // 待抢单、待接单、待到达(本人),进入起点科室流程
1221
+			          uni.navigateTo({
1222
+			            url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${responeseData.drugsBagType.value}&drugsBagId=${responeseData.id}&orderId=${responeseData.gdId || ''}&type=receive`,
1223
+			          });
1224
+			        }else if(responeseData.drugsState.value == 5 && responeseData.workOrderDTO.worker.id == uni.getStorageSync('userData').user.id){
1225
+			          // 待送达(本人),进入终点科室流程
1226
+			          this.pageNavigateByConfig(config, responeseData, responeseData, code)
1227
+			        }else{
1228
+			          // 查看药包信息
1229
+			          uni.navigateTo({
1230
+			            url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${responeseData.drugsBagType.value}&drugsBagId=${responeseData.id}&type=view`,
1231
+			          });
1232
+			        }
1233
+			      }
1234
+			    }else{
1235
+			      uni.showToast({
1236
+			        icon: "none",
1237
+			        title: res.msg || "接口获取数据失败!",
1238
+			      });
1239
+			    }
1240
+			  })
1241
+			},
1242
+			// 根据配置跳转页面
1243
+			pageNavigateByConfig(config, responseData, queryObj, code){
1244
+			  let drugsBagType = queryObj.drugsBagType.value;
1245
+			  let orderId = responseData.gdId;
1246
+			  let drugsBagId = responseData.id;
1247
+			  let orderStateValue = responseData.drugsState;
1248
+			  if(config.drugsModel === 1){
1249
+			    // 一单一码
1250
+			    if(responseData.drugsState.value == 4){
1251
+			      // 待到达
1252
+			      if(config.drugsStartCheck === 1){
1253
+			        // 起点科室支持核对
1254
+			        uni.navigateTo({
1255
+			          url: `/pages/newDrug/checkPage/checkPage?drugsBagType=${drugsBagType}&orderId=${orderId}`,
1256
+			        });
1257
+			      }else{
1258
+			        // 起点科室不支持核对
1259
+			        if(config.drugsStartPhoto === 1){
1260
+			          // 起点科室支持拍照留存
1261
+			          uni.navigateTo({
1262
+			            url: `/pages/newDrug/photoRetention/photoRetention?drugsBagType=${drugsBagType}&orderId=${orderId}`,
1263
+			          });
1264
+			        }else{
1265
+			          // 起点科室不支持拍照留存
1266
+			          this.completeOrder(responseData, queryObj);
1267
+			        }
1268
+			      }
1269
+			    }else if(responseData.drugsState.value == 5){
1270
+			      // 待送达
1271
+			      uni.showLoading({
1272
+			        title: "加载中",
1273
+			        mask: true,
1274
+			      });
1275
+			      post("/transflow/scanBind", { type: drugsBagType, orderId, code }).then((ress) => {
1276
+			        uni.hideLoading();
1277
+			        if (ress.state == 200) {
1278
+			          if(ress.data.msg){
1279
+			            uni.showToast({
1280
+			              icon: "none",
1281
+			              title: ress.data.msg || "接口获取数据失败!",
1282
+			            });
1283
+			          }else{
1284
+			            if(config.drugsEndCheck === 1){
1285
+			              // 起点科室支持核对
1286
+			              uni.navigateTo({
1287
+			                url: `/pages/newDrug/checkPage/checkPage?drugsBagType=${drugsBagType}&orderId=${orderId}`,
1288
+			              });
1289
+			            }else{
1290
+			              // 起点科室不支持核对
1291
+			              if(config.drugsEndPhoto === 1){
1292
+			                // 起点科室支持拍照留存
1293
+			                uni.navigateTo({
1294
+			                  url: `/pages/newDrug/photoRetention/photoRetention?drugsBagType=${drugsBagType}&orderId=${orderId}`,
1295
+			                });
1296
+			              }else{
1297
+			                // 终点科室不支持拍照留存
1298
+			                this.completeOrder(responseData, queryObj);
1299
+			              }
1300
+			            }
1301
+			          }
1302
+			        } else {
1303
+			          uni.showToast({
1304
+			            icon: "none",
1305
+			            title: ress.msg || "接口获取数据失败!",
1306
+			          });
1307
+			        }
1308
+			      });
1309
+			    }
1310
+			  }else if(config.drugsModel === 2){
1311
+			    // 一单多码
1312
+			    uni.showLoading({
1313
+			      title: "加载中",
1314
+			      mask: true,
1315
+			    });
1316
+			    post("/transflow/scanBind", { type: drugsBagType, orderId, code }).then((ress) => {
1317
+			      uni.hideLoading();
1318
+			      if (ress.state == 200) {
1319
+			        if(ress.data.msg){
1320
+			          uni.showToast({
1321
+			            icon: "none",
1322
+			            title: ress.data.msg || "接口获取数据失败!",
1323
+			          });
1324
+			        }else{
1325
+			          uni.navigateTo({
1326
+			            url: `/pages/newDrug/continueScanning/continueScanning?drugsBagType=${drugsBagType}&orderId=${orderId}&drugsBagId=${drugsBagId}&orderStateValue=${orderStateValue.value}`,
1327
+			          });
1328
+			        }
1329
+			      } else {
1330
+			        uni.showToast({
1331
+			          icon: "none",
1332
+			          title: ress.msg || "接口获取数据失败!",
1333
+			        });
1334
+			      }
1335
+			    });
1336
+			  }
1337
+			},
1338
+			// 工单完成
1339
+			completeOrder(responseData, queryObj){
1340
+			  console.log(responseData, queryObj)
1341
+			  uni.showLoading({
1342
+			    title: "加载中",
1343
+			    mask: true,
1344
+			  });
1345
+			  let postData = {
1346
+			    "type": queryObj.drugsBagType.value,
1347
+			    "orderId": responseData.gdId,
1348
+			  };
1349
+			  post('/transflow/checkComplete', postData).then(res => {
1350
+			    uni.hideLoading();
1351
+			    if(res.state == 200){
1352
+			       uni.showToast({
1353
+			         icon: "none",
1354
+			         title: responseData.drugsState.value == 4 ? "交接成功,请尽快送达科室!" : (responseData.drugsState.value == 5 ? "交接成功,完成配送!" : ""),
1355
+			         duration: 60000,
1356
+			         mask: true,
1357
+			         complete(){
1358
+			           setTimeout(() => {
1359
+			             uni.hideToast();
1360
+			             uni.redirectTo({
1361
+			               url: `/pages/receiptpage/receiptpage`,
1362
+			             });
1363
+			           }, 2000)
1364
+			         }
1365
+			       });
1366
+			    }else{
1367
+			      uni.showToast({
1368
+			        icon: "none",
1369
+			        title: res.msg || "接口获取数据失败!",
1370
+			      });
1371
+			    }
1372
+			  })
1373
+			},
1186 1374
       // 手动查询药品-取消
1187 1375
       drugbagCancel() {
1188 1376
         this.drugbagModels.disjunctor = false;