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: () => [],
},
});
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
/> </QCardActions

View File

@ -18,17 +18,16 @@ const $props = defineProps({
},
});
const updateState = async () => {
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"
/>
</QCardSection>
<QCardActions align="right">
@ -73,7 +72,7 @@ const updateState = async () => {
:label="t('globals.confirm')"
color="primary"
:disable="!newState"
@click="updateState()"
@click="updateState"
unelevated
autofocus
/> </QCardActions

View File

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