fix: 견적 V2 자동 견적 산출 UI 오류 수정
- actions.ts: BomBulkResponse 타입, FinishedGoods에 has_bom/bom 필드 추가 - QuoteRegistrationV2.tsx: handleCalculate 응답 처리, DevFill BOM 필터링 - LocationDetailPanel.tsx: bomItemsByTab process_group 기반 매핑 - QuoteSummaryPanel.tsx: detailTotals grouped_items 기반 계산 해결된 문제: 1. 오른쪽 패널 제품 리스트 미표시 2. 개소별 합계(상세소계) 미표시 3. 상세별 합계(그룹) 미표시 4. 예상 견적금액 0원 표시
This commit is contained in:
@@ -140,15 +140,31 @@ export function QuoteSummaryPanel({
|
||||
}
|
||||
|
||||
const subtotals = selectedLocation.bomResult.subtotals;
|
||||
const groupedItems = selectedLocation.bomResult.grouped_items;
|
||||
const result: DetailCategory[] = [];
|
||||
|
||||
Object.entries(subtotals).forEach(([key, value]) => {
|
||||
if (typeof value === "object" && value !== null) {
|
||||
// grouped_items에서 items 가져오기 (subtotals에는 items가 없을 수 있음)
|
||||
const groupItemsRaw = groupedItems?.[key]?.items || value.items || [];
|
||||
// DetailItem 형식으로 변환
|
||||
const groupItems: DetailItem[] = (groupItemsRaw as Array<{
|
||||
item_name?: string;
|
||||
name?: string;
|
||||
quantity?: number;
|
||||
unit_price?: number;
|
||||
total_price?: number;
|
||||
}>).map((item) => ({
|
||||
name: item.item_name || item.name || "",
|
||||
quantity: item.quantity || 0,
|
||||
unitPrice: item.unit_price || 0,
|
||||
totalPrice: item.total_price || 0,
|
||||
}));
|
||||
result.push({
|
||||
label: value.name || key,
|
||||
count: value.count || 0,
|
||||
amount: value.subtotal || 0,
|
||||
items: value.items || [],
|
||||
items: groupItems,
|
||||
});
|
||||
} else if (typeof value === "number") {
|
||||
result.push({
|
||||
|
||||
Reference in New Issue
Block a user