This commit is contained in:
Lizandro Guarnizo
2026-05-18 23:45:11 -05:00
parent 25f21be966
commit bbe83c79ba
8 changed files with 188 additions and 47 deletions
+13 -3
View File
@@ -166,7 +166,7 @@
<!-- Lista de tickets -->
<div class="space-y-3">
<template x-for="t in tickets" :key="t.ID">
<div class="bg-white rounded-xl border overflow-hidden" :class="t._noLeidos > 0 ? 'border-[#8eb02f]' : 'border-slate-200'">
<div :id="'portal-ticket-' + t.ID" class="bg-white rounded-xl border overflow-hidden" :class="t._noLeidos > 0 ? 'border-[#8eb02f]' : 'border-slate-200'">
<div class="p-4 flex items-start justify-between cursor-pointer" @click="abrirTicket(t)">
<div>
<div class="flex items-center gap-2 mb-1">
@@ -261,12 +261,22 @@ function portalProyecto() {
facturasNoLeidas: 0,
async init() {
// Soporte de URL param ?tab=Facturas
const params = new URLSearchParams(window.location.search);
const tabParam = params.get('tab');
if (tabParam) this.activeTab = tabParam;
await this.loadTickets();
// Si la tab activa es Facturas, marcar como leídas automáticamente
const ticketId = params.get('ticket');
if (ticketId) {
this.activeTab = 'Tickets';
const t = this.tickets.find(x => String(x.ID) === String(ticketId));
if (t) {
t._open = true;
this.$nextTick(() => {
const el = document.getElementById('portal-ticket-' + t.ID);
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' });
});
}
}
if (this.activeTab === 'Facturas') {
this.marcarFacturasLeidas();
}