From 0e36d9fd360a88d8932bb189e1203845d2931b46 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 24 Feb 2026 15:32:03 +0800 Subject: [PATCH] feat: allow receiving dept leaders to view available task attachments --- frontend/src/views/TaskHall.vue | 36 ++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/TaskHall.vue b/frontend/src/views/TaskHall.vue index 1ab362a..b69d31a 100644 --- a/frontend/src/views/TaskHall.vue +++ b/frontend/src/views/TaskHall.vue @@ -299,10 +299,25 @@ - 附件: + + 附件: + + 附件{{ index + 1 }} + + + + 附件: - {{ (task.attachmentUrl || '').split(',').filter(u => u.trim()).length }}个附件(接单后可下载) + {{ parseAttachmentUrls(task.attachmentUrl).length }}个附件(接单后可下载) @@ -3411,6 +3426,22 @@ const canDownloadAttachment = (task: TaskOrSubTask) => { return false } +// 解析附件链接 +const parseAttachmentUrls = (attachmentUrl?: string) => { + if (!attachmentUrl) return [] + return attachmentUrl.split(',').map(url => url.trim()).filter(Boolean) +} + +// 可接任务卡片:接单部门负责人可提前查看附件信息 +const canViewAvailableTaskAttachmentInfo = computed(() => { + const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}') + const isAdmin = userInfo.isAdmin === 1 || userInfo.isAdmin === true + if (isAdmin) { + return true + } + return isDepartmentLeader.value && effectiveDeptType.value === 'receiving' +}) + // 加载配置数据(从全局store加载) const loadConfigs = async () => { try { @@ -8628,4 +8659,3 @@ onUnmounted(() => { color: #888 !important; } -