feat: conditionally display price rows in PriceDataComponent based on availability
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s

This commit is contained in:
puriphatt 2025-07-08 13:39:53 +07:00
parent 2b310c667d
commit a89de83fe9

View file

@ -167,26 +167,28 @@ withDefaults(
<div class="col-12 full-width"> <div class="col-12 full-width">
<q-table <q-table
:rows-per-page-options="[0]" :rows-per-page-options="[0]"
:rows="[ :rows="
{ [
priceDisplay.price && {
label: $t('productService.product.salePrice'), label: $t('productService.product.salePrice'),
pricePerUnit: price, pricePerUnit: price,
calcVat, calcVat,
vatIncluded, vatIncluded,
}, },
{ priceDisplay.agentPrice && {
label: $t('productService.product.agentPrice'), label: $t('productService.product.agentPrice'),
calcVat: agentPriceCalcVat, calcVat: agentPriceCalcVat,
vatIncluded: agentPriceVatIncluded, vatIncluded: agentPriceVatIncluded,
pricePerUnit: agentPrice, pricePerUnit: agentPrice,
}, },
{ priceDisplay.serviceCharge && {
label: $t('productService.product.processingPrice'), label: $t('productService.product.processingPrice'),
calcVat: serviceChargeCalcVat, calcVat: serviceChargeCalcVat,
vatIncluded: serviceChargeVatIncluded, vatIncluded: serviceChargeVatIncluded,
pricePerUnit: serviceCharge, pricePerUnit: serviceCharge,
}, },
]" ].filter(Boolean)
"
:columns :columns
hide-bottom hide-bottom
bordered bordered