From 4e29ea77d7985bb70d90516d77575e64f2a71067 Mon Sep 17 00:00:00 2001 From: ysn <2126564605@qq.com> Date: Thu, 23 Apr 2026 14:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E6=95=88=E7=AE=A1=E7=90=86-=E7=BB=A9?= =?UTF-8?q?=E6=95=88=E7=AE=A1=E7=90=86-=E7=BB=A9=E6=95=88=E5=A1=AB?= =?UTF-8?q?=E6=8A=A5-=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performanceManagement/dataReporting.vue | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue b/src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue index 0cc1dd0f..766975fd 100644 --- a/src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue +++ b/src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue @@ -71,7 +71,7 @@ 删除 @@ -350,10 +350,11 @@ export default { downloadBsEfficiencyTaskTemplate() .then(res => { downloadXls(res.data, `${row.yearMonth}绩效填报模板.xlsx`); - row.subTasks.forEach(task => { - if (task.attachLink != '') { + // 只下载状态为2(已完成)的任务文件 + const completedTasks = row.subTasks.filter(task => task.status === 2); + completedTasks.forEach(task => { + if (task.attachLink) { downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); - return; } }); }) @@ -475,7 +476,22 @@ export default { pageBsEfficiencyTask(params) .then(res => { if (res.data.code === 200) { - this.data = res.data.data.records || []; + // 为子任务添加父级状态 + const processTasks = (tasks) => { + return tasks.map(task => { + if (task.subTasks && task.subTasks.length > 0) { + // 为每个子任务添加父级状态 + task.subTasks = task.subTasks.map(subTask => ({ + ...subTask, + parentStatus: task.status // 添加父级状态 + })); + // 递归处理子任务的子任务 + processTasks(task.subTasks); + } + return task; + }); + }; + this.data = processTasks(res.data.data.records || []); this.page.total = res.data.data.total || 0; } else { this.data = [];