From 77033702dcbddaba9bb0fc6723d07714aba1fab8 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 31 十月 2025 17:24:20 +0800
Subject: [PATCH] BUG
---
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