fix(WEB): 견적 개소 입력 개선 및 BOM 변환 안정화
- 층/부호 필수 검증 제거, 빈값 시 "-" 대체 - DevFill 제품 1개 고정 + 수량 1 고정 (모델별 인증 반영) - note에서 "-" 값 필터링, formula_source 필드 추가 - FG 조회 시 has_bom 필터 제거
This commit is contained in:
@@ -43,13 +43,16 @@ const WRITERS = ['드미트리', '김철수', '이영희', '박지민', '최서
|
||||
export function generateQuoteFormItem(
|
||||
index: number,
|
||||
products?: Array<{ code: string; name: string; category?: string }>,
|
||||
category?: string
|
||||
category?: string,
|
||||
fixedProductCode?: string
|
||||
): QuoteFormItem {
|
||||
const selectedCategory = category || randomPick(PRODUCT_CATEGORIES);
|
||||
|
||||
// 카테고리에 맞는 제품 필터링
|
||||
let productCode = '';
|
||||
if (products && products.length > 0) {
|
||||
if (fixedProductCode) {
|
||||
productCode = fixedProductCode;
|
||||
} else if (products && products.length > 0) {
|
||||
const categoryProducts = products.filter(p =>
|
||||
p.category?.toUpperCase() === selectedCategory || !p.category
|
||||
);
|
||||
@@ -70,7 +73,7 @@ export function generateQuoteFormItem(
|
||||
guideRailType: randomPick(GUIDE_RAIL_TYPES),
|
||||
motorPower: randomPick(MOTOR_POWERS),
|
||||
controller: randomPick(CONTROLLERS),
|
||||
quantity: randomInt(1, 10),
|
||||
quantity: 1,
|
||||
wingSize: '50',
|
||||
inspectionFee: 50000,
|
||||
};
|
||||
@@ -104,11 +107,22 @@ export function generateQuoteData(options: GenerateQuoteDataOptions = {}): Quote
|
||||
// 품목 수 결정
|
||||
const count = itemCount ?? randomInt(1, 5);
|
||||
|
||||
// 품목 생성 (동일 카테고리 사용)
|
||||
// 제품 1개 고정 선택 (모델별 인증이라 섞을 수 없음)
|
||||
const selectedCategory = category || randomPick(PRODUCT_CATEGORIES);
|
||||
let fixedProductCode = '';
|
||||
if (products && products.length > 0) {
|
||||
const categoryProducts = products.filter(p =>
|
||||
p.category?.toUpperCase() === selectedCategory || !p.category
|
||||
);
|
||||
if (categoryProducts.length > 0) {
|
||||
fixedProductCode = randomPick(categoryProducts).code;
|
||||
}
|
||||
}
|
||||
|
||||
// 품목 생성 (동일 제품, 수량 1)
|
||||
const items: QuoteFormItem[] = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
items.push(generateQuoteFormItem(i, products, selectedCategory));
|
||||
items.push(generateQuoteFormItem(i, products, selectedCategory, fixedProductCode));
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user