新增财务仪表盘并统一金额到角
This commit is contained in:
@@ -222,7 +222,7 @@ function readError(error: unknown, fallback: string) {
|
||||
}
|
||||
|
||||
function formatMoney(value: number) {
|
||||
return `¥${Number(value || 0).toFixed(2)}`
|
||||
return `¥${(Math.round(Number(value || 0) * 10) / 10).toFixed(1)}`
|
||||
}
|
||||
|
||||
function walletBizTypeLabel(type: string) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
type WithdrawalRequest,
|
||||
} from '../api/withdrawal'
|
||||
import { fetchWalletBalance, type WalletAccount } from '../api/wallet'
|
||||
import { formatMoney, formatMoneyWithSymbol } from '@/shared/utils/money'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -84,7 +85,7 @@ async function handleSubmit() {
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确认提现 ¥${withdrawForm.value.amount.toFixed(2)} 到 ${selectedAccount.value?.account_name} (${selectedAccount.value?.account_no}) ?`,
|
||||
`确认提现 ${formatMoneyWithSymbol(withdrawForm.value.amount)} 到 ${selectedAccount.value?.account_name} (${selectedAccount.value?.account_no}) ?`,
|
||||
'确认提现',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
@@ -175,7 +176,7 @@ function accountTypeLabel(type: string) {
|
||||
<el-icon><Wallet /></el-icon>
|
||||
可用余额
|
||||
</div>
|
||||
<div class="balance-value">¥{{ account?.available_balance.toFixed(2) || '0.00' }}</div>
|
||||
<div class="balance-value">¥{{ formatMoney(account?.available_balance) }}</div>
|
||||
</div>
|
||||
<div class="balance-item">
|
||||
<div class="balance-label">
|
||||
@@ -183,7 +184,7 @@ function accountTypeLabel(type: string) {
|
||||
冻结余额
|
||||
</div>
|
||||
<div class="balance-value frozen">
|
||||
¥{{ account?.frozen_balance.toFixed(2) || '0.00' }}
|
||||
¥{{ formatMoney(account?.frozen_balance) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -251,7 +252,7 @@ function accountTypeLabel(type: string) {
|
||||
|
||||
<el-form-item label="到账金额">
|
||||
<div class="actual-amount">
|
||||
¥{{ withdrawForm.amount > 0 ? withdrawForm.amount.toFixed(2) : '0.00' }}
|
||||
¥{{ formatMoney(withdrawForm.amount > 0 ? withdrawForm.amount : 0) }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
@@ -264,7 +265,7 @@ function accountTypeLabel(type: string) {
|
||||
show-icon
|
||||
style="margin-bottom: 16px"
|
||||
>
|
||||
余额不足,可用余额:¥{{ account.available_balance.toFixed(2) }}
|
||||
余额不足,可用余额:¥{{ formatMoney(account.available_balance) }}
|
||||
</el-alert>
|
||||
|
||||
<el-alert type="info" :closable="false" show-icon style="margin-bottom: 16px">
|
||||
@@ -308,7 +309,7 @@ function accountTypeLabel(type: string) {
|
||||
<el-table-column prop="withdraw_no" label="提现单号" min-width="180" />
|
||||
<el-table-column label="提现金额" width="120">
|
||||
<template #default="{ row }">
|
||||
<span style="color: #f56c6c; font-weight: 600"> ¥{{ row.amount.toFixed(2) }} </span>
|
||||
<span style="color: #f56c6c; font-weight: 600"> ¥{{ formatMoney(row.amount) }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收款方式" width="150">
|
||||
|
||||
Reference in New Issue
Block a user