feat(turnero): opción solo entrega de muestras con prioridad y badge naranja en cola

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-03 00:07:05 -05:00
co-authored by Claude Sonnet 4.6
parent 76dda4722a
commit 34004b4d98
5 changed files with 51 additions and 18 deletions
+12 -2
View File
@@ -465,14 +465,24 @@ function renderCola(snap) {
border-radius:7px;padding:5px 9px;font-size:.78rem;cursor:pointer">
<i class="fas fa-bell"></i>
</button>`;
const esMuestra = t.solo_muestras == 1;
const muestraBadge = esMuestra
? `<div style="font-size:.6rem;font-weight:700;color:#ea580c;letter-spacing:.04em;margin-top:1px">
<i class="fas fa-plus-square me-1"></i>TOMA DE MUESTRAS
</div>`
: '';
const cardStyle = esMuestra
? 'cursor:pointer;border:2px solid #ea580c!important;background:#fff7ed!important'
: 'cursor:pointer';
return `
<div class="cola-card ${enServicio ? 'en-servicio-card' : ''} ${esActivo ? 'activo' : ''}"
style="cursor:pointer" onclick="seleccionarSinLlamar(${t.id})"
style="${cardStyle}" onclick="seleccionarSinLlamar(${t.id})"
title="${enServicio ? 'Ver turno en servicio' : `Ver turno ${escHtml(t.codigo)}`}">
<div class="prio-dot" style="background:${t.prioridad_color}">${t.prioridad_codigo}</div>
<div class="prio-dot" style="background:${esMuestra ? '#ea580c' : t.prioridad_color}">${esMuestra ? '<i class="fas fa-plus"></i>' : escHtml(t.prioridad_codigo)}</div>
<div class="turno-info">
<div class="cod">${escHtml(t.codigo)}</div>
<div class="pac">${escHtml(t.paciente_nombre || 'Paciente')}</div>
${muestraBadge}
</div>
${indicador}
</div>`;
+20 -4
View File
@@ -471,6 +471,12 @@ document.addEventListener('DOMContentLoaded', function() {
<!-- ── Sección 3: Exámenes ── -->
<div class="ficha-section">
<h6><i class="fas fa-vial me-1"></i>Exámenes solicitados</h6>
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" id="chk-solo-muestras" onchange="toggleSoloMuestras()">
<label class="form-check-label small fw-semibold text-warning" for="chk-solo-muestras">
<i class="fas fa-vial me-1"></i>Solo entrega de muestras
</label>
</div>
<div id="lista-examenes">
<?php foreach ($examenesAgrupados as $cat => $items): ?>
<div class="exam-group-title"><?= htmlspecialchars($cat) ?></div>
@@ -1284,8 +1290,9 @@ async function guardarSolicitud() {
return;
}
const soloMuestras = document.getElementById('chk-solo-muestras').checked;
const examIds = Array.from(document.querySelectorAll('.exam-chk:checked')).map(c => parseInt(c.value));
if (!examIds.length) { mostrarError('Seleccione al menos un examen.'); return; }
if (!soloMuestras && !examIds.length) { mostrarError('Seleccione al menos un examen.'); return; }
const btn = document.getElementById('btn-guardar');
btn.disabled = true;
@@ -1308,8 +1315,9 @@ async function guardarSolicitud() {
transferencia: parseFloat(document.getElementById('comb-transferencia').value) || 0,
tarjeta: parseFloat(document.getElementById('comb-tarjeta').value) || 0,
} : null,
observaciones: document.getElementById('inp-obs').value.trim() || null,
embarazada: document.getElementById('chk-embarazada').checked ? 1 : 0,
observaciones: document.getElementById('inp-obs').value.trim() || null,
embarazada: document.getElementById('chk-embarazada').checked ? 1 : 0,
solo_muestras: soloMuestras ? 1 : 0,
}),
});
const json = await res.json();
@@ -1652,8 +1660,16 @@ async function soltarTurno() {
}
// ── Helpers ───────────────────────────────────────────────────
function toggleSoloMuestras() {
const solo = document.getElementById('chk-solo-muestras').checked;
document.querySelectorAll('.exam-chk').forEach(c => { c.checked = false; c.disabled = solo; });
document.getElementById('lista-examenes').style.opacity = solo ? '0.4' : '';
}
function resetCheckboxes() {
document.querySelectorAll('.exam-chk').forEach(c => c.checked = false);
document.getElementById('chk-solo-muestras').checked = false;
document.querySelectorAll('.exam-chk').forEach(c => { c.checked = false; c.disabled = false; });
document.getElementById('lista-examenes').style.opacity = '';
document.getElementById('sel-pago').value = '';
document.getElementById('inp-total').value = '';
document.getElementById('inp-obs').value = '';