0
0
Fork 0
This commit is contained in:
Javier Segarra 2024-05-14 14:41:34 +02:00
parent df911e0210
commit e07e62abb4
3 changed files with 19 additions and 19 deletions

View File

@ -15,11 +15,11 @@ const $props = defineProps({
default: () => [], default: () => [],
}, },
}); });
const updateQuantity = async () => { const updateQuantity = async (evt, rows) => {
showChangeQuantityDialog.value = true; showChangeQuantityDialog.value = true;
const rowsToUpdate = $props.selectedRows.map(({ ticketFk }) => const rowsToUpdate = $props.selectedRows.map((row) =>
axios.post(`Tickets/state`, { axios.post(`Sales//updateQuantity`, {
ticketFk, row,
quantity: newQuantity.value, quantity: newQuantity.value,
}) })
); );
@ -65,7 +65,7 @@ const updateQuantity = async () => {
:label="t('globals.confirm')" :label="t('globals.confirm')"
color="primary" color="primary"
:disable="!newQuantity || newQuantity < 0" :disable="!newQuantity || newQuantity < 0"
@click="updateQuantity()" @click="updateQuantity"
unelevated unelevated
autofocus autofocus
/> </QCardActions /> </QCardActions

View File

@ -18,17 +18,16 @@ const $props = defineProps({
}, },
}); });
const updateState = async () => { const updateState = async () => {
showChangeStateDialog.value = true;
const rowsToUpdate = $props.selectedRows.map(({ ticketFk }) =>
axios.post(`Tickets/state`, {
ticketFk,
code: newState.value,
})
);
try { try {
await Promise.all(rowsToUpdate); // showChangeStateDialog.value = true;
dialogRef.value.hide(); // 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) { } catch (err) {
return err; return err;
} }
@ -64,7 +63,7 @@ const updateState = async () => {
v-model="newState" v-model="newState"
:options="editableStates" :options="editableStates"
option-label="name" option-label="name"
option-value="id" option-value="code"
/> />
</QCardSection> </QCardSection>
<QCardActions align="right"> <QCardActions align="right">
@ -73,7 +72,7 @@ const updateState = async () => {
:label="t('globals.confirm')" :label="t('globals.confirm')"
color="primary" color="primary"
:disable="!newState" :disable="!newState"
@click="updateState()" @click="updateState"
unelevated unelevated
autofocus autofocus
/> </QCardActions /> </QCardActions

View File

@ -284,15 +284,16 @@ const handleWarehouses = async (data) => {
</div> </div>
<ChangeStateDialog <ChangeStateDialog
ref="changeStateDialogRef" ref="changeStateDialogRef"
@hide="onDialogHide" @hide="(evt) => vnPaginateRef.fetch()"
v-model="showChangeStateDialog" v-model="showChangeStateDialog"
:selected-rows="selectedRowsDetail" :selected-rows="{ selectedRowsDetail }"
></ChangeStateDialog> ></ChangeStateDialog>
<ChangeQuantityDialog <ChangeQuantityDialog
ref="changeQuantityDialogRef" ref="changeQuantityDialogRef"
@hide="onDialogHide" @hide="onDialogHide"
v-model="showChangeQuantityDialog" v-model="showChangeQuantityDialog"
:selected-rows="selectedRowsDetail" :selected-rows="selectedRowsDetail"
:rows=""
> >
</ChangeQuantityDialog> </ChangeQuantityDialog>
<ItemProposal <ItemProposal