Update recepcion.php
This commit is contained in:
@@ -169,26 +169,6 @@ $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['
|
|||||||
.consent-acciones { display: flex; gap: .3rem; flex-shrink: 0; }
|
.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: .72rem; padding: 2px 8px; border-radius: 7px; }
|
||||||
|
|
||||||
/* ── Modal firma presencial ── */
|
|
||||||
.modal-firma-backdrop {
|
|
||||||
display: none; position: fixed; inset: 0;
|
|
||||||
background: rgba(15,23,42,.65); z-index: 1050;
|
|
||||||
align-items: center; justify-content: center;
|
|
||||||
}
|
|
||||||
.modal-firma-backdrop.open { display: flex; }
|
|
||||||
.modal-firma-box {
|
|
||||||
background: #fff; border-radius: 16px;
|
|
||||||
width: min(94vw, 860px); height: min(88vh, 720px);
|
|
||||||
display: flex; flex-direction: column; overflow: hidden;
|
|
||||||
box-shadow: 0 8px 40px rgba(0,0,0,.35);
|
|
||||||
}
|
|
||||||
.modal-firma-hdr {
|
|
||||||
padding: 12px 18px; border-bottom: 1px solid #e2e8f0;
|
|
||||||
display: flex; align-items: center; justify-content: space-between;
|
|
||||||
font-size: .95rem; font-weight: 600; flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.modal-firma-box iframe { flex: 1; border: 0; }
|
|
||||||
|
|
||||||
/* ── Barra de acciones ── */
|
/* ── Barra de acciones ── */
|
||||||
.ficha-acciones {
|
.ficha-acciones {
|
||||||
position: sticky; bottom: 0;
|
position: sticky; bottom: 0;
|
||||||
@@ -450,19 +430,6 @@ require_once __DIR__ . '/../../../shared/components/sidebar.php';
|
|||||||
<span id="toast-msg"></span>
|
<span id="toast-msg"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ══ Modal firma presencial ═════════════════════════════════ -->
|
|
||||||
<div class="modal-firma-backdrop" id="modal-firma-rec">
|
|
||||||
<div class="modal-firma-box">
|
|
||||||
<div class="modal-firma-hdr">
|
|
||||||
<span><i class="fas fa-signature me-2 text-primary"></i><span id="modal-firma-titulo-rec">Firmar consentimiento</span></span>
|
|
||||||
<button class="btn btn-sm btn-outline-secondary" onclick="cerrarModalFirmaRec()">
|
|
||||||
<i class="fas fa-times"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<iframe id="firma-iframe-rec" src="" title="Formulario de consentimiento"></iframe>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// ── Estado ────────────────────────────────────────────────────
|
// ── Estado ────────────────────────────────────────────────────
|
||||||
let turnoActivo = null;
|
let turnoActivo = null;
|
||||||
@@ -481,6 +448,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
pollingColaId = setInterval(cargarCola, 3000);
|
pollingColaId = setInterval(cargarCola, 3000);
|
||||||
document.getElementById('inp-buscar-pac')
|
document.getElementById('inp-buscar-pac')
|
||||||
.addEventListener('keydown', e => { if (e.key === 'Enter') buscarPaciente(); });
|
.addEventListener('keydown', e => { if (e.key === 'Enter') buscarPaciente(); });
|
||||||
|
// Refrescar consentimientos al volver a la pestaña (firma en otra pestaña)
|
||||||
|
document.addEventListener('visibilitychange', () => {
|
||||||
|
if (!document.hidden && turnoActivo) refrescarConsentimientos(turnoActivo.id);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ── Cola ──────────────────────────────────────────────────────
|
// ── Cola ──────────────────────────────────────────────────────
|
||||||
@@ -802,9 +773,9 @@ function renderConsentimientos(lista) {
|
|||||||
|
|
||||||
// Botón de firma (solo si no está firmado/rechazado)
|
// Botón de firma (solo si no está firmado/rechazado)
|
||||||
const btnFirmar = (!ya && c.token)
|
const btnFirmar = (!ya && c.token)
|
||||||
? `<button class="btn btn-outline-primary" onclick="abrirFirmaPresencialRec('${token}', ${nomJs})"
|
? `<button class="btn btn-outline-primary" onclick="abrirFirmaPresencialRec('${token}')"
|
||||||
title="Firmar aquí en pantalla">
|
title="Abrir firma en nueva pestaña">
|
||||||
<i class="fas fa-signature"></i> Firmar
|
<i class="fas fa-external-link-alt"></i> Firmar
|
||||||
</button>` : '';
|
</button>` : '';
|
||||||
|
|
||||||
// Botón enviar/reenviar WhatsApp
|
// Botón enviar/reenviar WhatsApp
|
||||||
@@ -826,28 +797,16 @@ function renderConsentimientos(lista) {
|
|||||||
}).join('');
|
}).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Firmar presencialmente (modal iframe) ─────────────────────
|
// ── Firmar en nueva pestaña ──────────────────────────────────
|
||||||
function abrirFirmaPresencialRec(token, nombreForm) {
|
function abrirFirmaPresencialRec(token) {
|
||||||
const url = BASE_WA + 'ver_formulario_enviado.php?token=' + encodeURIComponent(token);
|
window.open(
|
||||||
document.getElementById('modal-firma-titulo-rec').textContent = 'Firmar: ' + nombreForm;
|
BASE_WA + 'ver_formulario_enviado.php?token=' + encodeURIComponent(token) + '&firmar=1',
|
||||||
document.getElementById('firma-iframe-rec').src = url;
|
'_blank'
|
||||||
document.getElementById('modal-firma-rec').classList.add('open');
|
);
|
||||||
}
|
|
||||||
function cerrarModalFirmaRec() {
|
|
||||||
document.getElementById('modal-firma-rec').classList.remove('open');
|
|
||||||
document.getElementById('firma-iframe-rec').src = '';
|
|
||||||
// Refrescar consentimientos al cerrar
|
|
||||||
if (turnoActivo) refrescarConsentimientos(turnoActivo.id);
|
|
||||||
}
|
}
|
||||||
function verFirmado(token) {
|
function verFirmado(token) {
|
||||||
window.open(BASE_WA + 'ver_formulario_enviado.php?token=' + encodeURIComponent(token), '_blank');
|
window.open(BASE_WA + 'ver_formulario_enviado.php?token=' + encodeURIComponent(token), '_blank');
|
||||||
}
|
}
|
||||||
// Cerrar modal al clic fuera
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
document.getElementById('modal-firma-rec').addEventListener('click', function(e) {
|
|
||||||
if (e.target === this) cerrarModalFirmaRec();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// ── Refrescar estado de consentimientos ───────────────────────
|
// ── Refrescar estado de consentimientos ───────────────────────
|
||||||
async function refrescarConsentimientos(turnoId) {
|
async function refrescarConsentimientos(turnoId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user