平台默认的流转对话框中执行者是可以显示多个的,并且选择执行者对话框中也是多选的,如果需要控制只允许选择一人需要对流转对话框进行修改
某个具体流程功能的流转对话框可以参考http://docs.wex5.com/bex5-process-question-list-10008/
由于平台默认的/UI2/system/service/process/dialog/processDialog.w是继承/UI2/system/service/process/dialog/processDialog.m.w实现的,所以processDialog.w中调用的某些js方法是在/UI2/system/service/process/dialog/processDialog.m.js中定义的,因此在自己扩展流转对话框中如果有需要修改平台原始的js方法的,需要自己把/UI2/system/service/process/dialog/processDialog.m.js中的函数定义复制到自己的js中然后进行修改
设置流转对话框只运行选择一个需要如下两个地方控制
1.控制选择执行者对话框中为单选
修改Model.prototype.createExecutorDialog = function() {中的multiSelection的值为false;具体如下:
Model.prototype.createExecutorDialog = function(){
return new OrgDialog({
cacheKind: cacheKind,
title: new justep.Message(justep.Message.JUSTEP230055).getMessage(),
showTitle: true,
multiSelection: true,
parentNode: this.getElementByXid("dialogs")
});
};
V3.7之前的版本这个修改需要替换下面的文件/UI2/system/components/justep/org/dialog/singleOrgDialogPC.js
2.选择执行者对话框返回数据后,执行者只允许显示最后选择的人
修改Model.prototype.getExecutorDialog = function(){中对executorData的 操作,具体如下:
Model.prototype.getExecutorDialog = function() {
if (!this.executorDialog) {
this.executorDialog = this.createExecutorDialog();
this.executorDialog.on("onReceive", function(evt) {
var newRows = [];
var rows = evt.data || [];
var executors = this.getExecutors(this.executorDialog._param_owner);
for (var i = 0; i < rows.length; i++) {
if (executors.indexOf(rows[i].val("sFID")) === -1) {
newRows.push({
rowid : justep.UUID.createUUID(),
owner : this.executorDialog._param_owner,
sFID : rows[i].val("sFID"),
sFName : rows[i].val("sFName"),
sName : rows[i].val("sName")
});
}
}
if (newRows.length > 0) {
var executorData = this.comp("executorData");
executorData.clear();
executorData.loadData({rows : newRows}, true);
}
}, this);
}
return this.executorDialog;
};
注释:如果在环节上设置了执行规则,执行规则中设置了执行者表达式默认指定了要流转的人,需要控制流转对话框中不显示添加执行者的按钮,可以对如下添加按钮(+)的div设置bind-visble,平台默认设置了
bind-visible="!val('btnStatus')"
修改为:

评一波