From 55974423eac0d11d069af360fccf06de3034fccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=9C=EA=B3=A8=EC=95=BD=EC=82=AC?= Date: Sun, 15 Feb 2026 17:46:04 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A1=B0=EC=A0=9C=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=97=90=202=EB=8B=A8=EA=B3=84=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 1단계: 제품 선택 (같은 주성분의 여러 제품 중 선택) - 2단계: 원산지/로트 선택 (선택한 제품의 원산지별 로트 중 선택) - formula_ingredients API 응답 구조 변경에 따른 프론트엔드 수정 - available_products 배열 기반 렌더링 - 제품 선택 드롭다운과 원산지 선택 드롭다운 분리 - 제품 변경 시 원산지/로트 옵션 동적 로드 예시: - 인삼 → 신흥인삼 선택 → [한국산|중국산] 선택 가능 - 인삼 → 세화인삼 선택 → [한국산|미국산] 선택 가능 --- static/app.js | 76 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/static/app.js b/static/app.js index f1ad19f..5f55b53 100644 --- a/static/app.js +++ b/static/app.js @@ -595,20 +595,39 @@ $(document).ready(function() { const cheopTotal = parseFloat($('#cheopTotal').val()) || 0; const totalGrams = ing.grams_per_cheop * cheopTotal; + // 제품 선택 옵션 생성 + let productOptions = ''; + if (ing.available_products && ing.available_products.length > 0) { + ing.available_products.forEach(product => { + const specInfo = product.specification ? ` [${product.specification}]` : ''; + productOptions += ``; + }); + } + $('#compoundIngredients').append(` - - ${ing.herb_name} + + + ${ing.herb_name} + ${ing.total_available_stock > 0 + ? `(총 ${ing.total_available_stock.toFixed(0)}g 사용 가능)` + : '(재고 없음)'} + ${totalGrams.toFixed(1)} - - + ${productOptions} - 확인중... + + + + 대기중