fix reports

This commit is contained in:
2026-06-24 01:46:30 +03:30
parent 69da635247
commit 78ce8ad4b4
5 changed files with 295 additions and 101 deletions
@@ -62,15 +62,28 @@
{{ row.sts_str || '-' }}
</span>
<div class="flex flex-wrap items-center gap-2">
<span
class="inline-flex rounded-lg border px-2 py-0.5 text-xs font-600"
:class="typeTagClass(row)"
>
{{ typeLabel(row) }}
</span>
</div>
<div class="space-y-2">
<MobileStatCard bordered variant="danger" label="مقدار (ریال)" :value="usePrice(row.cash ?? 0, true, '')">
<MobileStatCard
bordered
:variant="amountVariant(row)"
label="مقدار"
:value="amountLabel(row)"
>
<template #prefix>
<BaseIcon icon="vuesax-linear:empty-wallet" size="18" color="#dc2626" />
</template>
</MobileStatCard>
<MobileStatCard bordered variant="warning" :label="metalLabel.goldUnit()" :value="goldLabel(row)">
<template #prefix>
<BaseIcon icon="vuesax-linear:coin" size="18" color="#b45309" />
<BaseIcon
:icon="isMoneyWithdraw(row) ? 'vuesax-linear:empty-wallet' : 'vuesax-linear:coin'"
size="18"
:color="amountIconColor(row)"
/>
</template>
</MobileStatCard>
</div>
@@ -104,10 +117,14 @@ import MobileInfoGrid from '@/components/mobile/MobileInfoGrid.vue'
import MobileSheetHeader from '@/components/mobile/MobileSheetHeader.vue'
import MobileStatCard from '@/components/mobile/MobileStatCard.vue'
import { status } from '@/pages/menuPages/withdraw/information/hooks/status'
import {
formatWithdrawAmountDisplay,
isMoneyWithdraw,
withdrawAmountValue,
withdrawTypeLabel
} from '@/pages/menuPages/withdraw/utils/withdrawDisplay'
import { isMobile } from '@core/utils/is'
import { toJalali } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel } from '@/utils/adminMetalLabels'
import { toNumber } from 'lodash'
import { useRouter } from 'vue-router'
@@ -155,8 +172,36 @@ function noteLabel(row: Withdraw) {
return String(row.note)
}
function goldLabel(row: Withdraw) {
if (row.gold == null) return '-'
return String(row.gold)
function typeLabel(row: Withdraw) {
return withdrawTypeLabel(row)
}
function typeTagClass(row: Withdraw) {
if (!isMoneyWithdraw(row)) {
return 'border-amber-300 bg-amber-50 text-amber-700'
}
return withdrawAmountValue(row) > 0
? 'border-green-300 bg-green-50 text-green-700'
: withdrawAmountValue(row) < 0
? 'border-red-300 bg-red-50 text-red-700'
: 'border-gray-300 bg-gray-50 text-gray-700'
}
function amountLabel(row: Withdraw) {
return formatWithdrawAmountDisplay(row)
}
function amountVariant(row: Withdraw) {
const value = withdrawAmountValue(row)
if (value > 0) return 'success'
if (value < 0) return 'danger'
return 'warning'
}
function amountIconColor(row: Withdraw) {
const value = withdrawAmountValue(row)
if (value > 0) return '#15803d'
if (value < 0) return '#dc2626'
return '#b45309'
}
</script>