feat: add additional info to preview

This commit is contained in:
Methapon Metanipat 2024-10-18 12:32:55 +07:00
parent 5a8e17f236
commit 859c6b7961
3 changed files with 16 additions and 4 deletions

View file

@ -115,7 +115,9 @@ onMounted(async () => {
delete localStorage['quotation-preview'];
data.value = JSON.parse(sessionStorage.getItem('quotation-preview') || '{}');
const parsed = JSON.parse(sessionStorage.getItem('quotation-preview') || '');
data.value = 'data' in parsed ? parsed.data : undefined;
if (data.value) {
const res = await branchStore.fetchById(data.value?.registeredBranchId);
@ -149,7 +151,7 @@ onMounted(async () => {
})) || [];
}
summaryPrice.value = obj.productServiceList.reduce(
summaryPrice.value = (data.value?.productServiceList || []).reduce(
(a, c) => {
const price = precisionRound((c.pricePerUnit || 0) * c.amount);
const vat = precisionRound(