feat: olvidar firma, editar tiempos tomas, obs en header, fix dispositivos
- feat(turnero): Botón "Olvidar" en lugar.php y recepcion.php para descartar firma de consentimiento completo (nuevo endpoint resetear_consentimiento.php) - feat(turnero): Botón "Olvidar" por toma individual en prolongadas para borrar firma+hora de una toma específica (nuevo endpoint resetear_toma.php) - feat(turnero): Editar tiempos en tomas en_progreso: hora_campo signed muestra readonly con botón olvidar, permite re-editar tras olvidar - feat(turnero): Guardar tiempos (draft save) también en estado en_progreso - feat(turnero): Observaciones de tomas prolongadas se muestran en header de tarjeta firmada (campo obs_campo en _mpMap) - fix(turnero): Token del equipo se sobreescribía en tabla — ip permitía solo un registro con ip='' (UNIQUE); ahora ip es nullable Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
8e9d7750a7
commit
ff52fa5ba7
@@ -1633,6 +1633,12 @@ function renderConsentimientos(lista) {
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>`;
|
||||
|
||||
const btnOlvidar = (ya && c.token && c.estado !== 'rechazado')
|
||||
? `<button class="btn btn-outline-warning" title="Olvidar firma — permite re-firmar"
|
||||
onclick="_olvidarConsentimiento('${token}', ${nomJs.replace(/"/g,'"')})">
|
||||
<i class="fas fa-undo"></i>
|
||||
</button>` : '';
|
||||
|
||||
const motivoRow = (c.estado === 'cerrado_anticipado' && c.cierre_anticipado?.motivo)
|
||||
? `<div style="font-size:.75rem;color:#92400e;background:#fef3c7;border-radius:4px;padding:3px 8px;margin-top:3px;width:100%">
|
||||
<i class="fas fa-comment-alt me-1"></i>${escHtml(c.cierre_anticipado.motivo)}
|
||||
@@ -1644,13 +1650,27 @@ function renderConsentimientos(lista) {
|
||||
${progresoBadge}
|
||||
${countdownEl}
|
||||
<span class="c-badge">${label}</span>
|
||||
<div class="acciones-consent">${btnAccion}${btnVer}${btnQuitar}</div>
|
||||
<div class="acciones-consent">${btnAccion}${btnVer}${btnOlvidar}${btnQuitar}</div>
|
||||
</div>
|
||||
${motivoRow}
|
||||
</div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
// ── Olvidar (resetear) consentimiento ────────────────────────
|
||||
async function _olvidarConsentimiento(token, nombre) {
|
||||
if (!confirm(`¿Seguro que deseas descartar la firma de "${nombre}"?\nEl paciente podrá volver a firmarlo.`)) return;
|
||||
try {
|
||||
const r = await fetch(API + 'resetear_consentimiento.php', {
|
||||
method: 'POST', headers: {'Content-Type':'application/json'},
|
||||
body: JSON.stringify({ token })
|
||||
});
|
||||
const j = await r.json();
|
||||
if (!j.ok) { mostrarError(j.error || 'Error al resetear'); return; }
|
||||
cargarConsentimientos();
|
||||
} catch(e) { mostrarError(e.message); }
|
||||
}
|
||||
|
||||
// ── Quitar consentimiento ─────────────────────────────────────
|
||||
let _mqcConsentId = null;
|
||||
function _abrirModalQuitarConsent(consentId, formNombre) {
|
||||
|
||||
Reference in New Issue
Block a user