From 8a19a6fa336768d8b6712752c9d713360067ecb0 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 8 Dec 2025 08:45:20 +0000 Subject: (최겸) 구매 피드백 수정, 안전담당자, pq항목 내 첨부, 내외자 구분, 도로명주소 api 반영(운영기준) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pq_new/[vendorId]/[submissionId]/page.tsx | 1 + app/[lng]/partners/(partners)/pq_new/[id]/page.tsx | 20 +++++++ app/[lng]/partners/(partners)/pq_new/page.tsx | 31 +++++++++- app/api/juso/route.ts | 69 ++++++++++++++++++++++ 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 app/api/juso/route.ts (limited to 'app') diff --git a/app/[lng]/evcp/(evcp)/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx b/app/[lng]/evcp/(evcp)/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx index 8e3006cc..93302f87 100644 --- a/app/[lng]/evcp/(evcp)/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx +++ b/app/[lng]/evcp/(evcp)/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx @@ -157,6 +157,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) { vendorId={vendorId} pqSubmission={pqSubmission} vendorInfo={vendorInfo} + vendorCountry={pqSubmission.vendorCountry} /> diff --git a/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx b/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx index f298cc77..8fbf15db 100644 --- a/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx +++ b/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { getServerSession } from "next-auth/next"; import { authOptions } from "@/app/api/auth/[...nextauth]/route"; import { Button } from "@/components/ui/button"; +import { Badge } from "@/components/ui/badge"; import { ArrowLeft, LogIn } from "lucide-react"; import { Shell } from "@/components/shell"; import { getPQById, getPQDataByVendorId } from "@/lib/pq/service"; @@ -159,6 +160,24 @@ export default async function PQEditPage(props: PQEditPageProps) { )} */} +
+

PQ 품목

+ {Array.isArray(pqSubmission.pqItems) && pqSubmission.pqItems.length > 0 ? ( +
+ {pqSubmission.pqItems.map((item: any, idx: number) => ( + + {item?.itemName || item?.itemCode || "품목"} + {item?.itemCode ? ` (${item.itemCode})` : ""} + + ))} +
+ ) : pqSubmission.pqItems ? ( +
{String(pqSubmission.pqItems)}
+ ) : ( +

지정된 PQ 품목이 없습니다.

+ )} +
+ {/* PQ 입력 컴포넌트 */} ); diff --git a/app/[lng]/partners/(partners)/pq_new/page.tsx b/app/[lng]/partners/(partners)/pq_new/page.tsx index fb77ce0e..b6cc3535 100644 --- a/app/[lng]/partners/(partners)/pq_new/page.tsx +++ b/app/[lng]/partners/(partners)/pq_new/page.tsx @@ -65,6 +65,31 @@ function getFormattedDate(date: Date | null) { }).format(new Date(date)); } +function renderPQItems(pqItems: unknown) { + if (!pqItems) return "-"; + + if (typeof pqItems === "string") { + return pqItems || "-"; + } + + if (Array.isArray(pqItems)) { + if (pqItems.length === 0) return "-"; + + return ( +
+ {pqItems.map((item: any, idx: number) => ( + + {item?.itemName || item?.itemCode || ""} + {item?.itemCode ? ` (${item.itemCode})` : ""} + + ))} +
+ ); + } + + return "-"; +} + export default async function PQListPage({ params }: IndexPageProps) { // 캐시 비활성화 noStore(); @@ -212,6 +237,7 @@ export default async function PQListPage({ params }: IndexPageProps) { 유형 PQ 번호 프로젝트 + PQ 품목 상태 요청일 제출일 @@ -222,7 +248,7 @@ export default async function PQListPage({ params }: IndexPageProps) { {pqList.length === 0 ? ( - + 요청된 PQ가 없습니다. @@ -250,6 +276,9 @@ export default async function PQListPage({ params }: IndexPageProps) { {pq.projectName || "-"} + + {renderPQItems(pq.pqItems)} + {getStatusBadge(pq.status)} diff --git a/app/api/juso/route.ts b/app/api/juso/route.ts new file mode 100644 index 00000000..258e51d3 --- /dev/null +++ b/app/api/juso/route.ts @@ -0,0 +1,69 @@ +"use server"; + +import { NextRequest, NextResponse } from "next/server"; + +const JUSO_URL = "https://business.juso.go.kr/addrlink/addrLinkUrl.do"; + +export async function GET() { + const confmKey = process.env.JUSO_API_KEY || ""; + const returnUrl = `${process.env.NEXT_PUBLIC_BASE_URL || ""}/api/juso`; + const resultType = "4"; + + const html = ` + + + + +
+ + + +
+ + + `; + + return new NextResponse(html, { + status: 200, + headers: { "Content-Type": "text/html; charset=utf-8" }, + }); +} + +export async function POST(req: NextRequest) { + const formData = await req.formData(); + + const zipNo = String(formData.get("zipNo") || ""); + const roadAddrPart1 = String(formData.get("roadAddrPart1") || ""); + const roadAddrPart2 = String(formData.get("roadAddrPart2") || ""); + const addrDetail = String(formData.get("addrDetail") || ""); + + const origin = process.env.NEXT_PUBLIC_BASE_URL || "*"; + + const script = ` + + `; + + return new NextResponse(script, { + status: 200, + headers: { "Content-Type": "text/html; charset=utf-8" }, + }); +} + -- cgit v1.2.3