diff --git a/src/pages/05_quotation/peview/ViewForm.vue b/src/pages/05_quotation/peview/ViewForm.vue index b730563b..510f0b0b 100644 --- a/src/pages/05_quotation/peview/ViewForm.vue +++ b/src/pages/05_quotation/peview/ViewForm.vue @@ -159,16 +159,18 @@ onMounted(async () => { data.value = JSON.parse(sessionStorage.getItem('quotation-preview') || '{}'); - productList.value = data.value?.productServiceList.map((v) => ({ - id: v.product.id, - code: v.product.code, - detail: v.product.detail, - amount: v.amount, - priceUnit: v.pricePerUnit, - discount: v.discount, - vat: v.vat, - value: 0, - })); + if (data.value) { + productList.value = data.value?.productServiceList.map((v) => ({ + id: v.product.id, + code: v.product.code, + detail: v.product.detail, + amount: v.amount, + priceUnit: v.pricePerUnit || 0, + discount: v.discount || 0, + vat: v.vat || 0, + value: 0, + })); + } summaryPrice.value = obj.productServiceList.reduce( (a, c) => {