2024-04-02 11:02:16 +07:00
|
|
|
import { RouteRecordRaw } from 'vue-router';
|
2024-08-30 12:05:37 +07:00
|
|
|
import { isRoleInclude } from 'stores/utils';
|
2024-04-02 11:02:16 +07:00
|
|
|
|
|
|
|
|
const routes: RouteRecordRaw[] = [
|
|
|
|
|
{
|
|
|
|
|
path: '',
|
|
|
|
|
redirect: { name: 'Home' },
|
|
|
|
|
component: () => import('layouts/MainLayout.vue'),
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'Home',
|
|
|
|
|
component: () => import('pages/MainPage.vue'),
|
|
|
|
|
},
|
2024-04-02 13:44:45 +07:00
|
|
|
{
|
|
|
|
|
path: '/branch-management',
|
|
|
|
|
name: 'BranchManagement',
|
2024-08-30 12:05:37 +07:00
|
|
|
beforeEnter: (to, from, next) => {
|
|
|
|
|
if (
|
|
|
|
|
isRoleInclude([
|
|
|
|
|
'admin',
|
|
|
|
|
'branch_admin',
|
|
|
|
|
'head_of_admin',
|
2024-09-04 14:37:22 +07:00
|
|
|
'head_of_account',
|
2024-08-30 12:05:37 +07:00
|
|
|
'system',
|
|
|
|
|
'owner',
|
2024-12-10 16:03:26 +07:00
|
|
|
'branch_manager',
|
2024-08-30 12:05:37 +07:00
|
|
|
])
|
|
|
|
|
) {
|
|
|
|
|
next();
|
|
|
|
|
} else {
|
|
|
|
|
next('/');
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-04-02 13:44:45 +07:00
|
|
|
component: () => import('pages/01_branch-management/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/personnel-management',
|
|
|
|
|
name: 'PersonnelManagement',
|
2024-08-30 12:05:37 +07:00
|
|
|
beforeEnter: (to, from, next) => {
|
|
|
|
|
if (
|
|
|
|
|
isRoleInclude([
|
|
|
|
|
'admin',
|
|
|
|
|
'branch_admin',
|
|
|
|
|
'head_of_admin',
|
|
|
|
|
'system',
|
|
|
|
|
'owner',
|
2024-09-02 09:44:16 +07:00
|
|
|
'branch_manager',
|
2024-08-30 12:05:37 +07:00
|
|
|
])
|
|
|
|
|
) {
|
|
|
|
|
next();
|
|
|
|
|
} else {
|
|
|
|
|
next('/');
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-04-02 13:44:45 +07:00
|
|
|
component: () => import('pages/02_personnel-management/MainPage.vue'),
|
|
|
|
|
},
|
2024-04-22 12:16:17 +07:00
|
|
|
{
|
|
|
|
|
path: '/customer-management',
|
2024-08-02 16:13:22 +07:00
|
|
|
name: 'CustomerManagement',
|
|
|
|
|
component: () => import('pages/03_customer-management/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/customer-management/:customerId',
|
|
|
|
|
name: 'CustomerSpecificManagement',
|
|
|
|
|
component: () => import('pages/03_customer-management/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/customer-management/:customerId/branch',
|
|
|
|
|
name: 'CustomerBranchManagement',
|
2024-04-22 12:16:17 +07:00
|
|
|
component: () => import('pages/03_customer-management/MainPage.vue'),
|
|
|
|
|
},
|
2024-06-10 16:42:40 +07:00
|
|
|
{
|
|
|
|
|
path: '/product-service',
|
|
|
|
|
name: 'productAndService',
|
|
|
|
|
component: () => import('pages/04_product-service/MainPage.vue'),
|
|
|
|
|
},
|
2024-06-19 15:43:58 +07:00
|
|
|
{
|
2024-07-25 09:27:58 +07:00
|
|
|
path: '/quotation',
|
|
|
|
|
name: 'Quotation',
|
|
|
|
|
component: () => import('pages/05_quotation/MainPage.vue'),
|
2024-06-19 15:43:58 +07:00
|
|
|
},
|
2024-10-24 18:08:05 +07:00
|
|
|
{
|
|
|
|
|
path: '/workflow',
|
|
|
|
|
name: 'Workflow',
|
|
|
|
|
component: () => import('pages/04_flow-managment/MainPage.vue'),
|
|
|
|
|
},
|
2024-08-13 17:15:55 +07:00
|
|
|
{
|
2024-08-14 19:53:23 +07:00
|
|
|
path: '/document-management',
|
2024-08-13 17:15:55 +07:00
|
|
|
name: 'document-management',
|
|
|
|
|
component: () => import('pages/06_edm/MainPage.vue'),
|
|
|
|
|
},
|
2024-11-08 13:11:42 +07:00
|
|
|
{
|
|
|
|
|
path: '/agencies-management',
|
|
|
|
|
name: 'agencies-management',
|
|
|
|
|
component: () => import('pages/07_agencies-management/MainPage.vue'),
|
|
|
|
|
},
|
2024-11-22 18:02:03 +07:00
|
|
|
{
|
|
|
|
|
path: '/request-list',
|
|
|
|
|
name: 'RequestList',
|
|
|
|
|
component: () => import('pages/08_request-list/MainPage.vue'),
|
|
|
|
|
},
|
2024-12-02 10:02:10 +07:00
|
|
|
{
|
|
|
|
|
path: '/task-order',
|
|
|
|
|
name: 'TaskOrder',
|
|
|
|
|
component: () => import('pages/09_task-order/MainPage.vue'),
|
|
|
|
|
},
|
2024-04-02 11:02:16 +07:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
2024-09-27 15:45:24 +07:00
|
|
|
{
|
2024-11-07 14:55:16 +07:00
|
|
|
path: '/quotation/add',
|
2024-09-27 15:45:24 +07:00
|
|
|
name: 'QuotationAdd',
|
|
|
|
|
component: () => import('pages/05_quotation/QuotationForm.vue'),
|
|
|
|
|
},
|
2024-11-07 14:55:16 +07:00
|
|
|
{
|
|
|
|
|
path: '/quotation/view',
|
|
|
|
|
name: 'QuotationView',
|
|
|
|
|
component: () => import('pages/05_quotation/QuotationForm.vue'),
|
|
|
|
|
},
|
2024-10-16 18:03:50 +07:00
|
|
|
{
|
2024-10-18 10:56:10 +07:00
|
|
|
path: '/quotation/document-view',
|
|
|
|
|
name: 'QuotationDocumentView',
|
2024-10-24 16:36:46 +07:00
|
|
|
component: () => import('pages/05_quotation/preview/ViewForm.vue'),
|
2024-10-16 18:03:50 +07:00
|
|
|
},
|
2024-11-22 18:02:03 +07:00
|
|
|
{
|
|
|
|
|
path: '/request-list/:requestListId',
|
|
|
|
|
name: 'requestListView',
|
|
|
|
|
component: () => import('pages/08_request-list/RequestListView.vue'),
|
|
|
|
|
},
|
2024-12-25 11:59:49 +07:00
|
|
|
{
|
2024-12-25 15:14:57 +07:00
|
|
|
path: '/task-order/add',
|
2024-12-25 11:59:49 +07:00
|
|
|
name: 'TaskOrderAdd',
|
|
|
|
|
component: () => import('pages/09_task-order/order_view/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-12-25 13:44:02 +07:00
|
|
|
path: '/task-order/:id',
|
2024-12-27 10:04:33 +07:00
|
|
|
name: 'TaskOrderView',
|
2024-12-25 13:44:02 +07:00
|
|
|
component: () => import('pages/09_task-order/PageView.vue'),
|
2024-12-25 11:59:49 +07:00
|
|
|
},
|
|
|
|
|
{
|
2024-12-27 10:25:09 +07:00
|
|
|
path: '/task-order/:id/doc-product-receive',
|
2024-12-26 17:44:16 +07:00
|
|
|
name: 'docReceive',
|
|
|
|
|
component: () => import('pages/09_task-order/document_view/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-12-27 10:25:09 +07:00
|
|
|
path: '/task-order/:id/doc-product-order',
|
2024-12-26 17:44:16 +07:00
|
|
|
name: 'docOrder',
|
2024-12-25 13:44:02 +07:00
|
|
|
component: () => import('pages/09_task-order/document_view/MainPage.vue'),
|
2024-12-25 11:59:49 +07:00
|
|
|
},
|
2024-09-27 15:45:24 +07:00
|
|
|
|
2024-04-02 11:02:16 +07:00
|
|
|
// Always leave this as last one,
|
|
|
|
|
// but you can also remove it
|
|
|
|
|
{
|
|
|
|
|
path: '/:catchAll(.*)*',
|
|
|
|
|
component: () => import('pages/error/NotFound.vue'),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export default routes;
|