diff --git a/automatizaciones.html b/automatizaciones.html index b790663..4d69fb7 100644 --- a/automatizaciones.html +++ b/automatizaciones.html @@ -39,8 +39,8 @@ -
-
+
+
@@ -61,6 +61,21 @@
+
+
+ Activos: + 0 +
+
+ Archivados: + 0 +
+
+ Total: + 0 +
+
+
@@ -73,7 +88,7 @@
-
+

Validación de Expediente

@@ -99,15 +114,15 @@
-
-
+
+
Asegurado
-
+
Teléfono @@ -116,7 +131,7 @@
- +
@@ -127,13 +142,13 @@
-
-
@@ -141,25 +156,25 @@
- +
- +
- +
@@ -242,6 +257,13 @@ compSelect.innerHTML = ''; uniqueCompanies.forEach(c => compSelect.innerHTML += ``); + // ACTUALIZAR ESTADÍSTICAS + const active = scrapedData.filter(s => s.status === 'pending').length; + const archived = scrapedData.filter(s => s.status === 'archived').length; + document.getElementById('countActive').innerText = active; + document.getElementById('countArchived').innerText = archived; + document.getElementById('countTotal').innerText = scrapedData.length; + renderFilteredInbox(); } catch (e) { showToast("Error de conexión", true); } } @@ -251,7 +273,7 @@ const search = document.getElementById('searchBox').value.toUpperCase(); const provider = document.getElementById('filterProvider').value; const company = document.getElementById('filterCompany').value; - const status = document.getElementById('filterStatus').value; // NUEVO FILTRO + const status = document.getElementById('filterStatus').value; const filtered = scrapedData.filter(svc => { const raw = svc.raw_data || {}; @@ -264,14 +286,14 @@ const matchesSearch = name.includes(search) || ref.includes(search) || addr.includes(search) || phone.includes(search); const matchesProvider = provider === 'ALL' || svc.provider === provider; const matchesCompany = company === 'ALL' || comp === company; - const matchesStatus = status === 'ALL' || svc.status === status; // + const matchesStatus = status === 'ALL' || svc.status === status; return matchesSearch && matchesProvider && matchesCompany && matchesStatus; }); container.innerHTML = ""; if(filtered.length === 0) { - container.innerHTML = '
No se encontraron expedientes con estos filtros.
'; + container.innerHTML = '
No se encontraron expedientes con estos filtros.
'; return; } @@ -305,29 +327,28 @@ ${svc.provider === 'multiasistencia' ? 'MULTI' : 'HOME'}
-
+
-

${name}

- ${statusLabel} +

${name}

+ ${statusLabel}
-

${fullAddr}

-
- #${svc.service_ref} - ${guildName ? `${guildName}` : ''} - ${opName ? `${opName}` : ''} +

${fullAddr}

+
+ #${svc.service_ref} + ${guildName ? `${guildName}` : ''} + ${opName ? `${opName}` : ''}
${!isArchived ? ` - -
` : ''} + ` : ''}
`; container.appendChild(card); }); @@ -444,7 +465,7 @@ function showToast(msg, isError = false) { const t = document.getElementById('toast'), m = document.getElementById('toastMsg'); - t.className = `fixed bottom-8 right-8 px-8 py-4 rounded-2xl shadow-2xl z-[200] flex items-center gap-3 transition-all ${isError ? 'bg-red-600' : 'bg-slate-900'} text-white`; + t.className = `fixed bottom-8 right-8 px-8 py-4 rounded-2xl shadow-2xl z-[200] flex items-center gap-3 transition-all ${isError ? 'bg-red-600' : 'bg-slate-900'} text-white text-left`; m.innerText = msg; t.classList.remove('hidden'); setTimeout(() => t.classList.add('hidden'), 4000); }