This commit is contained in:
Alex Moreno 2025-03-06 11:33:17 +01:00
commit 91e25acd55
2 changed files with 16 additions and 14 deletions

View File

@ -123,7 +123,7 @@ async function handleSave() {
}
function validateFields(item) {
// Only validate fields that are being updated
const shouldExist = (field) => !isUpdate || field in item;
const shouldExist = (field) => field in item;
if (!shouldExist('ticketServiceTypeFk') && !item.ticketServiceTypeFk) {
notify('Description is required', 'negative');

View File

@ -1,10 +1,15 @@
import { RouterView } from 'vue-router';
import { setRectificative } from 'src/pages/InvoiceIn/composables/setRectificative';
const invoiceInCard = {
name: 'InvoiceInCard',
path: ':id',
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
redirect: { name: 'InvoiceInSummary' },
beforeEnter: async (to, from, next) => {
await setRectificative(to);
next();
},
meta: {
menu: [
'InvoiceInBasicData',
@ -32,8 +37,7 @@ const invoiceInCard = {
title: 'basicData',
icon: 'vn:settings',
},
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
component: () => import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
},
{
name: 'InvoiceInVat',
@ -51,8 +55,7 @@ const invoiceInCard = {
title: 'dueDay',
icon: 'vn:calendar',
},
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
component: () => import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
},
{
name: 'InvoiceInIntrastat',
@ -61,8 +64,7 @@ const invoiceInCard = {
title: 'intrastat',
icon: 'vn:lines',
},
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
component: () => import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
},
{
name: 'InvoiceInCorrective',
@ -71,8 +73,7 @@ const invoiceInCard = {
title: 'corrective',
icon: 'attachment',
},
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
},
{
name: 'InvoiceInLog',
@ -86,7 +87,7 @@ const invoiceInCard = {
],
};
export default {
export default {
name: 'InvoiceIn',
path: '/invoice-in',
meta: {
@ -98,7 +99,7 @@ export default {
component: RouterView,
redirect: { name: 'InvoiceInMain' },
children: [
{
{
name: 'InvoiceInMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
@ -111,7 +112,7 @@ export default {
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
children: [
{
name: 'InvoiceInList',
name: 'InvoiceInList',
path: 'list',
meta: {
title: 'list',
@ -137,9 +138,10 @@ export default {
title: 'serial',
icon: 'view_list',
},
component: () => import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
component: () =>
import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
},
],
},
],
};
};