From de398f47dd12b3890c9ee545422da78e82b60fa9 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 08 十二月 2025 09:22:06 +0800
Subject: [PATCH] 修改PDA出入库中出现undefined问题,修改job中因为上游调用频率过快导致job死掉,修改前端报警信息使用不同颜色

---
 新建文件夹/PDA/pages/stash/outFinish.vue |  960 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 529 insertions(+), 431 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outFinish.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outFinish.vue"
index 7a4b864..f80184f 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outFinish.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outFinish.vue"
@@ -16,8 +16,14 @@
 						</uni-forms-item>
 						<uni-forms-item :label="order_qty">
 						</uni-forms-item>
+						<uni-forms-item label="寰呮壂鐗╂枡缂栫爜:">
+						<uni-easyinput type="text" placeholder="璇锋壂鎻忕墿鏂欑紪鐮�" ref='materialInput' 
+							:focus="step === 1" v-model="materialCode" 
+							@confirm="materialCodeInput"
+							@blur="materialCodeInput" />
+						</uni-forms-item>
 						<uni-forms-item label="搴撲綅缂栧彿:">
-							<uni-easyinput type="text" placeholder="璇锋壂鎻忓簱浣嶇紪鍙�" ref='midInput' :focus="!focus"
+							<uni-easyinput type="text" placeholder="璇锋壂鎻忓簱浣嶇紪鍙�" ref='midInput' :focus="focus"
 								v-model="barcode" @confirm="barcodeInput" />
 						</uni-forms-item>
 						<!-- <uni-forms-item label="鍑哄簱鏁伴噺:">
@@ -37,7 +43,7 @@
 							<view style="display: flex;justify-content: space-around;margin-top: 2%;">
 								<!-- <button @click="reset" type="default" size="default"
 									style="width: 160rpx;border: 1rpx solid #007aff;color: #007aff;">閲嶇疆</button> -->
-								<button @click="submit" type="primary" size="default" style="width: 200rpx;">纭鍑哄簱</button>
+								<button @click="submit" type="primary" size="default" style="width: 250rpx;">纭鍑哄簱</button>
 							</view>
 						</uni-forms-item>
 					</uni-forms>
@@ -126,449 +132,541 @@
 </template>
 
 <script>
