From 30c83dd9d658e1b515051865b3965b5756b24f18 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 08 四月 2026 16:53:05 +0800
Subject: [PATCH] 采购台账删除传入子id导致报错问题

---
 src/views/procurementManagement/procurementLedger/index.vue |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 1eb1e39..3a62191 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -624,8 +624,11 @@
                           prop="taxRate"
                           v-if="currentSupplierType === 1">
               <el-select v-model="productForm.taxRate"
-                         placeholder="璇烽�夋嫨"
+                         placeholder="璇烽�夋嫨鎴栬緭鍏�"
                          clearable
+                         filterable
+                         remote
+                         :remote-method="handleTaxRateRemote"
                          @change="mathNum">
                 <el-option label="1"
                            value="1" />
@@ -633,6 +636,9 @@
                            value="6" />
                 <el-option label="13"
                            value="13" />
+                <el-option v-if="customTaxRate"
+                           :label="customTaxRate"
+                           :value="customTaxRate" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -1049,6 +1055,7 @@
   const productOperationType = ref("");
   const productOperationIndex = ref("");
   const currentId = ref("");
+  const customTaxRate = ref("");
   const productFormData = reactive({
     productForm: {
       productId: "",
@@ -1889,7 +1896,12 @@
   const handleDelete = () => {
     let ids = [];
     if (selectedRows.value.length > 0) {
-      ids = selectedRows.value.map(item => item.id);
+      // ids = selectedRows.value.map(item => item.id);
+      selectedRows.value.forEach(item => {
+        if (item.purchaseContractNumber) {
+          ids.push(item.id);
+        }
+      });
     } else {
       proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
       return;
@@ -1917,6 +1929,20 @@
     const day = String(today.getDate()).padStart(2, "0");
     return `${year}-${month}-${day}`;
   }
+  // 澶勭悊绋庣巼杩滅▼鎼滅储
+  const handleTaxRateRemote = query => {
+    if (query) {
+      // 楠岃瘉杈撳叆鏄惁涓烘暟瀛椾笖鍦�0-100涔嬮棿
+      const num = parseFloat(query);
+      if (!isNaN(num) && num > 0 && num < 100) {
+        customTaxRate.value = query;
+      } else {
+        customTaxRate.value = "";
+      }
+    } else {
+      customTaxRate.value = "";
+    }
+  };
   const mathNum = () => {
     if (!productForm.value.taxRate) {
       proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");

--
Gitblit v1.9.3