mirror of https://github.com/jeecgboot/jeecg-boot
【issues/7830】合计小数计算精度 ---
parent
45f905ddac
commit
56661815ec
|
@ -6,6 +6,7 @@ import { reactive } from "vue";
|
||||||
import { getTenantId, getToken } from "/@/utils/auth";
|
import { getTenantId, getToken } from "/@/utils/auth";
|
||||||
import { useUserStoreWithOut } from "/@/store/modules/user";
|
import { useUserStoreWithOut } from "/@/store/modules/user";
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import Big from 'big.js';
|
||||||
|
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import { defHttp } from "@/utils/http/axios";
|
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类型再计算
|
// update-begin--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算
|
||||||
const value = Number(next[key]);
|
const value = Number(next[key]);
|
||||||
if (!Number.isNaN(value)) {
|
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;
|
return prev;
|
||||||
}, 0);
|
}, 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;
|
return totals;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue