fix: 完善回单失败引导及真实认证验证(09-08-reimbursement-payment-closeout)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-09-15 15:26:08 +08:00
父节点 8d08d46d16
当前提交 b7d2285d8d
共修改 9 个文件,包含 383 行新增和 13 行删除
+5 -1
查看文件
@@ -295,6 +295,9 @@ export function PaymentBatchesPage() {
const canUploadReceipt =
canEditReceiptAttachments && requiresBankReceipt && receiptAttachmentsQuery.isSuccess;
const activeReceiptCount = (receiptAttachmentsQuery.data?.items ?? []).filter((item) => !item.archivedAt).length;
const hasReceiptSystemFailure = (receiptAttachmentsQuery.data?.items ?? []).some((item) =>
!item.archivedAt && ["system_failed", "key_failed", "snapshot_failed"].includes(item.ocrState ?? ""),
);
const needsBankReceipt =
canExecuteSelectedBatch && requiresBankReceipt && receiptAttachmentsQuery.isSuccess && activeReceiptCount === 0;
const receiptReadinessQuery = useQuery({
@@ -1032,7 +1035,8 @@ export function PaymentBatchesPage() {
</div>
{canExecuteSelectedBatch && requiresBankReceipt && activeReceiptCount > 0 && !canRegisterPaymentComplete ? (
<div className="space-y-2 rounded-lg border p-3 text-sm" role="status">
<p>{receiptReadinessQuery.isFetching ? "正在核对回单…" : receiptReadinessQuery.isError ?
<p>{receiptReadinessQuery.isFetching ? "正在核对回单…" : hasReceiptSystemFailure ?
"回单尚未满足付款登记条件,存在系统核验故障,请联系管理员排查下方失败原因。修复并获原件重传授权后,可重新上传回单;保留原失败记录,不要直接重复识别或登记付款。" : receiptReadinessQuery.isError ?
resolveError(receiptReadinessQuery.error) : "回单尚未满足付款登记条件,请查看核验详情,完成识别、更正或独立复核。"}</p>
<Button type="button" size="sm" variant="secondary" disabled={receiptReadinessQuery.isFetching}
onClick={() => { void receiptReadinessQuery.refetch(); void receiptAttachmentsQuery.refetch(); }}>
@@ -1364,6 +1364,8 @@ test.describe("R7E 全站高风险操作二次确认", () => {
await page.goto(`/payment-batches?id=${paymentBatchId}`);
const receipt = page.locator(".detail-evidence-card").filter({ hasText: "合成银行回单.pdf" });
await expect(receipt).toContainText("请联系管理员");
await expect(page.getByRole("status").filter({ hasText: "回单尚未满足付款登记条件" })).toContainText("存在系统核验故障");
await expect(page.getByText("请查看核验详情", { exact: false })).toHaveCount(0);
await expect(receipt.getByRole("button", { name: "重新识别", exact: true })).toHaveCount(0);
await expect(receipt.getByRole("button", { name: "核验详情", exact: true })).toHaveCount(0);
await expect(page.getByRole("button", { name: "登记付款完成", exact: true })).toHaveCount(0);