From 6c9406cfb0b7c42f448b0aad4f5731e9e4798f07 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 13 Nov 2024 12:53:37 +0100 Subject: [PATCH] perf: #6943 TicketList --- src/pages/Ticket/TicketList.vue | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index 59b223aa1..2cad174ae 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -47,14 +47,13 @@ const userParams = { to: null, }; onMounted(() => { + initializeFromQuery(); + stateStore.rightDrawer = true; if (!route.query.createForm) return; onClientSelected(JSON.parse(route.query.createForm)); }); -// Método para inicializar las variables desde la query string const initializeFromQuery = () => { const query = route.query.table ? JSON.parse(route.query.table) : {}; - - // Asigna los valores a las variables correspondientes from.value = query.from || from.toISOString(); to.value = query.to || to.toISOString(); Object.assign(userParams, { from, to }); @@ -312,11 +311,6 @@ const getDateColor = (date) => { if (comparation < 0) return 'bg-success'; }; -onMounted(() => { - initializeFromQuery(); - stateStore.rightDrawer = true; -}); - async function makeInvoice(ticket) { const ticketsIds = ticket.map((item) => item.id); const { data } = await axios.post(`Tickets/invoiceTicketsAndPdf`, { ticketsIds });