fix: 金额显示问题

This commit is contained in:
xingyu4j
2025-06-11 18:12:24 +08:00
parent 355a2056f4
commit 21f2472561
3 changed files with 15 additions and 9 deletions

View File

@@ -9,7 +9,12 @@ import { formatDateTime } from '@vben/utils';
import { Tag } from 'ant-design-vue';
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
import {
DICT_TYPE,
floatToFixed2,
getDictOptions,
getRangePickerDefaultProps,
} from '#/utils';
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
@@ -120,7 +125,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'price',
title: '转账金额',
formatter: ({ cellValue }) => `${(cellValue / 100).toFixed(2)}`,
formatter: 'formatAmount2',
},
{
field: 'status',
@@ -217,7 +222,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
content: (data) => {
return h(Tag, {
color: 'blue',
content: `${(data?.price / 100).toFixed(2)}`,
content: `${floatToFixed2(data?.price)}`,
});
},
},