From 0461da4bf8fda8a2ac92f47081a926d7cf60ebaf Mon Sep 17 00:00:00 2001 From: puriphatt Date: Fri, 4 Oct 2024 15:12:13 +0700 Subject: [PATCH] refactor: special --- src/components/05_quotation/FormAbout.vue | 8 +++++++ src/pages/05_quotation/MainPage.vue | 27 ++++++++++++----------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/components/05_quotation/FormAbout.vue b/src/components/05_quotation/FormAbout.vue index af6309bc..aa02b673 100644 --- a/src/components/05_quotation/FormAbout.vue +++ b/src/components/05_quotation/FormAbout.vue @@ -13,6 +13,7 @@ const customerStore = useCustomerStore(); const branchId = defineModel('branchId'); const customerBranchId = defineModel('customerBranchId'); const agentPrice = defineModel('agentPrice'); +const special = defineModel('special'); const branchOption = ref(); const customerOption = ref(); @@ -116,6 +117,13 @@ watch( v-model="agentPrice" style="font-size: 14px" /> +
diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue index b902b549..aee2385a 100644 --- a/src/pages/05_quotation/MainPage.vue +++ b/src/pages/05_quotation/MainPage.vue @@ -89,6 +89,7 @@ const { state: employeeFormState, currentFromDataEmployee } = storeToRefs(employeeFormStore); const { currentMyBranch } = storeToRefs(userBranch); +const special = ref(false); const branchId = ref(''); const agentPrice = ref(false); const currentCustomerId = ref(); @@ -355,17 +356,16 @@ function triggerAddQuotationDialog() { } function triggerQuotationDialog() { - const params = new URLSearchParams(); + const url = new URL('/quotation/add-quotation', window.location.origin); + url.searchParams.set('branchId', branchId.value); + url.searchParams.set( + 'customerBranchId', + quotationFormData.value.customerBranchId, + ); + url.searchParams.set('agentPrice', agentPrice.value.toString()); + url.searchParams.set('special', special.value.toString()); - params.set('branchId', branchId.value); - params.set('customerBranchId', branchId.value); - params.set('date', Date.now().toString()); - params.set('agentPrice', agentPrice.value.toString()); - - const query = params.toString(); - - window.open(`/quotation/add-quotation?${query}`, '_blank'); - // TODO: form and state controll + window.open(url.toString(), '_blank'); } function triggerSelectEmployeeDialog() { @@ -831,7 +831,7 @@ watch(() => pageState.currentTab, fetchQuotationList); - + pageState.currentTab, fetchQuotationList); >