diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/vendor/page.tsx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/vendor/page.tsx b/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/vendor/page.tsx index c3a786b9..00a9ef13 100644 --- a/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/vendor/page.tsx +++ b/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/vendor/page.tsx @@ -1,7 +1,7 @@ import { Separator } from "@/components/ui/separator"; import { getRfqWithDetails, getRfqVendorResponses } from "@/lib/rfq-last/service"; import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert"; -import { AlertCircle, Users, Send, FileText, CheckCircle2, Clock, XCircle } from "lucide-react"; +import { AlertCircle, Users, Send, FileText, CheckCircle2, Clock } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { RfqVendorTable } from "@/lib/rfq-last/vendor/rfq-vendor-table"; @@ -12,7 +12,15 @@ interface VendorPageProps { lng: string; id: string; }; - searchParams: Promise<Record<string, any>>; + searchParams: Promise<Record<string, string | string[]>>; +} + +// rfqCode를 기반으로 rfqCategory 결정 +function getRfqCategory(rfqCode: string): "itb" | "rfq" | "general" { + if (rfqCode.startsWith("I")) return "itb"; + if (rfqCode.startsWith("R")) return "rfq"; + if (rfqCode.startsWith("F")) return "general"; + return "general"; // 기본값 } export default async function VendorPage(props: VendorPageProps) { @@ -48,10 +56,13 @@ export default async function VendorPage(props: VendorPageProps) { ); } + // rfqCategory 결정 + const rfqCategory = getRfqCategory(rfqData.rfqCode); + // 응답 상태별 집계 const statusSummary = { total: rfqData?.details.length || 0, - invited: vendorResponses?.filter(v => v.status === "초대됨").length || 0, + invited: vendorResponses?.filter(v => v.status === "대기중").length || 0, drafting: vendorResponses?.filter(v => v.status === "작성중").length || 0, submitted: vendorResponses?.filter(v => v.status === "제출완료").length || 0, confirmed: vendorResponses?.filter(v => v.status === "최종확정").length || 0, @@ -125,8 +136,9 @@ export default async function VendorPage(props: VendorPageProps) { <RfqVendorTable rfqId={rfqId} rfqCode={rfqData.rfqCode } - rfqDetails={rfqData.details || []} - vendorResponses={vendorResponses || []} + rfqDetails={rfqData.details as any || []} + vendorResponses={vendorResponses as any || []} + rfqCategory={rfqCategory} /> </CardContent> </Card> |
