refactor: refs #5926 call Docuwares/upload-delivery-note

This commit is contained in:
Alex Moreno 2025-03-18 07:17:33 +01:00
parent d744b22119
commit 22bdd0ef08
2 changed files with 12 additions and 14 deletions

View File

@ -32,7 +32,7 @@ onMounted(() => {
watch( watch(
() => props.ticket, () => props.ticket,
() => restoreTicket () => restoreTicket,
); );
const { push, currentRoute } = useRouter(); const { push, currentRoute } = useRouter();
@ -66,10 +66,10 @@ const onClientSelected = async(clientId) =>{
const onAddressSelected = (addressId) => { const onAddressSelected = (addressId) => {
address.value = addressId; address.value = addressId;
} };
const fetchClient = async () => { const fetchClient = async () => {
const response = await getClient(client.value) const response = await getClient(client.value);
if (!response) return; if (!response) return;
const [retrievedClient] = response.data; const [retrievedClient] = response.data;
selectedClient.value = retrievedClient; selectedClient.value = retrievedClient;
@ -151,7 +151,7 @@ function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
recipientId: ticket.value.clientFk, recipientId: ticket.value.clientFk,
type: type, type: type,
}, },
'_blank' '_blank',
); );
} }
@ -339,7 +339,7 @@ async function changeShippedHour(time) {
const { data } = await axios.post( const { data } = await axios.post(
`Tickets/${ticketId.value}/updateEditableTicket`, `Tickets/${ticketId.value}/updateEditableTicket`,
params params,
); );
if (data) window.location.reload(); if (data) window.location.reload();
@ -405,8 +405,7 @@ async function uploadDocuware(force) {
uploadDocuware(true); uploadDocuware(true);
}); });
const { data } = await axios.post(`Docuwares/upload`, { const { data } = await axios.post(`Docuwares/upload-delivery-note`, {
fileCabinet: 'deliveryNote',
ticketIds: [parseInt(ticketId.value)], ticketIds: [parseInt(ticketId.value)],
}); });

View File

@ -344,8 +344,7 @@ async function sendDocuware(ticket) {
try { try {
let ticketIds = ticket.map((item) => item.id); let ticketIds = ticket.map((item) => item.id);
const { data } = await axios.post(`Docuwares/upload`, { const { data } = await axios.post(`Docuwares/upload-delivery-note`, {
fileCabinet: 'deliveryNote',
ticketIds, ticketIds,
}); });