From 43f105070cf75a057d1d0ce4ff330c3b19a21ab0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 12 七月 2025 13:45:52 +0800
Subject: [PATCH] 1.付款登记-优化:删除权限优化

---
 src/views/procurementManagement/invoiceEntry/components/Modal.vue |   47 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index e3d96af..f4f3045 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -113,12 +113,14 @@
         rowKey="id"
         :column="columns"
         :tableData="form.productData"
+				:summaryMethod="summarizeChildrenTable"
+				:isShowSummary="true"
         height="auto"
       >
         <template #ticketsNumRef="{ row }">
           <el-input-number
             v-model="row.ticketsNum"
-            placeholder="璇烽�夋嫨"
+            placeholder="璇疯緭鍏�"
             :min="0"
             :step="0.1"
             clearable
@@ -129,7 +131,7 @@
         <template #ticketsAmountRef="{ row }">
           <el-input-number
             v-model="row.ticketsAmount"
-            placeholder="璇烽�夋嫨"
+            placeholder="璇疯緭鍏�"
             :min="0"
             :step="0.1"
             clearable
@@ -150,6 +152,7 @@
 
 <script setup>
 import { ref, getCurrentInstance } from "vue";
+import { defineEmits } from 'vue';
 import { useModal } from "@/hooks/useModal";
 import useFormData from "@/hooks/useFormData";
 import FileUpload from "@/components/Upload/FileUpload.vue";
@@ -211,14 +214,18 @@
   title: "鏉ョエ鐧昏",
 });
 
+const emit = defineEmits(['refreshList']);
+
 const columns = [
   {
     label: "浜у搧澶х被",
     prop: "productCategory",
+		width: 120,
   },
   {
     label: "瑙勬牸鍨嬪彿",
     prop: "specificationModel",
+		width: 120,
   },
   {
     label: "鍗曚綅",
@@ -283,10 +290,12 @@
   {
     label: "鏈潵绁ㄦ暟",
     prop: "futureTickets",
+		width: 100,
   },
   {
     label: "鏈潵绁ㄩ噾棰�(鍏�)",
     prop: "futureTicketsAmount",
+		width: 200,
   },
 ];
 
@@ -316,7 +325,19 @@
     form.productData = data.productData;
   }
 };
-
+// 瀛愯〃鍚堣鏂规硶
+const summarizeChildrenTable = (param) => {
+	return proxy.summarizeTable(param, [
+		"taxInclusiveUnitPrice",
+		"taxInclusiveTotalPrice",
+		"taxExclusiveTotalPrice",
+		"ticketsNum",
+		"ticketsAmount",
+		"ticketsAmountRef",
+		"futureTickets",
+		"futureTicketsAmount",
+	]);
+};
 //鏈鏉ョエ鏁板け鐒︽搷浣�
 const invoiceNumBlur = (row) => {
   if (!row.ticketsNum || row.ticketsNum === "") {
@@ -328,11 +349,11 @@
     return;
   }
   // 璁$畻鏈鏉ョエ閲戦
-  row.ticketsAmount = row.ticketsNum * row.taxInclusiveUnitPrice;
+  row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2)
   // 璁$畻鏈潵绁ㄦ暟
-  row.futureTickets = row.tempFutureTickets - row.ticketsNum;
+  row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
   // 璁$畻鏈潵绁ㄩ噾棰�
-  row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount;
+  row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
   calculateinvoiceAmount();
 };
 
@@ -351,9 +372,9 @@
     (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2)
   );
   // 璁$畻鏈潵绁ㄦ暟
-  row.futureTickets = row.tempFutureTickets - row.ticketsNum;
+  row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
   // 璁$畻鏈潵绁ㄩ噾棰�
-  row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount;
+  row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
   calculateinvoiceAmount();
 };
 
@@ -361,7 +382,7 @@
   let invoiceAmountTotal = 0;
   form.productData.forEach((item) => {
     if (item.ticketsAmount) {
-      invoiceAmountTotal += item.ticketsAmount;
+      invoiceAmountTotal += Number(item.ticketsAmount);
     }
   });
   form.invoiceAmount = invoiceAmountTotal.toFixed(2);
@@ -381,6 +402,11 @@
 const removeFile = (file) => {
   const { tempId } = file.response.data;
   form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId);
+};
+
+const closeAndRefresh = () => {
+  closeModal();
+  emit('refreshList');
 };
 
 const submitForm = () => {
@@ -406,7 +432,7 @@
       });
       modalLoading.value = false;
       if (code == 200) {
-        closeModal();
+        closeAndRefresh();
       }
     } else {
       modalLoading.value = false;
@@ -416,6 +442,7 @@
 
 defineExpose({
   open,
+  closeAndRefresh,
 });
 </script>
 

--
Gitblit v1.9.3