fix(*): 全量 UI 审查与 undefined 展示异常修复
This commit is contained in:
@@ -50,6 +50,11 @@ import {
|
||||
INVOICE_STATUS_COLOR,
|
||||
} from '../../constants';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
import {
|
||||
formatCurrency,
|
||||
formatNumber,
|
||||
toFiniteNumber,
|
||||
} from '../../helpers/safeDisplay';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
@@ -150,7 +155,7 @@ const Invoice = () => {
|
||||
// 计算选中记录的金额合计
|
||||
const selectedAmount = availableTopups
|
||||
.filter((t) => selectedTopupIds.includes(t.id))
|
||||
.reduce((sum, t) => sum + (t.money || 0), 0);
|
||||
.reduce((sum, t) => sum + (toFiniteNumber(t.money) ?? 0), 0);
|
||||
|
||||
// 选择常用开票信息
|
||||
const handleSelectTitle = (titleId) => {
|
||||
@@ -315,7 +320,7 @@ const Invoice = () => {
|
||||
title: t('支付金额'),
|
||||
dataIndex: 'money',
|
||||
width: 100,
|
||||
render: (v) => (v ? `¥${Number(v).toFixed(2)}` : '-'),
|
||||
render: (v) => formatCurrency(v),
|
||||
},
|
||||
{
|
||||
title: t('订单号'),
|
||||
@@ -343,7 +348,7 @@ const Invoice = () => {
|
||||
title: t('开票金额'),
|
||||
dataIndex: 'amount',
|
||||
width: 100,
|
||||
render: (v) => `¥${Number(v).toFixed(2)}`,
|
||||
render: (v) => formatCurrency(v),
|
||||
},
|
||||
{
|
||||
title: t('状态'),
|
||||
@@ -449,7 +454,7 @@ const Invoice = () => {
|
||||
<span className='text-lg font-bold text-amber-600 dark:text-amber-400'>
|
||||
{t('合计')}
|
||||
{I18N_TECHNICAL_TEXT.CNY_TOTAL_SEPARATOR}
|
||||
{selectedAmount.toFixed(2)}
|
||||
{formatNumber(selectedAmount, 2, '0.00')}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -584,7 +589,7 @@ const Invoice = () => {
|
||||
<div className='flex justify-between'>
|
||||
<Text>{t('开票金额')}</Text>
|
||||
<Text strong className='text-amber-600'>
|
||||
¥{Number(detailData.amount).toFixed(2)}
|
||||
{formatCurrency(detailData.amount)}
|
||||
</Text>
|
||||
</div>
|
||||
<div className='flex justify-between'>
|
||||
@@ -640,7 +645,7 @@ const Invoice = () => {
|
||||
)}
|
||||
</span>
|
||||
<span className='font-medium'>
|
||||
¥{Number(topup.money).toFixed(2)}
|
||||
{formatCurrency(topup.money)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user