From 713091471f5bc416ecaaa7f11852785df2f08c77 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 31 十月 2025 16:41:09 +0800
Subject: [PATCH] 调试

---
 components/machine.vue |   91 ++++++++++++++++++++++++++++-----------------
 1 files changed, 57 insertions(+), 34 deletions(-)

diff --git a/components/machine.vue b/components/machine.vue
index 90c6533..49de6c8 100644
--- a/components/machine.vue
+++ b/components/machine.vue
@@ -157,40 +157,63 @@
 			},
 			// 淇濆瓨骞剁敓鏁堬紝灏嗘椂闂寸瓑淇℃伅鎻愪氦鍒板悗绔�
 			// 鍙樻洿锛氳繑鍥� Promise锛涙垚鍔熷悗灞�閮ㄥ埛鏂帮紙璋冪敤 findByOrderId锛夎�屼笉鏄暣椤� reload
-			save() {
-				if (!this.statusForm.id) {
-					this.$showMessage("id涓虹┖锛屼笉鍏佽鎺ㄩ��");
-					return Promise.resolve();
-				}
-				return this.$post({
-					url: "/MesOrderSta/ChangeMachineTime",
-					data: {
-						maStartTime: this.maStartTime,
-						maShoutTime: this.maShoutTime,
-						maEndTime: this.maEndTime,
-						id: this.statusForm.id,
-						orderId: this.orderId,
-						machineNo: this.machineNo,
-						flag: this.flag
-					}
-				}).then(res => {
-					if (res && res.data && res.data.tbBillList) {
-						this.$showMessage("鍛煎彨鎴愬姛");
-						// 灞�閮ㄥ埛鏂帮細閲嶆柊鎷夊彇褰撳墠宸ュ崟鐘舵�佸苟鏇存柊褰撳墠缁勪欢鏁版嵁
-						this.findByOrderId();
-						// 濡傛灉闇�瑕佸湪淇濆瓨鍚庡叧闂璇濇鎴栬繑鍥炰笂涓�绾э紝鍙湪杩欓噷澶勭悊
-					} else {
-						this.$showMessage("鍛煎彨澶辫触");
-						this.cancel();
-					}
-					return res;
-				}).catch(err => {
-					// 淇濇寔鍙嬪ソ鐨勯敊璇彁绀哄苟灏嗛敊璇姏鍑轰互渚垮閮ㄩ摼寮忓鐞�
-					console.error('淇濆瓨澶辫触锛�', err);
-					this.$showMessage("淇濆瓨鏃跺彂鐢熼敊璇�");
-					throw err;
-				});
-			},
+            save() {
+                if (!this.statusForm.id) {
+                    this.$showMessage("id涓虹┖锛屼笉鍏佽鎺ㄩ��");
+                    return Promise.resolve();
+                }
+                return this.$post({
+                    url: "/MesOrderSta/ChangeMachineTime",
+                    data: {
+                        maStartTime: this.maStartTime,
+                        maShoutTime: this.maShoutTime,
+                        maEndTime: this.maEndTime,
+                        id: this.statusForm.id,
+                        orderId: this.orderId,
+                        machineNo: this.machineNo,
+                        flag: this.flag
+                    }
+                }).then(res => {
+                    if (res && res.data && res.data.tbBillList) {
+                        this.$showMessage("鍛煎彨鎴愬姛");
+
+                        // 鍏抽敭淇敼锛氭竻绌� flag 鐨勫��
+                        this.flag = -1; // 鎴栬�呮牴鎹笟鍔¢渶姹傝缃负鍏朵粬鍒濆鍊�
+
+                        // 鏂规1锛氫娇鐢╱ni-app鐨勯〉闈㈠埛鏂版柟娉�
+                        // 鏂规硶1锛氳Е鍙戜笅鎷夊埛鏂帮紙濡傛灉椤甸潰鏀寔锛�
+                        if (uni.startPullDownRefresh) {
+                            uni.startPullDownRefresh();
+                            // 2绉掑悗鍋滄鍒锋柊
+                            setTimeout(() => {
+                                uni.stopPullDownRefresh();
+                            }, 2000);
+                        }
+
+                        // 鏂规硶2锛氶噸鏂拌皟鐢ㄩ〉闈㈢殑onLoad鏂规硶锛堟帹鑽愶級
+                        const pages = getCurrentPages();
+                        const currentPage = pages[pages.length - 1];
+                        if (currentPage && currentPage.onLoad) {
+                            // 淇濆瓨褰撳墠椤甸潰鍙傛暟
+                            const pageOptions = currentPage.options || {};
+                            // 閲嶆柊鍔犺浇椤甸潰鏁版嵁
+                            currentPage.onLoad(pageOptions);
+                        }
+
+                        // 鏂规硶3锛氬悓鏃跺埛鏂扮粍浠舵暟鎹�
+                        this.findByOrderId();
+
+                    } else {
+                        this.$showMessage("鍛煎彨澶辫触");
+                        this.cancel();
+                    }
+                    return res;
+                }).catch(err => {
+                    console.error('淇濆瓨澶辫触锛�', err);
+                    this.$showMessage("淇濆瓨鏃跺彂鐢熼敊璇�");
+                    throw err;
+                });
+            },
 			// 鍙栨秷鎿嶄綔锛屾仮澶嶄负涓婃淇濆瓨鐨勬暟鎹�
 			cancel() {
 				this.maShoutTime = this.statusForm.maShoutTime;

--
Gitblit v1.9.3