Actualizar servicios2.html

This commit is contained in:
2026-03-22 13:36:22 +00:00
parent bf881519d7
commit 89bcece3aa

View File

@@ -68,7 +68,7 @@
<div class="flex flex-wrap gap-4 items-center mt-2"> <div class="flex flex-wrap gap-4 items-center mt-2">
<div class="relative flex-1 min-w-[250px] max-w-md"> <div class="relative flex-1 min-w-[250px] max-w-md">
<i data-lucide="search" class="w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"></i> <i data-lucide="search" class="w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"></i>
<input type="text" id="searchFilter" oninput="renderLists()" placeholder="Buscar por cliente, REF, población, teléfono..." class="w-full pl-11 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-xl text-xs font-bold focus:ring-2 focus:ring-blue-500 outline-none transition-all"> <input type="text" id="searchFilter" oninput="renderLists()" placeholder="Buscar cliente, REF, dirección, avería..." class="w-full pl-11 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-xl text-xs font-bold focus:ring-2 focus:ring-blue-500 outline-none transition-all">
</div> </div>
<div class="relative w-full md:w-48"> <div class="relative w-full md:w-48">
<select id="opFilter" onchange="renderLists()" class="w-full bg-slate-50 border border-slate-200 text-xs font-black px-4 py-3 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 uppercase tracking-widest text-slate-600 appearance-none pr-10 cursor-pointer"> <select id="opFilter" onchange="renderLists()" class="w-full bg-slate-50 border border-slate-200 text-xs font-black px-4 py-3 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 uppercase tracking-widest text-slate-600 appearance-none pr-10 cursor-pointer">
@@ -674,12 +674,19 @@
else if (!isWorking) { kpiPendingStart++; category = 'pending_start'; } else if (!isWorking) { kpiPendingStart++; category = 'pending_start'; }
else { kpiWorking++; category = 'working'; } else { kpiWorking++; category = 'working'; }
const name = (raw["Nombre Cliente"] || raw["CLIENTE"] || "").toLowerCase(); // Juntamos todos los campos clave en un "super string" para que el buscador lo encuentre TODO
const ref = (s.service_ref || "").toLowerCase(); const searchString = `
const phone = (raw["Teléfono"] || "").toLowerCase(); ${s.service_ref || ""}
const pop = (raw["Población"] || "").toLowerCase(); ${raw["Nombre Cliente"] || raw["CLIENTE"] || ""}
${raw["Dirección"] || raw["DOMICILIO"] || ""}
const matchesSearch = searchTerm === "" || name.includes(searchTerm) || ref.includes(searchTerm) || phone.includes(searchTerm) || pop.includes(searchTerm); ${raw["Población"] || raw["POBLACION-PROVINCIA"] || ""}
${raw["Código Postal"] || raw["C.P."] || ""}
${raw["Teléfono"] || raw["TELEFONOS"] || raw["TELEFONO"] || ""}
${raw["Descripción"] || raw["DESCRIPCION"] || raw["Averia"] || ""}
${raw["Compañía"] || raw["Procedencia"] || ""}
`.toLowerCase();
const matchesSearch = searchTerm === "" || searchString.includes(searchTerm);
const matchesOp = selectedOp === "ALL" || s.assigned_name === selectedOp; const matchesOp = selectedOp === "ALL" || s.assigned_name === selectedOp;
let matchesWeek = true; let matchesWeek = true;