From b20a537aedb953df62e818785886bde2c3d4789d Mon Sep 17 00:00:00 2001 From: marsalva Date: Sat, 14 Mar 2026 16:44:17 +0000 Subject: [PATCH] Actualizar proveedores.html --- proveedores.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/proveedores.html b/proveedores.html index 48aa143..88b76ba 100644 --- a/proveedores.html +++ b/proveedores.html @@ -749,13 +749,19 @@ } // --- CARGAR ESTADOS EN EL SELECTOR --- + filterStatusOptions(); // Ejecutamos el filtro inicial + const statusSelect = document.getElementById('impStatus'); - statusSelect.innerHTML = ''; - systemStatuses.forEach(st => { - statusSelect.innerHTML += ``; - }); - if (raw.status_operativo) statusSelect.value = raw.status_operativo; + + // Si el JSON traía un estado previo, intentamos fijarlo (solo si es válido en el filtro) + if (raw.status_operativo && Array.from(statusSelect.options).some(opt => opt.value === String(raw.status_operativo))) { + statusSelect.value = raw.status_operativo; + } + // Añadimos un "chivato" para que si eligen a un operario a mano, se desbloqueen los estados al instante + const opSelect = document.getElementById('impOperator'); + opSelect.removeEventListener('change', filterStatusOptions); // Limpiar previo por si acaso + opSelect.addEventListener('change', filterStatusOptions); // --- ADAPTACIÓN VISUAL PARA ARCHIVADOS (VISTA BREVE) --- // Obtenemos los contenedores que queremos ocultar cuando esté archivado const guildOperatorSection = document.getElementById('impGuild').closest('.grid'); // El bloque azul de gremio/operario