diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-12-09 06:49:14 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-12-09 06:49:14 +0000 |
| commit | 68e876e3b85ca32e54224b6c796aece46c223fc0 (patch) | |
| tree | 9d6137eea9770a53f5b4c2e814952b15124c0d9c | |
| parent | cf3f7cf0efa2753a401b36f6eb3a49cb9697ddce (diff) | |
(최겸) 구매 미실사 pq 시 구매자체평가로 자동생성
| -rw-r--r-- | app/[lng]/evcp/(evcp)/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx | 6 | ||||
| -rw-r--r-- | app/[lng]/partners/(partners)/pq_new/[id]/page.tsx | 32 | ||||
| -rw-r--r-- | components/pq-input/pq-input-tabs.tsx | 4 | ||||
| -rw-r--r-- | lib/pq/service.ts | 2 |
4 files changed, 39 insertions, 5 deletions
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 974550c6..5baf6efb 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 @@ -54,7 +54,11 @@ export default async function PQReviewPage(props: PQReviewPageProps) { const pqSubmission = await getPQById(submissionId, vendorId)
// PQ 데이터 조회 (질문과 답변)
- const pqData = await getPQDataByVendorId(vendorId, pqSubmission.projectId || undefined)
+ const pqData = await getPQDataByVendorId(
+ vendorId,
+ pqSubmission.projectId || undefined,
+ pqSubmission.type as "GENERAL" | "PROJECT" | "NON_INSPECTION"
+ )
// 협력업체 정보 (pqSubmission에 이미 포함되어 있음)
const vendorInfo = {
diff --git a/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx b/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx index cb905f39..e43d600f 100644 --- a/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx +++ b/app/[lng]/partners/(partners)/pq_new/[id]/page.tsx @@ -30,6 +30,32 @@ export default async function PQEditPage(props: PQEditPageProps) { const params = await props.params; const pqSubmissionId = parseInt(params.id, 10); + if (Number.isNaN(pqSubmissionId)) { + return ( + <Shell className="gap-6"> + <div className="flex items-center justify-between"> + <div> + <h2 className="text-2xl font-bold tracking-tight">잘못된 PQ ID</h2> + <p className="text-muted-foreground">유효한 PQ ID가 아닙니다.</p> + </div> + </div> + <div className="flex flex-col items-center justify-center py-12 text-center"> + <div className="rounded-lg border border-dashed p-10 shadow-sm"> + <p className="mb-6 text-muted-foreground"> + 요청하신 PQ ID를 확인하고 다시 시도해주세요. + </p> + <Button asChild> + <Link href="/partners/pq_new"> + <ArrowLeft className="mr-2 h-4 w-4" /> + 목록으로 돌아가기 + </Link> + </Button> + </div> + </div> + </Shell> + ); + } + // 인증 확인 const session = await getServerSession(authOptions); @@ -101,7 +127,11 @@ export default async function PQEditPage(props: PQEditPageProps) { } // PQ 데이터 조회 (pqCriterias와 답변) - const pqData = await getPQDataByVendorId(idAsNumber, pqSubmission.projectId || undefined); + const pqData = await getPQDataByVendorId( + idAsNumber, + pqSubmission.projectId || undefined, + pqSubmission.type as "GENERAL" | "PROJECT" | "NON_INSPECTION" + ); // 상태에 따른 읽기 전용 모드 결정 const isReadOnly = [ "APPROVED"].includes(pqSubmission.status); diff --git a/components/pq-input/pq-input-tabs.tsx b/components/pq-input/pq-input-tabs.tsx index 6c9a1254..6ffd637a 100644 --- a/components/pq-input/pq-input-tabs.tsx +++ b/components/pq-input/pq-input-tabs.tsx @@ -651,8 +651,8 @@ export function PQInputTabs({ if (result.ok) { toast({ - title: "PQ Submitted", - description: "Your PQ information has been submitted successfully", + title: "PQ 제출 완료", + description: "PQ 정보가 성공적으로 제출되었습니다", }); // 제출 후 PQ 목록 페이지로 리디렉션 window.location.href = "/partners/pq_new"; diff --git a/lib/pq/service.ts b/lib/pq/service.ts index 15e71c4d..ea8a389c 100644 --- a/lib/pq/service.ts +++ b/lib/pq/service.ts @@ -2641,7 +2641,7 @@ export async function approvePQAction({ await db .update(vendorPQSubmissions) .set({ - status: "APPROVED", + status: "QM_APPROVED", approvedAt: currentDate, updatedAt: currentDate, }) |
