重构财务台账工具与异常优先页面(05-30-finance-ledger-tools-redesign)
这个提交包含在:
@@ -284,6 +284,7 @@ export function ApOperationsPage() {
|
||||
const [ledgerDateTo, setLedgerDateTo] = useState("");
|
||||
const [ledgerSearch, setLedgerSearch] = useState("");
|
||||
const [ledgerPage, setLedgerPage] = useState(1);
|
||||
const [showLedgerTools, setShowLedgerTools] = useState(false);
|
||||
|
||||
const [reviewTarget, setReviewTarget] = useState<PaymentBatch | null>(null);
|
||||
const [reviewComment, setReviewComment] = useState("");
|
||||
@@ -617,8 +618,8 @@ export function ApOperationsPage() {
|
||||
return (
|
||||
<ListWorkspace>
|
||||
<WorkspaceHeader
|
||||
title="财务付款与对账"
|
||||
subtitle="待付款、异常付款、风险、对账和台账集中处理。"
|
||||
title="应付账款"
|
||||
subtitle="优先处理待付款、异常付款、风险和对账差异;导出和代账交接进入台账工具。"
|
||||
actions={
|
||||
<>
|
||||
<Button
|
||||
@@ -632,24 +633,16 @@ export function ApOperationsPage() {
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => exportMutation.mutate("csv")}
|
||||
disabled={exportMutation.isPending}
|
||||
onClick={() => setShowLedgerTools((current) => !current)}
|
||||
>
|
||||
{exportMutation.isPending ? "导出中..." : "导出 CSV"}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => exportMutation.mutate("xlsx")}
|
||||
disabled={exportMutation.isPending}
|
||||
>
|
||||
{exportMutation.isPending ? "导出中..." : "导出 Excel"}
|
||||
台账工具
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
{summaryQuery.isError ? (
|
||||
<SectionError message={resolveErrorMessage(summaryQuery.error, "AP 摘要加载失败")} />
|
||||
<SectionError message={resolveErrorMessage(summaryQuery.error, "应付摘要加载失败")} />
|
||||
) : null}
|
||||
{paymentBatchesQuery.isError ? (
|
||||
<SectionError message={resolveErrorMessage(paymentBatchesQuery.error, "付款批次数据加载失败")} />
|
||||
@@ -677,6 +670,40 @@ export function ApOperationsPage() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{showLedgerTools ? (
|
||||
<div className="finance-command-panel space-y-3" data-testid="ap-ledger-tools">
|
||||
<div className="flex flex-col gap-3 md:flex-row md:items-start md:justify-between">
|
||||
<div>
|
||||
<h3 className="text-base font-semibold text-zinc-900">台账工具</h3>
|
||||
<p className="mt-1 text-sm leading-6 text-zinc-500">
|
||||
导出只用于财务复核和代账交接,范围按当前筛选条件生成;文件可能包含付款、票据和员工摘要信息。
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex shrink-0 flex-wrap gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => exportMutation.mutate("csv")}
|
||||
disabled={exportMutation.isPending}
|
||||
>
|
||||
{exportMutation.isPending ? "导出中..." : "导出 CSV"}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => exportMutation.mutate("xlsx")}
|
||||
disabled={exportMutation.isPending}
|
||||
>
|
||||
{exportMutation.isPending ? "导出中..." : "导出 Excel"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 text-sm text-slate-600">
|
||||
当前工具不会执行真实付款,也不会生成正式总账凭证;付款仍由线下银行或既有财务流程完成。
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div className="finance-command-panel">
|
||||
<Tabs value={activeTab} onValueChange={(value) => setActiveTab(value as OperationsTab)}>
|
||||
<TabsList className="ops-command-bar__tabs !w-full !justify-start">
|
||||
|
||||
在新工单中引用
屏蔽一个用户