From c8ab5b3bfd64fe7a41a09d542705fa881e6e8f32 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 13 Aug 2024 14:57:09 +0200 Subject: [PATCH 01/11] feat: refs #7663 add setWeight menu opt (wip) --- src/pages/Ticket/Card/TicketDescriptorMenu.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue index c7784bc2a0..6ffae48eec 100644 --- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue +++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue @@ -44,6 +44,7 @@ const actions = { push({ name: 'TicketSummary', params: { id: clonedTicketId } }); } }, + setWeight: async () => {}, remove: async () => { try { await axios.post(`Tickets/${ticketId}/setDeleted`); @@ -146,10 +147,15 @@ async function sendSms(body) { } function openConfirmDialog(callback) { + const message = + callback == 'setWeight' + ? t('Es posible que se facture este ticket, desea continuar?') + : undefined; dialog({ component: VnConfirm, componentProps: { promise: actions[callback], + message, }, }); } @@ -253,6 +259,12 @@ function openConfirmDialog(callback) { {{ t('To clone ticket') }} + + + + + {{ t('Set weight') }} + + + + - +en: + invoiceIds: "Invoices have been generated with the following ids: {invoiceIds}" + es: Open Delivery Note...: Abrir albarán... Send Delivery Note...: Enviar albarán... @@ -297,5 +334,7 @@ es: Ticket cloned: Ticked clonado It was not able to clone the ticket: No se pudo clonar el ticket Set weight: Establecer peso + Weight set: Peso establecido This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar? + invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}" diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 1773846636..a7a541e6d3 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -31,8 +31,7 @@ const $props = defineProps({ const entityId = computed(() => $props.id || route.params.id); const summaryRef = ref(); -const ticket = ref(); -const salesLines = ref(null); +const ticket = computed(() => summaryRef.value?.entity); const editableStates = ref([]); const ticketUrl = ref(); const grafanaUrl = 'https://grafana.verdnatura.es'; @@ -40,12 +39,6 @@ const grafanaUrl = 'https://grafana.verdnatura.es'; onMounted(async () => { ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/'; }); -async function setData(data) { - if (data) { - ticket.value = data; - salesLines.value = data.sales; - } -} function formattedAddress() { if (!ticket.value) return ''; @@ -89,7 +82,6 @@ async function changeState(value) { -