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

dev-scheduling
ysn 1 month ago
parent c6d0246962
commit 4e29ea77d7
  1. 26
      src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue

@ -71,7 +71,7 @@
删除 删除
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.parentId && scope.row.status == 2" v-if="scope.row.parentId && scope.row.status == 2 && scope.row.parentStatus == 1"
type="text" type="text"
@click="resetTaskDetail(scope.row)" @click="resetTaskDetail(scope.row)"
> >
@ -350,10 +350,11 @@ export default {
downloadBsEfficiencyTaskTemplate() downloadBsEfficiencyTaskTemplate()
.then(res => { .then(res => {
downloadXls(res.data, `${row.yearMonth}绩效填报模板.xlsx`); downloadXls(res.data, `${row.yearMonth}绩效填报模板.xlsx`);
row.subTasks.forEach(task => { // 2
if (task.attachLink != '') { const completedTasks = row.subTasks.filter(task => task.status === 2);
completedTasks.forEach(task => {
if (task.attachLink) {
downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); downloadFileBlob(task.attachLink, task.taskName + '.xlsx');
return;
} }
}); });
}) })
@ -475,7 +476,22 @@ export default {
pageBsEfficiencyTask(params) pageBsEfficiencyTask(params)
.then(res => { .then(res => {
if (res.data.code === 200) { 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; this.page.total = res.data.data.total || 0;
} else { } else {
this.data = []; this.data = [];

Loading…
Cancel
Save