perf: #6943 TicketList
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2024-11-13 12:53:37 +01:00
parent 6ac52e0b5f
commit 6c9406cfb0
1 changed files with 2 additions and 8 deletions

View File

@ -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 });