feat: CRUD de EPS + select en modal de paciente
- Tabla lab_eps creada y poblada con valores existentes de lab_pacientes - Módulo lab_eps: listado, crear, editar, activar/desactivar, eliminar - API /api/lab/eps.php: GET list, POST save/toggle/delete - Modal paciente en recepción: campo EPS cambiado de texto libre a select cargado desde lab_eps al iniciar la página Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
fb8fb9bc7a
commit
da2bfde38f
@@ -1000,7 +1000,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
<div class="row g-2">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control form-control-sm" id="mpac-eps" placeholder="EPS">
|
||||
<select class="form-select form-select-sm" id="mpac-eps">
|
||||
<option value="">— Sin EPS —</option>
|
||||
</select>
|
||||
<label>EPS</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2324,6 +2326,21 @@ function fmt(n) {
|
||||
|
||||
const BASE_URL_API_LAB = '<?= BASE_URL ?>/api/lab/';
|
||||
|
||||
// ── Cargar EPS una vez al inicio ─────────────────────────────
|
||||
(async function() {
|
||||
try {
|
||||
const r = await fetch(BASE_URL_API_LAB + 'eps.php?action=list&solo_activas=1');
|
||||
const j = await r.json();
|
||||
if (!j.ok) return;
|
||||
const sel = document.getElementById('mpac-eps');
|
||||
(j.eps || []).forEach(e => {
|
||||
const o = document.createElement('option');
|
||||
o.value = e.nombre; o.textContent = e.nombre;
|
||||
sel.appendChild(o);
|
||||
});
|
||||
} catch(_) {}
|
||||
})();
|
||||
|
||||
function escHtml(str) {
|
||||
const d = document.createElement('div');
|
||||
d.appendChild(document.createTextNode(String(str)));
|
||||
|
||||
Reference in New Issue
Block a user