Update recepcion.php

This commit is contained in:
Lizandro Guarnizo
2026-06-16 12:14:26 -05:00
parent 415ea3ef56
commit 047583604d
+4 -2
View File
@@ -472,6 +472,7 @@ let pollingColaId = null;
const API = '<?= BASE_URL ?>modules/turnero/api/';
const API_PAC = '<?= BASE_URL ?>api/lab/get_pacientes.php';
const BASE_WA = '<?= BASE_URL ?>';
const DESK_ID = <?= $deskId ?: 'null' ?>;
// ── Arranque ──────────────────────────────────────────────────
@@ -1033,8 +1034,8 @@ async function firmarConsentimiento(formularioId, nombre) {
body: JSON.stringify({ turno_id: turnoActivo.id, formulario_id: formularioId }),
});
const json = await res.json();
if (json.ok && json.data?.url) {
window.open(json.data.url, '_blank');
if (json.ok && (json.url || json.data?.url)) {
window.open(json.url || json.data.url, '_blank');
// Iniciar polling automático para detectar firma
if (!pollingConsentimientosId) {
pollingConsentimientosId = setInterval(() => {
@@ -1243,5 +1244,6 @@ function mostrarToast(msg, type = 'info', duration = 2500) {
toastTimer = setTimeout(() => el.classList.remove('show'), duration);
}
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>