From a3525f8bdfcf849cc1716fab81cb8facadbe9a8e Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 27 Oct 2025 10:03:06 +0000 Subject: (최겸) 구매 협력업체 관리(PQ/실사관리, 정기평가 협력업체 제출 상세 dialog 개발, MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit-investigation-dialog.tsx | 2 +- .../request-investigation-dialog.tsx | 6 +- lib/pq/pq-review-table-new/send-results-dialog.tsx | 8 ++- .../pq-review-table-new/vendors-table-columns.tsx | 80 ++++++++++++++-------- 4 files changed, 62 insertions(+), 34 deletions(-) (limited to 'lib/pq/pq-review-table-new') diff --git a/lib/pq/pq-review-table-new/edit-investigation-dialog.tsx b/lib/pq/pq-review-table-new/edit-investigation-dialog.tsx index c5470e47..c4057798 100644 --- a/lib/pq/pq-review-table-new/edit-investigation-dialog.tsx +++ b/lib/pq/pq-review-table-new/edit-investigation-dialog.tsx @@ -224,7 +224,7 @@ export function EditInvestigationDialog({ name="confirmedAt" render={({ field }) => ( - 실사 확정일 + 실사 계획 확정일 diff --git a/lib/pq/pq-review-table-new/request-investigation-dialog.tsx b/lib/pq/pq-review-table-new/request-investigation-dialog.tsx index 6941adbb..aaf10a71 100644 --- a/lib/pq/pq-review-table-new/request-investigation-dialog.tsx +++ b/lib/pq/pq-review-table-new/request-investigation-dialog.tsx @@ -55,7 +55,7 @@ const requestInvestigationFormSchema = z.object({ required_error: "QM 담당자를 선택해주세요.", }), forecastedAt: z.date({ - required_error: "실사 예정일을 선택해주세요.", + required_error: "실사 수행 예정일을 선택해주세요.", }), investigationAddress: z.string().min(1, "실사 장소를 입력해주세요."), investigationMethod: z.string().optional(), @@ -189,7 +189,7 @@ export function RequestInvestigationDialog({ name="forecastedAt" render={({ field }) => ( - 실사 예정일 + 실사 수행 예정일 @@ -201,7 +201,7 @@ export function RequestInvestigationDialog({ {field.value ? ( format(field.value, "yyyy년 MM월 dd일") ) : ( - 실사 예정일을 선택하세요 + 실사 수행 예정일을 선택하세요 )} diff --git a/lib/pq/pq-review-table-new/send-results-dialog.tsx b/lib/pq/pq-review-table-new/send-results-dialog.tsx index 3c8614cc..6c75e6ca 100644 --- a/lib/pq/pq-review-table-new/send-results-dialog.tsx +++ b/lib/pq/pq-review-table-new/send-results-dialog.tsx @@ -123,7 +123,9 @@ export function SendResultsDialog({
Vendor
-
{result.vendorCode} | {result.vendorName}
+
+ {(result.vendorCode === "N/A" ? "미등록" : result.vendorCode)} | {result.vendorName} +
수신자
@@ -151,7 +153,9 @@ export function SendResultsDialog({
{result.investigationNotes && (
-
실사합격조건
+
+ {result.auditResult.includes("Pass") ? "QM 의견" : "실사합격조건"} +
{result.investigationNotes}
)} diff --git a/lib/pq/pq-review-table-new/vendors-table-columns.tsx b/lib/pq/pq-review-table-new/vendors-table-columns.tsx index ffa15e56..30b1c83f 100644 --- a/lib/pq/pq-review-table-new/vendors-table-columns.tsx +++ b/lib/pq/pq-review-table-new/vendors-table-columns.tsx @@ -3,6 +3,11 @@ import * as React from "react" import { type DataTableRowAction } from "@/types/table" import { type ColumnDef } from "@tanstack/react-table" + +// ColumnDef 타입 확장 +type ExtendedColumnDef = ColumnDef & { + excelHeader?: string; +} import { Ellipsis, Eye, FileEdit, Trash2, Building2, FileText, Edit } from "lucide-react" import { formatDate } from "@/lib/utils" @@ -116,11 +121,11 @@ function getStatusBadge(status: string) { /** * tanstack table 컬럼 정의 */ -export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef[] { +export function getColumns({ setRowAction, router }: GetColumnsProps): ExtendedColumnDef[] { // ---------------------------------------------------------------- // 1) select 컬럼 (체크박스) // ---------------------------------------------------------------- - const selectColumn: ColumnDef = { + const selectColumn: ExtendedColumnDef = { id: "select", header: ({ table }) => { const selectedRows = table.getSelectedRowModel().rows; @@ -180,7 +185,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef // -------------------------- // -------------------------------------- - const pqNoColumn: ColumnDef = { + const pqNoColumn: ExtendedColumnDef = { accessorKey: "pqNumber", header: ({ column }) => ( @@ -190,10 +195,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef {row.getValue("pqNumber")} ), + excelHeader: "PQ No.", } // 협력업체 컬럼 - const vendorColumn: ColumnDef = { + const vendorColumn: ExtendedColumnDef = { accessorKey: "vendorName", header: ({ column }) => ( @@ -206,10 +212,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ), enableSorting: true, enableHiding: true, + excelHeader: "협력업체", } // PQ 유형 컬럼 - const typeColumn: ColumnDef = { + const typeColumn: ExtendedColumnDef = { accessorKey: "type", header: ({ column }) => ( @@ -233,10 +240,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef }, enableSorting: true, enableHiding: true, + excelHeader: "PQ 유형", } // 프로젝트 컬럼 - const projectColumn: ColumnDef = { + const projectColumn: ExtendedColumnDef = { accessorKey: "projectName", header: ({ column }) => ( @@ -260,10 +268,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef }, enableSorting: true, enableHiding: true, + excelHeader: "프로젝트", } // 상태 컬럼 - const statusColumn: ColumnDef = { + const statusColumn: ExtendedColumnDef = { accessorKey: "combinedStatus", header: ({ column }) => ( @@ -278,6 +287,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef }, enableSorting: true, enableHiding: true, + excelHeader: "진행현황", }; // PQ 상태와 실사 상태를 결합하는 헬퍼 함수 @@ -371,7 +381,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef // }; - const evaluationResultColumn: ColumnDef = { + const evaluationResultColumn: ExtendedColumnDef = { accessorKey: "evaluationResult", header: ({ column }) => ( @@ -401,10 +411,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef }, enableSorting: true, enableHiding: true, + excelHeader: "평가 결과", }; // 답변 수 컬럼 - const answerCountColumn: ColumnDef = { + const answerCountColumn: ExtendedColumnDef = { accessorKey: "answerCount", header: ({ column }) => ( @@ -416,9 +427,10 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "답변 수", } - const investigationAddressColumn: ColumnDef = { + const investigationAddressColumn: ExtendedColumnDef = { accessorKey: "investigationAddress", header: ({ column }) => ( @@ -436,8 +448,9 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "실사 주소", } - const investigationRequestedAtColumn: ColumnDef = { + const investigationRequestedAtColumn: ExtendedColumnDef = { accessorKey: "investigationRequestedAt", header: ({ column }) => ( @@ -456,9 +469,10 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "실사 의뢰일", } - const investigationNotesColumn: ColumnDef = { + const investigationNotesColumn: ExtendedColumnDef = { accessorKey: "investigationNotes", header: ({ column }) => ( @@ -476,8 +490,9 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "QM 의견", } - const investigationMethodColumn: ColumnDef = { + const investigationMethodColumn: ExtendedColumnDef = { accessorKey: "investigationMethod", header: ({ column }) => ( @@ -501,10 +516,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef return {investigation.investigationMethod}; } }, + excelHeader: "실사품목", } // 실사품목 컬럼 - const pqItemsColumn: ColumnDef = { + const pqItemsColumn: ExtendedColumnDef = { accessorKey: "pqItems", header: ({ column }) => ( @@ -536,10 +552,10 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef - const investigationForecastedAtColumn: ColumnDef = { + const investigationForecastedAtColumn: ExtendedColumnDef = { accessorKey: "investigationForecastedAt", header: ({ column }) => ( - + ), cell: ({ row }) => { const investigation = row.original.investigation; @@ -555,12 +571,13 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "실사 수행 예정일", } - const investigationConfirmedAtColumn: ColumnDef = { + const investigationConfirmedAtColumn: ExtendedColumnDef = { accessorKey: "investigationConfirmedAt", header: ({ column }) => ( - + ), cell: ({ row }) => { const investigation = row.original.investigation; @@ -576,9 +593,10 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "실사 계획 확정일", } - const investigationCompletedAtColumn: ColumnDef = { + const investigationCompletedAtColumn: ExtendedColumnDef = { accessorKey: "investigationCompletedAt", header: ({ column }) => ( @@ -597,10 +615,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) }, + excelHeader: "실제 실사일", } // 제출일 컬럼 - const createdAtColumn: ColumnDef = { + const createdAtColumn: ExtendedColumnDef = { accessorKey: "createdAt", header: ({ column }) => ( @@ -609,10 +628,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef const dateVal = row.original.createdAt as Date return formatDate(dateVal, 'KR') }, + excelHeader: "PQ 전송일", } // 제출일 컬럼 - const submittedAtColumn: ColumnDef = { + const submittedAtColumn: ExtendedColumnDef = { accessorKey: "submittedAt", header: ({ column }) => ( @@ -621,10 +641,11 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef const dateVal = row.original.submittedAt as Date return dateVal ? formatDate(dateVal, 'KR') : "-" }, + excelHeader: "PQ 회신일", } // 승인/거부일 컬럼 - const approvalDateColumn: ColumnDef = { + const approvalDateColumn: ExtendedColumnDef = { accessorKey: "approvedAt", header: ({ column }) => ( @@ -638,12 +659,13 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef } return "-" }, + excelHeader: "PQ 승인/거부일", } // ---------------------------------------------------------------- // 3) actions 컬럼 (Dropdown 메뉴) // ---------------------------------------------------------------- - const actionsColumn: ColumnDef = { + const actionsColumn: ExtendedColumnDef = { id: "actions", enableHiding: false, cell: function Cell({ row }) { @@ -676,7 +698,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef ) : ( <> - 보기 + PQ 현황 )} @@ -697,7 +719,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef }} > - 방문실사 + 실사 정보 전달 및 요청 { @@ -710,7 +732,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef }} > - 협력업체 정보 조회 + 실사 실시 확정 정보 )} @@ -758,7 +780,7 @@ export function getColumns({ setRowAction, router }: GetColumnsProps): ColumnDef } // 요청자 컬럼 추가 -const requesterColumn: ColumnDef = { +const requesterColumn: ExtendedColumnDef = { accessorKey: "requesterName", header: ({ column }) => ( @@ -779,8 +801,9 @@ const requesterColumn: ColumnDef = { ? {pqRequesterName} : -; }, + excelHeader: "PQ/실사 요청자", }; -const qmManagerColumn: ColumnDef = { +const qmManagerColumn: ExtendedColumnDef = { accessorKey: "qmManager", header: ({ column }) => ( @@ -801,6 +824,7 @@ const qmManagerColumn: ColumnDef = { ); }, + excelHeader: "QM 담당자", }; -- cgit v1.2.3