From 5709db9dc8d689cdbb7a17842998de185b4a6b91 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期五, 11 七月 2025 13:06:00 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/procurementManagement/invoiceEntry/index.vue | 71 ++++++++++++++++++++++++++++++----- 1 files changed, 60 insertions(+), 11 deletions(-) diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue index 6df2bb0..6df5636 100644 --- a/src/views/procurementManagement/invoiceEntry/index.vue +++ b/src/views/procurementManagement/invoiceEntry/index.vue @@ -24,8 +24,8 @@ <el-button type="primary" @click="handleAdd('add')"> 鏂板鐧昏 </el-button> -<!-- <el-button @click="handleOut">瀵煎嚭</el-button>--> -<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>--> + <el-button @click="handleOut">瀵煎嚭</el-button> + <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button> </div> </div> <PIMTable @@ -40,6 +40,8 @@ total: pagination.total, }" :expand-row-keys="expandRowKeys" + :summaryMethod="summarizeMainTable" + :isShowSummary="true" @expand-change="expandChange" @selection-change="handleSelectionChange" @pagination="changePage" @@ -65,10 +67,11 @@ <script setup> import { usePaginationApi } from "@/hooks/usePaginationApi"; -import { gePurchaseListPage } from "@/api/procurementManagement/invoiceEntry.js"; +import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js"; import { nextTick, onMounted, getCurrentInstance } from "vue"; import ExpandTable from "./components/ExpandTable.vue"; import Modal from "./components/Modal.vue"; +import {ElMessageBox} from "element-plus"; defineOptions({ name: "鏉ョエ鐧昏", @@ -113,7 +116,7 @@ { label: "渚涘簲鍟嗗悕绉�", prop: "supplierName", - width:240 + width:200 }, { label: "椤圭洰鍚嶇О", @@ -127,12 +130,12 @@ { label: "褰曞叆鏃ユ湡", prop: "entryDate", - width:100 + width:110 }, { label: "鍚堝悓閲戦(鍏�)", prop: "contractAmount", - width:150, + width:200, formatData: (val) => { return val ? parseFloat(val).toFixed(2) : 0; }, @@ -140,7 +143,7 @@ { label: "宸插紑绁ㄩ噾棰�(鍏�)", prop: "receiptPaymentAmount", - width:150, + width:200, formatData: (val) => { return val ? parseFloat(val).toFixed(2) : 0; }, @@ -148,7 +151,7 @@ { label: "寰呭紑绁ㄩ噾棰�(鍏�)", prop: "unReceiptPaymentAmount", - width:150, + width:200, formatData: (val) => { return val ? parseFloat(val).toFixed(2) : 0; }, @@ -182,8 +185,44 @@ modalRef.value.open(type, id); }; -const handleOut = () => {}; -const handleDelete = () => {}; +// 瀵煎嚭 +const handleOut = () => { + ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", { + confirmButtonText: "纭", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + proxy.download("/purchase/registration/export", {}, "鏉ョエ鐧昏.xlsx"); + }) + .catch(() => { + proxy.$modal.msg("宸插彇娑�"); + }); +}; +// 鍒犻櫎 +const handleDelete = () => { + let ids = []; + if (selectedRows.value.length > 0) { + ids = selectedRows.value.map((item) => item.id); + } else { + proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁"); + return; + } + ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", { + confirmButtonText: "纭", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + delRegistration(ids).then((res) => { + proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + getList(); + }); + }) + .catch(() => { + proxy.$modal.msg("宸插彇娑�"); + }); +}; const expandChange = async (row, expandedRows) => { if (expandedRows.length > 0) { @@ -196,7 +235,17 @@ pagination.currentPage = page; onCurrentChange(page); }; - +// 涓昏〃鍚堣鏂规硶 +const summarizeMainTable = (param) => { + return proxy.summarizeTable( + param, + ["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"], + { + ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁� + futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁� + } + ); +}; onMounted(() => { getTableData(); }); -- Gitblit v1.9.3