From d420578cb8bc076be2f0c7dd5a4dbfca335d7cdb Mon Sep 17 00:00:00 2001
From: zhang_nuo <zhang_12370@163.com>
Date: 星期一, 17 八月 2026 21:44:51 +0800
Subject: [PATCH] feat(personnel,production): 新增年龄自动计算及工单数量支持小数

---
 src/views/productionManagement/workOrderManagement/index.vue |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index 119bd9e..c89ed7b 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -57,7 +57,7 @@
               <span class="info-value">{{ transferCardRowData.productName }}</span>
             </div>
             <div class="info-item">
-              <span class="info-label">浜у搧瑙勬牸</span>
+              <span class="info-label">瑙勬牸鍨嬪彿</span>
               <span class="info-value">{{ transferCardRowData.model }}</span>
             </div>
             <div class="info-item">
@@ -133,7 +133,7 @@
           <el-input v-model.number="reportForm.quantity"
                     type="number"
                     min="0"
-                    step="1"
+                    step="0.001"
                     style="width: 300px"
                     placeholder="璇疯緭鍏ョ敓浜у悎鏍兼暟閲�"
                     @input="handleQuantityInput" />
@@ -446,7 +446,7 @@
     }
     const num = Number(value);
     // 鏁存暟涓斿ぇ浜庣瓑浜�1
-    if (isNaN(num) || !Number.isInteger(num) || num < 0) {
+    if (isNaN(num) || num < 0) {
       callback(new Error("鐢熶骇鍚堟牸鏁伴噺蹇呴』澶т簬绛変簬0"));
       return;
     }
@@ -461,7 +461,7 @@
     }
     const num = Number(value);
     // 鏁存暟涓斿ぇ浜庣瓑浜�0
-    if (isNaN(num) || !Number.isInteger(num) || num < 0) {
+    if (isNaN(num) || num < 0) {
       callback(new Error("鎶ュ簾鏁伴噺蹇呴』澶т簬绛変簬0"));
       return;
     }
@@ -487,17 +487,6 @@
     // 濡傛灉灏忎簬1锛屾竻闄�
     if (num < 0) {
       reportForm.quantity = null;
-      return;
-    }
-    // 濡傛灉鏄皬鏁板彇鏁存暟閮ㄥ垎
-    if (!Number.isInteger(num)) {
-      const intValue = Math.floor(num);
-      // 濡傛灉鍙栨暣鍚庡皬浜�1锛屾竻闄�
-      if (intValue < 0) {
-        reportForm.quantity = null;
-        return;
-      }
-      reportForm.quantity = intValue;
       return;
     }
     reportForm.quantity = num;
@@ -549,7 +538,7 @@
     if (!Number.isFinite(n)) return 0;
     if (n <= 0) return 0;
     if (n >= 100) return 100;
-    return Math.round(n);
+    return parseFloat(n.toFixed(2));
   };
   const progressColor = percentage => {
     const p = toProgressPercentage(percentage);
@@ -673,7 +662,10 @@
       }
     }
     currentReportRowData.value = row;
-    reportForm.planQuantity = row.planQuantity;
+    const planQuantity = Number(row.planQuantity || 0);
+    const completeQuantity = Number(row.completeQuantity || 0);
+    const remainingQuantity = Math.max(0, planQuantity - completeQuantity);
+    reportForm.planQuantity = remainingQuantity;
     reportForm.quantity =
       row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
     reportForm.productProcessRouteItemId = row.productProcessRouteItemId;

--
Gitblit v1.9.3