fix(WEB): 견적→수주→생산지시 데이터 연결 수정

- transformFrontendToApi()에 floor_code/symbol_code 추가 (제품 매핑)
- BomCalculationResultItem에 item_id 필드 추가
- transformV2ToApi()에서 견적 저장 시 item_id 전달 (공정 매핑 근본 수정)
This commit is contained in:
2026-02-10 19:03:19 +09:00
parent c6cce7fe61
commit 6e5ccca038
2 changed files with 6 additions and 0 deletions

View File

@@ -669,6 +669,8 @@ function transformFrontendToApi(data: OrderFormData | Record<string, unknown>):
supply_amount: supplyAmount,
tax_amount: taxAmount,
total_amount: supplyAmount + taxAmount,
floor_code: item.type || null,
symbol_code: item.symbol || null,
};
}),
};

View File

@@ -409,6 +409,7 @@ export interface BomMaterial {
// BOM 계산 결과 아이템 타입
export interface BomCalculationResultItem {
item_id?: number | null;
item_code: string;
item_name: string;
item_category?: string; // 품목 카테고리
@@ -758,6 +759,7 @@ export function transformV2ToApi(
// 2. items 생성 (BOM 결과 있으면 자재 상세, 없으면 완제품 기준)
let items: Array<{
item_id?: number | null;
item_name: string;
item_code: string;
specification: string | null;
@@ -788,6 +790,7 @@ export function transformV2ToApi(
: parseFloat((baseQty * orderQty).toFixed(2));
items.push({
item_id: bomItem.item_id || null,
item_name: bomItem.item_name,
item_code: bomItem.item_code,
specification: bomItem.specification || null,
@@ -818,6 +821,7 @@ export function transformV2ToApi(
: parseFloat((baseQty * orderQty).toFixed(2));
items.push({
item_id: bomItem.item_id || null,
item_name: bomItem.item_name,
item_code: bomItem.item_code,
specification: bomItem.specification || null,