diff --git a/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts b/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts index c11e36a..28e15e8 100644 --- a/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts +++ b/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts @@ -17,7 +17,9 @@ export const checkUnEmp = (val: any) => { //计算一个table的最高分 export const subCountScore = (subData: any) => { - return subData?.detailList?.reduce((preValue: any, item: any) => { return preValue + parseFloat(item.highScore) }, 0) + const mul = 10 ^ 5; + const sum = subData?.detailList?.reduce((preValue: any, item: any) => { return preValue + item.highScore * mul }, 0); + return Math.round(sum) / mul; } //单选取最大 @@ -33,16 +35,17 @@ export function chooseOne(data: any) { //多选加和 export function chooseMany(data: any) { let max = 0; + const mul = 10 ^ 5; if (data != undefined && data.length > 0) { max = data.reduce((preVal: any, item: any) => { if (item.standardDetailScore != '') { - return preVal + parseFloat(item.standardDetailScore) + return preVal + item.standardDetailScore * mul; } else { return preVal } }, 0) } - return max; + return Math.round(max) / mul; } //修改最大值 export function changeHighScore(method: any, list: any) {