feat(bandeja): modal de consentimientos + badges visibles confirmados

- Consentimientos abren en modal iframe (ver_formulario_enviado.php?embed=1)
- Igual que en toma de muestras: spinner de carga, click fuera para cerrar
- Badges de comentarios (Recep./Toma/Gral.) y estado (Finalizado/En servicio)
  confirmados visibles en tarjeta

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-27 21:48:09 -05:00
co-authored by Claude Sonnet 4.6
parent b76c2f11e9
commit 045fd64113
+83 -1
View File
@@ -296,6 +296,49 @@ Layout::open('Bandeja del día', 'fas fa-layer-group');
pointer-events: none;
}
.bnd-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ── Modal consentimiento ── */
.bnd-modal-consent {
display: none;
position: fixed;
inset: 0;
z-index: 9200;
background: rgba(0,0,0,.55);
align-items: center;
justify-content: center;
}
.bnd-modal-consent.open { display: flex; }
.bnd-modal-inner {
background: #fff;
border-radius: 12px;
width: min(820px, 96vw);
height: min(88vh, 700px);
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.bnd-modal-hdr {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 18px;
border-bottom: 1px solid #e2e8f0;
flex-shrink: 0;
}
.bnd-modal-hdr span { font-size:.88rem; font-weight:600; color:#1e293b; }
.bnd-modal-hdr button {
background: none; border: none; cursor: pointer;
font-size: 1.1rem; color: #64748b; line-height:1;
}
.bnd-modal-hdr button:hover { color:#1e293b; }
.bnd-modal-body { flex:1; overflow:hidden; position:relative; }
.bnd-modal-body iframe { width:100%; height:100%; border:none; }
.bnd-modal-loading {
position: absolute; inset: 0;
display: flex; align-items: center; justify-content: center;
font-size: .9rem; color: #94a3b8;
gap: 8px;
}
/* ── Print ── */
@media print {
.bnd-list, .bnd-topbar, .bnd-dh-actions,
@@ -338,6 +381,24 @@ Layout::open('Bandeja del día', 'fas fa-layer-group');
</div>
</div>
<!-- Modal consentimiento -->
<div class="bnd-modal-consent" id="bnd-modal-consent" onclick="_bndCerrarConsent(event)">
<div class="bnd-modal-inner">
<div class="bnd-modal-hdr">
<span id="bnd-modal-title"><i class="fas fa-file-signature"></i> Consentimiento</span>
<button onclick="_bndCerrarConsent()"><i class="fas fa-times"></i></button>
</div>
<div class="bnd-modal-body">
<div class="bnd-modal-loading" id="bnd-modal-loading">
<i class="fas fa-spinner fa-spin"></i> Cargando...
</div>
<iframe id="bnd-modal-iframe" src="" style="display:none"
onload="document.getElementById('bnd-modal-loading').style.display='none';this.style.display='block'">
</iframe>
</div>
</div>
</div>
<div class="bnd-toast" id="bnd-toast"></div>
<script>
@@ -447,6 +508,27 @@ function _renderLista(pendientes, vistos) {
el.innerHTML = html;
}
// ── Modal consentimiento ──────────────────────────────────────
function _bndAbrirConsent(token, nombre, ev) {
if (ev) ev.stopPropagation();
const modal = document.getElementById('bnd-modal-consent');
const iframe = document.getElementById('bnd-modal-iframe');
const loading = document.getElementById('bnd-modal-loading');
document.getElementById('bnd-modal-title').innerHTML = `<i class="fas fa-file-signature"></i> ${nombre||'Consentimiento'}`;
iframe.style.display = 'none';
iframe.src = '';
loading.style.display = 'flex';
modal.classList.add('open');
setTimeout(() => {
iframe.src = `ver_formulario_enviado.php?token=${encodeURIComponent(token)}&embed=1&compact=1&zoom=1.1`;
}, 60);
}
function _bndCerrarConsent(ev) {
if (ev && ev.target !== document.getElementById('bnd-modal-consent')) return;
document.getElementById('bnd-modal-consent').classList.remove('open');
document.getElementById('bnd-modal-iframe').src = '';
}
// ── Detalle ───────────────────────────────────────────────────
async function _bndVerDetalle(turnoId) {
_bndTurnoId = turnoId;
@@ -526,7 +608,7 @@ function _renderDetalle(d) {
const esFirmado = c.estado==='firmado';
const ico = esFirmado ? 'firmado fas fa-check-circle' : 'pendiente fas fa-clock';
const link = c.token
? `<a href="ver_formulario_enviado.php?token=${c.token}" target="_blank"><i class="fas fa-external-link-alt"></i> Ver</a>` : '';
? `<button onclick="_bndAbrirConsent('${c.token}','${c.formulario_nombre.replace(/'/g,"\\'")}',event)" style="background:none;border:none;cursor:pointer;font-size:.74rem;color:#3b82f6;padding:0;margin-left:4px"><i class="fas fa-eye"></i> Ver</button>` : '';
secC += `<div class="bnd-consent">
<i class="bnd-consent-ico ${ico}"></i>
<span style="font-size:.82rem">${c.formulario_nombre}</span>