feat(drug-usage): 음수재고 빨간색 + 테이블 스크롤 고정헤더

- 음수 현재고 빨간색 강조 (.negative-stock)
- 입고/조제 테이블 sticky header (max-height: 300px)
- 테이블 wrapper 추가 (border-radius)
This commit is contained in:
thug0bin 2026-03-11 20:53:02 +09:00
parent 88a23c26c1
commit f46071132c

View File

@ -263,6 +263,10 @@
.num-secondary {
color: #3b82f6;
}
.negative-stock {
color: #dc2626 !important;
font-weight: 600;
}
/* ── 빈 상태 ── */
.empty-state {
@ -390,6 +394,12 @@
background: #fef3c7;
color: #92400e;
}
.detail-table-wrapper {
max-height: 300px;
overflow-y: auto;
border: 1px solid #e2e8f0;
border-radius: 6px;
}
.detail-table {
width: 100%;
border-collapse: separate;
@ -398,6 +408,13 @@
min-width: 0;
table-layout: fixed;
}
.detail-table thead th {
position: sticky;
top: 0;
background: #f8fafc;
z-index: 1;
box-shadow: 0 1px 0 #e2e8f0;
}
.detail-table td, .detail-table th {
padding: 4px 8px;
border-bottom: 1px solid #e0e0e0;
@ -745,7 +762,7 @@
<td class="num-cell num-secondary">${formatNumber(item.import_count)}</td>
<td class="num-cell num-highlight">${formatNumber(item.rx_total_qty)}</td>
<td class="num-cell num-secondary">${formatNumber(item.import_total_qty)}</td>
<td class="num-cell">${formatNumber(item.current_stock)}</td>
<td class="num-cell ${item.current_stock < 0 ? 'negative-stock' : ''}">${formatNumber(item.current_stock)}</td>
</tr>
<tr class="detail-row" id="detail-${escapeHtml(item.drug_code)}" style="display:${expandedDrugCode === item.drug_code ? 'table-row' : 'none'};">
<td colspan="8">
@ -811,6 +828,7 @@
if (data.success && data.items.length > 0) {
container.innerHTML = `
<h4>📦 입고목록 <span class="count">(${data.total_count}건)</span></h4>
<div class="detail-table-wrapper">
<table class="detail-table" style="table-layout:fixed;">
<colgroup>
<col style="width:70px;">
@ -843,6 +861,7 @@
`).join('')}
</tbody>
</table>
</div>
`;
} else {
container.innerHTML = `
@ -886,6 +905,7 @@
container.innerHTML = `
<h4>💊 조제목록 <span class="count">(${data.total_count}건)</span> <span class="patient-info">${patientBadges}</span></h4>
<div class="detail-table-wrapper">
<table class="detail-table" style="table-layout:fixed;">
<colgroup>
<col style="width:65px;">
@ -924,6 +944,7 @@
`).join('')}
</tbody>
</table>
</div>
`;
} else {
container.innerHTML = `