From 5470429a79313630a7ddef601de1d89e7dada754 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 22 五月 2026 09:14:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev-new_pro_OA

---
 src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue b/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
index d058896..09e7421 100644
--- a/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
+++ b/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
@@ -111,6 +111,7 @@
         <span class="dialog-footer">
           <el-button type="primary"
                      :loading="materialSaving"
+                     :disabled="isSaveDisabled"
                      @click="handleMaterialSave">淇濆瓨</el-button>
           <el-button @click="dialogVisible = false">鍙栨秷</el-button>
         </span>
@@ -155,6 +156,33 @@
   const materialTableLoading = ref(false);
   const materialSaving = ref(false);
   const materialTableData = ref([]);
+
+  const isSaveDisabled = computed(() => {
+    if (materialTableData.value.length === 0) return true;
+    return !materialTableData.value.some(row => {
+      // 妫�鏌ユ槸鍚︽湁浠讳綍鐢ㄦ埛杈撳叆鍐呭
+      const hasBatch = Array.isArray(row.batchNo) && row.batchNo.length > 0;
+      const hasPickQty =
+        row.pickQty !== null && row.pickQty !== undefined && row.pickQty !== 0;
+
+      if (row.bom) {
+        // 瀵逛簬鏉ヨ嚜BOM鐨勮锛岃緭鍏ユ鍙湁鈥滄壒鍙封�濆拰鈥滈鐢ㄦ暟閲忊��
+        return hasBatch || hasPickQty;
+      } else {
+        // 瀵逛簬鏂板琛岋紝杈撳叆妗嗗寘鎷�滃伐搴忊�濄�佲�滃師鏂欌�濄�佲�滈渶姹傛暟閲忊�濄�佲�滄壒鍙封�濆拰鈥滈鐢ㄦ暟閲忊��
+        const hasOperation = !!row.operationName;
+        const hasMaterial = !!row.materialName;
+        const hasDemanded =
+          row.demandedQuantity !== null &&
+          row.demandedQuantity !== undefined &&
+          row.demandedQuantity !== 0;
+        return (
+          hasBatch || hasPickQty || hasOperation || hasMaterial || hasDemanded
+        );
+      }
+    });
+  });
+
   const processOptions = ref([]);
   const currentMaterialSelectRowIndex = ref(-1);
   let materialTempId = 0;

--
Gitblit v1.9.3