diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index e0721895..66a97065 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -246,6 +246,16 @@ const formDataEmployee = ref< const productServiceList = ref< Required[] >([]); +const productService = computed(() => { + return selectedInstallmentNo.value.length > 0 + ? productServiceList.value.filter((v) => { + return ( + v.installmentNo && + selectedInstallmentNo.value.includes(v.installmentNo) + ); + }) + : productServiceList.value; +}); async function fetchStatus() { statusQuotationForm.value = [ @@ -803,9 +813,12 @@ function storeDataLocal() { localStorage.setItem( 'quotation-preview', JSON.stringify({ - data: quotationFormData.value, + data: { + ...quotationFormData.value, + productServiceList: productService.value, + }, meta: { - selectedInstallmentNo: selectedInstallmentNo.value, + viewMod: view.value, source: { ...quotationFormState.value.source, code: @@ -828,7 +841,14 @@ function storeDataLocal() { }), ); - window.open('/quotation/document-view', '_blank'); + const documentTypes: Record = { + 3: 'invoice', + 4: 'payment', + 6: 'receipt', + }; + const documentType = documentTypes[view.value] || ''; + + window.open(`/quotation/document-view?type=${documentType}`, '_blank'); } const QUOTATION_STATUS = [ 'Issued', @@ -1167,16 +1187,7 @@ const view = ref(View.Quotation); })) " @delete="toggleDeleteProduct" - :rows=" - selectedInstallmentNo.length > 0 - ? productServiceList.filter((v) => { - return ( - v.installmentNo && - selectedInstallmentNo.includes(v.installmentNo) - ); - }) - : productServiceList - " + :rows="productService" @update:rows=" (v) => view === View.Quotation && (productServiceList = v) " @@ -1294,6 +1305,7 @@ const view = ref(View.Quotation); expand-icon="mdi-chevron-down-circle" header-class="surface-1" > + {{ quotationFormData.paySplit }}