From e9897d416b3e7327bbd4d4aef887eee37751ae82 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 27 Jun 2025 01:16:20 +0000 Subject: (대표님) 20250627 오전 10시 작업사항 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/evaluation/table/evaluation-columns.tsx | 341 +++++++++++++++++++--------- 1 file changed, 232 insertions(+), 109 deletions(-) (limited to 'lib/evaluation/table/evaluation-columns.tsx') diff --git a/lib/evaluation/table/evaluation-columns.tsx b/lib/evaluation/table/evaluation-columns.tsx index 821e8182..10aa7704 100644 --- a/lib/evaluation/table/evaluation-columns.tsx +++ b/lib/evaluation/table/evaluation-columns.tsx @@ -144,14 +144,14 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): }, // ░░░ 평가기간 ░░░ - { - accessorKey: "evaluationPeriod", - header: ({ column }) => , - cell: ({ row }) => ( - {row.getValue("evaluationPeriod")} - ), - size: 100, - }, + // { + // accessorKey: "evaluationPeriod", + // header: ({ column }) => , + // cell: ({ row }) => ( + // {row.getValue("evaluationPeriod")} + // ), + // size: 100, + // }, // ░░░ 구분 ░░░ { @@ -202,12 +202,113 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): }, ] }, + + { + accessorKey: "finalScore", + header: ({ column }) => , + cell: ({ row }) => { + const finalScore = row.getValue("finalScore"); + return finalScore ? ( + {finalScore.toFixed(1)} + ) : ( + - + ); + }, + size: 90, + }, + { + accessorKey: "finalGrade", + header: ({ column }) => , + cell: ({ row }) => { + const finalGrade = row.getValue("finalGrade"); + return finalGrade ? ( + + {finalGrade} + + ) : ( + - + ); + }, + size: 90, + }, + + // ═══════════════════════════════════════════════════════════════ + // 진행 현황 + // ═══════════════════════════════════════════════════════════════ + { + header: "평가자 진행 현황", + columns: [ + { + accessorKey: "status", + header: ({ column }) => , + cell: ({ row }) => { + const status = row.getValue("status"); + return ( + + {getStatusLabel(status)} + + ); + }, + size: 100, + }, + + { + id: "reviewProgress", + header: ({ column }) => , + cell: ({ row }) => { + const totalReviewers = row.original.totalReviewers || 0; + const completedReviewers = row.original.completedReviewers || 0; + + return getProgressBadge(completedReviewers, totalReviewers); + }, + size: 120, + }, + + { + accessorKey: "reviewCompletedAt", + header: ({ column }) => , + cell: ({ row }) => { + const completedAt = row.getValue("reviewCompletedAt"); + return completedAt ? ( + + {new Intl.DateTimeFormat("ko-KR", { + month: "2-digit", + day: "2-digit", + }).format(new Date(completedAt))} + + ) : ( + - + ); + }, + size: 100, + }, + + { + accessorKey: "finalizedAt", + header: ({ column }) => , + cell: ({ row }) => { + const finalizedAt = row.getValue("finalizedAt"); + return finalizedAt ? ( + + {new Intl.DateTimeFormat("ko-KR", { + month: "2-digit", + day: "2-digit", + }).format(new Date(finalizedAt))} + + ) : ( + - + ); + }, + size: 80, + }, + ] + }, // ═══════════════════════════════════════════════════════════════ // 제출 현황 // ═══════════════════════════════════════════════════════════════ { - header: "제출 현황", + header: "협력업체 제출 현황", columns: [ { accessorKey: "documentsSubmitted", @@ -266,6 +367,8 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): ] }, + + // ═══════════════════════════════════════════════════════════════ // 평가 점수 // ═══════════════════════════════════════════════════════════════ @@ -273,12 +376,12 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): header: "평가 점수", columns: [ { - accessorKey: "totalScore", - header: ({ column }) => , + accessorKey: "processScore", + header: ({ column }) => , cell: ({ row }) => { - const score = row.getValue("totalScore"); + const score = row.getValue("processScore"); return score ? ( - {score.toFixed(1)} + {Number(score).toFixed(1)} ) : ( - ); @@ -287,156 +390,176 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): }, { - accessorKey: "evaluationGrade", - header: ({ column }) => , + accessorKey: "priceScore", + header: ({ column }) => , cell: ({ row }) => { - const grade = row.getValue("evaluationGrade"); - return grade ? ( - {grade} + const score = row.getValue("priceScore"); + return score ? ( + {Number(score).toFixed(1)} ) : ( - ); }, - size: 60, + size: 80, }, - + { - accessorKey: "finalScore", - header: ({ column }) => , + accessorKey: "deliveryScore", + header: ({ column }) => , cell: ({ row }) => { - const finalScore = row.getValue("finalScore"); - return finalScore ? ( - {finalScore.toFixed(1)} + const score = row.getValue("deliveryScore"); + return score ? ( + {Number(score).toFixed(1)} ) : ( - ); }, - size: 90, + size: 80, + }, + + { + accessorKey: "selfEvaluationScore", + header: ({ column }) => , + cell: ({ row }) => { + const score = row.getValue("selfEvaluationScore"); + return score ? ( + {Number(score).toFixed(1)} + ) : ( + - + ); + }, + size: 80, }, + // ✅ 합계 - 4개 점수의 합으로 계산 { - accessorKey: "finalGrade", - header: ({ column }) => , + id: "totalScore", + header: ({ column }) => , cell: ({ row }) => { - const finalGrade = row.getValue("finalGrade"); - return finalGrade ? ( - - {finalGrade} - + const processScore = Number(row.getValue("processScore") || 0); + const priceScore = Number(row.getValue("priceScore") || 0); + const deliveryScore = Number(row.getValue("deliveryScore") || 0); + const selfEvaluationScore = Number(row.getValue("selfEvaluationScore") || 0); + + const total = processScore + priceScore + deliveryScore + selfEvaluationScore; + + return total > 0 ? ( + + {total.toFixed(1)} + ) : ( - ); }, - size: 90, + size: 80, }, - ] - }, - // ═══════════════════════════════════════════════════════════════ - // 진행 현황 - // ═══════════════════════════════════════════════════════════════ - { - header: "진행 현황", - columns: [ { - accessorKey: "status", - header: ({ column }) => , + accessorKey: "participationBonus", + header: ({ column }) => , cell: ({ row }) => { - const status = row.getValue("status"); - return ( - - {getStatusLabel(status)} - + const score = row.getValue("participationBonus"); + return score ? ( + +{Number(score).toFixed(1)} + ) : ( + - ); }, size: 100, }, { - id: "reviewProgress", - header: ({ column }) => , + accessorKey: "qualityDeduction", + header: ({ column }) => , cell: ({ row }) => { - const totalReviewers = row.original.totalReviewers || 0; - const completedReviewers = row.original.completedReviewers || 0; - - return getProgressBadge(completedReviewers, totalReviewers); + const score = row.getValue("qualityDeduction"); + return score ? ( + -{Number(score).toFixed(1)} + ) : ( + - + ); }, - size: 120, + size: 100, }, + // ✅ 새로운 평가점수 컬럼 추가 { - accessorKey: "reviewCompletedAt", - header: ({ column }) => , + id: "evaluationScore", + header: ({ column }) => , cell: ({ row }) => { - const completedAt = row.getValue("reviewCompletedAt"); - return completedAt ? ( - - {new Intl.DateTimeFormat("ko-KR", { - month: "2-digit", - day: "2-digit", - }).format(new Date(completedAt))} + const processScore = Number(row.getValue("processScore") || 0); + const priceScore = Number(row.getValue("priceScore") || 0); + const deliveryScore = Number(row.getValue("deliveryScore") || 0); + const selfEvaluationScore = Number(row.getValue("selfEvaluationScore") || 0); + const participationBonus = Number(row.getValue("participationBonus") || 0); + const qualityDeduction = Number(row.getValue("qualityDeduction") || 0); + + const totalScore = processScore + priceScore + deliveryScore + selfEvaluationScore; + const evaluationScore = totalScore + participationBonus - qualityDeduction; + + return totalScore > 0 ? ( + + {evaluationScore.toFixed(1)} ) : ( - ); }, - size: 100, + size: 90, }, { - accessorKey: "finalizedAt", - header: ({ column }) => , + accessorKey: "evaluationGrade", + header: ({ column }) => , cell: ({ row }) => { - const finalizedAt = row.getValue("finalizedAt"); - return finalizedAt ? ( - - {new Intl.DateTimeFormat("ko-KR", { - month: "2-digit", - day: "2-digit", - }).format(new Date(finalizedAt))} - + const grade = row.getValue("evaluationGrade"); + return grade ? ( + {grade} ) : ( - ); }, size: 80, }, + ] }, + + // ░░░ Actions ░░░ - { - id: "actions", - enableHiding: false, - size: 40, - minSize: 40, - cell: ({ row }) => { - return ( -
- - - -
- ); - }, - }, + // { + // id: "actions", + // enableHiding: false, + // size: 40, + // minSize: 40, + // cell: ({ row }) => { + // return ( + //
+ // + + // + //
+ // ); + // }, + // }, ]; } \ No newline at end of file -- cgit v1.2.3