feat: preview route and trigger preview

This commit is contained in:
Methapon Metanipat 2024-10-18 10:56:10 +07:00
parent b74ff126e3
commit 8f880fd34d
5 changed files with 24 additions and 4 deletions

View file

@ -275,6 +275,17 @@ async function fetchQuotationList() {
}
watch(() => pageState.currentTab, fetchQuotationList);
async function storeDataLocal(id: string) {
await quotationFormStore.assignFormData(id, 'assign');
localStorage.setItem(
'quotation-preview',
JSON.stringify(quotationFormData.value),
);
window.open('/quotation/document-view', '_blank');
}
</script>
<template>
@ -538,6 +549,7 @@ watch(() => pageState.currentTab, fetchQuotationList);
: v.createdBy.firstName + ' ' + v.createdBy.lastName
"
:total-price="v.finalPrice"
@preview="storeDataLocal(v.id)"
@view="
() => {
triggerQuotationDialog({