From 3679cbd2532204a35ad22c713b838218612dba01 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 6 Mar 2025 10:16:27 +0100 Subject: [PATCH] fix: refs #8316 add rectificative handling in invoiceIn route --- src/router/modules/invoiceIn.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/router/modules/invoiceIn.js b/src/router/modules/invoiceIn.js index fe70a1056..b8021e69f 100644 --- a/src/router/modules/invoiceIn.js +++ b/src/router/modules/invoiceIn.js @@ -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'), }, ], }, ], -}; \ No newline at end of file +};