Commit 240db610 by zhangxw

批量操作绩效,计算保留两位小数

1 parent 4aa1f91d
...@@ -128,10 +128,10 @@ Page({ ...@@ -128,10 +128,10 @@ Page({
}) })
// 未输入手动维护绩效金额 根据评分等级系数计算绩效工资 // 未输入手动维护绩效金额 根据评分等级系数计算绩效工资
if (((batchSingleList[singleSelectIndex].manualFinalPerformanceAmount ?? '') === '')) { if (((batchSingleList[singleSelectIndex].manualFinalPerformanceAmount ?? '') === '')) {
const performanceSalary = NP.times(NP.times(batchSingleList[singleSelectIndex].afterAttendanceTotalBasicSalary, 0.3), obj.rewardCoefficient) const performanceSalary = NP.round(NP.times(NP.times(batchSingleList[singleSelectIndex].afterAttendanceTotalBasicSalary, 0.3), obj.rewardCoefficient), 2)
this.setData({ this.setData({
[`batchSingleList[${singleSelectIndex}].performanceSalary`]: performanceSalary, [`batchSingleList[${singleSelectIndex}].performanceSalary`]: performanceSalary,
[`batchSingleList[${singleSelectIndex}].basicSalary`]: NP.plus(performanceSalary, batchSingleList[singleSelectIndex].baseSalary) [`batchSingleList[${singleSelectIndex}].basicSalary`]: NP.round(NP.plus(performanceSalary, batchSingleList[singleSelectIndex].baseSalary), 2)
}) })
} }
} }
...@@ -228,11 +228,11 @@ Page({ ...@@ -228,11 +228,11 @@ Page({
}) })
} else { } else {
// 计算绩效工资,没有手动维护金额按绩效等级系数进行计算 // 计算绩效工资,没有手动维护金额按绩效等级系数进行计算
const computedValue = value || (batchSingleList[index]?.manualGradeCode ? NP.times(NP.times(batchSingleList[index]?.afterAttendanceTotalBasicSalary, 0.3), batchSingleList[index].manualRewardCoefficient) : 0) const computedValue = value || (batchSingleList[index]?.manualGradeCode ? NP.round(NP.times(NP.times(batchSingleList[index]?.afterAttendanceTotalBasicSalary, 0.3), batchSingleList[index].manualRewardCoefficient), 2) : 0)
this.setData({ this.setData({
[`batchSingleList[${index}].manualFinalPerformanceAmount`]: value, [`batchSingleList[${index}].manualFinalPerformanceAmount`]: value,
[`batchSingleList[${index}].performanceSalary`]: computedValue, [`batchSingleList[${index}].performanceSalary`]: computedValue,
[`batchSingleList[${index}].basicSalary`]: NP.plus(computedValue, batchSingleList[index]?.baseSalary) [`batchSingleList[${index}].basicSalary`]: NP.round(NP.plus(computedValue, batchSingleList[index]?.baseSalary), 2)
}) })
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!