From 78c471eec35182959e0029ded18f144974ccaca2 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Thu, 23 Oct 2025 18:13:41 +0900 Subject: (김준회) 결재 템플릿 에디터 및 결재 워크플로 공통함수 작성, 실사의뢰 결재 연결 예시 작성 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cancel-investigation-dialog.tsx | 29 +- .../vendors-table-toolbar-actions.tsx | 317 ++++++++++++++++++--- 2 files changed, 305 insertions(+), 41 deletions(-) (limited to 'lib/pq') diff --git a/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx b/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx index e135d8b8..e22b9ca1 100644 --- a/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx +++ b/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx @@ -11,6 +11,8 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog" +import { Textarea } from "@/components/ui/textarea" +import { Label } from "@/components/ui/label" interface CancelInvestigationDialogProps { isOpen: boolean @@ -71,7 +73,7 @@ export function CancelInvestigationDialog({ interface ReRequestInvestigationDialogProps { isOpen: boolean onClose: () => void - onConfirm: () => Promise + onConfirm: (reason?: string) => Promise selectedCount: number } @@ -82,16 +84,24 @@ export function ReRequestInvestigationDialog({ selectedCount, }: ReRequestInvestigationDialogProps) { const [isPending, setIsPending] = React.useState(false) + const [reason, setReason] = React.useState("") async function handleConfirm() { setIsPending(true) try { - await onConfirm() + await onConfirm(reason || undefined) } finally { setIsPending(false) } } + // Dialog가 닫힐 때 상태 초기화 + React.useEffect(() => { + if (!isOpen) { + setReason("") + } + }, [isOpen]) + return ( !open && onClose()}> @@ -102,6 +112,21 @@ export function ReRequestInvestigationDialog({ 취소 상태인 실사만 재의뢰할 수 있습니다. + +
+
+ +