Actualizar calendario.html
This commit is contained in:
121
calendario.html
121
calendario.html
@@ -7,7 +7,7 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="https://unpkg.com/lucide@latest"></script>
|
||||
<style>
|
||||
body { background-color: #f4f7f9; -webkit-tap-highlight-color: transparent; }
|
||||
body { background-color: #f8fafc; -webkit-tap-highlight-color: transparent; }
|
||||
.fade-in { animation: fadeIn 0.3s ease-out forwards; }
|
||||
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
||||
.no-scrollbar::-webkit-scrollbar { display: none; }
|
||||
@@ -15,24 +15,27 @@
|
||||
|
||||
.main-content { padding-bottom: 120px; }
|
||||
.day-card { transition: all 0.2s; }
|
||||
.day-active { background-color: #2563eb; color: white; border-color: #2563eb; transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(37,99,235,0.4); }
|
||||
.day-active { background-color: #1e3a8a; color: white; border-color: #1e3a8a; transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(30,58,138,0.3); }
|
||||
.day-inactive { background-color: white; color: #64748b; border-color: #e2e8f0; }
|
||||
|
||||
/* Arreglo del Scroll del Modal */
|
||||
#serviceModal { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; background: #f8fafc; }
|
||||
/* Scroll del Modal */
|
||||
#serviceModal { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; background: #f1f5f9; }
|
||||
.modal-scroll-area { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 100px; }
|
||||
|
||||
/* Caja de descripción sobria */
|
||||
.desc-box { background: white; border: 1px solid #e2e8f0; border-radius: 1.5rem; padding: 1.25rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="text-slate-800 font-sans antialiased h-screen flex flex-col overflow-hidden relative">
|
||||
|
||||
<header class="bg-white px-5 pt-safe mt-6 pb-4 shadow-sm z-20 shrink-0 border-b border-slate-100">
|
||||
<header class="bg-white px-5 pt-safe mt-6 pb-4 shadow-sm z-20 shrink-0 border-b border-slate-200">
|
||||
<div class="flex items-center gap-3 mb-4">
|
||||
<a href="menu.html" class="w-10 h-10 shrink-0 bg-slate-50 rounded-full flex items-center justify-center text-slate-600 border border-slate-200 active:scale-95 transition-transform">
|
||||
<i data-lucide="arrow-left" class="w-5 h-5"></i>
|
||||
</a>
|
||||
<div class="flex-1 min-w-0">
|
||||
<p class="text-[10px] font-black text-blue-500 uppercase tracking-widest mb-0.5 truncate" id="monthYearDisplay">Cargando...</p>
|
||||
<h1 class="text-xl font-black tracking-tight text-slate-800 leading-none truncate">Mi Agenda</h1>
|
||||
<p class="text-[10px] font-black text-blue-800 uppercase tracking-widest mb-0.5 truncate" id="monthYearDisplay">Cargando...</p>
|
||||
<h1 class="text-xl font-black tracking-tight text-slate-900 leading-none truncate">Mi Agenda</h1>
|
||||
</div>
|
||||
<div class="flex gap-1 shrink-0">
|
||||
<button onclick="changeWeek(-1)" class="w-10 h-10 bg-white rounded-full flex items-center justify-center text-slate-600 border border-slate-200 active:bg-slate-50 shadow-sm"><i data-lucide="chevron-left" class="w-5 h-5"></i></button>
|
||||
@@ -44,20 +47,20 @@
|
||||
|
||||
<main class="flex-1 overflow-y-auto no-scrollbar p-5 main-content relative z-10" id="mainArea">
|
||||
<div id="loader" class="text-center py-10 opacity-50">
|
||||
<i data-lucide="loader-2" class="w-8 h-8 animate-spin mx-auto text-blue-500 mb-2"></i>
|
||||
<p class="text-xs font-bold uppercase tracking-widest">Cargando datos...</p>
|
||||
<i data-lucide="loader-2" class="w-8 h-8 animate-spin mx-auto text-blue-900 mb-2"></i>
|
||||
<p class="text-xs font-bold uppercase tracking-widest text-slate-400">Consultando Base de Datos...</p>
|
||||
</div>
|
||||
<div id="dayTitle" class="font-black text-slate-400 uppercase tracking-widest text-[10px] mb-4 hidden">Servicios</div>
|
||||
<div id="servicesList" class="space-y-4 hidden fade-in"></div>
|
||||
</main>
|
||||
|
||||
<nav class="bg-white/90 backdrop-blur-md border-t border-slate-200 z-20 absolute bottom-0 left-0 w-full shadow-[0_-10px_30px_rgba(0,0,0,0.05)] rounded-t-[2rem]">
|
||||
<nav class="bg-white/95 backdrop-blur-md border-t border-slate-200 z-20 absolute bottom-0 left-0 w-full rounded-t-[2rem] shadow-[0_-10px_30px_rgba(0,0,0,0.03)]">
|
||||
<div class="flex justify-around items-center px-3 pt-3 pb-8">
|
||||
<a href="menu.html" class="flex flex-col items-center p-2 text-slate-400 hover:text-blue-600 w-20">
|
||||
<a href="menu.html" class="flex flex-col items-center p-2 text-slate-400 hover:text-blue-900 w-20">
|
||||
<i data-lucide="layout-grid" class="w-6 h-6 mb-1"></i>
|
||||
<span class="text-[9px] font-black uppercase tracking-widest">Inicio</span>
|
||||
</a>
|
||||
<a href="calendario.html" class="flex flex-col items-center p-2 text-blue-600 w-20">
|
||||
<a href="calendario.html" class="flex flex-col items-center p-2 text-blue-900 w-20">
|
||||
<i data-lucide="calendar-days" class="w-6 h-6 mb-1"></i>
|
||||
<span class="text-[9px] font-black uppercase tracking-widest">Agenda</span>
|
||||
</a>
|
||||
@@ -69,11 +72,11 @@
|
||||
</nav>
|
||||
|
||||
<div id="serviceModal" class="translate-y-full transition-transform duration-300">
|
||||
<div class="pt-safe bg-white border-b border-slate-100 flex justify-between items-center p-4 shrink-0 shadow-sm">
|
||||
<div class="pt-safe bg-white border-b border-slate-200 flex justify-between items-center p-4 shrink-0 shadow-sm">
|
||||
<button onclick="closeModal()" class="bg-slate-100 p-2.5 rounded-full text-slate-600 active:scale-90 transition-transform"><i data-lucide="chevron-down" class="w-6 h-6"></i></button>
|
||||
<div class="flex items-center gap-2 bg-blue-50 px-4 py-1.5 rounded-full border border-blue-100">
|
||||
<i data-lucide="clock" class="w-4 h-4 text-blue-600"></i>
|
||||
<span class="font-black text-xs text-blue-700 uppercase" id="modTime">--:--</span>
|
||||
<div class="flex items-center gap-2 bg-slate-900 px-4 py-1.5 rounded-full">
|
||||
<i data-lucide="clock" class="w-4 h-4 text-blue-300"></i>
|
||||
<span class="font-black text-xs text-white uppercase" id="modTime">--:--</span>
|
||||
</div>
|
||||
<div class="w-10"></div>
|
||||
</div>
|
||||
@@ -82,61 +85,60 @@
|
||||
<input type="hidden" id="detId">
|
||||
<input type="hidden" id="detPhoneRaw">
|
||||
|
||||
<div id="urgentBanner" class="hidden bg-rose-600 text-white p-4 rounded-3xl flex items-center justify-center gap-3 shadow-xl shadow-rose-200 animate-pulse">
|
||||
<i data-lucide="alert-octagon" class="w-6 h-6"></i>
|
||||
<span class="font-black text-sm uppercase tracking-widest">¡SERVICIO URGENTE!</span>
|
||||
<div id="urgentBanner" class="hidden bg-blue-900 text-white p-4 rounded-3xl flex items-center justify-center gap-3 shadow-lg border-b-4 border-blue-700">
|
||||
<i data-lucide="alert-circle" class="w-6 h-6 text-blue-400"></i>
|
||||
<span class="font-black text-sm uppercase tracking-widest">Prioridad Máxima</span>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<button onclick="quickUpdate('camino')" class="bg-indigo-600 text-white font-black p-5 rounded-3xl flex flex-col items-center gap-2 shadow-lg shadow-indigo-200 active:scale-95 transition-transform">
|
||||
<i data-lucide="car" class="w-8 h-8"></i>
|
||||
<button onclick="quickUpdate('camino')" class="bg-white border border-slate-200 text-blue-900 font-black p-5 rounded-3xl flex flex-col items-center gap-2 shadow-sm active:bg-slate-50 transition-all">
|
||||
<i data-lucide="car" class="w-8 h-8 text-blue-800"></i>
|
||||
<span class="text-[10px] uppercase tracking-widest">De Camino</span>
|
||||
</button>
|
||||
<button onclick="quickUpdate('trabajando')" class="bg-amber-500 text-white font-black p-5 rounded-3xl flex flex-col items-center gap-2 shadow-lg shadow-amber-200 active:scale-95 transition-transform">
|
||||
<i data-lucide="wrench" class="w-8 h-8"></i>
|
||||
<button onclick="quickUpdate('trabajando')" class="bg-white border border-slate-200 text-blue-900 font-black p-5 rounded-3xl flex flex-col items-center gap-2 shadow-sm active:bg-slate-50 transition-all">
|
||||
<i data-lucide="wrench" class="w-8 h-8 text-blue-800"></i>
|
||||
<span class="text-[10px] uppercase tracking-widest">He Llegado</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-6 rounded-[2.5rem] shadow-sm border border-slate-200">
|
||||
<div class="flex justify-between items-start mb-1">
|
||||
<p class="text-[9px] font-black text-blue-600 uppercase tracking-widest" id="detCompany">Compañía</p>
|
||||
<p class="text-[9px] font-black text-blue-800 uppercase tracking-widest" id="detCompany">Compañía</p>
|
||||
<span id="detRef" class="text-[9px] font-black text-slate-400 uppercase"></span>
|
||||
</div>
|
||||
<h2 id="detName" class="text-2xl font-black text-slate-900 uppercase leading-none mb-6">Nombre Cliente</h2>
|
||||
|
||||
<button onclick="callClient()" class="w-full bg-blue-600 text-white font-black py-4 rounded-2xl shadow-xl shadow-blue-200 flex items-center justify-center gap-3 uppercase text-sm tracking-widest active:scale-95 transition-all">
|
||||
<i data-lucide="phone" class="w-5 h-5 fill-current"></i> Llamar al Cliente
|
||||
<button onclick="callClient()" class="w-full bg-blue-900 text-white font-black py-4 rounded-2xl shadow-xl flex items-center justify-center gap-3 uppercase text-sm tracking-widest active:scale-95 transition-all">
|
||||
<i data-lucide="phone" class="w-5 h-5 fill-current text-blue-400"></i> Llamar al Cliente
|
||||
</button>
|
||||
<button onclick="openWhatsApp()" class="w-full mt-3 bg-emerald-50 text-emerald-700 font-black py-3 rounded-2xl border border-emerald-100 flex items-center justify-center gap-2 text-xs uppercase tracking-widest active:scale-95 transition-all">
|
||||
<i data-lucide="message-circle" class="w-4 h-4"></i> Abrir WhatsApp
|
||||
<button onclick="openWhatsApp()" class="w-full mt-3 bg-slate-50 text-slate-700 font-black py-3 rounded-2xl border border-slate-200 flex items-center justify-center gap-2 text-xs uppercase tracking-widest active:scale-95">
|
||||
<i data-lucide="message-circle" class="w-4 h-4 text-emerald-500"></i> WhatsApp
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="bg-slate-900 text-white p-6 rounded-[2.5rem] shadow-2xl relative overflow-hidden">
|
||||
<i data-lucide="map" class="absolute -right-6 -bottom-6 w-40 h-40 text-white/5 pointer-events-none"></i>
|
||||
<div class="bg-white p-6 rounded-[2.5rem] shadow-sm border border-slate-200 relative overflow-hidden">
|
||||
<p class="text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2">Ubicación</p>
|
||||
<p id="detAddress" class="text-base font-bold uppercase leading-tight mb-6">Dirección Completa...</p>
|
||||
<p id="detAddress" class="text-base font-bold text-slate-900 uppercase leading-tight mb-6"></p>
|
||||
|
||||
<div class="flex items-center justify-between bg-white/10 p-4 rounded-2xl backdrop-blur-md">
|
||||
<div id="gpsLoading" class="text-xs font-bold text-slate-300 flex items-center gap-2"><i data-lucide="loader-2" class="w-3 h-3 animate-spin"></i> Calculando...</div>
|
||||
<div id="gpsResult" class="hidden flex gap-4">
|
||||
<div class="flex items-center justify-between bg-slate-50 p-4 rounded-2xl border border-slate-100">
|
||||
<div id="gpsLoading" class="text-xs font-bold text-slate-400 flex items-center gap-2"><i data-lucide="loader-2" class="w-3 h-3 animate-spin"></i> GPS...</div>
|
||||
<div id="gpsResult" class="hidden flex gap-4 text-slate-900">
|
||||
<div class="text-center"><p class="text-xl font-black leading-none" id="gpsMins">--</p><p class="text-[8px] font-bold text-slate-400 uppercase">min</p></div>
|
||||
<div class="w-px h-6 bg-white/20"></div>
|
||||
<div class="w-px h-6 bg-slate-200"></div>
|
||||
<div class="text-center"><p class="text-xl font-black leading-none" id="gpsKm">--</p><p class="text-[8px] font-bold text-slate-400 uppercase">km</p></div>
|
||||
</div>
|
||||
<button onclick="openMaps()" class="bg-white text-slate-900 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest shadow-lg active:scale-90 transition-transform">Ver Mapa</button>
|
||||
<button onclick="openMaps()" class="bg-blue-900 text-white px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest shadow-md active:scale-90 transition-transform">Ver Mapa</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-amber-50 border border-amber-200 p-6 rounded-[2.5rem]">
|
||||
<p class="text-[10px] font-black text-amber-700 uppercase tracking-widest mb-3 flex items-center gap-2"><i data-lucide="file-text" class="w-4 h-4"></i> Notas del Servicio</p>
|
||||
<div id="detDesc" class="text-sm font-bold text-slate-700 leading-relaxed max-h-60 overflow-y-auto no-scrollbar">--</div>
|
||||
<div class="desc-box">
|
||||
<p class="text-[10px] font-black text-blue-900 uppercase tracking-widest mb-3 flex items-center gap-2"><i data-lucide="file-text" class="w-4 h-4"></i> Descripción Técnica</p>
|
||||
<div id="detDesc" class="text-sm font-bold text-slate-600 leading-relaxed max-h-60 overflow-y-auto no-scrollbar">--</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-slate-50 border border-slate-200 rounded-3xl overflow-hidden">
|
||||
<button onclick="document.getElementById('extraDataBox').classList.toggle('hidden')" class="w-full p-4 flex justify-between items-center text-[10px] font-black text-slate-500 uppercase tracking-widest">
|
||||
<span>Ficha Completa de la Compañía</span>
|
||||
<div class="bg-white border border-slate-200 rounded-3xl overflow-hidden shadow-sm">
|
||||
<button onclick="document.getElementById('extraDataBox').classList.toggle('hidden')" class="w-full p-4 flex justify-between items-center text-[10px] font-black text-slate-500 uppercase tracking-widest bg-slate-50">
|
||||
<span>Ficha técnica completa</span>
|
||||
<i data-lucide="chevron-right" class="w-4 h-4"></i>
|
||||
</button>
|
||||
<div id="extraDataBox" class="hidden p-5 space-y-3 bg-white border-t border-slate-100" id="detExtraInfo">
|
||||
@@ -144,10 +146,10 @@
|
||||
</div>
|
||||
|
||||
<div class="pt-4">
|
||||
<button onclick="quickUpdate('finalizado')" class="w-full bg-emerald-500 text-white font-black py-5 rounded-[2rem] shadow-xl shadow-emerald-100 flex items-center justify-center gap-3 uppercase text-sm tracking-widest active:scale-95 transition-all">
|
||||
<i data-lucide="check-circle" class="w-6 h-6"></i> Finalizar y Cerrar
|
||||
<button onclick="quickUpdate('finalizado')" class="w-full bg-emerald-600 text-white font-black py-5 rounded-[2rem] shadow-xl flex items-center justify-center gap-3 uppercase text-sm tracking-widest active:scale-95 transition-all">
|
||||
<i data-lucide="check-circle" class="w-6 h-6"></i> Finalizar Trabajo
|
||||
</button>
|
||||
<p class="text-center text-[9px] font-bold text-slate-400 mt-4 uppercase tracking-widest">IntegraRepara Mobile v2.0</p>
|
||||
<p class="text-center text-[9px] font-bold text-slate-400 mt-6 uppercase tracking-widest">IntegraRepara Mobile</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -229,7 +231,7 @@
|
||||
<button onclick="selectDate('${isoDate}')" class="day-card ${isSelected ? 'day-active' : 'day-inactive'} border min-w-[4.2rem] rounded-2xl p-4 flex flex-col items-center justify-center shrink-0">
|
||||
<span class="text-[9px] font-black uppercase opacity-70">${dayName}</span>
|
||||
<span class="text-xl font-black mt-1">${dayNum}</span>
|
||||
<div class="mt-2 w-full flex justify-center h-1.5"><span id="badge-${isoDate}" class="bg-rose-500 w-1.5 h-1.5 rounded-full hidden"></span></div>
|
||||
<div class="mt-2 w-full flex justify-center h-1.5"><span id="badge-${isoDate}" class="bg-blue-400 w-1.5 h-1.5 rounded-full hidden"></span></div>
|
||||
</button>`;
|
||||
}
|
||||
updateBadges();
|
||||
@@ -309,7 +311,7 @@
|
||||
const raw = s.raw_data || {};
|
||||
const time = raw.scheduled_time || "--:--";
|
||||
if (s.provider === 'SYSTEM_BLOCK') {
|
||||
return `<div class="bg-rose-50/80 p-5 rounded-3xl border border-rose-100 flex gap-4"><div class="flex flex-col items-center justify-center border-r border-rose-200 pr-4 shrink-0"><i data-lucide="lock" class="w-5 h-5 text-rose-500"></i><span class="font-black text-rose-800 text-sm mt-1">${time}</span></div><div class="min-w-0 flex-1"><h3 class="font-black text-rose-800 text-sm uppercase">BLOQUEADO</h3><p class="text-[10px] font-bold text-rose-400 mt-1 uppercase">${raw["Descripción"] || ""}</p></div></div>`;
|
||||
return `<div class="bg-blue-50/50 p-5 rounded-3xl border border-slate-200 flex gap-4"><div class="flex flex-col items-center justify-center border-r border-slate-200 pr-4 shrink-0"><i data-lucide="lock" class="w-5 h-5 text-blue-900"></i><span class="font-black text-blue-900 text-sm mt-1">${time}</span></div><div class="min-w-0 flex-1"><h3 class="font-black text-blue-900 text-sm uppercase">BLOQUEADO</h3><p class="text-[10px] font-bold text-slate-400 mt-1 uppercase">${raw["Descripción"] || ""}</p></div></div>`;
|
||||
}
|
||||
|
||||
const name = raw["Nombre Cliente"] || raw["CLIENTE"] || "Asegurado";
|
||||
@@ -319,14 +321,14 @@
|
||||
|
||||
return `
|
||||
<div onclick="openService(${s.id})" class="bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm active:scale-95 transition-transform flex gap-4 relative overflow-hidden">
|
||||
${s.is_urgent ? '<div class="absolute top-0 right-0 bg-rose-600 text-white text-[8px] font-black px-3 py-1.5 rounded-bl-xl uppercase tracking-widest z-10">Urgente</div>' : ''}
|
||||
${s.is_urgent ? '<div class="absolute top-0 right-0 bg-blue-900 text-white text-[8px] font-black px-3 py-1.5 rounded-bl-xl uppercase tracking-widest z-10">Urgente</div>' : ''}
|
||||
<div class="flex flex-col items-center justify-center border-r border-slate-100 pr-4 shrink-0 min-w-[70px]">
|
||||
<i data-lucide="clock" class="w-6 h-6 text-blue-500 mb-1"></i>
|
||||
<i data-lucide="clock" class="w-6 h-6 text-blue-900 mb-1"></i>
|
||||
<span class="font-black text-slate-900 text-base">${time}</span>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap gap-1.5 mb-2">
|
||||
<span class="text-[8px] font-black bg-blue-50 text-blue-600 px-2 py-0.5 rounded uppercase border border-blue-100">${compShort}</span>
|
||||
<span class="text-[8px] font-black bg-blue-50 text-blue-900 px-2 py-0.5 rounded uppercase border border-blue-100">${compShort}</span>
|
||||
<span class="text-[8px] font-black bg-slate-100 text-slate-500 px-2 py-0.5 rounded uppercase border border-slate-200">${guildObj ? guildObj.name : 'Reparación'}</span>
|
||||
</div>
|
||||
<h3 class="font-black text-slate-800 text-sm uppercase leading-tight truncate">${name}</h3>
|
||||
@@ -369,11 +371,8 @@
|
||||
|
||||
for(let key in raw) {
|
||||
if(skipKeys.includes(key)) continue;
|
||||
let val = raw[key];
|
||||
// ARREGLO TYPEERROR: Verificamos si val es string antes del trim
|
||||
let valStr = String(val || "");
|
||||
let valStr = String(raw[key] || "");
|
||||
if(valStr.trim() === "") continue;
|
||||
|
||||
detailsHtml += `<div class="border-b border-slate-100 pb-2 mb-2 last:border-0 flex flex-col gap-0.5"><span class="text-[8px] font-black text-slate-400 uppercase tracking-widest">${key}</span><span class="text-[11px] font-bold text-slate-700 break-words">${valStr}</span></div>`;
|
||||
}
|
||||
extraContainer.innerHTML = detailsHtml || '<p class="text-xs text-slate-400">Sin datos adicionales.</p>';
|
||||
@@ -388,8 +387,6 @@
|
||||
const modal = document.getElementById('serviceModal');
|
||||
modal.classList.add('translate-y-full');
|
||||
setTimeout(() => modal.style.display = 'none', 300);
|
||||
document.getElementById('gpsLoading').classList.remove('hidden');
|
||||
document.getElementById('gpsResult').classList.add('hidden');
|
||||
}
|
||||
|
||||
function callClient() { const p = document.getElementById('detPhoneRaw').value; if (p) window.location.href = `tel:+34${p}`; else alert("Sin teléfono"); }
|
||||
@@ -397,7 +394,7 @@
|
||||
function openMaps() { const a = document.getElementById('detAddress').innerText; if (a) window.open(`maps://?q=${encodeURIComponent(a)}`, '_blank'); }
|
||||
|
||||
async function calculateDistance(dest) {
|
||||
if(!navigator.geolocation) { showGpsError("No GPS"); return; }
|
||||
if(!navigator.geolocation) return;
|
||||
navigator.geolocation.getCurrentPosition(async (pos) => {
|
||||
const lat = pos.coords.latitude; const lon = pos.coords.longitude;
|
||||
try {
|
||||
@@ -412,12 +409,10 @@
|
||||
document.getElementById('gpsResult').classList.remove('hidden');
|
||||
document.getElementById('gpsKm').innerText = km.toFixed(1);
|
||||
document.getElementById('gpsMins').innerText = Math.round((km/35)*60)+5;
|
||||
} else { showGpsError("Sin ubicación"); }
|
||||
} catch(e) { showGpsError("Error GPS"); }
|
||||
}, () => showGpsError("GPS off"), { enableHighAccuracy: true });
|
||||
}
|
||||
|
||||
function showGpsError(m) { document.getElementById('gpsLoading').innerHTML = `<span class="text-rose-400 font-bold">${m}</span>`; }
|
||||
} catch(e) { }
|
||||
});
|
||||
}
|
||||
|
||||
async function quickUpdate(action) {
|
||||
if(!currentServiceId) return;
|
||||
@@ -436,7 +431,7 @@
|
||||
method: 'PUT', headers: { "Content-Type": "application/json", "Authorization": `Bearer ${localStorage.getItem("token")}` },
|
||||
body: JSON.stringify({ status_operativo: st.id })
|
||||
});
|
||||
if(res.ok) { showToast("¡Hecho!"); closeModal(); refreshData(); }
|
||||
if(res.ok) { showToast("¡Actualizado!"); closeModal(); refreshData(); }
|
||||
} catch (e) { alert("Error"); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user