feat: 실시간 POS 품목별 OTC 용법 라벨 인쇄 버튼 추가
POS 상세 패널:
- 품목 목록에 💊 인쇄 버튼 추가
- 프리셋 있으면 → 바로 인쇄
- 프리셋 없으면 → 새 창으로 등록 페이지 열기
API:
- /api/admin/pos-live/detail에 barcode 필드 추가
OTC 라벨 관리 페이지:
- URL 파라미터(barcode, name) 자동 처리
- POS에서 넘어올 때 자동으로 해당 약품 로드
This commit is contained in:
@@ -401,6 +401,30 @@
|
||||
debounceTimer = setTimeout(previewLabel, 500);
|
||||
});
|
||||
});
|
||||
|
||||
// URL 파라미터로 바코드/이름 전달 시 자동 로드
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const urlBarcode = params.get('barcode');
|
||||
const urlName = params.get('name');
|
||||
if (urlBarcode) {
|
||||
currentBarcode = urlBarcode;
|
||||
currentDrugName = urlName || urlBarcode;
|
||||
document.getElementById('barcode').value = urlBarcode;
|
||||
document.getElementById('searchInput').value = urlName || urlBarcode;
|
||||
|
||||
// 기존 프리셋 확인
|
||||
fetch(`/api/admin/otc-labels/${urlBarcode}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.exists) {
|
||||
document.getElementById('displayName').value = data.label.display_name || '';
|
||||
document.getElementById('effect').value = data.label.effect || '';
|
||||
document.getElementById('dosageInstruction').value = data.label.dosage_instruction || '';
|
||||
document.getElementById('usageTip').value = data.label.usage_tip || '';
|
||||
}
|
||||
previewLabel();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 약품 검색 (MSSQL)
|
||||
|
||||
Reference in New Issue
Block a user