feat: arquitectura multi-escuela con panel de gestion developer y SINPE dinamico
This commit is contained in:
+96
-1
@@ -184,6 +184,10 @@
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
|
||||
<span>Diagnóstico del Sistema & BD</span>
|
||||
</button>
|
||||
<button class="dev-tab-btn" id="btnDevTabEscuelas" onclick="switchDevTab('escuelas')" style="display: inline-flex; align-items: center; gap: 8px;">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21h18"/><path d="M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16"/><path d="M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4"/><line x1="9" y1="9" x2="9" y2="9.01"/><line x1="15" y1="9" x2="15" y2="9.01"/></svg>
|
||||
<span>Escuelas & Sedes</span>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<!-- 1. PESTAÑA: USUARIOS Y ADMINISTRADORES -->
|
||||
@@ -367,6 +371,30 @@
|
||||
<!-- Inyectado dinámicamente -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 4. PESTAÑA: ESCUELAS & SEDES (MULTI-TENANT) -->
|
||||
<div id="devTabContentEscuelas" class="dev-tab-content" style="display: none;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px;">
|
||||
<div>
|
||||
<h3 style="margin: 0; font-size: 1.18rem; font-weight: 900; color: var(--text-main);">Gestión de Escuelas & Sedes Multi-Tenant</h3>
|
||||
<p style="margin: 4px 0 0 0; font-size: 0.85rem; color: var(--text-muted);">Cada centro educativo opera de forma autónoma con su propio catálogo, SINPE Móvil, estudiantes y personal.</p>
|
||||
</div>
|
||||
<button onclick="openModalDevEscuela()" class="dev-action-btn dev-action-btn-primary" style="padding: 10px 18px; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 8px;">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||||
<span>+ Dar de Alta Nueva Escuela</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Resumen global de sedes -->
|
||||
<div id="devEscuelasSummaryStrip" style="display: flex; gap: 12px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 4px;">
|
||||
<!-- Inyectado dinámicamente -->
|
||||
</div>
|
||||
|
||||
<!-- Grid de Tarjetas de Escuelas -->
|
||||
<div id="devEscuelasGrid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px;">
|
||||
<!-- Inyectado dinámicamente -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PANEL DE ADMINISTRACIÓN DE LA SODA (#viewAdmin) -->
|
||||
@@ -781,7 +809,12 @@
|
||||
</div>
|
||||
<div>
|
||||
<strong style="color: #166534; font-size: 1rem; display: block;">Recarga por SINPE Móvil</strong>
|
||||
<p style="font-size: 0.74rem; color: #15803d; margin: 0;">Número Soda: <strong>8888-SODA (7632)</strong></p>
|
||||
<p style="font-size: 0.74rem; color: #15803d; margin: 0;">
|
||||
<span id="parentSinpeEscuelaNombre" style="font-weight: 800;">Soda Escolar</span> · Tel: <strong id="parentSinpeNumero">8888-8888</strong>
|
||||
</p>
|
||||
<p style="font-size: 0.70rem; color: #166534; margin: 2px 0 0 0;">
|
||||
Titular: <span id="parentSinpeTitular" style="font-weight: 700;">Soda Central</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span style="font-size: 0.7rem; color: #166534; background: #dcfce7; font-weight: 800; padding: 3px 8px; border-radius: 6px;">Inmediato</span>
|
||||
@@ -1897,6 +1930,68 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MODAL: CREAR NUEVA ESCUELA / SEDE MULTI-TENANT (DEVELOPER) -->
|
||||
<div class="modal-qr-backdrop" id="modalDevEscuela" style="display: none;" onclick="closeModalDevEscuela(event)">
|
||||
<div class="modal-qr-card" onclick="event.stopPropagation()" style="max-width: 540px; text-align: left; padding: 24px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--border); padding-bottom: 12px; margin-bottom: 16px;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 38px; height: 38px; border-radius: 10px; background: rgba(139, 92, 246, 0.12); color: #8b5cf6; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21h18"/><path d="M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16"/><path d="M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4"/><line x1="9" y1="9" x2="9" y2="9.01"/><line x1="15" y1="9" x2="15" y2="9.01"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin: 0; font-size: 1.18rem; font-weight: 900; color: var(--text-main);">Alta de Nueva Sede Escolar</h3>
|
||||
<span style="font-size: 0.76rem; color: #8b5cf6; font-weight: 700;">Multi-Tenant & Soda Independiente</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" onclick="closeModalDevEscuela()" style="background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); padding: 4px;">✕</button>
|
||||
</div>
|
||||
|
||||
<form id="formDevEscuela" onsubmit="guardarDevEscuela(event)">
|
||||
<div style="display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 14px;">
|
||||
<div>
|
||||
<label style="font-size: 0.8rem; font-weight: 800; color: var(--text-main); display: block; margin-bottom: 4px;">Código Único: *</label>
|
||||
<input type="text" id="devEscuelaCodigo" required maxlength="8" placeholder="Ej: SJT" style="width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 800; text-transform: uppercase; box-sizing: border-box;" oninput="this.value = this.value.toUpperCase().replace(/[^A-Z0-9]/g, '')">
|
||||
<span style="font-size: 0.68rem; color: var(--text-muted); display: block; margin-top: 2px;">Prefijo para carnés</span>
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.8rem; font-weight: 800; color: var(--text-main); display: block; margin-bottom: 4px;">Nombre del Centro Educativo: *</label>
|
||||
<input type="text" id="devEscuelaNombre" required placeholder="Ej: Saint Joseph School" style="width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 700; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;">
|
||||
<div>
|
||||
<label style="font-size: 0.8rem; font-weight: 800; color: var(--text-main); display: block; margin-bottom: 4px;">Teléfono SINPE Móvil: *</label>
|
||||
<input type="tel" id="devEscuelaSinpe" required placeholder="Ej: 8888-1234" style="width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 700; box-sizing: border-box;">
|
||||
<span style="font-size: 0.68rem; color: var(--text-muted); display: block; margin-top: 2px;">Para recargas de los padres</span>
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.8rem; font-weight: 800; color: var(--text-main); display: block; margin-bottom: 4px;">Titular SINPE Móvil:</label>
|
||||
<input type="text" id="devEscuelaSinpeNombre" placeholder="Ej: Soda Saint Joseph" style="width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 700; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 16px;">
|
||||
<label style="font-size: 0.8rem; font-weight: 800; color: var(--text-main); display: block; margin-bottom: 4px;">Concesionario / Responsable Legal:</label>
|
||||
<input type="text" id="devEscuelaConcesionario" placeholder="Ej: Servicios Alimentarios Gómez S.A." style="width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 700; box-sizing: border-box;">
|
||||
</div>
|
||||
|
||||
<div style="background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.25); border-radius: 12px; padding: 12px; margin-bottom: 18px; font-size: 0.78rem; color: var(--text-main); line-height: 1.45;">
|
||||
⚡ <strong>Automatización Instantánea:</strong> Al registrar la sede, el sistema clonará de forma automática el menú base de productos saludables MEP y creará sus credenciales operativas (<code>cajero_codigo</code> y <code>admin_codigo</code>, clave temporal <code>123456</code>).
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; gap: 10px; border-top: 1.5px solid var(--border); padding-top: 14px;">
|
||||
<button type="button" onclick="closeModalDevEscuela()" style="padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 800; font-size: 0.85rem; cursor: pointer;">
|
||||
Cancelar
|
||||
</button>
|
||||
<button type="submit" id="btnDevSubmitEscuela" class="dev-action-btn dev-action-btn-primary" style="padding: 10px 22px; font-size: 0.9rem; display: flex; align-items: center; gap: 6px;">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg> Dar de Alta Escuela
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- BARRA DE NAVEGACIÓN INFERIOR PWA (MÓVILES) -->
|
||||
<nav class="pwa-bottom-nav" id="pwaBottomNav" style="display: none;">
|
||||
<button class="pwa-nav-item active" id="pwaNavMenu" onclick="pwaNavigateTo('menu')">
|
||||
|
||||
Reference in New Issue
Block a user