From 6f005044032f59fcb12550b2efdff89bd4191849 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 24 十月 2025 16:56:38 +0800
Subject: [PATCH] 修改说明

---
 components/mold.vue |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/components/mold.vue b/components/mold.vue
index ac24885..0760c5a 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -108,9 +108,7 @@
 
         <!-- 璇存槑 -->
         <view class="tool-desc">
-            <p style="color:red;">褰撳墠宸ュ崟涓紝鎹簡鍑犳鍒�锛屽氨浼氫骇鐢熷嚑鏉℃暟鎹�備笂鍒�鏃堕棿銆佷笅鍒�鏃堕棿鍦ㄨ〃涓兘鐪嬪埌銆�</p>
-            <p style="color:red;">涓婂垁鏃堕棿鍜屽搴旀椂闂寸敤鐢熶骇璁℃暟鍣ㄥ尮閰嶏紝鏌ュ嚭褰撴椂鐨勭敓浜ф暟锛堢疮璁¤鏁帮級銆�</p>
-            <p style="color:red;">瀵垮懡姣旈璀﹀�煎湪鍒�鍏蜂笂锛岄粯璁ょ粺涓�銆�</p>
+            <p style="color:red;">'浣跨敤涓婇檺'浠ヤ笅鍒�鏃剁殑'浣跨敤涓婇檺'涓烘爣鍑�</p>
         </view>
     </view>
 </template>
@@ -189,10 +187,12 @@
                             return null;
                         };
 
+                        // 杩欓噷闇�瑕佹妸 lifeWarn 瀛楁涔熷甫鍑烘潵
                         const mapped = (payload || []).map(t => ({
                             no: getField(t, 'cutterId', 'CUTTER_ID', 'cutteR_ID', 'daA001', 'no'),
                             name: getField(t, 'cutterName', 'CUTTER_NAME', 'cutteR_NAME', 'name'),
-                            model: getField(t, 'cutterModel', 'CUTTER_MODEL', 'cutteR_MODEL', 'model')
+                            model: getField(t, 'cutterModel', 'CUTTER_MODEL', 'cutteR_MODEL', 'model'),
+                            lifeWarn: getField(t, 'modlLifeWorning', 'lifeWarn', 'LIFE_WARN', 'lifE_WARN')
                         }));
 
                         this.filteredTools = mapped;
@@ -242,6 +242,14 @@
                 this.toolName = tool.name;
                 this.toolModel = tool.model;
                 this.activeToolNo = tool.no;
+                // 鏂板锛氬甫鍑哄鍛芥瘮棰勮鍊�
+                if (tool.lifeWarn !== undefined && tool.lifeWarn !== null) {
+                    // 鏍煎紡鍖栦负鐧惧垎姣斿瓧绗︿覆
+                    const warn = Number(tool.lifeWarn);
+                    this.lifeWarnInput = warn <= 1 ? `${(warn * 100).toFixed(0)}%` : `${warn.toFixed(0)}%`;
+                } else {
+                    this.lifeWarnInput = '';
+                }
             },
             confirmTool() {
                 this.showToolDialog = false;
@@ -487,6 +495,13 @@
                         this.toolModel = order.cutterModel || order.cutteR_MODEL || '';
                         // 鍏抽敭锛氳幏鍙栧伐鍗曟渶鏂伴噰闆嗘暟
                         this.workOrderCurrentCjNum = order.CurrentCjNum ?? order.currentCjNum ?? null;
+                        // 鏂板锛氳嚜鍔ㄥ~鍏呭鍛芥瘮棰勮鍊�
+                        if (order.modlLifeWorning !== undefined && order.modlLifeWorning !== null) {
+                            const warn = Number(order.modlLifeWorning);
+                            this.lifeWarnInput = warn <= 1 ? `${(warn * 100).toFixed(0)}%` : `${warn.toFixed(0)}%`;
+                        } else {
+                            this.lifeWarnInput = '';
+                        }
                     } else {
                         this.workOrderCurrentCjNum = null;
                     }
@@ -523,8 +538,8 @@
             this.fetchTools('');
             this.machineNo = uni.getStorageSync('machineNo') || '';
             this.workOrderNo = uni.getStorageSync('daa001') || '';
-            // 榛樿棰勮鍊� (90% -> 0.9)
-            this.lifeWarnInput = '90';
+            // 鍘婚櫎榛樿棰勮鍊� (90% -> 0.9)
+            //this.lifeWarnInput = '90';
 
             if (this.machineNo && this.workOrderNo) {
                 this.fetchFormData();

--
Gitblit v1.9.3