feat(工资结算记录): 历史薪资设置只计算已结算的记录

This commit is contained in:
hzj 2025-12-23 11:49:38 +08:00
parent e6c0fa5fc9
commit bf729514d4

View File

@ -397,9 +397,11 @@ const fetchWorkReports = async (userId) => {
})) }))
// - // -
const totalAmount = targets.reduce((sum, target) => { const totalAmount = targets.reduce((sum, target, index) => {
let salary = 0 let salary = 0
//
if (index > 0) {
// 使 // 使
if (userIdentity.body?.agent) { if (userIdentity.body?.agent) {
// agent true 使 ownSalary // agent true 使 ownSalary
@ -411,8 +413,11 @@ const fetchWorkReports = async (userId) => {
// anchor true 使 memberSalary // anchor true 使 memberSalary
salary = parseFloat(target.target?.settlementResult?.memberSalary || 0) salary = parseFloat(target.target?.settlementResult?.memberSalary || 0)
} }
return sum + salary return sum + salary
} else {
// sum
return sum
}
}, 0) }, 0)
totalSalary.value = totalAmount.toFixed(2) totalSalary.value = totalAmount.toFixed(2)