139 lines
4.6 KiB
JavaScript
139 lines
4.6 KiB
JavaScript
import { RouterView } from 'vue-router';
|
|
import axios from 'axios';
|
|
|
|
export default {
|
|
path: '/invoice-in',
|
|
name: 'InvoiceIn',
|
|
meta: {
|
|
title: 'invoiceIns',
|
|
icon: 'vn:invoice-in',
|
|
},
|
|
component: RouterView,
|
|
redirect: { name: 'InvoiceInMain' },
|
|
menus: {
|
|
main: ['InvoiceInList'],
|
|
card: [
|
|
'InvoiceInBasicData',
|
|
'InvoiceInVat',
|
|
'InvoiceInDueDay',
|
|
'InvoiceInIntrastat',
|
|
'InvoiceInLog',
|
|
'InvoiceInCorrective',
|
|
],
|
|
},
|
|
children: [
|
|
{
|
|
path: '',
|
|
name: 'InvoiceInMain',
|
|
component: () => import('src/pages/InvoiceIn/InvoiceInMain.vue'),
|
|
redirect: { name: 'InvoiceInList' },
|
|
children: [
|
|
{
|
|
path: 'list',
|
|
name: 'InvoiceInList',
|
|
meta: {
|
|
title: 'list',
|
|
icon: 'view_list',
|
|
},
|
|
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'InvoiceInCard',
|
|
path: ':id',
|
|
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
|
|
beforeEnter: async (to, from, next) => {
|
|
const card = to.matched.find((match) => match.name == 'InvoiceInCard');
|
|
const corrective = card.children.find(
|
|
(child) => child.name == 'InvoiceInCorrective'
|
|
);
|
|
|
|
const { data: correctings } = await axios.get('InvoiceInCorrections', {
|
|
params: {
|
|
filter: {
|
|
where: {
|
|
correctingFk: to.params.id,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
corrective.meta.hidden = !correctings.length > 0;
|
|
next();
|
|
},
|
|
redirect: { name: 'InvoiceInSummary' },
|
|
children: [
|
|
{
|
|
name: 'InvoiceInSummary',
|
|
path: 'summary',
|
|
meta: {
|
|
title: 'summary',
|
|
icon: 'view_list',
|
|
},
|
|
component: () =>
|
|
import('src/pages/InvoiceIn/Card/InvoiceInSummary.vue'),
|
|
},
|
|
{
|
|
name: 'InvoiceInBasicData',
|
|
path: 'basic-data',
|
|
meta: {
|
|
title: 'basicData',
|
|
icon: 'vn:settings',
|
|
roles: ['salesPerson'],
|
|
},
|
|
component: () =>
|
|
import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
|
|
},
|
|
{
|
|
name: 'InvoiceInVat',
|
|
path: 'vat',
|
|
meta: {
|
|
title: 'vat',
|
|
icon: 'vn:tax',
|
|
},
|
|
component: () => import('src/pages/InvoiceIn/Card/InvoiceInVat.vue'),
|
|
},
|
|
{
|
|
name: 'InvoiceInDueDay',
|
|
path: 'due-day',
|
|
meta: {
|
|
title: 'dueDay',
|
|
icon: 'vn:calendar',
|
|
},
|
|
component: () =>
|
|
import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
|
|
},
|
|
{
|
|
name: 'InvoiceInIntrastat',
|
|
path: 'intrastat',
|
|
meta: {
|
|
title: 'intrastat',
|
|
icon: 'vn:lines',
|
|
},
|
|
component: () =>
|
|
import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
|
|
},
|
|
{
|
|
name: 'InvoiceInLog',
|
|
path: 'log',
|
|
meta: {
|
|
title: 'log',
|
|
icon: 'history',
|
|
},
|
|
component: () => import('src/pages/InvoiceIn/Card/InvoiceInLog.vue'),
|
|
},
|
|
{
|
|
name: 'InvoiceInCorrective',
|
|
path: 'corrective',
|
|
meta: {
|
|
title: 'corrective',
|
|
icon: 'attachment',
|
|
},
|
|
component: () =>
|
|
import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|