|
|
|
|
@ -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'); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|