fix: 加固日历日期与动态错误合同(09-05-error-explainability-payment-readiness,09-08-reimbursement-payment-closeout)
这个提交包含在:
@@ -1,4 +1,5 @@
|
||||
import { formatInvoiceOcrFieldLabels } from "../lib/invoiceOcr";
|
||||
import { formatDisplayDateTime } from "../lib/displayFormat";
|
||||
import { resolveErrorReasonMessage, UNKNOWN_VALIDATION_MESSAGE } from "./errorReasons";
|
||||
|
||||
function readStringList(value: unknown): string[] {
|
||||
@@ -307,8 +308,9 @@ export function mapApiErrorMessage(
|
||||
|
||||
if (details?.workflow === "remind_too_frequent") {
|
||||
const nextAllowedAt = typeof details?.nextAllowedAt === "string" ? details.nextAllowedAt : null;
|
||||
return nextAllowedAt
|
||||
? `24 小时内已催办过,请在 ${nextAllowedAt.slice(0, 19).replace("T", " ")} 后再试。`
|
||||
return nextAllowedAt && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(nextAllowedAt)
|
||||
&& Number.isFinite(new Date(nextAllowedAt).getTime())
|
||||
? `24 小时内已催办过,请在北京时间 ${formatDisplayDateTime(nextAllowedAt, { includeSeconds: true })} 后再试。`
|
||||
: "24 小时内已催办过。";
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export function formatDisplayDate(value: string | null | undefined) {
|
||||
}).format(timestamp);
|
||||
}
|
||||
|
||||
export function formatDisplayDateTime(value: string | null | undefined) {
|
||||
export function formatDisplayDateTime(value: string | null | undefined, options: { includeSeconds?: boolean } = {}) {
|
||||
if (!value) return "-";
|
||||
|
||||
const timestamp = new Date(value).getTime();
|
||||
@@ -30,6 +30,7 @@ export function formatDisplayDateTime(value: string | null | undefined) {
|
||||
day: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
...(options.includeSeconds ? { second: "2-digit" as const } : {}),
|
||||
}).format(timestamp);
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户