From d0af866d532da9c8108ce863dda5bb3019bb3d3a Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期三, 03 十二月 2025 15:34:25 +0800
Subject: [PATCH] 新增:刷新按钮处理方法
---
components/mold.vue | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index 356dd86..7e21efb 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -210,11 +210,14 @@
// 鏂板锛氬埛鏂版寜閽鐞嗘柟娉�
async handleRefresh() {
- // 鍒锋柊鍒�鍏峰垪琛ㄥ拰琛ㄥ崟鏁版嵁
this.fetchTools('');
if (this.machineNo && this.workOrderNo) {
await this.fetchFormData();
await this.fetchDefaultToolFromWorkOrder();
+ // 鍒锋柊鍚庤祴鍊肩涓�琛� currentCjNum
+ if (this.toolRecords.length > 0) {
+ this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum);
+ }
}
this.$showMessage('鍒锋柊瀹屾垚');
},
@@ -667,12 +670,15 @@
this.fetchTools('');
this.machineNo = uni.getStorageSync('machineNo') || '';
this.workOrderNo = uni.getStorageSync('daa001') || '';
- // 鍘婚櫎榛樿棰勮鍊� (90% -> 0.9)
- //this.lifeWarnInput = '90';
if (this.machineNo && this.workOrderNo) {
- this.fetchFormData();
- this.fetchDefaultToolFromWorkOrder();
+ this.fetchFormData().then(async () => {
+ await this.fetchDefaultToolFromWorkOrder();
+ // 杩涘叆椤甸潰鏃惰祴鍊肩涓�琛� currentCjNum
+ if (this.toolRecords.length > 0) {
+ this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum);
+ }
+ });
} else {
console.warn('鏈哄彴鍙锋垨宸ュ崟鍙蜂负绌猴紝鏃犳硶鑾峰彇琛ㄥ崟鏁版嵁');
}
--
Gitblit v1.9.3