diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue index ee34d01b..a0c64787 100644 --- a/src/pages/05_quotation/MainPage.vue +++ b/src/pages/05_quotation/MainPage.vue @@ -62,7 +62,10 @@ const flowStore = useFlowStore(); const userBranch = useMyBranch(); const ocrStore = useOcrStore(); -const { currentFormData: quotationFormData } = storeToRefs(quotationFormStore); +const { + currentFormData: quotationFormData, + currentFormState: quotationFormState, +} = storeToRefs(quotationFormStore); const { state: customerFormState, currentFormData: customerFormData } = storeToRefs(customerFormStore); const { currentMyBranch } = storeToRefs(userBranch); @@ -211,7 +214,7 @@ function triggerAddQuotationDialog() { // TODO: form and state controll } -function triggerQuotationDialog() { +function triggerQuotationDialog(statusDialog: 'info' | 'edit' | 'create') { const url = new URL('/quotation/add-quotation', window.location.origin); url.searchParams.set('branchId', branchId.value); url.searchParams.set( @@ -220,6 +223,7 @@ function triggerQuotationDialog() { ); url.searchParams.set('agentPrice', agentPrice.value.toString()); url.searchParams.set('special', special.value.toString()); + url.searchParams.set('statusDialog', statusDialog); window.open(url.toString(), '_blank'); } @@ -345,7 +349,7 @@ watch(() => pageState.currentTab, fetchQuotationList); size="sm" flat dense - @click="triggerQuotationDialog" + @click="triggerQuotationDialog('create')" :style="pageState.hideStat ? 'rotate: 90deg' : ''" style="transition: 0.1s ease-in-out" /> @@ -678,7 +682,12 @@ watch(() => pageState.currentTab, fetchQuotationList); submit-icon="mdi-check" height="auto" width="60vw" - :submit="() => triggerQuotationDialog()" + :submit=" + () => { + quotationFormState.mode = 'create'; + triggerQuotationDialog('create'); + } + " :close=" () => { branchId = ''; @@ -755,14 +764,7 @@ watch(() => pageState.currentTab, fetchQuotationList); ]" >