|
@@ -61,14 +61,25 @@
|
|
|
this.getInfo(processInstanceId)
|
|
this.getInfo(processInstanceId)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getChildren(data) {
|
|
|
|
|
+ const arr = [];
|
|
|
|
|
+ (data || []).forEach((item) => {
|
|
|
|
|
+ if (item.children && item.children.length > 0) {
|
|
|
|
|
+ arr.push(...this.getChildren(item.children));
|
|
|
|
|
+ }
|
|
|
|
|
+ arr.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ return arr;
|
|
|
|
|
+ },
|
|
|
async getInfo(processInstanceId) {
|
|
async getInfo(processInstanceId) {
|
|
|
// 审批记录
|
|
// 审批记录
|
|
|
let data = await getTaskListByProcessinstanceid(processInstanceId)
|
|
let data = await getTaskListByProcessinstanceid(processInstanceId)
|
|
|
// 移除已取消的审批
|
|
// 移除已取消的审批
|
|
|
data.forEach((task) => {
|
|
data.forEach((task) => {
|
|
|
- if (task.result !== 4) {
|
|
|
|
|
- this.tasks.push(task);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (task.result !== 4) {
|
|
|
|
|
+ // this.tasks.push(task);
|
|
|
|
|
+ this.tasks.push(...this.getChildren([task]));
|
|
|
|
|
+ // }
|
|
|
});
|
|
});
|
|
|
// 排序,将未完成的排在前面,已完成的排在后面;
|
|
// 排序,将未完成的排在前面,已完成的排在后面;
|
|
|
this.tasks.sort((a, b) => {
|
|
this.tasks.sort((a, b) => {
|
|
@@ -98,6 +109,8 @@
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ console.log('tasks~~~~', this.tasks)
|
|
|
},
|
|
},
|
|
|
getTimelineItemIcon(item) {
|
|
getTimelineItemIcon(item) {
|
|
|
if (item.result === 1) {
|
|
if (item.result === 1) {
|