|
|
@ -1,7 +1,24 @@ |
|
|
|
<template> |
|
|
|
<div class="workflow-use"> |
|
|
|
<WorkflowInfo v-if="done" :wf="this.node" :business="business" :workflowMoveID="$route.query.workflowMoveID" /> |
|
|
|
</div> |
|
|
|
<div class="workflow-use"> |
|
|
|
<div style="padding:10px 20px"> |
|
|
|
<el-steps :active="moves.length-1" :process-status="processStatus" finish-status="finish" align-center> |
|
|
|
<el-step v-for="(item, key) in moves" :key="key"> |
|
|
|
<div slot="title">{{ item.workflowNode.label }}</div> |
|
|
|
<div slot="description"> |
|
|
|
<div>节点说明:{{ item.workflowNode.description }}</div> |
|
|
|
<div>操作人:{{ item.promoter.nickName }}</div> |
|
|
|
<div>操作参数:{{ item.param||'无参数' }}</div> |
|
|
|
</div> |
|
|
|
</el-step> |
|
|
|
</el-steps> |
|
|
|
</div> |
|
|
|
<WorkflowInfo |
|
|
|
v-if="done" |
|
|
|
:wf="this.node" |
|
|
|
:business="business" |
|
|
|
:workflowMoveID="$route.query.workflowMoveID" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import {findWorkflowStep,getWorkflowMoveByID} from "@/api/workflowProcess.js" |
|
|
@ -11,7 +28,34 @@ export default { |
|
|
|
return{ |
|
|
|
done:false, |
|
|
|
business:null, |
|
|
|
node:null |
|
|
|
node:null, |
|
|
|
moves:[] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
processStatus(){ |
|
|
|
const node = this.moves[this.moves.length-1] |
|
|
|
if(node&&node.workflowNode.clazz == "end"){ |
|
|
|
if(node.workflowNode.success){ |
|
|
|
return "success" |
|
|
|
}else{ |
|
|
|
return "error" |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return "process" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
createDone(){ |
|
|
|
let path = "" |
|
|
|
if(this.node.view){ |
|
|
|
path = this.node.view |
|
|
|
}else{ |
|
|
|
path = this.workflow.view |
|
|
|
} |
|
|
|
this.$options.components.WorkflowInfo = ()=>import("@/"+path) |
|
|
|
this.done = true |
|
|
|
} |
|
|
|
}, |
|
|
|
async created(){ |
|
|
@ -22,19 +66,21 @@ export default { |
|
|
|
if(res.code == 0){ |
|
|
|
this.workflow = res.data.workflow |
|
|
|
this.node = res.data.workflow.nodes[0] |
|
|
|
this.done = true |
|
|
|
this.createDone() |
|
|
|
} |
|
|
|
}else if(workflowMoveID){ |
|
|
|
const res = await getWorkflowMoveByID({id:workflowMoveID}) |
|
|
|
if(res.code == 0){ |
|
|
|
this.business = res.data.business |
|
|
|
this.workflow = res.data.move.workflowProcess |
|
|
|
this.node = res.data.move.workflowNode |
|
|
|
this.done = true |
|
|
|
this.moves = res.data.moves |
|
|
|
this.createDone() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
beforeCreate(){ |
|
|
|
this.$options.components.WorkflowInfo = ()=>import("@/"+this.node.view) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |