From 921b6c61063040855faf866f48c280215c32331b Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 7 Nov 2024 14:55:16 +0700 Subject: [PATCH] refactor: routing --- src/pages/05_quotation/MainPage.vue | 5 ++++- src/router/routes.ts | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue index 33c0618c..4542fe5b 100644 --- a/src/pages/05_quotation/MainPage.vue +++ b/src/pages/05_quotation/MainPage.vue @@ -189,7 +189,10 @@ function triggerQuotationDialog(opts: { quotationId?: string; branchId?: string; }) { - const url = new URL('/quotation/add-quotation', window.location.origin); + const url = new URL( + `/quotation/${opts.statusDialog === 'create' ? 'add' : 'view'}`, + window.location.origin, + ); localStorage.setItem( 'new-quotation', diff --git a/src/router/routes.ts b/src/router/routes.ts index 120984f3..1d35d94a 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -93,10 +93,15 @@ const routes: RouteRecordRaw[] = [ }, { - path: '/quotation/add-quotation', + path: '/quotation/add', name: 'QuotationAdd', component: () => import('pages/05_quotation/QuotationForm.vue'), }, + { + path: '/quotation/view', + name: 'QuotationView', + component: () => import('pages/05_quotation/QuotationForm.vue'), + }, { path: '/quotation/document-view', name: 'QuotationDocumentView',