|
|
@@ -1,6 +1,7 @@
|
|
|
import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo'
|
|
|
import { getUsrId } from '@/services/bus/user'
|
|
|
import { FinanceReportReq } from "@/services/go/ermcp/report/interface"
|
|
|
+import { getDecimalsNum } from '@/utils/number'
|
|
|
import moment, { Moment } from "moment"
|
|
|
import { ref, SetupContext } from "vue"
|
|
|
import { reportCycleType, reportCyleTimeType } from "./enum"
|
|
|
@@ -103,6 +104,7 @@ export function queryTableList<T>(fn: Function) {
|
|
|
queryResultLoadingAndInfo(fn, loading, param).then(res => {
|
|
|
const result = res?.map((e: T, i: number) => {
|
|
|
for (const item in e) {
|
|
|
+ // 折中方案:处理浮点失真,如果页面卡顿,则需要服务处理
|
|
|
e[item] = getDecimalsNum(e[item])
|
|
|
}
|
|
|
return { ...e, key: String(i) };
|
|
|
@@ -112,16 +114,3 @@ export function queryTableList<T>(fn: Function) {
|
|
|
}
|
|
|
return { loading, tableList, queryTable }
|
|
|
}
|
|
|
-
|
|
|
-function getDecimalsNum(val: any) {
|
|
|
- let result = val
|
|
|
- if (typeof val === 'number') {
|
|
|
- const str = val.toString();
|
|
|
- const num = str.indexOf('.') + 1;
|
|
|
- const count = str.length - num;
|
|
|
- if (count > 6) {
|
|
|
- result = val.toFixed(2)
|
|
|
- }
|
|
|
- }
|
|
|
- return result
|
|
|
-}
|