summaryrefslogtreecommitdiff
path: root/components/pq-input/pq-review-wrapper.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-10-03 04:48:47 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-10-03 04:48:47 +0000
commitdefda07c0bb4b0bd444ca8dc4fd3f89322bda0ce (patch)
treed7f257781f107d7ec2fd4ef76cb4f840f5065a06 /components/pq-input/pq-review-wrapper.tsx
parent00743c8b4190fac9117c2d9c08981bbfdce576de (diff)
(대표님) edp, tbe, dolce 등
Diffstat (limited to 'components/pq-input/pq-review-wrapper.tsx')
-rw-r--r--components/pq-input/pq-review-wrapper.tsx63
1 files changed, 34 insertions, 29 deletions
diff --git a/components/pq-input/pq-review-wrapper.tsx b/components/pq-input/pq-review-wrapper.tsx
index ca5f314f..44916dce 100644
--- a/components/pq-input/pq-review-wrapper.tsx
+++ b/components/pq-input/pq-review-wrapper.tsx
@@ -21,7 +21,7 @@ import {
DialogTitle
} from "@/components/ui/dialog"
import { useToast } from "@/hooks/use-toast"
-import { CheckCircle, AlertCircle, Paperclip } from "lucide-react"
+import { CheckCircle, AlertCircle, Paperclip, Square } from "lucide-react"
import { PQGroupData } from "@/lib/pq/service"
import { approvePQAction, rejectPQAction, updateSHICommentAction } from "@/lib/pq/service"
// import * as ExcelJS from 'exceljs';
@@ -48,14 +48,14 @@ interface PQReviewWrapperProps {
pqData: PQGroupData[]
vendorId: number
pqSubmission: PQSubmission
- canReview: boolean
+ vendorInfo?: any // 협력업체 정보 (선택사항)
}
export function PQReviewWrapper({
pqData,
vendorId,
pqSubmission,
- canReview
+ vendorInfo
}: PQReviewWrapperProps) {
const router = useRouter()
const { toast } = useToast()
@@ -66,6 +66,7 @@ export function PQReviewWrapper({
const [rejectReason, setRejectReason] = React.useState("")
const [shiComments, setShiComments] = React.useState<Record<number, string>>({})
const [isUpdatingComment, setIsUpdatingComment] = React.useState<number | null>(null)
+
// 코드 순서로 정렬하는 함수 (1-1-1, 1-1-2, 1-2-1 순서)
const sortByCode = (items: any[]) => {
@@ -88,6 +89,7 @@ export function PQReviewWrapper({
})
}
+
// 기존 SHI 코멘트를 로컬 상태에 초기화
React.useEffect(() => {
const initialComments: Record<number, string> = {}
@@ -369,25 +371,27 @@ export function PQReviewWrapper({
<Card key={item.criteriaId}>
<CardHeader>
<div className="flex justify-between items-start">
- <div>
- <CardTitle className="text-base">
- {item.code} - {item.checkPoint}
-
-
- </CardTitle>
- {item.description && (
- <CardDescription className="mt-1 whitespace-pre-wrap">
- {item.description}
- </CardDescription>
- )}
- {item.remarks && (
- <div className="mt-2 p-2 rounded-md">
- <p className="text-sm font-medium text-muted-foreground mb-1">Remark:</p>
- <p className="text-sm whitespace-pre-wrap">
- {item.remarks}
- </p>
+ <div className="flex-1">
+ <div className="flex items-start gap-3">
+ <div className="flex-1">
+ <CardTitle className="text-base">
+ {item.code} - {item.checkPoint}
+ </CardTitle>
+ {item.description && (
+ <CardDescription className="mt-1 whitespace-pre-wrap">
+ {item.description}
+ </CardDescription>
+ )}
+ {item.remarks && (
+ <div className="mt-2 p-2 rounded-md">
+ <p className="text-sm font-medium text-muted-foreground mb-1">Remark:</p>
+ <p className="text-sm whitespace-pre-wrap">
+ {item.remarks}
+ </p>
+ </div>
+ )}
</div>
- )}
+ </div>
</div>
{/* 항목 상태 표시 */}
{!!item.answer || item.attachments.length > 0 ? (
@@ -606,26 +610,27 @@ export function PQReviewWrapper({
))}
{/* 검토 버튼 */}
- {canReview && (
<div className="fixed bottom-4 right-4 bg-background p-4 rounded-lg shadow-md border">
<div className="flex gap-2">
- {/* <Button
- variant="outline"
+
+
+ {/* <Button
+ variant="outline"
onClick={handleExportToExcel}
disabled={isExporting}
>
<Download className="h-4 w-4 mr-2" />
{isExporting ? "내보내기 중..." : "Excel 내보내기"}
</Button> */}
- <Button
- variant="outline"
+ <Button
+ variant="outline"
onClick={() => setShowRejectDialog(true)}
disabled={isRejecting}
>
{isRejecting ? "거부 중..." : "거부"}
</Button>
- <Button
- variant="default"
+ <Button
+ variant="default"
onClick={() => setShowApproveDialog(true)}
disabled={isApproving}
>
@@ -633,7 +638,7 @@ export function PQReviewWrapper({
</Button>
</div>
</div>
- )}
+
{/* 승인 확인 다이얼로그 */}
<Dialog open={showApproveDialog} onOpenChange={setShowApproveDialog}>