From e07e62abb431440d14b4efde8abb6d38ec3e5b01 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 14 May 2024 14:41:34 +0200 Subject: [PATCH] updates --- .../Ticket/Negative/ChangeQuantityDialog.vue | 10 ++++---- .../Ticket/Negative/ChangeStateDialog.vue | 23 +++++++++---------- src/pages/Ticket/Negative/TicketLackList.vue | 5 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/pages/Ticket/Negative/ChangeQuantityDialog.vue b/src/pages/Ticket/Negative/ChangeQuantityDialog.vue index 1b8c71ed6a..07be42245d 100644 --- a/src/pages/Ticket/Negative/ChangeQuantityDialog.vue +++ b/src/pages/Ticket/Negative/ChangeQuantityDialog.vue @@ -15,11 +15,11 @@ const $props = defineProps({ default: () => [], }, }); -const updateQuantity = async () => { +const updateQuantity = async (evt, rows) => { showChangeQuantityDialog.value = true; - const rowsToUpdate = $props.selectedRows.map(({ ticketFk }) => - axios.post(`Tickets/state`, { - ticketFk, + const rowsToUpdate = $props.selectedRows.map((row) => + axios.post(`Sales//updateQuantity`, { + row, quantity: newQuantity.value, }) ); @@ -65,7 +65,7 @@ const updateQuantity = async () => { :label="t('globals.confirm')" color="primary" :disable="!newQuantity || newQuantity < 0" - @click="updateQuantity()" + @click="updateQuantity" unelevated autofocus /> { - showChangeStateDialog.value = true; - const rowsToUpdate = $props.selectedRows.map(({ ticketFk }) => - axios.post(`Tickets/state`, { - ticketFk, - code: newState.value, - }) - ); - try { - await Promise.all(rowsToUpdate); - dialogRef.value.hide(); + // showChangeStateDialog.value = true; + // const rowsToUpdate = $props.selectedRows.map((ticketFk) => + // axios.post(`Tickets/state`, { + // ticketFk, + // code: newState.value, + // }) + // ); + // await Promise.all(rowsToUpdate); + dialogRef.value.hide({ refresh: true }); } catch (err) { return err; } @@ -64,7 +63,7 @@ const updateState = async () => { v-model="newState" :options="editableStates" option-label="name" - option-value="id" + option-value="code" /> @@ -73,7 +72,7 @@ const updateState = async () => { :label="t('globals.confirm')" color="primary" :disable="!newState" - @click="updateState()" + @click="updateState" unelevated autofocus /> {