|
|
@ -78,6 +78,7 @@ |
|
|
|
<flow :xmlData="xmlData" :taskData="taskList"></flow> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<!-- 选择待办人 的弹出框--> |
|
|
|
<el-dialog title="选择待办人" :visible.sync="nodeDialogVisible" width="80%"> |
|
|
|
<el-form label-position="right" class="formadd" > |
|
|
|
<el-row> |
|
|
@ -104,6 +105,7 @@ |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</el-dialog> |
|
|
|
<!-- 选择用户 的弹出框--> |
|
|
|
<el-dialog title="选择用户" :visible.sync="nodeUserDialogVisible" width="80%"> |
|
|
|
<el-form label-position="right" class="formadd" > |
|
|
|
<el-row> |
|
|
@ -130,18 +132,23 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
//选择待办人弹框 |
|
|
|
nodeDialogVisible:false, |
|
|
|
//选择用户弹框 |
|
|
|
nodeUserDialogVisible:false, |
|
|
|
// 模型xml数据 |
|
|
|
xmlData: "", |
|
|
|
nodeSid: "", |
|
|
|
// nextNodeSid:'', |
|
|
|
nodes: [], |
|
|
|
//根据角色查询的用户数组 |
|
|
|
users:[], |
|
|
|
//选择的用户的姓名 |
|
|
|
userName:'', |
|
|
|
//选择的用户sid |
|
|
|
userSid:'', |
|
|
|
taskList: [], |
|
|
|
//获取环节时默认是最后一个环节 |
|
|
|
endTask:true, |
|
|
|
//下一环节 |
|
|
|
nextNode:{}, |
|
|
|
formobj: { |
|
|
|
sid: '', |
|
|
|
comment:'', |
|
|
@ -165,7 +172,6 @@ export default { |
|
|
|
orgSid: '', // 部门sid |
|
|
|
baseOutsourcingApplicationVehicleDtos:[] |
|
|
|
}, |
|
|
|
nextNode:{}, |
|
|
|
agreeList: { //同意办理列表 |
|
|
|
businessSid: '', |
|
|
|
comment: '', |
|
|
@ -206,7 +212,7 @@ export default { |
|
|
|
const data = decodeURI(window.location.href.slice(one, two)) // url解码unescape()已从web中移除,尽量不使用 |
|
|
|
var tar = data.substr(data.indexOf('=') + 1) |
|
|
|
const obj = JSON.parse(tar) |
|
|
|
// 同意列表 |
|
|
|
// 同意列表 父级页面传递过来的流程的相关的属性参数 |
|
|
|
this.agreeList.businessSid = sid |
|
|
|
this.agreeList.instanceId = obj.instanceId |
|
|
|
this.agreeList.taskId = obj.taskId |
|
|
@ -220,46 +226,45 @@ export default { |
|
|
|
this.stopList.businessSid = sid |
|
|
|
this.stopList.instanceId = obj.instanceId |
|
|
|
this.stopList.taskId = obj.taskId |
|
|
|
//加载流程图相关的数据 |
|
|
|
this.getModelDetail(obj.deployId) |
|
|
|
this.getFlowViewer(obj.instanceId) |
|
|
|
this.getNextNodes(obj.taskId) |
|
|
|
window.parent.postMessage({ |
|
|
|
cmd: 'returnHeight', |
|
|
|
params: { |
|
|
|
//告诉父级页面,子页面的弹框高度。 |
|
|
|
code: 2, |
|
|
|
data: 1500 + 'px' |
|
|
|
} |
|
|
|
}, '*') |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//关闭弹出框 选择待办人弹框 |
|
|
|
closeNodeDialog(){ |
|
|
|
this.nodeDialogVisible = false |
|
|
|
}, |
|
|
|
//根据环节上配置的角色查询用户 |
|
|
|
selectUser() { |
|
|
|
this.nodeUserDialogVisible=true |
|
|
|
req.getUsers(this.nextNode.candidateGroups[0]).then(res => { |
|
|
|
this.users = res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
//选中下一环节的用户 |
|
|
|
checkedUser(val) { |
|
|
|
const choosetItem = this.users.filter((item) => item.sid == val) |
|
|
|
this.userName = choosetItem[0].name |
|
|
|
this.userSid = choosetItem[0].sid |
|
|
|
this.nodeUserDialogVisible = false |
|
|
|
}, |
|
|
|
/** xml 文件 */ |
|
|
|
getNextNodes(taskid) { |
|
|
|
// 发送请求,获取xml |
|
|
|
req.getNextNodes(taskid).then(res => { |
|
|
|
this.nodes = res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** xml 文件 */ |
|
|
|
getModelDetail(deployId) { |
|
|
|
// 发送请求,获取xml |
|
|
|
req.readXml(deployId).then(res =>{ |
|
|
|
this.xmlData = res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
//已办环节的节点 |
|
|
|
getFlowViewer(procInsId){ |
|
|
|
req.getFlowViewer(procInsId).then(res =>{ |
|
|
|
this.taskList = res.data |
|
|
@ -301,30 +306,32 @@ export default { |
|
|
|
}, |
|
|
|
// 同意 |
|
|
|
openAgree() { |
|
|
|
//查验下一环节要用到,流程定义的id |
|
|
|
this.formobj.modelId = 'process_5tqysnjc:2:325008' |
|
|
|
req.getNextNodesForSubmit(this.formobj).then(resp=>{ |
|
|
|
if (resp.success) { |
|
|
|
var arr= resp.data; |
|
|
|
//循环获取当前环节的下一个环节信息 |
|
|
|
for(var i=0;i<arr.length;i++){ |
|
|
|
if(i+1<arr.length&&this.agreeList.taskDefKey==arr[i].id){ |
|
|
|
this.nextNode=arr[i+1]; |
|
|
|
this.endTask=fasle; |
|
|
|
//不是最后一个环节 |
|
|
|
this.endTask=false; |
|
|
|
} |
|
|
|
} |
|
|
|
//如果是最后一个环节 则设置一个结束环节 提醒用户 |
|
|
|
if(this.endTask){ |
|
|
|
this.nextNode={ |
|
|
|
name:'结束' |
|
|
|
} |
|
|
|
}else{ |
|
|
|
/*this.nextNode=resp.data[1]; |
|
|
|
this.firstNode=resp.data[0];*/ |
|
|
|
//如果不是最后一个环节 要取下一个环节的角色sid |
|
|
|
var candidateGroups=this.nextNode.candidateGroups; |
|
|
|
this.roleSid=candidateGroups[0]; |
|
|
|
} |
|
|
|
this.nodeDialogVisible = true |
|
|
|
} |
|
|
|
this.submitdisabled = false |
|
|
|
// this.handleAgree() |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
@ -366,22 +373,25 @@ export default { |
|
|
|
_this.formobj = {} |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 同意任务 */ |
|
|
|
handleAgree() { |
|
|
|
this.nodeDialogVisible = true |
|
|
|
}, |
|
|
|
//同意任务 |
|
|
|
agree() { |
|
|
|
if(this.formobj.comment==''){ |
|
|
|
alert('请填写审批意见!'); |
|
|
|
} |
|
|
|
//意见 |
|
|
|
this.agreeList.comment = this.formobj.comment |
|
|
|
// this.agreeList.nextNodeSid = this.nextNodeSid |
|
|
|
//下一环节的用户sid |
|
|
|
this.agreeList.nextUserSid = this.userSid |
|
|
|
//调用后台接口流转 |
|
|
|
req.agreeTask(this.agreeList).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.nodeDialogVisible=false; |
|
|
|
//子页面向父级页面传递值 |
|
|
|
window.parent.postMessage({ |
|
|
|
cmd: 'returnHeight', |
|
|
|
params: { |
|
|
|
code: 1, |
|
|
|
data: document.body.scrollHeight + 'px' |
|
|
|
//操作成功,告诉父级页面关闭弹框 |
|
|
|
code: 1 |
|
|
|
} |
|
|
|
}, '*') |
|
|
|
} else { |
|
|
|