R71-A4 澄清报销缺票提示并修复发票上传挂起
这个提交包含在:
@@ -173,6 +173,10 @@ export function mapApiErrorMessage(
|
||||
return "该任务已被处理,请刷新列表。";
|
||||
}
|
||||
|
||||
if (details?.invoices === "bound_invoice_required") {
|
||||
return "提交前请先绑定至少 1 张发票。";
|
||||
}
|
||||
|
||||
if (details?.invoice === "not_bound") {
|
||||
return "该票据未绑定报销单,无法解绑。";
|
||||
}
|
||||
|
||||
@@ -578,6 +578,8 @@ export function ReimbursementDetailPage() {
|
||||
const precheckStandardChecks = reimbursementPrecheckQuery.data?.standardChecks ?? [];
|
||||
const blockStandardChecks = precheckStandardChecks.filter((item) => item.exceeded && item.controlMode === "block");
|
||||
const warnStandardChecks = precheckStandardChecks.filter((item) => item.exceeded && item.controlMode === "warn");
|
||||
const missingInvoiceSubmitMessage = "提交前需先绑定至少 1 张发票,可在“关联票据”区域添加。";
|
||||
const submitInvoiceNotice = canEditItems && detail.invoices.length < 1 ? missingInvoiceSubmitMessage : "";
|
||||
const selectedInvoiceEntries = Object.entries(selectedInvoices);
|
||||
|
||||
const expenseTypes = expenseTypesQuery.data?.items ?? [];
|
||||
@@ -627,6 +629,11 @@ export function ReimbursementDetailPage() {
|
||||
|
||||
try {
|
||||
setActionError("");
|
||||
if (detail.invoices.length < 1) {
|
||||
setActionError(missingInvoiceSubmitMessage);
|
||||
toast.error(missingInvoiceSubmitMessage);
|
||||
return;
|
||||
}
|
||||
const precheck = await precheckReimbursement(reimbursementId);
|
||||
const message = buildPrecheckDialogMessage(precheck);
|
||||
|
||||
@@ -1214,6 +1221,7 @@ export function ReimbursementDetailPage() {
|
||||
actionError={actionError}
|
||||
submitDisabled={blockStandardChecks.length > 0}
|
||||
submitHint={blockStandardChecks.length > 0 ? "请修改超标明细后提交" : ""}
|
||||
submitNotice={submitInvoiceNotice}
|
||||
isPending={mutation.isPending}
|
||||
onSubmit={() => void handleSubmitAction()}
|
||||
onWithdraw={(comment) => mutation.mutate({ action: "withdraw", comment })}
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface ReimbursementActionsProps {
|
||||
actionError: string;
|
||||
submitDisabled?: boolean;
|
||||
submitHint?: string;
|
||||
submitNotice?: string;
|
||||
isPending: boolean;
|
||||
onSubmit: () => void;
|
||||
onWithdraw: (comment: string) => void;
|
||||
@@ -30,6 +31,7 @@ export function ReimbursementActions({
|
||||
actionError,
|
||||
submitDisabled = false,
|
||||
submitHint = "",
|
||||
submitNotice = "",
|
||||
isPending,
|
||||
onSubmit,
|
||||
onWithdraw,
|
||||
@@ -64,6 +66,11 @@ export function ReimbursementActions({
|
||||
</Button>
|
||||
</div>
|
||||
{submitHint ? <p className="text-sm text-zinc-500">{submitHint}</p> : null}
|
||||
{submitNotice ? (
|
||||
<p className="rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700">
|
||||
{submitNotice}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<div className="space-y-2 rounded-lg border border-zinc-200 p-4">
|
||||
<p className="text-sm font-medium text-zinc-800">撤回报销</p>
|
||||
|
||||
在新工单中引用
屏蔽一个用户