fix lable of katod
This commit is contained in:
@@ -60,29 +60,23 @@
|
||||
ریال
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.wallet?.product" :class="variant === 'desktop' ? 'dtxn-detail__row' : 'flex justify-between mb-3'">
|
||||
<div
|
||||
v-if="showMetalWalletBalance"
|
||||
:class="variant === 'desktop' ? 'dtxn-detail__row' : 'flex justify-between mb-3'"
|
||||
>
|
||||
<div :class="variant === 'desktop' ? 'dtxn-detail__label' : 'text-primary'">
|
||||
موجودی {{ item.wallet.product.title }}:
|
||||
{{ metalWalletBalanceLabel }}:
|
||||
</div>
|
||||
<div class="flex flex-col items-end text-xs text-yellow-700">
|
||||
<div class="flex items-center">
|
||||
<div class="text-base ml-1">{{ formatGoldAmount(item.balance_gold) }}</div>
|
||||
{{ getProductQuantityUnit(item.wallet.product) }}
|
||||
{{ metalWalletBalanceUnit }}
|
||||
</div>
|
||||
<div v-if="getProductUnitWeightLabel(item.wallet.product)" class="text-gray-500">
|
||||
هر عدد {{ getProductUnitWeightLabel(item.wallet.product) }}
|
||||
<div v-if="getProductUnitWeightLabel(metalWalletProduct)" class="text-gray-500">
|
||||
هر عدد {{ getProductUnitWeightLabel(metalWalletProduct) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else :class="variant === 'desktop' ? 'dtxn-detail__row' : 'flex justify-between mb-3'">
|
||||
<div :class="variant === 'desktop' ? 'dtxn-detail__label' : 'text-primary'">
|
||||
{{ getGoldWalletLabel(item.wallet?.product?.group_type) }}:
|
||||
</div>
|
||||
<div class="flex text-xs text-yellow-700 items-center">
|
||||
<div class="text-base ml-1">{{ formatGoldAmount(item.balance_gold) }}</div>
|
||||
{{ getWeightUnit() }}
|
||||
</div>
|
||||
</div>
|
||||
<div :class="variant === 'desktop' ? 'dtxn-detail__row' : 'flex justify-between mb-3'">
|
||||
<div :class="variant === 'desktop' ? 'dtxn-detail__label' : 'text-primary'">وضعیت:</div>
|
||||
<div class="flex text-xs items-center">
|
||||
@@ -112,13 +106,12 @@ import { formatGoldAmount, usePriceWithoutType } from '@/utils/usePrice'
|
||||
import type { Transaction } from '@/models/transaction'
|
||||
import {
|
||||
getCashWalletLabel,
|
||||
getGoldWalletLabel,
|
||||
getMeltedGoldTradeLabel,
|
||||
getProductQuantityUnit,
|
||||
getProductTotalWeightLabel,
|
||||
getProductUnitWeightLabel,
|
||||
getTransactionMetalWalletBalanceLabel,
|
||||
getTransactionMetalWalletBalanceUnit,
|
||||
getTransactionTradePriceLabel,
|
||||
getWeightUnit,
|
||||
getMeltedGoldTradeLabel,
|
||||
resolveTransactionTradeProduct,
|
||||
shouldShowTransactionTotalWeightLine,
|
||||
} from '@/utils/productDealMethod'
|
||||
@@ -136,4 +129,19 @@ const tradeProduct = computed(() => resolveTransactionTradeProduct(props.item))
|
||||
const tradeProductLabel = computed(
|
||||
() => (tradeProduct.value?.title ?? '').trim() || getMeltedGoldTradeLabel(),
|
||||
)
|
||||
const metalWalletProduct = computed(() => {
|
||||
if (props.item.order && tradeProduct.value?.title) {
|
||||
return tradeProduct.value
|
||||
}
|
||||
|
||||
return props.item.wallet?.product ?? tradeProduct.value ?? null
|
||||
})
|
||||
const metalWalletBalanceLabel = computed(() => getTransactionMetalWalletBalanceLabel(props.item))
|
||||
const metalWalletBalanceUnit = computed(() => getTransactionMetalWalletBalanceUnit(props.item))
|
||||
const showMetalWalletBalance = computed(
|
||||
() =>
|
||||
props.item.order != null
|
||||
|| props.item.wallet?.product != null
|
||||
|| Math.abs(Number(props.item.balance_gold) || 0) > 0,
|
||||
)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user