diff --git a/static/app.js b/static/app.js index 3decd42..f91d267 100644 --- a/static/app.js +++ b/static/app.js @@ -1231,6 +1231,7 @@ $(document).ready(function() { 로트ID + 품명 수량 단가 입고일 @@ -1240,9 +1241,19 @@ $(document).ready(function() { `; origin.lots.forEach(lot => { + // variant 속성들을 뱃지로 표시 + let variantBadges = ''; + if (lot.form) variantBadges += `${lot.form}`; + if (lot.processing) variantBadges += `${lot.processing}`; + if (lot.grade) variantBadges += `${lot.grade}`; + originsHtml += ` #${lot.lot_id} + + ${lot.display_name ? `${lot.display_name}` : '-'} + ${variantBadges} + ${lot.quantity_onhand.toFixed(1)}g ${formatCurrency(lot.unit_price_per_g)} ${lot.received_date} @@ -1389,9 +1400,22 @@ $(document).ready(function() { let linesHtml = ''; data.lines.forEach(line => { + // display_name이 있으면 표시, 없으면 herb_name + const displayName = line.display_name || line.herb_name; + + // variant 속성들을 뱃지로 표시 + let variantBadges = ''; + if (line.form) variantBadges += `${line.form}`; + if (line.processing) variantBadges += `${line.processing}`; + if (line.grade) variantBadges += `${line.grade}`; + linesHtml += ` - ${line.herb_name} + +
${line.herb_name}
+ ${line.display_name ? `${line.display_name}` : ''} + ${variantBadges} + ${line.insurance_code || '-'} ${line.origin_country || '-'} ${line.quantity_g}g @@ -1705,11 +1729,28 @@ $(document).ready(function() { origins.forEach(origin => { const stockStatus = origin.total_quantity >= requiredQty ? '' : ' (재고 부족)'; const priceInfo = `${formatCurrency(origin.min_price)}/g`; + + // 해당 원산지의 display_name 목록 생성 + let displayNames = []; + if (origin.lots && origin.lots.length > 0) { + origin.lots.forEach(lot => { + if (lot.display_name) { + displayNames.push(lot.display_name); + } + }); + } + + // 고유한 display_name만 표시 (중복 제거) + const uniqueDisplayNames = [...new Set(displayNames)]; + const displayNameText = uniqueDisplayNames.length > 0 + ? ` [${uniqueDisplayNames.join(', ')}]` + : ''; + const option = ``; selectElement.append(option); });