Merge branch 'master' into hotfix_checbox_css
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2025-01-20 11:17:58 +00:00
commit c3203b18e7
2 changed files with 19 additions and 7 deletions

View File

@ -208,15 +208,28 @@ async function remove(item) {
async function handleConfirm() {
const result = await confirm(route.params.id);
if (result) {
const sale = await axios.get(`OrderRows`, {
params: {
filter: JSON.stringify({
where: { orderFk: route.params.id },
}),
},
});
const ticket = await axios.get(`Sales`, {
params: {
filter: JSON.stringify({
where: { id: sale.data[0].saleFk },
}),
},
});
quasar.notify({
message: t('globals.dataSaved'),
type: 'positive',
});
router.push({
name: 'TicketSale',
query: {
table: JSON.stringify({ id: route.params.id }),
},
params: { id: ticket.data[0].ticketFk },
query: { table: JSON.stringify({ filter: { limit: 20, skip: 0 } }) },
});
}
}

View File

@ -54,7 +54,6 @@ const transfer = ref({
});
const tableRef = ref([]);
const canProceed = ref();
const isLoading = ref(false);
watch(
() => route.params.id,
@ -197,6 +196,7 @@ const changeQuantity = async (sale) => {
try {
if (!rowToUpdate.value) return;
rowToUpdate.value = null;
sale.isNew = false;
await updateQuantity(sale);
} catch (e) {
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
@ -214,9 +214,6 @@ const updateQuantity = async ({ quantity, id }) => {
};
const addSale = async (sale) => {
if (isLoading.value) return;
isLoading.value = true;
const params = {
barcode: sale.itemFk,
quantity: sale.quantity,
@ -237,6 +234,7 @@ const addSale = async (sale) => {
sale.item = newSale.item;
notify('globals.dataSaved', 'positive');
sale.isNew = false;
arrayData.fetch({});
};
@ -754,6 +752,7 @@ watch(
option-label="name"
option-value="id"
v-model="row.itemFk"
:use-like="false"
@update:model-value="updateItem(row)"
>
<template #option="scope">