From fd3e3b19aaf23c4f68d8b98d514499510b152e39 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 11 七月 2025 15:54:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

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

diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index e3d96af..ae6a79f 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";
@@ -210,6 +213,8 @@
 } = useModal({
   title: "鏉ョエ鐧昏",
 });
+
+const emit = defineEmits(['refreshList']);
 
 const columns = [
   {
@@ -283,10 +288,12 @@
   {
     label: "鏈潵绁ㄦ暟",
     prop: "futureTickets",
+		width: 100,
   },
   {
     label: "鏈潵绁ㄩ噾棰�(鍏�)",
     prop: "futureTicketsAmount",
+		width: 200,
   },
 ];
 
@@ -316,7 +323,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 +347,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 +370,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 +380,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 +400,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 +430,7 @@
       });
       modalLoading.value = false;
       if (code == 200) {
-        closeModal();
+        closeAndRefresh();
       }
     } else {
       modalLoading.value = false;
@@ -416,6 +440,7 @@
 
 defineExpose({
   open,
+  closeAndRefresh,
 });
 </script>
 

--
Gitblit v1.9.3