v4.0.11HQ后端优化(快链、账单日等)
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-09-02 15:45:12 +08:00
parent 1000b489a0
commit 6880b5daf4
31 changed files with 1014 additions and 402 deletions
+34 -4
View File
@@ -31,6 +31,7 @@ import {
import { request, type Paginated } from '../lib/api';
import { ADMIN_OPTIONS_PAGE_SIZE, fmtTime } from '../lib/constants';
import { downloadExcelCsv } from '../lib/exportExcel';
import { appendExportColumns } from '../lib/export-columns';
import { useAdminList } from '../lib/useAdminList';
import { useAdminListColumns } from '../lib/useAdminListColumns';
import { AdminListHeader } from '../components/AdminListHeader';
@@ -44,6 +45,8 @@ type Row = {
amount: number;
status: StoreSettlementStatus;
date: string;
periodStart?: string | null;
periodEnd?: string | null;
overdue?: boolean;
redeemCount?: number | null;
redeemAmount?: number | null;
@@ -198,6 +201,7 @@ export default function StoreBillsPage() {
if (filters.storeId) qs.set('storeId', filters.storeId);
if (filters.dateFrom) qs.set('dateFrom', filters.dateFrom);
if (filters.dateTo) qs.set('dateTo', filters.dateTo);
appendExportColumns(qs, exportColumnKeys);
const result = await request<{ csv: string; count: number }>(`/admin/store-bills/export?${qs}`);
downloadExcelCsv(result.csv, `门店对账单_${filters.dateFrom || 'all'}_${filters.dateTo || 'all'}.csv`);
message.success(`已导出 ${result.count} 条 T+1 账单`);
@@ -218,6 +222,7 @@ export default function StoreBillsPage() {
const baseColumns: ColumnsType<Row> = [
{
title: '类型',
key: '类型',
dataIndex: 'kind',
width: 100,
render: (k: StoreSettlementKind) => (
@@ -228,6 +233,7 @@ export default function StoreBillsPage() {
},
{
title: '单号',
key: '账单号',
dataIndex: 'billNo',
width: 180,
render: (v, row) => (
@@ -243,39 +249,58 @@ export default function StoreBillsPage() {
</Tooltip>
),
key: '出账日',
dataIndex: 'date',
width: 160,
render: (v, row) => (row.kind === 'T1_BILL' ? String(v || '').slice(0, 10) : fmtTime(v)),
},
{ title: '门店', dataIndex: ['store', 'name'], width: 140 },
{ title: '登录手机', dataIndex: ['store', 'phone'], width: 120, render: (v) => v || '—' },
{ title: '城市', dataIndex: ['store', 'cityName'], width: 90 },
{
title: (
<Tooltip title="T+1 账期为出账日前一日的核销窗口;手动提现无账期">
</Tooltip>
),
key: '账期',
width: 200,
render: (_, row) =>
row.kind === 'T1_BILL' && row.periodStart
? `${row.periodStart} ~ ${row.periodEnd}`
: '—',
},
{ title: '门店', key: '门店', dataIndex: ['store', 'name'], width: 140 },
{ title: '登录手机', key: '登录手机', dataIndex: ['store', 'phone'], width: 120, render: (v) => v || '—' },
{ title: '城市', key: '城市', dataIndex: ['store', 'cityName'], width: 90 },
{
title: '收款户名',
key: '收款户名',
width: 100,
render: (_, row) =>
row.kind === 'T1_BILL' ? row.bankAccount?.bankAccountName || '—' : '—',
},
{
title: '收款账号',
key: '收款账号',
width: 140,
render: (_, row) =>
row.kind === 'T1_BILL' ? row.bankAccount?.bankAccountNo || '—' : '—',
},
{
title: '笔数',
key: '笔数',
width: 80,
render: (_, row) =>
row.kind === 'T1_BILL' ? (row.redeemCount ?? '—') : (row.payoutCount ?? '—'),
},
{
title: '应付金额',
key: '应付金额',
dataIndex: 'amount',
width: 110,
render: (v) => `¥${Number(v).toFixed(2)}`,
},
{
title: '状态',
key: '状态',
dataIndex: 'status',
width: 100,
render: (s: string, row) => (
@@ -325,7 +350,7 @@ export default function StoreBillsPage() {
}
| undefined;
const { columns, settingsButton, settingsModal } = useAdminListColumns('finance-store-bills', baseColumns, { page, pageSize });
const { columns, settingsButton, settingsModal, exportColumnKeys } = useAdminListColumns('finance-store-bills', baseColumns, { page, pageSize });
return (
<div>
@@ -495,6 +520,11 @@ export default function StoreBillsPage() {
<Descriptions.Item label="出账日">
{String(detail.billDate || '').slice(0, 10)}
</Descriptions.Item>
<Descriptions.Item label="账期">
{detail.periodStart
? `${String(detail.periodStart).slice(0, 10)} ~ ${String(detail.periodEnd || '').slice(0, 10)}`
: '—'}
</Descriptions.Item>
<Descriptions.Item label="应付">
¥{Number(detail.payoutAmount ?? 0).toFixed(2)}
</Descriptions.Item>