OAFRONT5 收口PC剩余P2展示问题

这个提交包含在:
2026-05-25 10:04:34 +08:00
父节点 ef24010d4a
当前提交 373301da32
共修改 4 个文件,包含 48 行新增和 32 行删除
+26 -24
查看文件
@@ -41,6 +41,7 @@ import { isApiError } from "../api/types";
import { useAuth } from "../auth/AuthContext";
import { hasPermission } from "../auth/permissions";
import { ConfirmDialog } from "../components/common/ConfirmDialog";
import { DateTextInput } from "../components/common/DateTextInput";
import { ListWorkspace, WorkspaceHeader } from "../components/patterns/ListWorkspace";
import { Button } from "../components/ui/button";
import {
@@ -62,6 +63,7 @@ import {
} from "../components/ui/table";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../components/ui/tabs";
import { downloadBlob } from "../lib/download";
import { formatDisplayDate, formatDisplayDateTime } from "../lib/displayFormat";
type OperationsTab = "ledger" | "pending" | "failed" | "risk" | "reconciliation";
type RiskActionType = "resolve" | "dismiss";
@@ -91,20 +93,24 @@ function resolveErrorMessage(error: unknown, fallback = "操作失败") {
}
function formatDateTime(value: string | null) {
if (!value) {
return "-";
}
const date = new Date(value);
if (Number.isNaN(date.getTime())) {
return value;
}
return date.toLocaleString("zh-CN", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
});
return formatDisplayDateTime(value);
}
function formatDate(value: string | null | undefined) {
return formatDisplayDate(value);
}
function displayPersonName(value: string | null | undefined, fallback = "-") {
const name = value?.trim();
if (!name) return fallback;
const smokeNameLabels: Record<string, string> = {
Employee: "测试员工",
Manager: "测试主管",
Admin: "测试管理员",
Finance: "测试财务",
"Finance Manager": "测试财务负责人",
};
return smokeNameLabels[name] ?? name;
}
function statusBadgeClass(status: string) {
@@ -737,8 +743,7 @@ export function ApOperationsPage() {
</div>
<div className="space-y-2">
<div className="text-sm font-medium text-zinc-700">报销日期从</div>
<Input
type="date"
<DateTextInput
value={ledgerDateFrom}
onChange={(event) => {
setLedgerDateFrom(event.target.value);
@@ -748,8 +753,7 @@ export function ApOperationsPage() {
</div>
<div className="space-y-2">
<div className="text-sm font-medium text-zinc-700">报销日期至</div>
<Input
type="date"
<DateTextInput
value={ledgerDateTo}
onChange={(event) => {
setLedgerDateTo(event.target.value);
@@ -811,7 +815,7 @@ export function ApOperationsPage() {
<div className="text-xs text-zinc-500">{item.description || "无说明"}</div>
</TableCell>
<TableCell>
<div className="font-medium text-zinc-900">{item.owner?.name ?? item.submitter?.name ?? "-"}</div>
<div className="font-medium text-zinc-900">{displayPersonName(item.owner?.name ?? item.submitter?.name)}</div>
<div className="text-xs text-zinc-500">{item.department?.name ?? "-"}</div>
</TableCell>
<TableCell>
@@ -830,7 +834,7 @@ export function ApOperationsPage() {
{paymentStatusLabel(item.payment.status)}
</span>
<div className="text-xs text-zinc-500">
{item.payment.paymentDate ?? "-"} · {item.payment.paidBy?.name ?? "未记录操作人"}
{formatDate(item.payment.paymentDate)} · {displayPersonName(item.payment.paidBy?.name, "未记录操作人")}
</div>
<div className="text-xs text-zinc-500">
凭证:{item.payment.paymentVoucherNo ?? "-"}
@@ -912,16 +916,14 @@ export function ApOperationsPage() {
</div>
<div className="space-y-2">
<div className="text-sm font-medium text-zinc-700">创建时间从</div>
<Input
type="date"
<DateTextInput
value={pendingCreatedAtFrom}
onChange={(event) => setPendingCreatedAtFrom(event.target.value)}
/>
</div>
<div className="space-y-2">
<div className="text-sm font-medium text-zinc-700">创建时间至</div>
<Input
type="date"
<DateTextInput
value={pendingCreatedAtTo}
onChange={(event) => setPendingCreatedAtTo(event.target.value)}
/>