From e44ce4501ea4cf30e79b2181fda84cd3faf8ec8a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 12 七月 2025 15:34:02 +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