|

楼主 |
发表于 2018-5-18 17:49:58
|
显示全部楼层
- Model.prototype.BatchExecuteBtnClick = function(event){
- var checkedTaskList=this.comp("list").getCheckeds();
- if (checkedTaskList.length == 0) {
- justep.Util.hint("请选择您要启动的待办事项!", {type: 'warning', parent: this.getRootNode()});
- return;
- }
- // $.each(checkedTaskList, function(index, task) {
- // console.log(task.getID());
- //
- // })
- // 根据业务数据启动多个流程实例,在启动的process的onStartCommit事件中收集待办任务的id
- biz.Request.beginBatch();// 启动批
- var p = this.comp("process");
- for (var i = 0; i < checkedTaskList.length; i++) {
- p.start(null, null, checkedTaskList[i].getID(), null);// 批中启动流程
- }
- biz.Request.endBatch();// 结束批
- if (this.tasks.length == 0) {
- justep.Util.hint("启动流程失败!", {type: 'error', parent: this.getRootNode()});
- return;
- }
- //var p = this.comp("process");
- // 使用其中的一条待办执行流转查询,并弹出流转对话框给用户修改,以得到control信息
- p.advanceQueryExt(checkedTaskList[0].getID());
- };
- Model.prototype.processStartCommit = function(event){
- this.tasks.push(event.task);
- };
- Model.prototype.processBeforeAdvance = function(event){
- event.cancel = true; // 取消后续操作
-
- // 所有的待办按得到的control中的执行人进行流转
- var params = new biz.Request.ActionParam();
- var tasksParam = new biz.Request.ListParam();
-
- // 批量启动后直接批量流转
- for (var i = 0; i < this.tasks.length; i++) {
- tasksParam.add(this.tasks[i]);
- //console.log(this.tasks[i]);
- }
- params.setList("tasks", tasksParam);
- var controlData = event.processControl.getData();
- var controlParam = new biz.Request.ObjectParam(controlData, "com.justep.system.process.ProcessControl");
- params.setObject("control", controlParam);
- biz.Request.sendBizRequest({
- "context" : this.getContext(),
- "action" : "batchAdvanceProcess",
- "directExecute" : true,
- "parameters" : params
- });
- // 流程成功后关闭页面
- setTimeout(function() {
- me.close()
- }, 1);
- };
复制代码 |
|