diff --git a/src/components/production/ProductionDashboard/index.tsx b/src/components/production/ProductionDashboard/index.tsx index cf27738e..89463793 100644 --- a/src/components/production/ProductionDashboard/index.tsx +++ b/src/components/production/ProductionDashboard/index.tsx @@ -106,7 +106,7 @@ export default function ProductionDashboard() { // ===== 필터링된 데이터 (탭에서 이미 필터링됨) ===== const filteredOrders = workOrders; - // ===== 긴급/지연 작업 필터링 ===== + // ===== 긴급/지연/완료 작업 필터링 ===== const urgentOrders = useMemo( () => filteredOrders.filter((o) => o.isUrgent).slice(0, 5), [filteredOrders] @@ -115,6 +115,14 @@ export default function ProductionDashboard() { () => filteredOrders.filter((o) => o.isDelayed).slice(0, 5), [filteredOrders] ); + // 최근 완료 작업 (createdAt 기준 정렬, 최신 5건) + const recentCompletedOrders = useMemo( + () => filteredOrders + .filter((o) => o.status === 'completed') + .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) + .slice(0, 5), + [filteredOrders] + ); // ===== 핸들러 ===== const handleOrderClick = (id: string) => { @@ -212,8 +220,8 @@ export default function ProductionDashboard() { /> - {/* 3컬럼 레이아웃 */} -
+ 완료된 작업이 없습니다. +
+ ) : ( + recentCompletedOrders.map((order) => ( +{order.productName}
{order.client}
@@ -365,12 +412,15 @@ function WorkOrderCard({ order, onClick, showDelay }: WorkOrderCardProps) { {showDelay && order.delayDays && (+{order.delayDays}일 지연
)} - {order.isUrgent && !showDelay && ( + {showCompleted && ( +{formatDate(order.createdAt)}
+ )} + {order.isUrgent && !showDelay && !showCompleted && (순위 {order.priority}
)}{order.instruction}