人效管理-绩效管理-绩效填报-详情-接口对接

dev-scheduling
ysn 1 month ago
parent a71eefc721
commit 5fe2875c46
  1. 30
      src/views/personnelEfficiencyManagement/performanceManagement/components/prefDetail.vue

@ -167,32 +167,11 @@ export default {
}); });
}, },
downloadDetail() { downloadDetail() {
if (!this.row.subTasks || this.row.subTasks.length === 0) {
this.$message.warning('暂无可下载文件!');
return;
}
const completedTasks = this.row.subTasks.filter(task => task.status === 2); 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('暂无可下载文件!'); this.$message.warning('暂无可下载文件!');
return; 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 => { this.row.subTasks.forEach(task => {
if (task.attachLink != '') { if (task.attachLink != '') {
downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); 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> </script>

Loading…
Cancel
Save