fix: 修复待我审核标签页数量计算,同时包含主任务和子任务组

This commit is contained in:
Your Name 2026-01-07 17:25:44 +08:00
parent 146f439fd5
commit 0c12b28f7a

View File

@ -4611,13 +4611,21 @@ const loadAllTabCounts = async () => {
}).catch(() => {})
)
// 6. 待我审核任务数量(仅部门负责人)
// 6. 待我审核任务数量(仅部门负责人)- 需要同时计算主任务和子任务组
if (isDepartmentLeader.value) {
promises.push(
taskApi.getPendingApprovalTasks().then(res => {
if (res.code === 200) {
pendingApprovalTotal.value = (res.data || []).length
Promise.all([
taskApi.getPendingApprovalTasks(),
taskApi.getPendingApprovalTaskGroups()
]).then(([tasksRes, groupsRes]) => {
let count = 0
if (tasksRes.code === 200) {
count += (tasksRes.data || []).length
}
if (groupsRes.code === 200) {
count += (groupsRes.data || []).length
}
pendingApprovalTotal.value = count
}).catch(() => {})
)
}