fix: allow receiving dept leaders to download pending attachments in task detail

This commit is contained in:
Your Name 2026-02-24 15:36:12 +08:00
parent 0e36d9fd36
commit f483ad4738

View File

@ -3412,14 +3412,18 @@ const isHighScoreTask = (task: TaskOrSubTask) => {
return task.score && task.score >= 500
}
// 判断是否可以下载附件(非pending状态或管理员可下载)
// 判断是否可以下载附件
const canDownloadAttachment = (task: TaskOrSubTask) => {
// 管理员可以下载
// 管理员可下载
const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}')
if (userInfo.isAdmin === 1 || userInfo.isAdmin === true) {
return true
}
// 非pending状态可以下载(已接单、进行中、已完成等)
// 接单部门负责人在可接任务视角可提前查看附件
if (task.status === 'pending' && canViewAvailableTaskAttachmentInfo.value) {
return true
}
// 非pending状态可下载(已接单、进行中、已完成等)
if (task.status !== 'pending') {
return true
}