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 ++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

(limited to 'lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx')

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<void>
+  onConfirm: (reason?: string) => Promise<void>
   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 (
     <Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
       <DialogContent>
@@ -102,6 +112,21 @@ export function ReRequestInvestigationDialog({
             취소 상태인 실사만 재의뢰할 수 있습니다.
           </DialogDescription>
         </DialogHeader>
+        
+        <div className="space-y-4 py-4">
+          <div className="space-y-2">
+            <Label htmlFor="reason">재의뢰 사유 (선택)</Label>
+            <Textarea
+              id="reason"
+              placeholder="재의뢰 사유를 입력해주세요..."
+              value={reason}
+              onChange={(e) => setReason(e.target.value)}
+              rows={4}
+              disabled={isPending}
+            />
+          </div>
+        </div>
+
         <DialogFooter>
           <Button
             type="button"
-- 
cgit v1.2.3

