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-10-24 18:08:05 +07:00
|
|
|
{
|
|
|
|
|
path: '/workflow',
|
|
|
|
|
name: 'Workflow',
|
|
|
|
|
component: () => import('pages/04_flow-managment/MainPage.vue'),
|
2025-03-10 15:02:28 +07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/property',
|
|
|
|
|
name: 'Property',
|
|
|
|
|
component: () => import('pages/04_property-managment/MainPage.vue'),
|
2024-10-24 18:08:05 +07:00
|
|
|
},
|
2025-03-04 11:22:31 +07:00
|
|
|
{
|
|
|
|
|
path: '/quotation',
|
|
|
|
|
name: 'Quotation',
|
|
|
|
|
component: () => import('pages/05_quotation/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'),
|
|
|
|
|
},
|
2025-03-04 11:22:31 +07:00
|
|
|
{
|
|
|
|
|
path: '/invoice',
|
|
|
|
|
name: '/Invoice',
|
|
|
|
|
component: () => import('pages/10_invoice/MainPage.vue'),
|
|
|
|
|
},
|
2025-01-14 09:08:31 +07:00
|
|
|
{
|
|
|
|
|
path: '/credit-note',
|
|
|
|
|
name: 'CreditNote',
|
|
|
|
|
component: () => import('pages/11_credit-note/MainPage.vue'),
|
|
|
|
|
},
|
2025-01-14 11:34:20 +07:00
|
|
|
{
|
2025-03-04 11:22:31 +07:00
|
|
|
path: '/debit-note',
|
|
|
|
|
name: 'debitNote',
|
|
|
|
|
component: () => import('pages/12_debit-note/MainPage.vue'),
|
2025-01-14 11:34:20 +07:00
|
|
|
},
|
2025-01-14 16:12:30 +07:00
|
|
|
{
|
|
|
|
|
path: '/receipt',
|
|
|
|
|
name: 'receipt',
|
|
|
|
|
component: () => import('pages/13_receipt/MainPage.vue'),
|
|
|
|
|
},
|
2025-01-27 09:04:08 +07:00
|
|
|
{
|
2025-03-04 11:22:31 +07:00
|
|
|
path: '/report',
|
|
|
|
|
name: 'report',
|
|
|
|
|
component: () => import('pages/14_report/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/dash-board',
|
|
|
|
|
name: 'dashBoard',
|
|
|
|
|
component: () => import('pages/15_dash-board/MainPage.vue'),
|
2025-01-27 09:04:08 +07:00
|
|
|
},
|
2025-03-06 10:46:53 +07:00
|
|
|
{
|
|
|
|
|
path: '/notification',
|
|
|
|
|
name: 'Notification',
|
|
|
|
|
component: () => import('pages/00_notification/MainPage.vue'),
|
|
|
|
|
},
|
2025-03-18 09:58:45 +07:00
|
|
|
{
|
|
|
|
|
path: '/manual',
|
|
|
|
|
name: 'Manual',
|
|
|
|
|
component: () => import('pages/00_manual/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/manual/:category/:page',
|
|
|
|
|
name: 'ManualView',
|
|
|
|
|
component: () => import('pages/00_manual/ViewPage.vue'),
|
|
|
|
|
},
|
2025-04-25 15:15:37 +07:00
|
|
|
{
|
|
|
|
|
path: '/troubleshooting',
|
|
|
|
|
name: 'Troubleshooting',
|
|
|
|
|
component: () => import('pages/00_manual/MainPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/troubleshooting/:category/:page',
|
|
|
|
|
name: 'TroubleshootingView',
|
|
|
|
|
component: () => import('pages/00_manual/ViewPage.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
|
|
|
},
|
2025-01-14 09:08:31 +07:00
|
|
|
{
|
|
|
|
|
path: '/credit-note/add',
|
|
|
|
|
name: 'CreditNoteNew',
|
|
|
|
|
component: () => import('pages/11_credit-note/FormPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/credit-note/:id',
|
|
|
|
|
name: 'CreditNoteView',
|
|
|
|
|
component: () => import('pages/11_credit-note/FormPage.vue'),
|
|
|
|
|
},
|
2025-01-24 15:14:46 +07:00
|
|
|
{
|
|
|
|
|
path: '/credit-note/document-view',
|
|
|
|
|
name: 'CreditNoteDocumentView',
|
|
|
|
|
component: () => import('pages/11_credit-note/document-view/MainPage.vue'),
|
|
|
|
|
},
|
2025-01-14 16:12:30 +07:00
|
|
|
{
|
|
|
|
|
path: '/receipt/:id',
|
|
|
|
|
name: 'receiptform',
|
|
|
|
|
component: () => import('pages/13_receipt/MainPage.vue'),
|
|
|
|
|
},
|
2025-01-27 09:04:08 +07:00
|
|
|
{
|
|
|
|
|
path: '/debit-note/add',
|
|
|
|
|
name: 'DebitNoteNew',
|
|
|
|
|
component: () => import('pages/12_debit-note/FormPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/debit-note/:id',
|
|
|
|
|
name: 'DebitNoteView',
|
|
|
|
|
component: () => import('pages/12_debit-note/FormPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/debit-note/document-view',
|
|
|
|
|
name: 'DebitNoteDocumentView',
|
|
|
|
|
component: () => import('pages/12_debit-note/document-view/MainPage.vue'),
|
|
|
|
|
},
|
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;
|