R7E-16E/R7E-16F 高风险操作确认统一
这个提交包含在:
@@ -38,6 +38,7 @@ import { useAuth } from "../auth/AuthContext";
|
||||
import { hasPermission } from "../auth/permissions";
|
||||
import { RiskFlagsCard } from "../components/common/RiskFlagsCard";
|
||||
import { AiSuggestionCard } from "../components/ai/AiSuggestionCard";
|
||||
import { ActionConfirmDialog } from "../components/common/ActionConfirmDialog";
|
||||
import { Pagination } from "../components/common/Pagination";
|
||||
import { StatusBadge } from "../components/common/StatusBadge";
|
||||
import { TableSkeleton } from "../components/common/TableSkeleton";
|
||||
@@ -244,6 +245,8 @@ export function PurchaseRequestsPage() {
|
||||
const [archivePoNo, setArchivePoNo] = useState("");
|
||||
const [archiveContractNo, setArchiveContractNo] = useState("");
|
||||
const [selectedAttachmentName, setSelectedAttachmentName] = useState("");
|
||||
const [submitPrecheckConfirm, setSubmitPrecheckConfirm] = useState<string | null>(null);
|
||||
const [erpRequeueConfirm, setErpRequeueConfirm] = useState<{ target: PurchaseRequestErpRequeueTarget; label: string } | null>(null);
|
||||
const attachmentInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
const suppliersQuery = useQuery({
|
||||
@@ -742,7 +745,8 @@ export function PurchaseRequestsPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((precheck.decision === "warn" || precheck.decision === "manual_review") && !window.confirm(message)) {
|
||||
if (precheck.decision === "warn" || precheck.decision === "manual_review") {
|
||||
setSubmitPrecheckConfirm(message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1736,7 +1740,7 @@ export function PurchaseRequestsPage() {
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
disabled={requeueErpMutation.isPending}
|
||||
onClick={() => requeueErpMutation.mutate({ target: action.target, label: meta.title })}
|
||||
onClick={() => setErpRequeueConfirm({ target: action.target, label: meta.title })}
|
||||
>
|
||||
{isSubmittingAction ? "处理中..." : action.label}
|
||||
</Button>
|
||||
@@ -1757,6 +1761,32 @@ export function PurchaseRequestsPage() {
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
<ActionConfirmDialog
|
||||
open={Boolean(submitPrecheckConfirm)}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) setSubmitPrecheckConfirm(null);
|
||||
}}
|
||||
kind="precheck"
|
||||
targetName={detail ? resolvePurchaseDisplayCode(detail) : "采购申请"}
|
||||
description={submitPrecheckConfirm}
|
||||
onConfirm={async () => {
|
||||
submitMutation.mutate();
|
||||
}}
|
||||
/>
|
||||
<ActionConfirmDialog
|
||||
open={Boolean(erpRequeueConfirm)}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) setErpRequeueConfirm(null);
|
||||
}}
|
||||
kind="retry"
|
||||
targetName={erpRequeueConfirm?.label}
|
||||
description="确认后会重新补发或重试 ERP 同步消息,并追加新的同步处理记录。"
|
||||
onConfirm={async () => {
|
||||
if (erpRequeueConfirm) {
|
||||
requeueErpMutation.mutate(erpRequeueConfirm);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</ListWorkspace>
|
||||
);
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户