From 751e8a196c1b6377b1d21a83c7df07036cdcebb5 Mon Sep 17 00:00:00 2001 From: liu <2302563948@qq.com> Date: Wed, 16 Sep 2026 23:51:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2=E5=90=88?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/components/XinTable/index.tsx | 2 +- web/pages/purchase/order.tsx | 38 ++++++++++++++++++++++++++ web/pages/recon/bill.tsx | 40 ++++++++++++++++++++++++++++ web/pages/recon/container-return.tsx | 34 ++++++++++++++++++++++- web/pages/recon/payment.tsx | 17 ++++++++++++ 5 files changed, 129 insertions(+), 2 deletions(-) diff --git a/web/components/XinTable/index.tsx b/web/components/XinTable/index.tsx index cb7c0fb..d321fda 100644 --- a/web/components/XinTable/index.tsx +++ b/web/components/XinTable/index.tsx @@ -557,7 +557,7 @@ export default function XinTable = any>(props: Xin )} {/* 操作栏 */} - + { ...actionBarRender() } {...toolBarRender()} diff --git a/web/pages/purchase/order.tsx b/web/pages/purchase/order.tsx index 270e1cd..98fff70 100644 --- a/web/pages/purchase/order.tsx +++ b/web/pages/purchase/order.tsx @@ -1214,6 +1214,43 @@ const PurchaseOrderPage: React.FC = () => { ) ]; + /** 列表底部合计行:统计当前页的 预估成本/账单总金额/商品金额/总件数/总重量 */ + const renderListSummary: TableProps['summary'] = (pageData) => { + const sums = pageData.reduce( + (acc, row) => ({ + estimate_amount: acc.estimate_amount + Number(row.estimate_amount ?? 0), + bill_total_amount: acc.bill_total_amount + Number(row.bill_total_amount ?? 0), + bill_product_amount: acc.bill_product_amount + Number(row.bill_product_amount ?? 0), + total_quantity: acc.total_quantity + Number(row.total_quantity ?? 0), + total_weight: acc.total_weight + Number(row.total_weight ?? 0), + }), + { estimate_amount: 0, bill_total_amount: 0, bill_product_amount: 0, total_quantity: 0, total_weight: 0 }, + ); + return ( + + + 本页合计 + + + ¥{sums.estimate_amount.toFixed(2)} + + + ¥{sums.bill_total_amount.toFixed(2)} + + + ¥{sums.bill_product_amount.toFixed(2)} + + + {sums.total_quantity} + + + {sums.total_weight.toFixed(3)}斤 + + + + ); + }; + const tableProps: XinTableProps = { api: '/purchase/order', columns, @@ -1225,6 +1262,7 @@ const PurchaseOrderPage: React.FC = () => { width: 300 }, formProps: false, + summary: renderListSummary, }; return ( diff --git a/web/pages/recon/bill.tsx b/web/pages/recon/bill.tsx index 65f255a..f960380 100644 --- a/web/pages/recon/bill.tsx +++ b/web/pages/recon/bill.tsx @@ -162,6 +162,45 @@ const BillPage: React.FC = () => { ); }; + /** 列表底部合计行:统计当前页的 商品金额/配送费/附加金额/售后金额/账单总金额 */ + const renderListSummary: TableProps['summary'] = (pageData) => { + const sums = pageData.reduce( + (acc, row) => ({ + product_amount: acc.product_amount + Number(row.product_amount ?? 0), + delivery_fee: acc.delivery_fee + Number(row.delivery_fee ?? 0), + added_amount: acc.added_amount + Number(row.added_amount ?? 0), + after_sale: acc.after_sale + Number(row.after_sale ?? 0), + total_amount: acc.total_amount + Number(row.total_amount ?? 0), + }), + { product_amount: 0, delivery_fee: 0, added_amount: 0, after_sale: 0, total_amount: 0 }, + ); + return ( + + + 本页合计 + + + ¥{sums.product_amount.toFixed(2)} + + + ¥{sums.delivery_fee.toFixed(2)} + + + ¥{sums.added_amount.toFixed(2)} + + + + ¥{sums.after_sale.toFixed(2)} + + + + ¥{sums.total_amount.toFixed(2)} + + + + ); + }; + /** 关联订单列 */ const orderColumns: TableProps['columns'] = [ { @@ -343,6 +382,7 @@ const BillPage: React.FC = () => { tableRef, operateRender, formProps: false, + summary: renderListSummary, actionBarRender: (dom) => [dom.search, dom.keywordSearch], toolBarRender: (dom) => [ dom.columnSetting, diff --git a/web/pages/recon/container-return.tsx b/web/pages/recon/container-return.tsx index 64f2541..046e07d 100644 --- a/web/pages/recon/container-return.tsx +++ b/web/pages/recon/container-return.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { Button, DatePicker, Form, Modal, Select, Typography } from 'antd'; +import { Button, DatePicker, Form, Modal, Select, Table, Typography } from 'antd'; +import type { TableProps } from 'antd'; import { DownloadOutlined } from '@ant-design/icons'; import dayjs from 'dayjs'; import XinTable from '@/components/XinTable'; @@ -165,6 +166,36 @@ const ContainerReturnPage: React.FC = () => { }, ]; + /** 列表底部合计行:统计当前页的 压(回)筐数量/压(回)托盘数量/抵扣(附加)金额 */ + const renderListSummary: TableProps['summary'] = (pageData) => { + const sums = pageData.reduce( + (acc, row) => ({ + box_num: acc.box_num + Number(row.box_num ?? 0), + tray_num: acc.tray_num + Number(row.tray_num ?? 0), + amount: acc.amount + Number(row.amount ?? 0), + }), + { box_num: 0, tray_num: 0, amount: 0 }, + ); + return ( + + + 本页合计 + + + + + + + + + + + + + + ); + }; + const tableProps: XinTableProps = { api: '/recon/container-return', columns, @@ -175,6 +206,7 @@ const ContainerReturnPage: React.FC = () => { editShow: false, deleteShow: false, formProps: false, + summary: renderListSummary, toolBarRender: (dom) => [