feat(recepcion): panel muestras muestra último turno atendido por letra

API: agrega por_prioridad con último código llamado a muestras por letra.
Vista: badges con color de prioridad mostrando "A: A-023", "B: B-011", etc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-30 19:51:10 -05:00
co-authored by Claude Sonnet 4.6
parent 498a144c18
commit 941b6740f0
2 changed files with 25 additions and 6 deletions
+7 -6
View File
@@ -3096,12 +3096,13 @@ async function _cargarResumenMuestras() {
if (!j.ok) return;
const cont = document.getElementById('muestras-estaciones');
if (!cont) return;
cont.innerHTML = j.estaciones.map(e => {
const libre = !e.turno_id;
return `<span class="badge ${libre ? 'bg-secondary' : 'bg-success'}" style="font-size:.75rem;font-weight:500" title="${libre ? 'Libre' : escHtml(e.paciente_nombre || '')}">
${escHtml(e.nombre)}: ${libre ? '—' : escHtml(e.codigo)}
</span>`;
}).join('');
cont.innerHTML = (j.por_prioridad || []).map(p =>
`<span style="display:inline-flex;align-items:center;gap:4px;font-size:.78rem;font-weight:700;
padding:2px 8px;border-radius:99px;background:${escHtml(p.color)}22;color:${escHtml(p.color)};
border:1.5px solid ${escHtml(p.color)}55;white-space:nowrap">
${escHtml(p.codigo)}: ${escHtml(p.ultimo_codigo)}
</span>`
).join('');
const cb = document.getElementById('muestras-cola-badge');
cb.textContent = `${j.en_espera} en espera`;
cb.classList.toggle('d-none', j.en_espera === 0);