fix: refs #7936 improve error handling
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
1571bd55ea
commit
011b5814a7
|
@ -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();
|
||||
|
|
|
@ -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 }} -
|
||||
|
|
Loading…
Reference in New Issue