From 60977504246152d12e2b08640fb63545090d2054 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 12 二月 2026 13:28:55 +0800
Subject: [PATCH] 进销存升级 1.选择台账时,若未来票金额为0时,来票登记按钮置灰,来票结束的采购限制不能继续来票操作)还有台账存在多个产品,若其中一个产品不能继续来票操作,这种情况也需要让有关来票的输入框置灰

---
 src/views/procurementManagement/invoiceEntry/index.vue |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue
index 00a6881..8c435e0 100644
--- a/src/views/procurementManagement/invoiceEntry/index.vue
+++ b/src/views/procurementManagement/invoiceEntry/index.vue
@@ -39,7 +39,7 @@
         <div></div>
         <div>
           <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
-          <el-button type="primary" @click="handleAdd('add')">
+          <el-button type="primary" @click="handleAdd('add')" :disabled="isInvoiceDisabled">
             鏉ョエ鐧昏
           </el-button>
 <!--          <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
@@ -84,7 +84,7 @@
 <script setup>
 import { usePaginationApi } from "@/hooks/usePaginationApi";
 import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js";
-import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
+import { nextTick, onMounted, getCurrentInstance, ref, computed } from "vue";
 import ExpandTable from "./components/ExpandTable.vue";
 import Modal from "./components/Modal.vue";
 import {ElMessageBox} from "element-plus";
@@ -186,6 +186,18 @@
   );
 };
 
+// 璁$畻鏄惁鍙互鏉ョエ鐧昏锛氬鏋滄墍鏈夐�変腑琛岀殑寰呮潵绁ㄩ噾棰濋兘涓�0锛屽垯绂佺敤鎸夐挳
+const isInvoiceDisabled = computed(() => {
+  if (selectedRows.value.length === 0) {
+    return true;
+  }
+  // 濡傛灉鎵�鏈夐�変腑琛岀殑寰呮潵绁ㄩ噾棰濋兘涓�0鎴栧皬浜庣瓑浜�0锛屽垯绂佺敤
+  return selectedRows.value.every(row => {
+    const amount = parseFloat(row.unReceiptPaymentAmount || 0);
+    return amount <= 0;
+  });
+});
+
 const handleAdd = (type) => {
 	if (selectedRows.value.length < 1) {
 		proxy.$modal.msgWarning("璇疯嚦灏戦�変腑涓�鏉℃暟鎹�");

--
Gitblit v1.9.3