feat: 도매상 설정 중앙 관리 시스템

- config/wholesalers.json: 도매상 정보 중앙 관리 (ID, 이름, 로고, 색상, API)
- config/__init__.py: Python 헬퍼 (get_wholesalers, get_wholesaler)
- wholesaler_config_api.py: /api/config/wholesalers 엔드포인트
- 백제약품 로고(favicon) 추가: logo_baekje.ico
- 잔고 모달에 로고 표시 기능 추가
This commit is contained in:
thug0bin
2026-03-06 17:18:40 +09:00
parent 2d09f139ca
commit ad0b55ee2d
6 changed files with 202 additions and 6 deletions

View File

@@ -2210,6 +2210,20 @@
.balance-icon.geoyoung { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.balance-icon.sooin { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.balance-logo-wrap {
width: 48px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
}
.balance-logo {
width: 40px;
height: 40px;
object-fit: contain;
border-radius: 8px;
}
.balance-info {
flex: 1;
min-width: 0;
@@ -2281,6 +2295,26 @@
document.getElementById('balanceModal').classList.remove('show');
}
// 도매상 설정 (중앙 관리)
const WHOLESALER_CONFIG = {
baekje: {
id: 'baekje', name: '백제약품', icon: '💉',
logo: '/static/img/logo_baekje.ico',
color: '#f59e0b', api: '/api/baekje/balance'
},
geoyoung: {
id: 'geoyoung', name: '지오영', icon: '🏭',
logo: '/static/img/logo_geoyoung.ico',
color: '#06b6d4', api: '/api/geoyoung/balance'
},
sooin: {
id: 'sooin', name: '수인약품', icon: '💊',
logo: '/static/img/logo_sooin.svg',
color: '#a855f7', api: '/api/sooin/balance'
}
};
const WHOLESALER_ORDER = ['baekje', 'geoyoung', 'sooin'];
async function loadBalances() {
const content = document.getElementById('balanceContent');
content.innerHTML = `
@@ -2289,11 +2323,7 @@
<div>잔고 조회 중...</div>
</div>`;
const wholesalers = [
{ id: 'baekje', name: '백제약품', icon: '💉', api: '/api/baekje/balance' },
{ id: 'geoyoung', name: '지오영', icon: '🏭', api: '/api/geoyoung/balance' },
{ id: 'sooin', name: '수인약품', icon: '💊', api: '/api/sooin/balance' }
];
const wholesalers = WHOLESALER_ORDER.map(id => WHOLESALER_CONFIG[id]);
const results = {};
let totalBalance = 0;
@@ -2323,7 +2353,11 @@
html += `
<div class="balance-card ${isError ? 'error' : ''}">
<div class="balance-icon ${ws.id}">${ws.icon}</div>
<div class="balance-logo-wrap">
<img src="${ws.logo}" alt="${ws.name}" class="balance-logo"
onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
<div class="balance-icon ${ws.id}" style="display:none;">${ws.icon}</div>
</div>
<div class="balance-info">
<div class="balance-name">${ws.name}</div>
<div class="balance-detail">