- 약재 추가 드롭다운에서 제품명 대신 마스터 약재명 표시 - /api/herbs/masters 엔드포인트 사용하여 ingredient_code 기반 약재 목록 로드 - /api/herbs/by-ingredient/<code> 엔드포인트 추가 (제품 목록 조회) - 2단계 선택 구조: 약재(마스터) → 제품 → 원산지/롯트 - 기존 처방 약재와 새로 추가하는 약재의 테이블 구조 통일 (6칼럼) - 원산지 선택 칼럼에 제품/원산지 드롭다운 함께 표시 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
43 lines
1.4 KiB
HTML
43 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>약재 선택 테스트</title>
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>약재 선택 드롭다운 테스트</h1>
|
|
|
|
<div id="test-area"></div>
|
|
|
|
<button id="add-row">행 추가</button>
|
|
|
|
<script>
|
|
$('#add-row').click(function() {
|
|
// API 호출하여 약재 목록 가져오기
|
|
$.get('http://localhost:5001/api/herbs/masters', function(response) {
|
|
console.log('API Response:', response);
|
|
|
|
if (response.success) {
|
|
const select = $('<select></select>');
|
|
select.append('<option value="">약재 선택</option>');
|
|
|
|
// 재고가 있는 약재만 필터링
|
|
const herbsWithStock = response.data.filter(herb => herb.has_stock === 1);
|
|
console.log('Herbs with stock:', herbsWithStock.length);
|
|
|
|
herbsWithStock.forEach(herb => {
|
|
let displayName = herb.herb_name;
|
|
if (herb.herb_name_hanja) {
|
|
displayName += ` (${herb.herb_name_hanja})`;
|
|
}
|
|
select.append(`<option value="${herb.ingredient_code}">${displayName}</option>`);
|
|
});
|
|
|
|
$('#test-area').append(select);
|
|
$('#test-area').append('<br><br>');
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |