#7936 improve InvoiceIn #1004

Merged
jorgep merged 55 commits from 7936-improveInvoiceIn into dev 2024-12-18 09:22:09 +00:00
2 changed files with 9 additions and 12 deletions
Showing only changes of commit 011b5814a7 - Show all commits

View File

@ -176,7 +176,8 @@ async function saveChanges(data) {
try {
await axios.post($props.saveUrl || $props.url + '/crud', changes);
} catch (e) {
return (isLoading.value = false);
isLoading.value = false;
throw e;
}
originalData.value = JSON.parse(JSON.stringify(formData.value));
if (changes.creates?.length) await vnPaginateRef.value.fetch();

View File

@ -1,22 +1,21 @@
<script setup>
import { ref, computed, capitalize } from 'vue';
import { useRouter } from 'vue-router';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useArrayData } from 'src/composables/useArrayData';
import CrudModel from 'src/components/CrudModel.vue';
import FetchData from 'src/components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const { push, currentRoute } = useRouter();
const route = useRoute();
const { t } = useI18n();
const invoiceId = +currentRoute.value.params.id;
const arrayData = useArrayData();
const invoiceIn = computed(() => arrayData.store.data);
const invoiceInCorrectionRef = ref();
const filter = {
include: { relation: 'invoiceIn' },
where: { correctingFk: invoiceId },
where: { correctingFk: route.params.id },
};
const columns = computed(() => [
{
@ -70,8 +69,6 @@ const siiTypeInvoiceIns = ref([]);
const invoiceCorrectionTypes = ref([]);
const requiredFieldRule = (val) => val || t('globals.requiredField');
const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`);
</script>
<template>
<FetchData
@ -98,7 +95,6 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
:filter="filter"
auto-load
primary-key="correctingFk"
@save-changes="onSave"
:default-remove="false"
>
<template #body="{ rows }">
@ -120,8 +116,8 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
:disable="row.invoiceIn.isBooked"
:filter-options="['description']"
>
<template #option="{ opt }">
<QItem>
<template #option="{ opt, itemProps }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.description }}</QItemLabel>
</QItemSection>
@ -142,8 +138,8 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
:filter-options="['code', 'description']"
:disable="row.invoiceIn.isBooked"
>
<template #option="{ opt }">
<QItem>
<template #option="{ opt, itemProps }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel
>{{ opt.code }} -