Actualizar proveedores.html
This commit is contained in:
@@ -749,13 +749,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- CARGAR ESTADOS EN EL SELECTOR ---
|
// --- CARGAR ESTADOS EN EL SELECTOR ---
|
||||||
const statusSelect = document.getElementById('impStatus');
|
filterStatusOptions(); // Ejecutamos el filtro inicial
|
||||||
statusSelect.innerHTML = '<option value="">(Sin Estado)</option>';
|
|
||||||
systemStatuses.forEach(st => {
|
|
||||||
statusSelect.innerHTML += `<option value="${st.id}">${st.name.toUpperCase()}</option>`;
|
|
||||||
});
|
|
||||||
if (raw.status_operativo) statusSelect.value = raw.status_operativo;
|
|
||||||
|
|
||||||
|
const statusSelect = document.getElementById('impStatus');
|
||||||
|
|
||||||
|
// 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) ---
|
// --- ADAPTACIÓN VISUAL PARA ARCHIVADOS (VISTA BREVE) ---
|
||||||
// Obtenemos los contenedores que queremos ocultar cuando esté archivado
|
// Obtenemos los contenedores que queremos ocultar cuando esté archivado
|
||||||
const guildOperatorSection = document.getElementById('impGuild').closest('.grid'); // El bloque azul de gremio/operario
|
const guildOperatorSection = document.getElementById('impGuild').closest('.grid'); // El bloque azul de gremio/operario
|
||||||
|
|||||||
Reference in New Issue
Block a user