From 2b49f7643d15b74889d190f216630559006ed93a Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 01 十二月 2025 09:48:43 +0800
Subject: [PATCH] pad和后端的优化

---
 新建文件夹/PDA/pages/stash/CheckFinish.vue |  179 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 130 insertions(+), 49 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
index db66df7..bdc9c63 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
@@ -438,56 +438,137 @@
 					}
 				})
 			},
+			// submit() {
+			// 	if (this.barcode == "") {
+			// 		this.$refs.uToast.show({
+			// 			title: "璇锋壂鎻忚揣浣嶇紪鍙�",
+			// 			type: 'error'
+			// 		})
+			// 		return;
+			// 	}
+			// 	if (this.materSn.length == 0) {
+			// 		this.$refs.uToast.show({
+			// 			title: "璇疯緭鍏ュ疄鐩樻暟閲�",
+			// 			type: 'error'
+			// 		})
+			// 		return;
+			// 	}
+			// 	this.$u.post('/api/DeliveryOrder/CheckFinish', {
+			// 		MainData: {
+			// 			"locationCode": this.barcode,
+			// 			"taskId":this.taskId,
+			// 			// "warehouseCode": this.warehouseId,
+			// 			// "orderNo": this.orderNo,
+			// 			"qty": this.materSn,
+			// 			// "batchNo": this.batchNo,
+			// 		},
+			// 		// DelKeys: this.sns
+			// 	}).then(res => {
+			// 		this.Testcheck = false;
+			// 		if (res.status) {
+			// 			this.$refs.uToast.show({
+			// 				title: "鐩樼偣鎴愬姛",
+			// 				type: "success"
+			// 			})
+			// 			// this.Inqty=res.message;
+			// 			// this.order_Inqty="宸插嚭搴撴暟閲忥細"+this.Inqty;
+			// 			this.barcode="";
+			// 			// uni.setStorageSync('checkTask',true);
+
+
+			// 	//鍏抽敭淇敼锛氫娇鐢� getCurrentPages 鑾峰彇鍓嶄竴涓〉闈㈠苟鐩存帴璋冪敤鍏舵柟娉�	Y	
+			// 	const pages = getCurrentPages();
+			// 	const prevPage = pages[pages.length - 2]; // 鑾峰彇涓婁竴涓〉闈㈠疄渚�
+			// 	console.log('鍓嶄竴涓〉闈�:', prevPage);
+				
+			// 	if (prevPage && prevPage.refreshData) {
+			// 		// 鐩存帴璋冪敤涓婁竴涓〉闈㈢殑鍒锋柊鏂规硶
+			// 		prevPage.refreshData();
+			// 		console.log('宸茶皟鐢ㄥ墠涓�涓〉闈㈢殑鐩樼偣鍒锋柊鏂规硶');
+			// 	} 
+
+			// 	setTimeout(() => {
+			// 			    uni.navigateBack({
+			// 			        delta: 1
+			// 			    });
+			// 			}, 300);
+			// 			// this.materSn="";
+			// 		} else {
+			// 			this.$refs.uToast.show({
+			// 				title: res.message,
+			// 				type: "error"
+			// 			})
+			// 		}
+			// 	})
+			// }
 			submit() {
-				if (this.barcode == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忚揣浣嶇紪鍙�",
-						type: 'error'
-					})
-					return;
-				}
-				if (this.materSn.length == 0) {
-					this.$refs.uToast.show({
-						title: "璇疯緭鍏ュ疄鐩樻暟閲�",
-						type: 'error'
-					})
-					return;
-				}
-				this.$u.post('/api/DeliveryOrder/CheckFinish', {
-					MainData: {
-						"locationCode": this.barcode,
-						"taskId":this.taskId,
-						// "warehouseCode": this.warehouseId,
-						// "orderNo": this.orderNo,
-						"qty": this.materSn,
-						// "batchNo": this.batchNo,
-					},
-					// DelKeys: this.sns
-				}).then(res => {
-					this.Testcheck = false;
-					if (res.status) {
-						this.$refs.uToast.show({
-							title: "鐩樼偣鎴愬姛",
-							type: "success"
-						})
-						// this.Inqty=res.message;
-						// this.order_Inqty="宸插嚭搴撴暟閲忥細"+this.Inqty;
-						this.barcode="";
-						// uni.setStorageSync('checkTask',true);
-						setTimeout(() => {
-						    uni.navigateBack({
-						        delta: 1
-						    });
-						}, 300);
-						// this.materSn="";
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
-			}
+    if (this.barcode == "") {
+        this.$refs.uToast.show({
+            title: "璇锋壂鎻忚揣浣嶇紪鍙�",
+            type: 'error'
+        })
+        return;
+    }
+    if (this.materSn.length == 0) {
+        this.$refs.uToast.show({
+            title: "璇疯緭鍏ュ疄鐩樻暟閲�",
+            type: 'error'
+        })
+        return;
+    }
+
+    // 鏂板浜屾纭閫昏緫
+    uni.showModal({
+        title: '纭鐩樼偣',
+        content: '鎮ㄧ‘瀹氳鎻愪氦鐩樼偣淇℃伅鍚楋紵',
+        success: (res) => {
+            if (res.confirm) {
+                // 鐢ㄦ埛鐐瑰嚮纭畾锛屾墽琛屽師鏈夌殑鎻愪氦閫昏緫
+                this.$u.post('/api/DeliveryOrder/CheckFinish', {
+                    MainData: {
+                        "locationCode": this.barcode,
+                        "taskId": this.taskId,
+                        "qty": this.materSn,
+                    },
+                }).then(res => {
+                    this.Testcheck = false;
+                    if (res.status) {
+                        this.$refs.uToast.show({
+                            title: "鐩樼偣鎴愬姛",
+                            type: "success"
+                        })
+                        this.barcode = "";
+
+                        // 鍏抽敭淇敼锛氫娇鐢� getCurrentPages 鑾峰彇鍓嶄竴涓〉闈㈠苟鐩存帴璋冪敤鍏舵柟娉�
+                        const pages = getCurrentPages();
+                        const prevPage = pages[pages.length - 2]; // 鑾峰彇涓婁竴涓〉闈㈠疄渚�
+                        console.log('鍓嶄竴涓〉闈�:', prevPage);
+                        
+                        if (prevPage && prevPage.refreshData) {
+                            // 鐩存帴璋冪敤涓婁竴涓〉闈㈢殑鍒锋柊鏂规硶
+                            prevPage.refreshData();
+                            console.log('宸茶皟鐢ㄥ墠涓�涓〉闈㈢殑鐩樼偣鍒锋柊鏂规硶');
+                        } 
+
+                        setTimeout(() => {
+                            uni.navigateBack({
+                                delta: 1
+                            });
+                        }, 300);
+                    } else {
+                        this.$refs.uToast.show({
+                            title: res.message,
+                            type: "error"
+                        })
+                    }
+                })
+            } else {
+                // 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屼笉鍋氫换浣曟搷浣�
+            }
+        }
+    });
+}
+
 		}
 	}
 </script>

--
Gitblit v1.9.3