收口报销详情返回与金额展示(07-27-yang-jun-reimbursement-readiness)

这个提交包含在:
2026-08-01 15:03:48 +08:00
父节点 85fad71070
当前提交 3bfcbbfc91
共修改 16 个文件,包含 219 行新增和 81 行删除
+14
查看文件
@@ -33,6 +33,20 @@ export function formatDisplayDateTime(value: string | null | undefined) {
}).format(timestamp);
}
export function formatMoney(value: string | number | null | undefined) {
if (value == null || value === "") return "-";
const amount = typeof value === "number" ? value : Number(value);
if (!Number.isFinite(amount)) return "-";
return new Intl.NumberFormat("zh-CN", {
style: "currency",
currency: "CNY",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(amount);
}
export function formatCompactIdentifier(
value: string | number | null | undefined,
options: { head?: number; tail?: number; minLength?: number } = {},
+23
查看文件
@@ -0,0 +1,23 @@
export type PcDetailNavigationState = {
from?: string;
};
export function buildPcDetailSource(pathname: string, search: string) {
return `${pathname}${search}`;
}
export function resolvePcDetailSource(value: unknown, currentPath: string) {
if (typeof value !== "string" || !value.startsWith("/") || value.startsWith("//") || value.includes("#")) {
return null;
}
const url = new URL(value, "https://hyb-oa.invalid");
const isReimbursementList = url.pathname === "/reimbursements";
const isWorkflowTask = /^\/workflow\/tasks\/[^/]+$/.test(url.pathname);
if (!isReimbursementList && !isWorkflowTask) {
return null;
}
const source = `${url.pathname}${url.search}`;
return source === currentPath ? null : source;
}