diff --git a/src/app/[locale]/(protected)/sales/order-management-sales/production-orders/[id]/page.tsx b/src/app/[locale]/(protected)/sales/order-management-sales/production-orders/[id]/page.tsx index 069e69ed..e7f000d8 100644 --- a/src/app/[locale]/(protected)/sales/order-management-sales/production-orders/[id]/page.tsx +++ b/src/app/[locale]/(protected)/sales/order-management-sales/production-orders/[id]/page.tsx @@ -30,6 +30,7 @@ import { Circle, Activity, Play, + ChevronDown, } from "lucide-react"; import { PageLayout } from "@/components/organisms/PageLayout"; import { PageHeader } from "@/components/organisms/PageHeader"; @@ -200,6 +201,7 @@ export default function ProductionOrderDetailPage() { const [isCreateWorkOrderDialogOpen, setIsCreateWorkOrderDialogOpen] = useState(false); const [isSuccessDialogOpen, setIsSuccessDialogOpen] = useState(false); const [isCreating, setIsCreating] = useState(false); + const [bomOpen, setBomOpen] = useState(false); // 데이터 로드 const loadDetail = async () => { @@ -335,68 +337,69 @@ export default function ProductionOrderDetailPage() { - {/* BOM 품목별 공정 분류 */} - - - BOM 품목별 공정 분류 - - - {detail.bomProcessGroups.length === 0 ? ( -
-

- BOM 계산 결과가 없습니다. -

+ {/* BOM 품목별 공정 분류 (접이식) */} + {detail.bomProcessGroups.length > 0 && ( + + setBomOpen((prev) => !prev)} + > +
+ + BOM 품목별 공정 분류 + + ({detail.bomProcessGroups.length}개 공정) + + +
- ) : ( - <> -

- 절곡 부품 전개도 정보 -

- +
+ {bomOpen && ( + {detail.bomProcessGroups.map((group) => (
-

- {group.processName} - {group.sizeSpec && ( - - {group.sizeSpec} - - )} +

+ {group.processName} + + {group.items.length}건 +

- 항목코드 - 세부품명 + 품목코드 + 품목명 규격 - LOT NO - 필요수량 - 수량 + 단위 + 수량 + 단가 + 금액 + 개소 {group.items.map((item, idx) => ( - - {item.itemCode} + + + {item.itemCode} + {item.itemName} {item.spec || "-"} - - {item.lotNo ? ( - - {item.lotNo} - - ) : "-"} - - - {item.requiredQty > 0 ? formatNumber(item.requiredQty) : "-"} - - {item.qty} + {item.unit || "-"} + {formatNumber(item.quantity)} + {formatNumber(item.unitPrice)} + {formatNumber(item.totalPrice)} + {item.nodeName || "-"} ))} @@ -404,10 +407,10 @@ export default function ProductionOrderDetailPage() { ))} - + )} - - + + )} {/* 작업지시서 목록 */} diff --git a/src/components/production/ProductionOrders/actions.ts b/src/components/production/ProductionOrders/actions.ts index 8ee99645..e62288ab 100644 --- a/src/components/production/ProductionOrders/actions.ts +++ b/src/components/production/ProductionOrders/actions.ts @@ -68,10 +68,12 @@ function transformDetailApiToFrontend(data: ApiProductionOrderDetail): Productio id: item.id, itemCode: item.item_code, itemName: item.item_name, - spec: item.spec, - lotNo: item.lot_no, - requiredQty: item.required_qty, - qty: item.qty, + spec: item.spec || item.specification || '', + unit: item.unit || '', + quantity: item.quantity ?? 0, + unitPrice: item.unit_price ?? 0, + totalPrice: item.total_price ?? 0, + nodeName: item.node_name || '', })), })), }; diff --git a/src/components/production/ProductionOrders/types.ts b/src/components/production/ProductionOrders/types.ts index c6caea12..4fb0fad6 100644 --- a/src/components/production/ProductionOrders/types.ts +++ b/src/components/production/ProductionOrders/types.ts @@ -90,9 +90,11 @@ export interface ApiBomItem { item_code: string; item_name: string; spec: string; - lot_no: string; - required_qty: number; - qty: number; + unit: string; + quantity: number; + unit_price: number; + total_price: number; + node_name: string; } // 프론트 상세 타입 @@ -121,9 +123,11 @@ export interface BomItem { itemCode: string; itemName: string; spec: string; - lotNo: string; - requiredQty: number; - qty: number; + unit: string; + quantity: number; + unitPrice: number; + totalPrice: number; + nodeName: string; } // 조회 파라미터