From 5fe2875c4673776a7951835151e0fe1a1ded6966 Mon Sep 17 00:00:00 2001 From: ysn <2126564605@qq.com> Date: Thu, 23 Apr 2026 09:51:32 +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-=E8=AF=A6=E6=83=85-=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/prefDetail.vue | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/src/views/personnelEfficiencyManagement/performanceManagement/components/prefDetail.vue b/src/views/personnelEfficiencyManagement/performanceManagement/components/prefDetail.vue index 00fe3616..f173a08c 100644 --- a/src/views/personnelEfficiencyManagement/performanceManagement/components/prefDetail.vue +++ b/src/views/personnelEfficiencyManagement/performanceManagement/components/prefDetail.vue @@ -167,32 +167,11 @@ export default { }); }, downloadDetail() { - if (!this.row.subTasks || this.row.subTasks.length === 0) { - this.$message.warning('暂无可下载文件!'); - return; - } const completedTasks = this.row.subTasks.filter(task => task.status === 2); - if (completedTasks.length === 0) { + if (!this.row.subTasks || this.row.subTasks.length === 0 || completedTasks.length === 0) { this.$message.warning('暂无可下载文件!'); return; } - // 调用模板下载接口 - downloadBsEfficiencyTaskTemplate() - .then(res => { - downloadXls(res.data, `${this.row.yearMonth}绩效填报模板.xlsx`); - this.row.subTasks.forEach(task => { - if (task.attachLink != '') { - downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); - return; - } - }); - }) - .catch(error => { - console.error('下载模板失败:', error); - this.$message.error('下载失败,请检查网络或稍后重试'); - }); - }, - downloadSummary() { this.row.subTasks.forEach(task => { if (task.attachLink != '') { downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); @@ -200,6 +179,13 @@ export default { } }); }, + downloadSummary() { + if (this.row.attachLink == '') { + this.$message.warning('暂无可下载文件!'); + return; + } + downloadFileBlob(this.row.attachLink, this.row.taskName + '.xlsx'); + }, }, };