123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542 |
- /**
- * 组织选择器
- * @param conf
- *
- * conf 参数
- * UserDialog
- * orgId:组织ID
- * orgName:组织名称
- * @returns
- */
- function OrgDialog(conf)
- {
- var dialogWidth=1000;
- var dialogHeight=600;
-
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- if(!conf.isSingle)conf.isSingle=false;
- var scope="{type:\"system\",value:\"all\"}";
- if(conf.scope) scope = (conf.scope).replace(/\'/g, '"');
-
- var url=__ctx + '/platform/system/sysOrg/dialog.ht?isSingle=' + conf.isSingle;
- url=url.getNewUrl();
-
- //重新选择的时候,展现上次数据
- var arrys = new Array();
- if( conf.ids && conf.names){
- var ids=conf.ids.split(",");
- var names=conf.names.split(",");
- for ( var i = 0; i < ids.length; i++) {
- var selectUsers={
- id:ids[i],
- name:names[i]
- }
- arrys.push(selectUsers);
- }
-
- }else if(conf.arguments){
- arrys=conf.arguments;
- }
-
-
- var that =this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '组织选择器',
- url: url,
- isResize: true,
- //自定义参数
- arrys: arrys,
- scope : scope,
- //回调函数
- sucCall:function(rtn){
- conf.callback.call(that,rtn.orgId,rtn.orgName,rtn.orgJson);
- }
- });
- }
- /**
- * 用户选择器 .
- * UserDialog({scope:"",callback:function(userIds,fullnames,emails,mobiles){},selectUsers:[{id:'',name:''}]})
- *
- * 组织级别范围,为json字符串{type:"system,script",value:""}。
- * 这个value还可以扩展
- * scope说明:
- * {
- * type:system,
- * value:
- * all 全部组织,
- * self: 当前登录组织
- * grade: 当前组织往上找找到级别1
- * company:当前组织往上找找到级别2
- * department:当前组织往上找找到级别3
- * group:当前组织往上找找到级别4
- * other:当前组织往上找找到级别5
- * up: 当前组织上级组织
- * type:script
- * value:为脚本,返回一个组织ID
- *
- * }
- */
- function UserDialog(conf){
- var dialogWidth=800;
- var dialogHeight=500;
-
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- if(!conf.isSingle)conf.isSingle=false;
- var scope="{type:\"system\",value:\"all\"}";
- if(conf.scope) scope = (conf.scope).replace(/\'/g, '"');
-
- url=__ctx + "/platform/system/sysUser/dialog.ht?isSingle=" + conf.isSingle;
- url=url.getNewUrl();
-
- //重新选择的时候,展现上次数据
- var selectUsers="";
- if( conf.selectUserIds && conf.selectUserNames){
- selectUsers={
- selectUserIds:conf.selectUserIds ,
- selectUserNames:conf.selectUserNames
- }
- }else if(conf.selectUsers){
- var arr = conf.selectUsers ;
- var ids = '';
- var names = '';
- for ( var i = 0; i < arr.length; i++) {
- if(i!=0){
- ids+=',';
- names+=',';
- }
- ids+=arr[i].id;
- names+=arr[i].name;
- }
- selectUsers={
- selectUserIds:ids ,
- selectUserNames:names
- }
- }
-
-
- var that =this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '用户选择器',
- url: url,
- scope : scope,
- isResize: true,
- //自定义参数
- selectUsers: selectUsers,
- sucCall:function(rtn){
- var userIds=rtn.userIds;
- var fullnames=rtn.fullnames;
- var emails=rtn.emails;
- var mobiles=rtn.mobiles;
-
- conf.callback.call(that,userIds,fullnames,emails,mobiles,rtn);
- }
- });
-
- }
- /**
- * 这个选择器只用户在流程那里选择人员或部门。
- * 调用方法:
- *
- *
- * FlowUserDialog({selectUsers:[{type:'',id:'',name:''}],callback:function(aryType,aryId,aryName){}});
- * selectUsers,表示之前选择的人员,使用json数组来表示。
- * 数据格式:{type:'',id:'',name:''}
- * type:选择的类型。可能的值 user,org,role,pos .
- * id:选择的ID
- * name:显示的名称。
- *
- * JSON数组:
- * 这个回调函数包括三个参数 ,这三个参数都为数组。
- * objType:返回的类型,可能的值(user,org,role,pos) 。
- * objIds:对象的Id。
- * objNames:对象的名称。
- */
- function FlowUserDialog(conf){
- var dialogWidth=750;
- var dialogHeight=500;
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- url=__ctx + "/platform/system/sysUser/flowDialog.ht";
- url=url.getNewUrl();
- //重新选择的时候,展现上次数据,必须传入
- var selectUsers="";
- if( conf.selectUsers!=undefined && conf.selectUsers!=null && conf.selectUsers!=""){
- selectUsers=conf.selectUsers;
- }
-
- var scope="{type:\"system\",value:\"all\"}";
- if(conf.scope)
- scope = (conf.scope).replace(/\'/g, '"');
-
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '人员或部门',
- url: url,
- scope:scope,
- isResize: true,
- //自定义参数
- selectUsers: selectUsers,
- sucCall:function(rtn){
- conf.callback.call(that,rtn.objType,rtn.objIds,rtn.objNames);
- }
- });
- }
- /**
- * 角色选择器
- */
- function RoleDialog(conf)
- {
- var dialogWidth=1000;
- var dialogHeight=600;
-
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
- if(!conf.isSingle)conf.isSingle=false;
- var url=__ctx + '/platform/system/sysRole/dialog.ht?isSingle=' + conf.isSingle +'&isGrade='+ conf.isGrade;
- url=url.getNewUrl();
-
- //重新选择的时候,展现上次数据
- var arrys = new Array();
- if( conf.ids && conf.names){
- var ids=conf.ids.split(",");
- var names=conf.names.split(",");
- for ( var i = 0; i < ids.length; i++) {
- var selectUsers={
- id:ids[i],
- name:names[i]
- }
- arrys.push(selectUsers);
- }
-
- }else if(conf.arguments){
- arrys=conf.arguments;
- }
- var that =this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '角色选择器 ',
- url: url,
- isResize: true,
- //自定义参数
- arrys: arrys,
- sucCall:function(rtn){
- conf.callback.call(that,rtn.roleId,rtn.roleName);
- }
- });
- }
- /**
- * 岗位选择器
- * conf.callback
- * posId:岗位ID
- * posName:岗位名称
- * @returns
- */
- function PosDialog(conf)
- {
- var dialogWidth=1000;
- var dialogHeight=600;
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- if(!conf.isSingle)conf.isSingle=false;
- var scope="{type:\"system\",value:\"all\"}";
- if(conf.scope) scope = (conf.scope).replace(/\'/g, '"');
-
- var url=__ctx + '/platform/system/position/dialog.ht?isSingle=' + conf.isSingle;
- url=url.getNewUrl();
-
- //重新选择的时候,展现上次数据
- var arrys = new Array();
- if( conf.ids && conf.names){
- var ids=conf.ids.split(",");
- var names=conf.names.split(",");
- for ( var i = 0; i < ids.length; i++) {
- var selectUsers={
- id:ids[i],
- name:names[i]
- }
- arrys.push(selectUsers);
- }
-
- }else if(conf.arguments){
- arrys=conf.arguments;
- }
-
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '岗位选择器',
- url: url,
- scope : scope,
- isResize: true,
- //自定义参数
- arrys: arrys,
- sucCall:function(rtn){
- conf.callback.call(that,rtn.posId,rtn.posName);
- }
- });
-
- }
- /**
- * 用户参数选择器
- * @param conf
- * dialogWidth:对话框高度 650
- * dialogHeight:对话框高度 500
- *
- */
- function UserParamDialog(conf){
- var dialogWidth=650;
- var dialogHeight=500;
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- var args={cmpIds:conf.cmpIds,cmpNames:conf.cmpNames};
- var url=__ctx + '/platform/system/sysUserParam/dialog.ht?nodeUserId='+conf.nodeUserId;
-
-
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '用户参数选择器',
- url: url,
- isResize: true,
- //自定义参数
- args: args,
- sucCall:function(rtn){
- conf.callback.call(that,rtn.paramValue1,rtn.paramValue2);
- }
- });
- }
- /**
- * 组织参数
- */
- function OrgParamDialog(conf){
- var dialogWidth=650;
- var dialogHeight=500;
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- var args={cmpIds:conf.cmpIds,cmpNames:conf.cmpNames};
- var url=__ctx + '/platform/system/sysOrgParam/dialog.ht?nodeUserId='+conf.nodeUserId;
- url=url.getNewUrl();
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '组织参数',
- url: url,
- isResize: true,
- //自定义参数
- args: args,
- sucCall:function(rtn){
- conf.callback.call(that,rtn.paramValue1,rtn.paramValue2);
- }
- });
- }
- /**
- * 上下级选择器
- */
- function UplowDialog(conf){
- var dialogWidth=650;
- var dialogHeight=500;
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- var url=__ctx + '/platform/bpm/bpmNodeUserUplow/dialog.ht';
- url=url.getNewUrl();
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '上下级选择器',
- url: url,
- isResize: true,
- //自定义参数
- sucCall:function(rtn){
- conf.callback.call(that,rtn.json,rtn.show);
- }
- });
- }
- /**
- *上级部门类型选择器
- */
- function typeSetDialog(conf){
- var dialogWidth=500;
- var dialogHeight=360;
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- var args={cmpIds:conf.cmpIds,cmpNames:conf.cmpNames};
- var url=__ctx + '/platform/bpm/bpmDefinition/typeSetDialog.ht';
- url=url.getNewUrl();
-
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '上级部门类型选择器',
- url: url,
- isResize: true,
- //自定义参数
- args: args,
- sucCall:function(rtn){
- conf.callback.call(that,rtn.json,rtn.show);
- }
- });
- }
- /**
- * 打开选择引用流程实例的对话框
- * @param conf
- */
- function ActInstDialog(conf){
- var dialogWidth=900;
- var dialogHeight=700;
-
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
-
- if(!conf.isSingle)conf.isSingle=false;
- var url=__ctx + '/platform/bpm/bpmReferDefinition/actInstDialog.ht?defId='+conf.defId+'&isSingle=' + conf.isSingle;
- url=url.getNewUrl();
-
-
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '打开选择引用流程实例的对话框',
- url: url,
- isResize: true,
- //自定义参数
- arguments: conf.arguments,
- sucCall:function(rtn){
- conf.callback.call(that,rtn);
- }
- });
- };
- /**
- * 级联设置
- */
- function GangedSetCascade(data,callback){
- var dialogWidth=550;
- var dialogHeight=400;
-
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1});
-
-
- var url=__ctx + "/platform/bpm/bpmGangedSetCascade.ht";
- url=url.getNewUrl();
-
- var that = this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '级联设置',
- url: url,
- isResize: true,
- //自定义参数
- data: data,
- sucCall:function(rtn){
- callback.call(that,rtn);
- }
- });
-
- };
- /**
- * 分级用户选择器
- * GradeUserDialog({callback:function(userIds,fullnames,emails,mobiles){},selectUsers:[{id:'',name:''}]})
- */
- function GradeUserDialog(conf){
-
- var dialogWidth=1000;
- var dialogHeight=500;
-
- conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
- if(!conf.isSingle)conf.isSingle=false;
-
- url=__ctx + "/platform/system/sysUser/gradeDialog.ht?isSingle=" + conf.isSingle;
- url=url.getNewUrl();
-
- //重新选择的时候,展现上次数据
- var selectUsers="";
- if( conf.selectUserIds && conf.selectUserNames){
- selectUsers={
- selectUserIds:conf.selectUserIds ,
- selectUserNames:conf.selectUserNames
- }
- }else if(conf.selectUsers){
- var arr = conf.selectUsers ;
- var ids = '';
- var names = '';
- for ( var i = 0; i < arr.length; i++) {
- if(i!=0){
- ids+=',';
- names+=',';
- }
- ids+=arr[i].id;
- names+=arr[i].name;
- }
- selectUsers={
- selectUserIds:ids ,
- selectUserNames:names
- }
- }
-
- var that =this;
- DialogUtil.open({
- height:conf.dialogHeight,
- width: conf.dialogWidth,
- title : '用户选择器',
- url: url,
- isResize: true,
- //自定义参数
- selectUsers: selectUsers,
- sucCall:function(rtn){
- var userIds=rtn.userIds;
- var fullnames=rtn.fullnames;
- var emails=rtn.emails;
- var mobiles=rtn.mobiles;
-
- conf.callback.call(that,userIds,fullnames,emails,mobiles);
- }
- });
-
- }
|