0
0
Fork 0

fix: refs #7524 changes

This commit is contained in:
Jorge Penadés 2024-10-24 12:29:46 +02:00
parent d918b76010
commit c9cfb2b1cf
1 changed files with 22 additions and 35 deletions

View File

@ -243,36 +243,31 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
};
const moveTicketsAdvance = async () => {
try {
let ticketsToMove = [];
for (const ticket of selectedTickets.value) {
if (!ticket.id) {
try {
const { query, params } = await requestComponentUpdate(ticket, false);
axios.post(query, params);
} catch (e) {
console.error('Error moving ticket', e);
}
continue;
let ticketsToMove = [];
for (const ticket of selectedTickets.value) {
if (!ticket.id) {
try {
const { query, params } = await requestComponentUpdate(ticket, false);
axios.post(query, params);
} catch (e) {
console.error('Error moving ticket', e);
}
ticketsToMove.push({
originId: ticket.futureId,
destinationId: ticket.id,
originShipped: ticket.futureShipped,
destinationShipped: ticket.shipped,
workerFk: ticket.workerFk,
});
continue;
}
const params = { tickets: ticketsToMove };
await axios.post('Tickets/merge', params);
vnTableRef.value.reload();
selectedTickets.value = [];
if (ticketsToMove.length)
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
} catch (error) {
console.error('Error moving tickets', error);
ticketsToMove.push({
originId: ticket.futureId,
destinationId: ticket.id,
originShipped: ticket.futureShipped,
destinationShipped: ticket.shipped,
workerFk: ticket.workerFk,
});
}
const params = { tickets: ticketsToMove };
await axios.post('Tickets/merge', params);
vnTableRef.value.reload();
selectedTickets.value = [];
if (ticketsToMove.length) notify(t('advanceTickets.moveTicketSuccess'), 'positive');
};
const progressLength = ref(0);
@ -313,8 +308,6 @@ const splitTickets = async () => {
progressAdd(ticket.futureId);
}
}
} catch (error) {
console.error('Error splitting tickets', error);
} finally {
vnTableRef.value.reload();
}
@ -400,12 +393,6 @@ watch(
auto-load
@on-fetch="(data) => (zonesOptions = data)"
/>
<!-- Fix searchbar #8154 -->
<VnSearchbar
data-key="advanceTickets"
:label="t('weeklyTickets.search')"
:info="t('weeklyTickets.searchInfo')"
/>
<VnSubToolbar>
<template #st-data>
<QBtn