完成五人团队正式内用最小收口(07-18-small-team-internal-readiness)
这个提交包含在:
@@ -32,6 +32,7 @@ import type { PrecheckResponse } from "../api/feeControl";
|
||||
import { useAuth } from "../auth/AuthContext";
|
||||
import { hasPermission } from "../auth/permissions";
|
||||
import { AttachmentGovernanceBadges } from "../components/common/AttachmentGovernanceBadges";
|
||||
import { AttachmentDeleteConfirmDialog } from "../components/common/AttachmentDeleteConfirmDialog";
|
||||
import { useAttachmentDownloadReasonDialog } from "../components/common/useAttachmentDownloadReasonDialog";
|
||||
import { ConfirmDialog } from "../components/common/ConfirmDialog";
|
||||
import { MobileIcon } from "../components/mobile/MobileIcon";
|
||||
@@ -211,6 +212,7 @@ export function MobileReimbursementDetailPage() {
|
||||
const [confirmDeleteItemId, setConfirmDeleteItemId] = useState("");
|
||||
const [confirmDeleteInvoiceId, setConfirmDeleteInvoiceId] = useState("");
|
||||
const [confirmDeleteReimbursement, setConfirmDeleteReimbursement] = useState(false);
|
||||
const [deleteAttachmentTarget, setDeleteAttachmentTarget] = useState<{ id: string; name: string } | null>(null);
|
||||
const [submitConfirmPrecheck, setSubmitConfirmPrecheck] = useState<PrecheckResponse | null>(null);
|
||||
const [isInvoiceDialogOpen, setIsInvoiceDialogOpen] = useState(false);
|
||||
const [invoicePanel, setInvoicePanel] = useState<InvoicePanel>("upload");
|
||||
@@ -692,9 +694,11 @@ export function MobileReimbursementDetailPage() {
|
||||
});
|
||||
|
||||
const deleteAttachmentMutation = useMutation({
|
||||
mutationFn: (attachmentId: string) => deleteReimbursementAttachment(reimbursementId, attachmentId),
|
||||
mutationFn: ({ attachmentId, reason }: { attachmentId: string; reason: string }) =>
|
||||
deleteReimbursementAttachment(reimbursementId, attachmentId, reason),
|
||||
onSuccess: async () => {
|
||||
await invalidateDetail();
|
||||
setDeleteAttachmentTarget(null);
|
||||
toast.success("附件材料已删除");
|
||||
},
|
||||
onError: (error) => {
|
||||
@@ -1157,7 +1161,7 @@ export function MobileReimbursementDetailPage() {
|
||||
variant="secondary"
|
||||
type="button"
|
||||
disabled={deleteAttachmentMutation.isPending}
|
||||
onClick={() => deleteAttachmentMutation.mutate(attachment.id)}
|
||||
onClick={() => setDeleteAttachmentTarget({ id: attachment.id, name: attachment.originalName })}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
@@ -1561,6 +1565,20 @@ export function MobileReimbursementDetailPage() {
|
||||
confirmLabel="删除草稿"
|
||||
onConfirm={() => deleteReimbursementMutation.mutate()}
|
||||
/>
|
||||
|
||||
<AttachmentDeleteConfirmDialog
|
||||
open={Boolean(deleteAttachmentTarget)}
|
||||
targetName={deleteAttachmentTarget?.name}
|
||||
pending={deleteAttachmentMutation.isPending}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) setDeleteAttachmentTarget(null);
|
||||
}}
|
||||
onConfirm={(reason) => {
|
||||
if (deleteAttachmentTarget) {
|
||||
deleteAttachmentMutation.mutate({ attachmentId: deleteAttachmentTarget.id, reason });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</PageScaffold>
|
||||
);
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户