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:
co-authored by
Claude Sonnet 4.6
parent
76dda4722a
commit
34004b4d98
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user