feat: [worker-screen] 사이드바+상세 영역에 작업지시 진행상태 뱃지 표시
This commit is contained in:
@@ -100,8 +100,16 @@ interface SidebarOrder {
|
||||
priority: 'urgent' | 'priority' | 'normal';
|
||||
subType?: 'slat' | 'jointbar' | 'bending' | 'wip';
|
||||
bdCode?: string; // 재공품 BD- 코드 (예: BD-ST-24)
|
||||
status?: string; // 작업지시 상태 (waiting/in_progress/completed)
|
||||
}
|
||||
|
||||
const WO_STATUS_BADGE: Record<string, { label: string; className: string }> = {
|
||||
completed: { label: '완료', className: 'bg-gray-500 text-white' },
|
||||
in_progress: { label: '진행중', className: 'bg-green-100 text-green-700' },
|
||||
waiting: { label: '대기', className: 'bg-yellow-100 text-yellow-700' },
|
||||
pending: { label: '대기', className: 'bg-gray-100 text-gray-600' },
|
||||
};
|
||||
|
||||
const SUB_TYPE_TAGS: Record<string, { label: string; className: string }> = {
|
||||
slat: { label: '슬랫', className: 'bg-blue-100 text-blue-700' },
|
||||
jointbar: { label: '조인트바', className: 'bg-purple-100 text-purple-700' },
|
||||
@@ -472,6 +480,7 @@ export default function WorkerScreen() {
|
||||
priority: (wo.isUrgent ? 'urgent' : (wo.priority <= 3 ? 'priority' : 'normal')) as SidebarOrder['priority'],
|
||||
subType: isWip ? 'wip' as const : undefined,
|
||||
bdCode,
|
||||
status: wo.status,
|
||||
};
|
||||
});
|
||||
}, [filteredWorkOrders]);
|
||||
@@ -890,6 +899,7 @@ export default function WorkerScreen() {
|
||||
salesManager: apiOrder.salesManager || '-',
|
||||
managerPhone: apiOrder.managerPhone || '-',
|
||||
shippingDate: apiOrder.dueDate ? new Date(apiOrder.dueDate).toLocaleDateString('ko-KR') : '-',
|
||||
status: apiOrder.status || '-',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -904,6 +914,7 @@ export default function WorkerScreen() {
|
||||
salesManager: first.salesManager || '-',
|
||||
managerPhone: first.managerPhone || '-',
|
||||
shippingDate: first.dueDate ? new Date(first.dueDate).toLocaleDateString('ko-KR') : '-',
|
||||
status: first.status || '-',
|
||||
};
|
||||
}, [filteredWorkOrders, selectedSidebarOrderId, activeProcessTabKey]);
|
||||
|
||||
@@ -1514,7 +1525,14 @@ export default function WorkerScreen() {
|
||||
{/* 수주 정보 */}
|
||||
<Card>
|
||||
<CardContent className="p-4">
|
||||
<h3 className="text-sm font-semibold text-gray-900 mb-3">수주 정보</h3>
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<h3 className="text-sm font-semibold text-gray-900">수주 정보</h3>
|
||||
{orderInfo?.status && WO_STATUS_BADGE[orderInfo.status] && (
|
||||
<span className={`px-2 py-0.5 rounded text-xs font-semibold ${WO_STATUS_BADGE[orderInfo.status].className}`}>
|
||||
{WO_STATUS_BADGE[orderInfo.status].label}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-x-6 gap-y-3">
|
||||
<InfoField label="수주일" value={orderInfo?.orderDate} />
|
||||
<InfoField label="수주로트" value={orderInfo?.salesOrderNo} />
|
||||
@@ -1806,12 +1824,19 @@ function SidebarContent({
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="font-medium text-gray-900">{order.siteName}</p>
|
||||
{tag && (
|
||||
<span className={`px-1.5 py-0.5 rounded text-[10px] font-semibold ${tag.className}`}>
|
||||
{tag.label}
|
||||
</span>
|
||||
)}
|
||||
<p className={cn("font-medium", order.status === 'completed' ? 'text-gray-400 line-through' : 'text-gray-900')}>{order.siteName}</p>
|
||||
<div className="flex items-center gap-1">
|
||||
{order.status && WO_STATUS_BADGE[order.status] && (
|
||||
<span className={`px-1.5 py-0.5 rounded text-[10px] font-semibold ${WO_STATUS_BADGE[order.status].className}`}>
|
||||
{WO_STATUS_BADGE[order.status].label}
|
||||
</span>
|
||||
)}
|
||||
{tag && (
|
||||
<span className={`px-1.5 py-0.5 rounded text-[10px] font-semibold ${tag.className}`}>
|
||||
{tag.label}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{order.bdCode && (
|
||||
<p className="text-[10px] text-blue-600 font-mono mt-0.5">{order.bdCode}</p>
|
||||
|
||||
Reference in New Issue
Block a user