fix(encuesta): ocultar barra si paciente no tiene celular registrado
Si turnoActivo.paciente_cel está vacío, _ofrecerEncuesta retorna sin mostrar la barra, evitando el error de WA al intentar enviar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
90e3125e45
commit
a4ddc63b6f
@@ -1989,7 +1989,7 @@ async function finalizarAtencion() {
|
||||
if (hayPendientes) { mostrarError('Debe firmar todos los consentimientos antes de finalizar.'); return; }
|
||||
if (hayMuestrasPendientes) { mostrarError('Debe marcar cada muestra como recibida o pendiente antes de finalizar.'); return; }
|
||||
if (!confirm(`¿Finalizar atención del turno ${turnoActivo.codigo}?`)) return;
|
||||
const _t = { id: turnoActivo.id, paciente_nombre: turnoActivo.paciente_nombre };
|
||||
const _t = { id: turnoActivo.id, paciente_nombre: turnoActivo.paciente_nombre, paciente_cel: turnoActivo.paciente_cel };
|
||||
const ok = await cambiarEstadoTurno('finalizado');
|
||||
if (ok) _ofrecerEncuesta(_t);
|
||||
}
|
||||
@@ -2069,6 +2069,7 @@ async function cambiarEstadoTurno(nuevoEstado) {
|
||||
let _encuestaTurnoId = null, _encuestaTimer = null;
|
||||
|
||||
function _ofrecerEncuesta(turno) {
|
||||
if (!turno.paciente_cel) return;
|
||||
_encuestaTurnoId = turno.id;
|
||||
const bar = document.getElementById('bar-encuesta');
|
||||
document.getElementById('bar-encuesta-txt').textContent =
|
||||
|
||||
Reference in New Issue
Block a user