Actualizar presupuestos.html

This commit is contained in:
2026-03-29 21:40:12 +00:00
parent d9de63fbb6
commit fe5a6aa352

View File

@@ -118,7 +118,7 @@
<div class="bg-white w-full rounded-t-[2.5rem] p-6 pt-8 pb-safe transition-transform transform translate-y-full duration-300 max-h-[90vh] overflow-y-auto no-scrollbar" id="apptModalSheet">
<div class="flex justify-between items-center mb-6">
<div>
<span class="text-[10px] font-black text-blue-600 uppercase tracking-widest bg-blue-50 px-2 py-1 rounded-md">Agendar Cita</span>
<span class="text-[10px] font-black text-primary-dynamic uppercase tracking-widest bg-slate-50 border border-slate-100 px-2 py-1 rounded-md">Agendar Cita</span>
<h3 class="text-xl font-black text-slate-800 mt-2 leading-tight" id="apptClientName">Cliente</h3>
</div>
<button onclick="closeAppointmentModal()" class="p-2 bg-slate-100 rounded-full text-slate-500 active:scale-95"><i data-lucide="x" class="w-5 h-5"></i></button>
@@ -137,8 +137,8 @@
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Fecha de la visita *</label>
<input type="date" id="apptDate" onchange="checkAgendaForDate(this.value)" class="w-full bg-slate-50 border border-slate-200 px-4 py-3 rounded-xl text-sm font-bold outline-none focus:border-blue-500 text-blue-600">
</div>
<div id="agendaPreview" class="hidden bg-blue-50/50 border border-blue-100 rounded-2xl p-4 shadow-inner">
<p class="text-[10px] font-black text-blue-600 uppercase tracking-widest mb-3 flex items-center gap-1.5"><i data-lucide="map-pin" class="w-3.5 h-3.5"></i> Tu ruta este día</p>
<div id="agendaPreview" class="hidden bg-slate-50 border border-slate-200 rounded-2xl p-4 shadow-inner">
<p class="text-[10px] font-black text-primary-dynamic uppercase tracking-widest mb-3 flex items-center gap-1.5"><i data-lucide="map-pin" class="w-3.5 h-3.5"></i> Tu ruta este día</p>
<div id="agendaList" class="space-y-2 text-xs font-medium text-slate-600"></div>
</div>
<div>
@@ -158,7 +158,7 @@
</select>
</div>
<button onclick="confirmAppointment()" id="btnConfirmAppt" class="w-full bg-emerald-500 text-white py-4 rounded-xl font-black uppercase tracking-widest shadow-md hover:bg-emerald-600 active:scale-95 transition-transform mt-4 flex items-center justify-center gap-2">
<button onclick="confirmAppointment()" id="btnConfirmAppt" class="w-full bg-primary-dynamic text-white py-4 rounded-xl font-black uppercase tracking-widest shadow-lg hover:opacity-90 active:scale-95 transition-transform mt-4 flex items-center justify-center gap-2">
<i data-lucide="check-circle" class="w-5 h-5"></i> Confirmar Cita
</button>
</div>
@@ -539,9 +539,11 @@
<button onclick="updateStatus(${b.id}, 'rejected')" class="w-9 h-9 bg-rose-50 text-rose-600 rounded-full flex items-center justify-center active:scale-95 transition-transform border border-rose-100"><i data-lucide="x" class="w-5 h-5"></i></button>
`;
} else if ((b.status === 'accepted' || b.status === 'paid') && !isExpired) {
actionBtns = `<button onclick="openAppointmentModal(${b.id}, '${b.client_name}')" class="bg-emerald-500 text-white px-3 py-1.5 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-md hover:bg-emerald-600 active:scale-95 transition-transform">Dar Cita</button>`;
// Usamos bg-primary-dynamic en vez de bg-emerald
actionBtns = `<button onclick="openAppointmentModal(${b.id}, '${b.client_name}')" class="bg-primary-dynamic text-white px-3 py-1.5 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-md hover:opacity-90 active:scale-95 transition-transform">Dar Cita</button>`;
} else if (b.status === 'converted') {
actionBtns = `<span class="text-[9px] font-black text-blue-600 uppercase tracking-widest bg-blue-50 px-2 py-1 rounded-md">Agendado</span>`;
// Usamos text-primary-dynamic
actionBtns = `<span class="text-[9px] font-black text-primary-dynamic uppercase tracking-widest bg-slate-50 px-2 py-1 rounded-md border border-slate-100">Agendado</span>`;
} else {
actionBtns = `<span class="text-[9px] font-black text-slate-400 uppercase tracking-widest">Cerrado</span>`;
}
@@ -729,7 +731,7 @@
if(!dateStr) { preview.classList.add('hidden'); return; }
preview.classList.remove('hidden');
list.innerHTML = '<div class="text-center text-blue-400 py-2"><i data-lucide="loader-2" class="w-4 h-4 animate-spin mx-auto"></i></div>';
list.innerHTML = '<div class="text-center text-primary-dynamic py-2"><i data-lucide="loader-2" class="w-4 h-4 animate-spin mx-auto"></i></div>';
lucide.createIcons();
try {
@@ -761,9 +763,9 @@
// 🛑 FIX: Leemos la hora a pintar DENTRO de raw_data
const time = raw.scheduled_time ? raw.scheduled_time.substring(0,5) : 'S/H';
return `
<div class="flex justify-between items-center bg-white p-2.5 rounded-lg border border-blue-100 shadow-sm">
<span class="font-black text-blue-700 bg-blue-50 px-2 py-0.5 rounded border border-blue-100">${time}</span>
<span class="text-blue-600 truncate max-w-[150px] text-right font-bold text-[10px] uppercase tracking-widest" title="${pob}">${pob}</span>
<div class="flex justify-between items-center bg-white p-2.5 rounded-lg border border-slate-200 shadow-sm">
<span class="font-black text-primary-dynamic bg-slate-50 px-2 py-0.5 rounded border border-slate-100">${time}</span>
<span class="text-slate-600 truncate max-w-[150px] text-right font-bold text-[10px] uppercase tracking-widest" title="${pob}">${pob}</span>
</div>
`;
}).join('');