diff --git a/jeecgboot-vue3/src/utils/common/compUtils.ts b/jeecgboot-vue3/src/utils/common/compUtils.ts index 9a59edc5..f03b8078 100644 --- a/jeecgboot-vue3/src/utils/common/compUtils.ts +++ b/jeecgboot-vue3/src/utils/common/compUtils.ts @@ -6,6 +6,7 @@ import { reactive } from "vue"; import { getTenantId, getToken } from "/@/utils/auth"; import { useUserStoreWithOut } from "/@/store/modules/user"; import dayjs from 'dayjs'; +import Big from 'big.js'; import { Modal } from "ant-design-vue"; import { defHttp } from "@/utils/http/axios"; @@ -148,11 +149,16 @@ export function mapTableTotalSummary(tableData: Recordable[], fieldKeys: string[ // update-begin--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算 const value = Number(next[key]); if (!Number.isNaN(value)) { - prev += value; + // update-begin--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 + prev = Big(prev).plus(value).toString(); + // update-end--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 } - // update-end--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算 + // update-end--author:liaozhiyang---date:20240118---for:【issues/7830】PR 合计工具方法,转换为Nuber类型再计算 return prev; }, 0); + // update-begin--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 + totals[key] = +totals[key]; + // update-end--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 }); return totals; }