From 89a87a389d1e1a1a363aa39637694c044511af98 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 06 六月 2025 13:06:54 +0800
Subject: [PATCH] 数字展示修改
---
src/views/procurementManagement/paymentHistory/index.vue | 10 +++
src/views/salesManagement/invoiceLedger/index.vue | 24 +------
src/views/salesManagement/receiptPayment/index.vue | 24 +------
src/views/procurementManagement/invoiceEntry/index.vue | 4 -
src/views/salesManagement/receiptPaymentLedger/index.vue | 35 ++++-------
src/components/PIMTable/PIMTable.vue | 5 +
src/views/procurementManagement/paymentEntry/index.vue | 10 +++
src/views/salesManagement/receiptPaymentHistory/index.vue | 14 ++++
src/views/procurementManagement/paymentLedger/index.vue | 17 +++++
9 files changed, 77 insertions(+), 66 deletions(-)
diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 96f1f52..ab817f8 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -3,6 +3,7 @@
:header-cell-style="{ background: '#F0F1F5', color: '#333333' }" height="calc(100vh - 18.5em)"
:highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle" :row-key="rowKey"
style="width: 100%" tooltip-effect="dark" @row-click="rowClick" @current-change="currentChange" :show-summary="isShowSummary"
+ :summary-method="summaryMethod"
@selection-change="handleSelectionChange" class="lims-table">
<el-table-column align="center" type="selection" width="55" v-if="isSelection"/>
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
@@ -123,6 +124,10 @@
type: Function,
default: () => { }
},
+ summaryMethod: {
+ type: Function,
+ default: () => { }
+ },
rowClick: {
type: Function,
default: () => { }
diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue
index bccf47f..d73b5cc 100644
--- a/src/views/procurementManagement/invoiceEntry/index.vue
+++ b/src/views/procurementManagement/invoiceEntry/index.vue
@@ -107,9 +107,7 @@
<el-form-item label="浜у搧淇℃伅锛�" prop="entryDate">
</el-form-item>
</el-row>
- <el-table :data="productData" border @selection-change="productSelected" show-summary style="width: 100%">
- :summary-method="summarizeChildrenTable"
- >
+ <el-table :data="productData" border @selection-change="productSelected" show-summary style="width: 100%" :summary-method="summarizeChildrenTable">
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="浜у搧澶х被" prop="productCategory" />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
diff --git a/src/views/procurementManagement/paymentEntry/index.vue b/src/views/procurementManagement/paymentEntry/index.vue
index 11635a1..a995d6b 100644
--- a/src/views/procurementManagement/paymentEntry/index.vue
+++ b/src/views/procurementManagement/paymentEntry/index.vue
@@ -14,6 +14,8 @@
</div>
<div class="table_list">
<PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
+ :isShowSummary="isShowSummarySon"
+ :summaryMethod="summarizeMainTable1"
:handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination"
:total="total"></PIMTable>
</div>
@@ -201,7 +203,15 @@
}
})
const { searchForm, form, rules } = toRefs(data)
+const isShowSummarySon = ref(true);
+// 瀛愯〃鍚堣鏂规硶
+const summarizeMainTable1 = (param) => {
+ return proxy.summarizeTable(param, ['invoiceAmount', 'paymentAmountTotal', 'unPaymentAmountTotal'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
+};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
diff --git a/src/views/procurementManagement/paymentHistory/index.vue b/src/views/procurementManagement/paymentHistory/index.vue
index 08cd462..842cace 100644
--- a/src/views/procurementManagement/paymentHistory/index.vue
+++ b/src/views/procurementManagement/paymentHistory/index.vue
@@ -10,6 +10,8 @@
</div>
<div class="table_list">
<PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
+ :isShowSummary="isShowSummarySon"
+ :summaryMethod="summarizeMainTable1"
:handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination"
:total="total"></PIMTable>
</div>
@@ -23,6 +25,7 @@
paymentHistoryList
} from "@/api/procurementManagement/paymentEntry.js";
const { proxy } = getCurrentInstance()
+const isShowSummarySon = ref(true);
const tableColumn = ref([
{
label: '浠樻鏃ユ湡',
@@ -86,6 +89,13 @@
total.value = res.total
})
}
+// 瀛愯〃鍚堣鏂规硶
+const summarizeMainTable1 = (param) => {
+ return proxy.summarizeTable(param, ['currentPaymentAmount'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
+};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
selectedRows.value = selection
diff --git a/src/views/procurementManagement/paymentLedger/index.vue b/src/views/procurementManagement/paymentLedger/index.vue
index 2d340a7..e2bdc8b 100644
--- a/src/views/procurementManagement/paymentLedger/index.vue
+++ b/src/views/procurementManagement/paymentLedger/index.vue
@@ -32,6 +32,7 @@
tooltip-effect="dark"
@row-click="rowClick"
:show-summary="isShowSummary"
+ :summary-method="summarizeMainTable"
class="lims-table"
>
<el-table-column
@@ -78,6 +79,7 @@
:isSelection="false"
:tableLoading="tableLoadingSon"
:isShowSummary="isShowSummarySon"
+ :summaryMethod="summarizeMainTable1"
></PIMTable>
<pagination
v-show="sonTotal > 0"
@@ -175,7 +177,22 @@
const isShowSummarySon = ref(true);
const detailPageNum = ref(1);
const detailPageSize = ref(10);
+const { proxy } = getCurrentInstance()
+// 涓昏〃鍚堣鏂规硶
+const summarizeMainTable = (param) => {
+ return proxy.summarizeTable(param, ['invoiceAmount', 'paymentAmount', 'payableAmount'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
+};
+// 瀛愯〃鍚堣鏂规硶
+const summarizeMainTable1 = (param) => {
+ return proxy.summarizeTable(param, ['invoiceAmount', 'currentPaymentAmount', 'payableAmount'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
+};
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
page.current = 1;
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index 85f0473..db08cab 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -271,26 +271,10 @@
}
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = '鍚堣';
- return;
- }
- const prop = column.property;
- if (['invoiceAmount'].includes(prop)) {
- const values = data.map(item => Number(item[prop]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((acc, val) => (!isNaN(val) ? acc + val : acc), 0);
- } else {
- sums[index] = '';
- }
- } else {
- sums[index] = '';
- }
- })
- return sums;
+ return proxy.summarizeTable(param, ['invoiceTotal'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
};
// 鎵撳紑寮规
const openForm = (row) => {
diff --git a/src/views/salesManagement/receiptPayment/index.vue b/src/views/salesManagement/receiptPayment/index.vue
index 08e9f21..31f7491 100644
--- a/src/views/salesManagement/receiptPayment/index.vue
+++ b/src/views/salesManagement/receiptPayment/index.vue
@@ -199,26 +199,10 @@
}
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = '鍚堣';
- return;
- }
- const prop = column.property;
- if (['invoiceAmount','receiptPaymentAmount'].includes(prop)) {
- const values = data.map(item => Number(item[prop]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((acc, val) => (!isNaN(val) ? acc + val : acc), 0);
- } else {
- sums[index] = '';
- }
- } else {
- sums[index] = '';
- }
- })
- return sums;
+ return proxy.summarizeTable(param, ['invoiceTotal', 'receiptPaymentAmountTotal', 'noReceiptAmount'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
};
// 鎵撳紑寮规
const openForm = () => {
diff --git a/src/views/salesManagement/receiptPaymentHistory/index.vue b/src/views/salesManagement/receiptPaymentHistory/index.vue
index 0fd8eef..4d7eaf5 100644
--- a/src/views/salesManagement/receiptPaymentHistory/index.vue
+++ b/src/views/salesManagement/receiptPaymentHistory/index.vue
@@ -10,6 +10,8 @@
</div>
<div class="table_list">
<PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
+ :isShowSummary="isShowSummarySon"
+ :summaryMethod="summarizeMainTable1"
:handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination"
:total="total"></PIMTable>
</div>
@@ -35,6 +37,9 @@
{
label: '鍥炴閲戦',
prop: 'receiptPaymentAmount',
+ formatData: (params) => {
+ return parseFloat(params).toFixed(2);
+ }
},
{
label: '鍥炴鏂瑰紡',
@@ -77,7 +82,7 @@
})
const { searchForm } = toRefs(data)
const { receipt_payment_type } = proxy.useDict("receipt_payment_type")
-
+const isShowSummarySon = ref(true);
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -97,6 +102,13 @@
total.value = res.total
})
}
+// 瀛愯〃鍚堣鏂规硶
+const summarizeMainTable1 = (param) => {
+ return proxy.summarizeTable(param, ['receiptPaymentAmount'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
+};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
selectedRows.value = selection
diff --git a/src/views/salesManagement/receiptPaymentLedger/index.vue b/src/views/salesManagement/receiptPaymentLedger/index.vue
index 1c9b3bf..c4d5252 100644
--- a/src/views/salesManagement/receiptPaymentLedger/index.vue
+++ b/src/views/salesManagement/receiptPaymentLedger/index.vue
@@ -35,7 +35,7 @@
<el-table :data="receiptRecord" border
:row-key="row => row.id"
show-summary
- :summary-method="summarizeMainTable"
+ :summary-method="summarizeMainTable1"
height="calc(100vh - 18.5em)">
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column label="鍙戠敓鏃ユ湡" prop="receiptPaymentDate" show-overflow-tooltip/>
@@ -60,7 +60,7 @@
receiptPaymentListPage
} from "../../../api/salesManagement/receiptPayment.js";
import Pagination from "../../../components/PIMTable/Pagination.vue";
-
+const { proxy } = getCurrentInstance()
const tableData = ref([])
const receiptRecord = ref([])
const tableLoading = ref(false)
@@ -112,26 +112,17 @@
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = '鍚堣';
- return;
- }
- const prop = column.property;
- if (['invoiceAmount','receiptPaymentAmount','unReceiptPaymentAmount'].includes(prop)) {
- const values = data.map(item => Number(item[prop]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((acc, val) => (!isNaN(val) ? acc + val : acc), 0);
- } else {
- sums[index] = '';
- }
- } else {
- sums[index] = '';
- }
- })
- return sums;
+ return proxy.summarizeTable(param, ['invoiceTotal', 'receiptPaymentAmount', 'unReceiptPaymentAmount'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
+};
+// 瀛愯〃鍚堣鏂规硶
+const summarizeMainTable1 = (param) => {
+ return proxy.summarizeTable(param, ['receiptPaymentAmount', 'noReceiptAmount', 'invoiceTotal'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
};
const receiptPaymentList = (id) => {
--
Gitblit v1.9.3