fix: [production] product_code 표시 소스 개선
- WorkerScreen/ProductionDashboard에서 options.product_code 우선 사용 - fallback: sales_order.item.code (기존 방식) - Dashboard items 타입에 options 필드 추가
This commit is contained in:
@@ -107,3 +107,10 @@ fixed_tools: []
|
||||
# override of the corresponding setting in serena_config.yml, see the documentation there.
|
||||
# If null or missing, the value from the global config is used.
|
||||
symbol_info_budget:
|
||||
|
||||
# The language backend to use for this project.
|
||||
# If not set, the global setting from serena_config.yml is used.
|
||||
# Valid values: LSP, JetBrains
|
||||
# Note: the backend is fixed at startup. If a project with a different backend
|
||||
# is activated post-init, an error will be returned.
|
||||
language_backend:
|
||||
|
||||
@@ -27,7 +27,7 @@ interface WorkOrderApiItem {
|
||||
client?: { id: number; name: string }; root_nodes_count?: number;
|
||||
};
|
||||
assignee?: { id: number; name: string };
|
||||
items?: { id: number; item_name: string; item_id?: number | null; item?: { id: number; code: string; name: string } | null; quantity: number }[];
|
||||
items?: { id: number; item_name: string; item_id?: number | null; item?: { id: number; code: string; name: string } | null; quantity: number; options?: Record<string, unknown> | null }[];
|
||||
}
|
||||
|
||||
// ===== 상태 변환 =====
|
||||
@@ -42,8 +42,8 @@ function mapApiStatus(status: WorkOrderApiItem['status']): 'waiting' | 'inProgre
|
||||
// ===== API → WorkOrder 변환 =====
|
||||
function transformToProductionFormat(api: WorkOrderApiItem): WorkOrder {
|
||||
const totalQuantity = (api.items || []).reduce((sum, item) => sum + Number(item.quantity), 0);
|
||||
const productCode = api.sales_order?.item?.code || '-';
|
||||
const productName = api.items?.[0]?.item_name || '-';
|
||||
const productCode = (api.items?.[0]?.options?.product_code as string) || api.sales_order?.item?.code || '-';
|
||||
const productName = (api.items?.[0]?.options?.product_name as string) || api.items?.[0]?.item_name || '-';
|
||||
const dueDate = api.scheduled_date || '';
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
@@ -92,8 +92,8 @@ function mapApiStatus(status: WorkOrderApiItem['status']): WorkOrderStatus {
|
||||
// ===== API → WorkOrder 변환 =====
|
||||
function transformToWorkerScreenFormat(api: WorkOrderApiItem): WorkOrder {
|
||||
const totalQuantity = (api.items || []).reduce((sum, item) => sum + Number(item.quantity), 0);
|
||||
const productCode = api.sales_order?.item?.code || '-';
|
||||
const productName = api.items?.[0]?.item_name || '-';
|
||||
const productCode = (api.items?.[0]?.options?.product_code as string) || api.sales_order?.item?.code || '-';
|
||||
const productName = (api.items?.[0]?.options?.product_name as string) || api.items?.[0]?.item_name || '-';
|
||||
|
||||
// 납기일 계산 (지연 여부)
|
||||
const dueDate = api.scheduled_date || '';
|
||||
|
||||
Reference in New Issue
Block a user