-	const innerAudioContext = uni.createInnerAudioContext();
-	export default {
-		data() {
-			return {
-				items: ['鍑哄簱'], //, '瑙g洏''缁勭洏', , '鍗曟嵁淇℃伅'
-				current: 0,
-				taskId:"",
-				matTotal: [],
-				matInfos: [],
-				orderNo: "",
-				batchNo:"",
-				orderqty:"",
-				Inqty:"",
-				goods_no:"",
-				batch_num:"",
-				order_qty:"",
-				order_Inqty:"",
-				label: "",
-				orderInfo: [],
-				focus: false,
-				pkfocus: false,
-				barcode: "",
-				materSn: "",
-				Initiallife: 1000,
-				sns: [],
-				pksns: [],
-				addressFocus: false,
-				inboundBarcode: "",
-				address: "",
-				check: true,
-				value: "",
-				matInfo: [],
-				value2: "",
-				matTotals: [],
-				warehouseId: "",
-				Test: false,
-				Testlabel: "",
-				Testplaceholder: "",
-				Testcheck: false,
-				pkmaterSn: "",
-				pkmatInfos: [],
-				addressdisabled: false
-			}
-		},
-		onShow() {},
-		onLoad(res) {
-			this.focus = false;
-			this.addressFocus = false;
-			this.orderNo = res.orderNo;
-			this.taskId=res.taskId;
-			this.Inqty=res.order_Inqty;
-			this.orderqty=res.order_qty;
-			this.batchNo=res.batchNo;
-			this.warehouseId = res.warehouseId;
-			this.label = "鍗曟嵁缂栧彿锛�" + this.orderNo;
-			this.batch_num="鎵规鍙凤細"+res.batchNo;
-			this.order_qty="鍑哄簱鏁伴噺锛�"+res.stockQuantity;
-			this.order_Inqty="鐗╂枡鍚嶇О锛�"+res.materielName;
-			this.goods_no="鐗╂枡缂栧彿锛�"+res.materielCode;
-			// this.getData();
-		},
-		methods: {
-			// voiceSpeech(src) {
-			// 	innerAudioContext.src = src; // '../../static/success.mp3';
-			// 	innerAudioContext.play();
-			// },
-			updateFocus() {
-				debugger
-				this.$nextTick(() => {
-					this.materSn = '';
-					if (!this.focus) {
-						this.focus = true;
-					}
-				});
-			},
-			barcodeFocus() {
-				debugger
-				this.barcode = '';
-				if (this.focus) {
-					this.focus = false;
-				}
-			},
-			getData() {
-				var postData = {
-					MainData: {
-						orderNo: this.orderNo
-					},
-				}
-				this.$u.post('/api/InboundOrderDetail/GetInboundOrderDetails', postData).then((res) => {
-					if (res.status) {
-						this.orderInfo = res.data;
-						if (this.orderInfo.length > 3) {
-							this.loadVisible = true;
-						}
-					}
-				})
-			},
-			onClickItem(e) {
-				this.focus = false;
-				this.addressFocus = false;
-				if (this.current !== e.currentIndex) {
-					this.current = e.currentIndex;
-					if (this.current == 2) {
-						this.getData();
-					}
-				}
-			},
-			barcodeInput() {
-				this.$nextTick(function(x) {
-					if (this.barcode.length > 0) {
-						// if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
-						this.focus = true;
-						// } else {
-						// 	this.$refs.uToast.show({
-						// 		title: "鎵爜閿欒,璇锋壂鎻忔墭鐩樼爜",
-						// 		type: "error"
-						// 	})
-						// }
-					}
-				})
-			},
-			snInput() {
-				this.$nextTick(() => {
-					if (this.materSn != "") {
-						this.focus = false;
-						var matSn = this.materSn;
-						if (this.warehouseId == 11) {
-							matSn = matSn.replace(/,SC.*/, '');
-						}
-						//鏌ヨmatSn鏄惁瀛樺湪瀛楃
-						if(matSn.indexOf("POHA")>0){
-							this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
-								this.Testcheck = false;
-								if (res.status) {
-									this.sns.push(res.data.serialNumber);
-							
-									this.matInfos.push(res.data);
-									if (res.message) {
-										this.$refs.uToast.show({
-											title: res.message,
-											type: "error"
-										})
-										// setTimeout(() => {
-										// 	this.voiceSpeech('../../static/fail.mp3');
-										// }, 100);
-										return;
-									}
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/success.mp3');
-									// }, 100);
-								} else {
-									this.$refs.uToast.show({
-										title: res.message,
-										type: "error"
-									})
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/fail.mp3');
-									// }, 100);
-								}
-							})
-						}
-						setTimeout(() => {
-							this.materSn = "";
-						}, 100);
-					}
-				})
-			},
-			pksnInput() {
-				this.$nextTick(() => {
-					if (this.pkmaterSn != "") {
-						
-						var matSn = this.pkmaterSn;
-						
-						if(matSn.indexOf("POHA")>0){
-							this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
-								if (res.status) {
-									this.pksns.push(res.data.serialNumber);
-									this.pkmatInfos.push(res.data);
-									if (!res.status) {
-										this.$refs.uToast.show({
-											title: res.message,
-											type: "error"
-										})
-										// setTimeout(() => {
-										// 	this.voiceSpeech('../../static/fail.mp3');
-										// }, 100);
-										return;
-									}
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/success.mp3');
-									// }, 100);
-									return;
-								} else {
-									this.$refs.uToast.show({
-										title: res.message,
-										type: "error"
-									})
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/fail.mp3');
-									// }, 100);
-								}
-							})
-						}
-						setTimeout(() => {
-							this.pkmaterSn = "";
-						}, 100);
-					}
-				})
-			},
-			inbound() {
-				if (this.inboundBarcode == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忔墭鐩樻潯鐮�",
-						type: "error"
-					})
-					return;
-				}
-				if (this.address == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忓湴鍧�鏉$爜",
-						type: "error"
-					})
-					return;
-				}
-				var postData = {
-					MainData: {
-						"barcode": this.inboundBarcode,
-						"startPoint": this.address,
-						"warehouseId": this.warehouseId
-					}
-				}
-				this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
-					if (res.status) {
-						this.inboundBarcode = "";
-						if (this.warehouseId != 5) this.address = "";
-						setTimeout(() => {
-							this.addressFocus = false;
-							this.$refs.uToast.show({
-								title: "鎴愬姛",
-								type: "success"
-							})
-						}, 200);
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				}).catch(err => {
-					this.$refs.uToast.show({
-						title: err.message,
-						type: "error"
-					})
-				})
-			},
-			inputChangebarcode() {
-				this.addressFocus = false;
-				this.$nextTick(function(x) {
-					if (this.inboundBarcode != '') {
-						this.addressFocus = true;
-					}
-				})
-			},
-			deleteList(res) {
-				this.matInfos.splice(res, 1);
-				this.sns.splice(res, 1);
-			},
-			pkdeleteList(res) {
-				this.pkmatInfos.splice(res, 1);
-				this.pksns.splice(res, 1);
-			},
-			reset() {
-				this.barcode = "";
-				this.matInfos = [];
-				this.sns = [];
-				this.materSn = "";
-				if (this.warehouseId = !6) {
-					this.Initiallife = 0;
-				}
-			},
-			resetInPk() {
-				this.pkmaterSn = "";
-				this.pkfocus = false;
-				this.pkmatInfos = [];
-				this.pksns = [];
-			},
-			pksubmit() {
-				if (this.pkmatInfos.length == 0) {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忓唴绠辨爣绛�",
-						type: 'error'
-					})
-					return;
-				}
-				this.$u.post('/api/DeliveryOrder/FeedbackOut?warehouseId=' + this.warehouseId + "&orderNo=" + this.orderNo, this
-					.pksns).then(res => {
-					if (res.status) {
-						this.$refs.uToast.show({
-							title: "鍑哄簱鎴愬姛",
-							type: "success"
-						})
-						this.pkfocus = false;
-						this.pkmatInfos = [];
-						this.pksns = [];
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
-			},
+const innerAudioContext = uni.createInnerAudioContext();
+export default {
+  data() {
+    return {
+      items: ["鍑哄簱"], //, '瑙g洏''缁勭洏', , '鍗曟嵁淇℃伅'
+      current: 0,
+      taskId: "",
+      matTotal: [],
+      matInfos: [],
+      orderNo: "",
+      batchNo: "",
+      orderqty: "",
+      Inqty: "",
+      goods_no: "",
+      batch_num: "",
+      order_qty: "",
+      order_Inqty: "",
+      label: "",
+      orderInfo: [],
+      focus: false,
+      pkfocus: false,
+      barcode: "",
+      materSn: "",
+      Initiallife: 1000,
+      sns: [],
+      pksns: [],
+      addressFocus: false,
+      inboundBarcode: "",
+      address: "",
+      check: true,
+      value: "",
+      matInfo: [],
+      value2: "",
+      matTotals: [],
+      warehouseId: "",
+      Test: false,
+      Testlabel: "",
+      Testplaceholder: "",
+      Testcheck: false,
+      pkmaterSn: "",
+      pkmatInfos: [],
+      addressdisabled: false,
+      materialCode: "", // 鏂板锛氭壂鎻忕殑鐗╂枡缂栫爜
+      materialCodeValid: false, // 鏂板锛氱墿鏂欑紪鐮侀獙璇佺姸鎬�
+      step: 1, // 鏂板锛�1-鐗╂枡缂栫爜锛�2-搴撲綅缂栧彿锛�
+    };
+  },
+  onShow() {},
+  onLoad(res) {
+    this.focus = false;
+    this.addressFocus = false;
+    this.orderNo = res.orderNo;
+    this.taskId = res.taskId;
+    this.Inqty = res.order_Inqty;
+    this.orderqty = res.order_qty;
+    this.batchNo = res.batchNo;
+    this.warehouseId = res.warehouseId;
+    this.label = "鍗曟嵁缂栧彿锛�" + this.orderNo;
+    this.batch_num = "鎵规鍙凤細" + res.batchNo;
+    this.order_qty = "鍑哄簱鏁伴噺锛�" + res.stockQuantity;
+    this.order_Inqty = "鐗╂枡鍚嶇О锛�" + res.materielName;
+    this.goods_no = "鐗╂枡缂栧彿锛�" + res.materielCode;
+    this.materielCode = res.materielCode; // 璁剧疆鐢ㄤ簬楠岃瘉鐨勭墿鏂欑紪鐮�
+    // this.getData();
+  },
+  methods: {
+    // voiceSpeech(src) {
+    // 	innerAudioContext.src = src; // '../../static/success.mp3';
+    // 	innerAudioContext.play();
+    // },
 
-			
-// 	submit() {
-// 			if (this.barcode == "") {
-// 				this.$refs.uToast.show({
-// 				title: "璇锋壂鎻忚揣浣嶇紪鍙�",
-// 				type: 'error'
-// 				})
-// 				return;
-// 			}
-  
-//   this.$u.post('/api/DeliveryOrder/OutFinish', {
-//     MainData: {
-//       "locationCode": this.barcode,
-//       "taskId": this.taskId,
-//     },
-//   }).then(res => {
-//     if (res.status) {
-//       this.$refs.uToast.show({
-//         title: "鍑哄簱鎴愬姛",
-//         type: "success"
-//       })
-//       this.barcode = "";
-      
-//       // 鍏抽敭淇敼锛氫娇鐢� getCurrentPages 鑾峰彇鍓嶄竴涓〉闈㈠苟鐩存帴璋冪敤鍏舵柟娉�
-//       const pages = getCurrentPages();
-//       const prevPage = pages[pages.length - 2]; // 鑾峰彇涓婁竴涓〉闈㈠疄渚�
-      
-//       if (prevPage && prevPage.refreshData) {
-//         // 鐩存帴璋冪敤涓婁竴涓〉闈㈢殑鍒锋柊鏂规硶
-//         prevPage.refreshData();
-//       }
-      
-//       setTimeout(() => {
-//         uni.navigateBack({
-//           delta: 1
-//         });
-//       }, 300);
-//     } else {
-//       this.$refs.uToast.show({
-//         title: res.message,
-//         type: "error"
-//       })
-//     }
-//   })
-// }
+    // 鐗╂枡缂栫爜楠岃瘉
+    materialCodeInput() {
+      console.log("materialCodeInput 琚Е鍙�");
+      console.log("杈撳叆鍊�:", this.materialCode);
+      this.$nextTick(() => {
+        if (this.materialCode.trim() !== "") {
+          const scannedCode = this.materialCode.trim();
+          const expectedCode = this.materielCode;
 
+          console.log("鎵弿缂栫爜:", scannedCode);
+          console.log("鏈熸湜缂栫爜锛坢aterielCode锛�:", expectedCode);
 
+          if (scannedCode === expectedCode) {
+            this.materialCodeValid = true;
+            console.log("鉁� 鐗╂枡缂栫爜楠岃瘉鎴愬姛");
 
-submit() {
-    if (this.barcode == "") {
-        this.$refs.uToast.show({
-            title: "璇锋壂鎻忚揣浣嶇紪鍙�",
-            type: 'error'
-        })
-        return;
-    }
+            this.step = 2;
+            this.$refs.uToast.show({
+              title: "鐗╂枡缂栫爜楠岃瘉鎴愬姛",
+              type: "success",
+            });
+            this.$nextTick(() => {
+              this.$refs.midInput.focus();
+            });
+          } else {
+            this.materialCodeValid = false;
+            console.log("鉂� 鐗╂枡缂栫爜楠岃瘉澶辫触");
 
-    // 鏂板浜屾纭閫昏緫
-    uni.showModal({
-        title: '纭鍑哄簱',
-        content: '鎮ㄧ‘瀹氳鎻愪氦鍑哄簱淇℃伅鍚楋紵',
-        success: (res) => {
-            if (res.confirm) {
-                // 鐢ㄦ埛鐐瑰嚮纭畾锛屾墽琛屽師鏈夌殑鎻愪氦閫昏緫
-                this.$u.post('/api/DeliveryOrder/OutFinish', {
-                    MainData: {
-                        "locationCode": this.barcode,
-                        "taskId": this.taskId,
-                    },
-                }).then(res => {
-                    if (res.status) {
-                        this.$refs.uToast.show({
-                            title: "鍑哄簱鎴愬姛",
-                            type: "success"
-                        })
-                        this.barcode = "";
-                        
-                        // 鍏抽敭淇敼锛氫娇鐢� getCurrentPages 鑾峰彇鍓嶄竴涓〉闈㈠苟鐩存帴璋冪敤鍏舵柟娉�
-                        const pages = getCurrentPages();
-                        const prevPage = pages[pages.length - 2]; // 鑾峰彇涓婁竴涓〉闈㈠疄渚�
-                        
-                        if (prevPage && prevPage.refreshData) {
-                            // 鐩存帴璋冪敤涓婁竴涓〉闈㈢殑鍒锋柊鏂规硶
-                            prevPage.refreshData();
-                        }
-                        
-                        setTimeout(() => {
-                            uni.navigateBack({
-                                delta: 1
-                            });
-                        }, 300);
-                    } else {
-                        this.$refs.uToast.show({
-                            title: res.message,
-                            type: "error"
-                        })
-                    }
-                })
-            } else {
-                // 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屼笉鍋氫换浣曟搷浣�
-            }
+            this.$refs.uToast.show({
+              title: `鐗╂枡缂栫爜涓嶅尮閰峘,
+              type: "error",
+            });
+
+            setTimeout(() => {
+              this.materialCode = "";
+              this.step = 1;
+              this.$nextTick(() => {
+                this.$refs.materialInput.focus();
+              });
+            }, 500);
+          }
         }
-    });
-}
+      });
+    },
 
+    updateFocus() {
+      debugger;
+      this.$nextTick(() => {
+        this.materSn = "";
+        if (!this.focus) {
+          this.focus = true;
+        }
+      });
+    },
+    barcodeFocus() {
+      debugger;
+      this.barcode = "";
+      if (this.focus) {
+        this.focus = false;
+      }
+    },
+    getData() {
+      var postData = {
+        MainData: {
+          orderNo: this.orderNo,
+        },
+      };
+      this.$u
+        .post("/api/InboundOrderDetail/GetInboundOrderDetails", postData)
+        .then((res) => {
+          if (res.status) {
+            this.orderInfo = res.data;
+            if (this.orderInfo.length > 3) {
+              this.loadVisible = true;
+            }
+          }
+        });
+    },
+    onClickItem(e) {
+      this.focus = false;
+      this.addressFocus = false;
+      if (this.current !== e.currentIndex) {
+        this.current = e.currentIndex;
+        if (this.current == 2) {
+          this.getData();
+        }
+      }
+    },
+    // barcodeInput() {
+    //   this.$nextTick(function (x) {
+    //     if (this.barcode.length > 0) {
+    //       // if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
+    //       this.focus = true;
+    //       // } else {
+    //       // 	this.$refs.uToast.show({
+    //       // 		title: "鎵爜閿欒,璇锋壂鎻忔墭鐩樼爜",
+    //       // 		type: "error"
+    //       // 	})
+    //       // }
+    //     }
+    //   });
+    // },
+    barcodeInput() {
+      this.$nextTick(() => {
+        if (this.barcode.length > 0) {
+          this.$refs.uToast.show({
+            title: "搴撲綅缂栧彿鎵弿鎴愬姛",
+            type: "success",
+          });
+          setTimeout(() => {
+            this.$nextTick(() => {
+              this.$refs.midInput.focus();
+            });
+          }, 100);
+        }
+      });
+    },
 
+    snInput() {
+      this.$nextTick(() => {
+        if (this.materSn != "") {
+          this.focus = false;
+          var matSn = this.materSn;
+          if (this.warehouseId == 11) {
+            matSn = matSn.replace(/,SC.*/, "");
+          }
+          //鏌ヨmatSn鏄惁瀛樺湪瀛楃
+          if (matSn.indexOf("POHA") > 0) {
+            this.$u
+              .post("/api/MaterielInfo/CodeAnalysis?serNum=" + matSn, {})
+              .then((res) => {
+                this.Testcheck = false;
+                if (res.status) {
+                  this.sns.push(res.data.serialNumber);
 
-		}
-	}
+                  this.matInfos.push(res.data);
+                  if (res.message) {
+                    this.$refs.uToast.show({
+                      title: res.message,
+                      type: "error",
+                    });
+                    // setTimeout(() => {
+                    // 	this.voiceSpeech('../../static/fail.mp3');
+                    // }, 100);
+                    return;
+                  }
+                  // setTimeout(() => {
+                  // 	this.voiceSpeech('../../static/success.mp3');
+                  // }, 100);
+                } else {
+                  this.$refs.uToast.show({
+                    title: res.message,
+                    type: "error",
+                  });
+                  // setTimeout(() => {
+                  // 	this.voiceSpeech('../../static/fail.mp3');
+                  // }, 100);
+                }
+              });
+          }
+          setTimeout(() => {
+            this.materSn = "";
+          }, 100);
+        }
+      });
+    },
+    pksnInput() {
+      this.$nextTick(() => {
+        if (this.pkmaterSn != "") {
+          var matSn = this.pkmaterSn;
+
+          if (matSn.indexOf("POHA") > 0) {
+            this.$u
+              .post("/api/MaterielInfo/CodeAnalysis?serNum=" + matSn, {})
+              .then((res) => {
+                if (res.status) {
+                  this.pksns.push(res.data.serialNumber);
+                  this.pkmatInfos.push(res.data);
+                  if (!res.status) {
+                    this.$refs.uToast.show({
+                      title: res.message,
+                      type: "error",
+                    });
+                    // setTimeout(() => {
+                    // 	this.voiceSpeech('../../static/fail.mp3');
+                    // }, 100);
+                    return;
+                  }
+                  // setTimeout(() => {
+                  // 	this.voiceSpeech('../../static/success.mp3');
+                  // }, 100);
+                  return;
+                } else {
+                  this.$refs.uToast.show({
+                    title: res.message,
+                    type: "error",
+                  });
+                  // setTimeout(() => {
+                  // 	this.voiceSpeech('../../static/fail.mp3');
+                  // }, 100);
+                }
+              });
+          }
+          setTimeout(() => {
+            this.pkmaterSn = "";
+          }, 100);
+        }
+      });
+    },
+    inbound() {
+      if (this.inboundBarcode == "") {
+        this.$refs.uToast.show({
+          title: "璇锋壂鎻忔墭鐩樻潯鐮�",
+          type: "error",
+        });
+        return;
+      }
+      if (this.address == "") {
+        this.$refs.uToast.show({
+          title: "璇锋壂鎻忓湴鍧�鏉$爜",
+          type: "error",
+        });
+        return;
+      }
+      var postData = {
+        MainData: {
+          barcode: this.inboundBarcode,
+          startPoint: this.address,
+          warehouseId: this.warehouseId,
+        },
+      };
+      this.$u
+        .post("/api/Task/RequestInboundTask", postData)
+        .then((res) => {
+          if (res.status) {
+            this.inboundBarcode = "";
+            if (this.warehouseId != 5) this.address = "";
+            setTimeout(() => {
+              this.addressFocus = false;
+              this.$refs.uToast.show({
+                title: "鎴愬姛",
+                type: "success",
+              });
+            }, 200);
+          } else {
+            this.$refs.uToast.show({
+              title: res.message,
+              type: "error",
+            });
+          }
+        })
+        .catch((err) => {
+          this.$refs.uToast.show({
+            title: err.message,
+            type: "error",
+          });
+        });
+    },
+    inputChangebarcode() {
+      this.addressFocus = false;
+      this.$nextTick(function (x) {
+        if (this.inboundBarcode != "") {
+          this.addressFocus = true;
+        }
+      });
+    },
+    deleteList(res) {
+      this.matInfos.splice(res, 1);
+      this.sns.splice(res, 1);
+    },
+    pkdeleteList(res) {
+      this.pkmatInfos.splice(res, 1);
+      this.pksns.splice(res, 1);
+    },
+    reset() {
+      this.barcode = "";
+      this.matInfos = [];
+      this.sns = [];
+      this.materSn = "";
+      if ((this.warehouseId = !6)) {
+        this.Initiallife = 0;
+      }
+    },
+    resetInPk() {
+      this.pkmaterSn = "";
+      this.pkfocus = false;
+      this.pkmatInfos = [];
+      this.pksns = [];
+    },
+    pksubmit() {
+      if (this.pkmatInfos.length == 0) {
+        this.$refs.uToast.show({
+          title: "璇锋壂鎻忓唴绠辨爣绛�",
+          type: "error",
+        });
+        return;
+      }
+      this.$u
+        .post(
+          "/api/DeliveryOrder/FeedbackOut?warehouseId=" +
+            this.warehouseId +
+            "&orderNo=" +
+            this.orderNo,
+          this.pksns
+        )
+        .then((res) => {
+          if (res.status) {
+            this.$refs.uToast.show({
+              title: "鍑哄簱鎴愬姛",
+              type: "success",
+            });
+            this.pkfocus = false;
+            this.pkmatInfos = [];
+            this.pksns = [];
+          } else {
+            this.$refs.uToast.show({
+              title: res.message,
+              type: "error",
+            });
+          }
+        });
+    },
+
+    // 	submit() {
+    // 			if (this.barcode == "") {
+    // 				this.$refs.uToast.show({
+    // 				title: "璇锋壂鎻忚揣浣嶇紪鍙�",
+    // 				type: 'error'
+    // 				})
+    // 				return;
+    // 			}
+
+    //   this.$u.post('/api/DeliveryOrder/OutFinish', {
+    //     MainData: {
+    //       "locationCode": this.barcode,
+    //       "taskId": this.taskId,
+    //     },
+    //   }).then(res => {
+    //     if (res.status) {
+    //       this.$refs.uToast.show({
+    //         title: "鍑哄簱鎴愬姛",
+    //         type: "success"
+    //       })
+    //       this.barcode = "";
+
+    //       // 鍏抽敭淇敼锛氫娇鐢� getCurrentPages 鑾峰彇鍓嶄竴涓〉闈㈠苟鐩存帴璋冪敤鍏舵柟娉�
+    //       const pages = getCurrentPages();
+    //       const prevPage = pages[pages.length - 2]; // 鑾峰彇涓婁竴涓〉闈㈠疄渚�
+
+    //       if (prevPage && prevPage.refreshData) {
+    //         // 鐩存帴璋冪敤涓婁竴涓〉闈㈢殑鍒锋柊鏂规硶
+    //         prevPage.refreshData();
+    //       }
+
+    //       setTimeout(() => {
+    //         uni.navigateBack({
+    //           delta: 1
+    //         });
+    //       }, 300);
+    //     } else {
+    //       this.$refs.uToast.show({
+    //         title: res.message,
+    //         type: "error"
+    //       })
+    //     }
+    //   })
+    // }
+    submit() {
+      if (!this.materialCodeValid) {
+        this.$refs.uToast.show({
+          title: "璇峰厛鎵弿骞堕獙璇佺墿鏂欑紪鐮�",
+          type: "error",
+        });
+        return;
+      }
+      if (this.barcode == "") {
+        this.$refs.uToast.show({
+          title: "璇锋壂鎻忚揣浣嶇紪鍙�",
+          type: "error",
+        });
+        return;
+      }
+
+      // 鏂板浜屾纭閫昏緫
+      uni.showModal({
+        title: "纭鍑哄簱",
+        content: "鎮ㄧ‘瀹氳鎻愪氦鍑哄簱淇℃伅鍚楋紵",
+        success: (res) => {
+          if (res.confirm) {
+            // 鏄剧ず鍔犺浇涓�
+            uni.showLoading({
+              title: '鎻愪氦涓�...',
+              mask: true
+            });
+            
+            this.$u.post("/api/DeliveryOrder/OutFinish", {
+              MainData: {
+                locationCode: this.barcode,
+                taskId: this.taskId,
+              },
+            }).then((res) => {
+              uni.hideLoading();
+              
+              if (res.status) {
+                this.$refs.uToast.show({
+                  title: "鍑哄簱鎴愬姛",
+                  type: "success",
+                });
+                
+                // 娓呯┖杈撳叆妗�
+                this.barcode = "";
+                this.materialCode = "";
+                this.materialCodeValid = false;
+                
+                // 璁剧疆鍒锋柊鏍囪
+                uni.setStorageSync('needRefreshOutbound', true);
+                
+                // 寤惰繜杩斿洖
+                setTimeout(() => {
+                  uni.navigateBack({
+                    delta: 1
+                  });
+                }, 500);
+                
+              } else {
+                this.$refs.uToast.show({
+                  title: res.message || "鍑哄簱澶辫触",
+                  type: "error",
+                });
+              }
+            }).catch(err => {
+              uni.hideLoading();
+              this.$refs.uToast.show({
+                title: "璇锋眰澶辫触锛岃閲嶈瘯",
+                type: "error",
+              });
+            });
+          }
+        },
+      });
+    }
+  },
+};
 </script>
 
 <style lang="scss">
-	@import '@/common/uni-ui.scss';
+@import "@/common/uni-ui.scss";
 
-	.content {
-		display: flex;
-		height: 150px;
-	}
+.content {
+  display: flex;
+  height: 150px;
+}
 
-	.content-text {
-		font-size: 14px;
-		color: #666;
-	}
+.content-text {
+  font-size: 14px;
+  color: #666;
+}
 
-	.itemstyle {
-		margin-top: 30px;
-		margin-left: 5%;
-	}
+.itemstyle {
+  margin-top: 30px;
+  margin-left: 5%;
+}
 
-	.headerstyle {
-		width: 90%;
-	}
+.headerstyle {
+  width: 90%;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3