forked from verdnatura/salix-front
fix: refs #7524 changes
This commit is contained in:
parent
2779e7ac8d
commit
f1350dece5
|
@ -243,36 +243,31 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const moveTicketsAdvance = async () => {
|
const moveTicketsAdvance = async () => {
|
||||||
try {
|
let ticketsToMove = [];
|
||||||
let ticketsToMove = [];
|
for (const ticket of selectedTickets.value) {
|
||||||
for (const ticket of selectedTickets.value) {
|
if (!ticket.id) {
|
||||||
if (!ticket.id) {
|
try {
|
||||||
try {
|
const { query, params } = await requestComponentUpdate(ticket, false);
|
||||||
const { query, params } = await requestComponentUpdate(ticket, false);
|
axios.post(query, params);
|
||||||
axios.post(query, params);
|
} catch (e) {
|
||||||
} catch (e) {
|
console.error('Error moving ticket', e);
|
||||||
console.error('Error moving ticket', e);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
ticketsToMove.push({
|
continue;
|
||||||
originId: ticket.futureId,
|
|
||||||
destinationId: ticket.id,
|
|
||||||
originShipped: ticket.futureShipped,
|
|
||||||
destinationShipped: ticket.shipped,
|
|
||||||
workerFk: ticket.workerFk,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
ticketsToMove.push({
|
||||||
const params = { tickets: ticketsToMove };
|
originId: ticket.futureId,
|
||||||
await axios.post('Tickets/merge', params);
|
destinationId: ticket.id,
|
||||||
vnTableRef.value.reload();
|
originShipped: ticket.futureShipped,
|
||||||
selectedTickets.value = [];
|
destinationShipped: ticket.shipped,
|
||||||
if (ticketsToMove.length)
|
workerFk: ticket.workerFk,
|
||||||
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
});
|
||||||
} catch (error) {
|
|
||||||
console.error('Error moving tickets', error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
const progressLength = ref(0);
|
||||||
|
@ -313,8 +308,6 @@ const splitTickets = async () => {
|
||||||
progressAdd(ticket.futureId);
|
progressAdd(ticket.futureId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.error('Error splitting tickets', error);
|
|
||||||
} finally {
|
} finally {
|
||||||
vnTableRef.value.reload();
|
vnTableRef.value.reload();
|
||||||
}
|
}
|
||||||
|
@ -400,12 +393,6 @@ watch(
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (zonesOptions = data)"
|
@on-fetch="(data) => (zonesOptions = data)"
|
||||||
/>
|
/>
|
||||||
<!-- Fix searchbar #8154 -->
|
|
||||||
<VnSearchbar
|
|
||||||
data-key="advanceTickets"
|
|
||||||
:label="t('weeklyTickets.search')"
|
|
||||||
:info="t('weeklyTickets.searchInfo')"
|
|
||||||
/>
|
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-data>
|
<template #st-data>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
|
Loading…
Reference in New Issue