Files
tehran_taj/apps/admin-panel/src/views/wallet/wallet.vue
T

44 lines
1.5 KiB
Vue

<template>
<!--
Ported from legacy henza_admin/src/views/wallet/wallet.vue.
The "میزان شارژ پس از هر سفارش" card at the top of the legacy file is
COMMENTED OUT there and stays absent here. Note the card is gated on
`wallet.percent` even though it renders the charge LIST — legacy's own
mismatch, preserved.
-->
<div>
<a-card v-if="hasPermission('wallet.percent')" title="لیست کیف پول های شارژ شده" class="page-card">
<XTable ref="tbl" :model="model" mobile-cards>
<template #time="{ text }">
{{ text ? jdateTime(text) : '' }}
</template>
<template #value="{ text, record }">
<span :class="{ 'text-danger': text < 0, 'text-success': text > 0 }">
<template v-if="record.transaction_type == 1">
{{ Math.abs(Number(text)) }} گرم
</template>
<template v-else>
{{ priceUnit(Math.abs(Number(text))) }}
</template>
</span>
</template>
</XTable>
</a-card>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import XTable from '../../components/x-table/XTable.vue';
import { buildWalletModel } from './walletTbl';
import { useUsersStore } from '../../stores/users';
import { jdateTime, priceUnit } from '../../utils/filters';
const users = useUsersStore();
const hasPermission = (rid: string) => Boolean(users.hasPermission(rid));
const model = buildWalletModel();
const tbl = ref<{ fetch: () => Promise<void> } | null>(null);
</script>