이슈 #1: 리스트 화면 담당자/비고 컬럼 표시 이슈 #2: 상세 화면 담당자/연락처 표시 이슈 #7: 수정 화면 기본정보 필드 표시 주요 변경: - types.ts: Quote/QuoteApiData에 manager, contact, remarks 필드 추가 - types.ts: CalculationInputs, BomMaterial 타입 추가 - types.ts: transformApiToFrontend에서 새 필드 변환 로직 추가 - types.ts: transformQuoteToFormData에서 calculation_inputs 기반 폼 복원 - actions.ts: API 요청/응답 필드 매핑 개선 - api/quote.ts: API 엔드포인트 호출 개선
This commit is contained in:
@@ -85,6 +85,64 @@ interface InputSchemaField {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM 계산 요청 (단건)
|
||||
*/
|
||||
export interface CalculateBomRequest {
|
||||
finished_goods_code: string; // 완제품 코드
|
||||
input_variables: {
|
||||
W0: number; // 오픈사이즈 가로 (mm)
|
||||
H0: number; // 오픈사이즈 세로 (mm)
|
||||
QTY?: number; // 수량
|
||||
GT?: string; // 가이드레일 설치 유형 (벽면형/측면형)
|
||||
MP?: string; // 모터 전원 (220V/380V)
|
||||
CT?: string; // 연동제어기 (단독/연동)
|
||||
WS?: number; // 마구리 날개치수
|
||||
INSP?: number; // 검사비
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM 계산 요청 (다건)
|
||||
*/
|
||||
export interface CalculateBomBulkRequest {
|
||||
items: CalculateBomRequest[];
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM 계산 결과 항목
|
||||
*/
|
||||
interface BomResultItem {
|
||||
item_code: string;
|
||||
item_name: string;
|
||||
specification?: string;
|
||||
unit?: string;
|
||||
quantity: number;
|
||||
unit_price: number;
|
||||
total_price: number;
|
||||
process_group?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM 계산 결과
|
||||
*/
|
||||
export interface BomCalculationResult {
|
||||
finished_goods: {
|
||||
code: string;
|
||||
name: string;
|
||||
item_category?: string;
|
||||
};
|
||||
items: BomResultItem[];
|
||||
subtotals: Record<string, number>;
|
||||
grand_total: number;
|
||||
debug_steps?: Array<{
|
||||
step: number;
|
||||
label: string;
|
||||
description: string;
|
||||
data?: Record<string, unknown>;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* API 응답 공통 형식
|
||||
*/
|
||||
@@ -159,6 +217,26 @@ class QuoteApiClient extends ApiClient {
|
||||
const query = productCategory ? `?product_category=${productCategory}` : '';
|
||||
return this.get<ApiResponse<Record<string, InputSchemaField>>>(`/api/v1/quotes/calculation-schema${query}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM 기반 자동 견적 산출 (단건)
|
||||
*
|
||||
* @param request - BOM 산출 요청 파라미터
|
||||
* @returns BOM 계산 결과
|
||||
*/
|
||||
async calculateBom(request: CalculateBomRequest): Promise<ApiResponse<BomCalculationResult>> {
|
||||
return this.post<ApiResponse<BomCalculationResult>>('/api/v1/quotes/calculate/bom', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM 기반 자동 견적 산출 (다건)
|
||||
*
|
||||
* @param request - 다건 BOM 산출 요청 파라미터
|
||||
* @returns BOM 계산 결과 배열
|
||||
*/
|
||||
async calculateBomBulk(request: CalculateBomBulkRequest): Promise<ApiResponse<BomCalculationResult[]>> {
|
||||
return this.post<ApiResponse<BomCalculationResult[]>>('/api/v1/quotes/calculate/bom/bulk', request);
|
||||
}
|
||||
}
|
||||
|
||||
// 싱글톤 인스턴스 내보내기
|
||||
|
||||
Reference in New Issue
Block a user