diff --git a/modules/turnero/views/lugar.php b/modules/turnero/views/lugar.php
index e54670b..6173c4a 100644
--- a/modules/turnero/views/lugar.php
+++ b/modules/turnero/views/lugar.php
@@ -148,9 +148,9 @@ $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['
.card-bell-btn {
flex-shrink: 0; background: #2563eb; border: none; color: #fff;
- border-radius: 8px; width: 34px; height: 34px;
+ border-radius: 10px; width: 44px; height: 44px;
display: flex; align-items: center; justify-content: center;
- font-size: .82rem; cursor: pointer; transition: background .12s;
+ font-size: .95rem; cursor: pointer; transition: background .12s;
}
.card-bell-btn:hover { background: #1d4ed8; }
@@ -411,6 +411,11 @@ require_once __DIR__ . '/../../../shared/components/sidebar.php';
+
@@ -510,8 +515,8 @@ require_once __DIR__ . '/../../../shared/components/sidebar.php';
Nombre—
Documento—
-
Fecha nac.—
-
Celular—
+
Fecha nac.—
+
Celular—
Paciente embarazada
@@ -707,6 +712,24 @@ function iniciarPuesto() {
recuperarTurnoActivo();
cargarCola();
pollingColaId = setInterval(cargarCola, 7000);
+
+ document.addEventListener('visibilitychange', () => {
+ if (document.hidden) {
+ clearInterval(pollingColaId);
+ clearInterval(pollingConsentId);
+ pollingColaId = pollingConsentId = null;
+ } else if (lugarId) {
+ cargarCola();
+ pollingColaId = setInterval(cargarCola, 7000);
+ }
+ });
+
+ document.addEventListener('keydown', e => {
+ if (e.key === 'Escape' && lugarId &&
+ document.getElementById('overlay-selector').style.display !== 'none') {
+ document.getElementById('overlay-selector').style.display = 'none';
+ }
+ });
}
async function recuperarTurnoActivo() {
@@ -735,6 +758,7 @@ function cambiarLugar() {
clearInterval(pollingConsentId);
turnoActivo = null;
resetFicha();
+ document.getElementById('btn-cancelar-selector').style.display = '';
document.getElementById('overlay-selector').style.display = 'flex';
}
diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php
index 41ca4cf..b19a500 100644
--- a/modules/turnero/views/recepcion.php
+++ b/modules/turnero/views/recepcion.php
@@ -166,6 +166,8 @@ $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['
/* ── Checkboxes de exámenes ── */
.exam-group-title { font-size: .75rem; color: #94a3b8;
text-transform: uppercase; letter-spacing: .08em; margin: .6rem 0 .3rem; }
+ .exam-cat-label { display: flex; align-items: center; gap: .35rem; cursor: pointer; }
+ .exam-cat-label input[type=checkbox] { cursor: pointer; }
.exam-check-item { display: flex; align-items: center; gap: .5rem;
padding: .3rem .4rem; border-radius: 6px; cursor: pointer;
transition: background .1s; font-size: .88rem; }
@@ -188,7 +190,7 @@ $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['
.consent-item .c-badge { font-size: .7rem; font-weight: 700; padding: 1px 8px;
border-radius: 99px; border: 1px solid currentColor; opacity: .85; }
.consent-acciones { display: flex; gap: .3rem; flex-shrink: 0; }
- .consent-acciones .btn { font-size: .72rem; padding: 2px 8px; border-radius: 7px; }
+ .consent-acciones .btn { font-size: .82rem; padding: 5px 12px; border-radius: 7px; }
.consent-prof-row { display:flex; align-items:center; gap:.4rem; font-size:.75rem;
margin-top:.25rem; padding-top:.25rem; border-top:1px solid rgba(0,0,0,.07); }
.consent-prof-row .badge { font-size:.65rem; }
@@ -576,12 +578,21 @@ document.addEventListener('DOMContentLoaded', function() {
$items): ?>
-
= htmlspecialchars($cat) ?>
+
+
+
@@ -1452,17 +1463,17 @@ async function guardarSolicitud() {
pollingConsentimientosId = null;
}
- // No mostrar consentimientos post-guardado aquí (ya vienen de create_solicitud)
- // Solo renderizar si vienen nuevos
if (consentimientos && consentimientos.length > 0) {
renderConsentimientos(consentimientos);
document.getElementById('sec-consentimientos').style.display = '';
document.getElementById('btn-enviar-consent').classList.remove('d-none');
+ document.getElementById('btn-pasar-lugar').classList.remove('d-none');
+ document.getElementById('btn-guardar').classList.add('d-none');
+ } else {
+ // Sin consentimientos → pasar directamente al lugar
+ await pasarALugar();
}
- document.getElementById('btn-pasar-lugar').classList.remove('d-none');
- document.getElementById('btn-guardar').classList.add('d-none');
-
} catch (err) {
mostrarError(err.message);
btn.disabled = false;
@@ -1701,7 +1712,7 @@ async function pasarALugar() {
if (!turnoActivo || !solicitudActiva) return;
const btn = document.getElementById('btn-pasar-lugar');
- btn.disabled = true;
+ if (btn) btn.disabled = true;
try {
const res = await fetch(API + 'cambiar_estado.php', {
@@ -1714,7 +1725,7 @@ async function pasarALugar() {
}),
});
const json = await res.json();
- if (!json.ok) { mostrarError(json.error); btn.disabled = false; return; }
+ if (!json.ok) { mostrarError(json.error); if (btn) btn.disabled = false; return; }
// Reiniciar ficha
turnoActivo = null;
@@ -1731,7 +1742,7 @@ async function pasarALugar() {
} catch (err) {
mostrarError(err.message);
- btn.disabled = false;
+ if (btn) btn.disabled = false;
}
}
@@ -1860,6 +1871,24 @@ function filtrarExamenes(q) {
}
function toggleTodosExamenes(val) {
document.querySelectorAll('.exam-chk').forEach(c => c.checked = val);
+ document.querySelectorAll('.exam-cat-chk').forEach(c => c.checked = val);
+}
+
+function toggleCategoria(chk) {
+ const cat = chk.dataset.cat;
+ document.querySelectorAll(`.exam-chk[data-cat="${CSS.escape(cat)}"]`).forEach(c => {
+ if (c.closest('.exam-check-item')?.style.display !== 'none') c.checked = chk.checked;
+ });
+}
+
+function actualizarCatChk(cat) {
+ const catChk = document.querySelector(`.exam-cat-chk[data-cat="${CSS.escape(cat)}"]`);
+ if (!catChk) return;
+ const items = Array.from(document.querySelectorAll(`.exam-chk[data-cat="${CSS.escape(cat)}"]`))
+ .filter(c => c.closest('.exam-check-item')?.style.display !== 'none');
+ const checked = items.filter(c => c.checked).length;
+ catChk.checked = checked === items.length && items.length > 0;
+ catChk.indeterminate = checked > 0 && checked < items.length;
}
function escHtml(str) {
@@ -2114,8 +2143,8 @@ async function abrirModalPaciente(id, nombrePrefill) {
mpacAvatar(nombrePrefill);
}
_mpacModal().show();
- setTimeout(() => document.getElementById('mpac-nombre').focus(), 300);
}
+ setTimeout(() => document.getElementById('mpac-nombre').focus(), 300);
}
function mpacRellenar(p) {