Update lugar.php
This commit is contained in:
@@ -393,7 +393,7 @@ async function cargarCola() {
|
||||
const res = await fetch(`${API}get_cola.php?area=lugar&lugar_id=${lugarId}`);
|
||||
const json = await res.json();
|
||||
if (!json.ok) return;
|
||||
renderCola(json.data);
|
||||
renderCola(json);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
@@ -433,11 +433,11 @@ async function llamarSiguiente() {
|
||||
const json = await res.json();
|
||||
if (!json.ok) { alert('Error: ' + json.error); return; }
|
||||
|
||||
if (!json.data.turno) {
|
||||
if (!json.turno) {
|
||||
alert('Cola del lugar vacía.');
|
||||
return;
|
||||
}
|
||||
await abrirFicha(json.data.turno);
|
||||
await abrirFicha(json.turno);
|
||||
cargarCola();
|
||||
} catch (err) {
|
||||
alert('Error: ' + err.message);
|
||||
@@ -481,10 +481,10 @@ async function cargarFichaSolicitud(turnoId) {
|
||||
const json = await res.json();
|
||||
if (!json.ok) return;
|
||||
|
||||
const sol = json.data.solicitud;
|
||||
const pac = json.data.paciente;
|
||||
const exams = json.data.examenes || [];
|
||||
const consts = json.data.consentimientos || [];
|
||||
const sol = json.solicitud;
|
||||
const pac = json.paciente;
|
||||
const exams = json.examenes || [];
|
||||
const consts = json.consentimientos || [];
|
||||
|
||||
// Datos del paciente
|
||||
if (pac) {
|
||||
@@ -580,7 +580,7 @@ async function actualizarConsentimientos(turnoId) {
|
||||
const res = await fetch(`${API}get_consentimientos.php?turno_id=${turnoId}`);
|
||||
const json = await res.json();
|
||||
if (!json.ok) return;
|
||||
renderConsentimientos(json.data.consentimientos || []);
|
||||
renderConsentimientos(json.consentimientos || []);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ async function iniciarAtencion() {
|
||||
btn.disabled = hayPendientes;
|
||||
return;
|
||||
}
|
||||
turnoActivo = json.data.turno;
|
||||
turnoActivo = json.turno;
|
||||
actualizarEstadoBadge('en_servicio');
|
||||
|
||||
// Mostrar "Finalizar" y "Regresar", ocultar "Iniciar"
|
||||
|
||||
Reference in New Issue
Block a user