forked from verdnatura/salix-front
updates
This commit is contained in:
parent
df911e0210
commit
e07e62abb4
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue