|
@@ -31,9 +31,7 @@ function AuditFlow(props) {
|
|
if (!tasks || tasks.length == 0) {
|
|
if (!tasks || tasks.length == 0) {
|
|
return false;
|
|
return false;
|
|
} else {
|
|
} else {
|
|
- // 查询最后一个task的activityId
|
|
|
|
let current = 0;
|
|
let current = 0;
|
|
- const activityId = tasks[tasks.length - 1].activity_id;
|
|
|
|
flow.workflowActivityRules.forEach((item, index) => {
|
|
flow.workflowActivityRules.forEach((item, index) => {
|
|
let task = tasks.find(task => task.activity_id == item.activityId);
|
|
let task = tasks.find(task => task.activity_id == item.activityId);
|
|
if (task) {
|
|
if (task) {
|
|
@@ -65,6 +63,12 @@ function AuditFlow(props) {
|
|
}
|
|
}
|
|
}, [tasks, userId]);
|
|
}, [tasks, userId]);
|
|
|
|
|
|
|
|
+ const getTaskId = () => {
|
|
|
|
+ const runningTask = tasks.find(item => item.task_status == 'RUNNING' && item.userid == userId);
|
|
|
|
+ console.log('==========================', runningTask.taskid);
|
|
|
|
+ if (runningTask) return runningTask.taskid;
|
|
|
|
+ };
|
|
|
|
+
|
|
const getDesc = item => {
|
|
const getDesc = item => {
|
|
const { activityId } = item;
|
|
const { activityId } = item;
|
|
if (!tasks || tasks.length == 0) return '';
|
|
if (!tasks || tasks.length == 0) return '';
|
|
@@ -192,10 +196,10 @@ function AuditFlow(props) {
|
|
</Steps>
|
|
</Steps>
|
|
{showAduit && status != -1 && (
|
|
{showAduit && status != -1 && (
|
|
<div className={styles.btns} style={{ marginLeft: 80 }}>
|
|
<div className={styles.btns} style={{ marginLeft: 80 }}>
|
|
- <Button type="primary" onClick={() => onApprove(true, tasks[current].taskid)}>
|
|
|
|
|
|
+ <Button type="primary" onClick={() => onApprove(true, getTaskId())}>
|
|
审批通过
|
|
审批通过
|
|
</Button>
|
|
</Button>
|
|
- <Button onClick={() => onApprove(false, tasks[current].taskid)} danger>
|
|
|
|
|
|
+ <Button onClick={() => onApprove(false, getTaskId())} danger>
|
|
审批拒绝
|
|
审批拒绝
|
|
</Button>
|
|
</Button>
|
|
</div>
|
|
</div>
|