$(function () { jQuery.getScript(basePath + "/WF/Admin/Admin.js") .done(function () { /* 耶,没有问题,这里可以干点什么 */ //alert('ok'); }) .fail(function () { /* 靠,马上执行挽救操作 */ //alert('err'); }); }); var optionKey = 0; var flowNo = null; var w = window.innerWidth / 2; var h = window.innerHeight - 40; function InitBar(optionKey) { var nodeID = GetQueryString("FK_Node"); var en = new Entity("BP.WF.Template.NodeSimple", nodeID); flowNo = en.FK_Flow; var str = nodeID.substr(nodeID.length - 2); var isSatrtNode = false; if (str == "01") isSatrtNode = true; //var html = "
请选择访问规则: "; var html = "
接受人规则: "; if (isSatrtNode == true) html = "
发起人范围限定规则: "; html += ""; html += ""; if (GetQueryString("FK_Node").substr(GetQueryString("FK_Node").length - 2) != "01") html += ""; html += ""; html += "
"; document.getElementById("bar").innerHTML = html; $("#changBar option[value='" + optionKey + "']").attr("selected", "selected"); } //批处理. function Batch() { var url = "Batch.htm?NodeID=" + GetQueryString("FK_Node") + "&FK_Flow=" + GetQueryString("FK_Flow"); SetHref(url); } function SaveRole() { $("#Btn_Save").html("正在保存请稍后."); try { Save(); } catch (e) { alert(e); return; } AccepterRole_ClearStartFlowsCash(); $("#Btn_Save").html("保存成功"); setTimeout(function () { $("#Btn_Save").html("保存"); }, 1000); } //清除缓存,本组织的. function AccepterRole_ClearStartFlowsCash() { var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_AttrNode_AccepterRole"); var data = handler.DoMethodReturnString("AccepterRole_ClearStartFlowsCash"); } //清除缓存,所有本组织的. function AccepterRole_ClearAllOrgStartFlowsCash() { var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_AttrNode_AccepterRole"); var data = handler.DoMethodReturnString("AccepterRole_ClearAllOrgStartFlowsCash"); } function OldVer() { var nodeID = GetQueryString("FK_Node"); var flowNo = GetQueryString("FK_Flow"); var url = '../NodeAccepterRole.aspx?FK_Flow=' + flowNo + '&FK_Node=' + nodeID; SetHref(url); } function Help() { var url = ""; switch (optionKey) { case DeliveryWay.ByStation: url = 'http://bbs.ccflow.org/showtopic-131376.aspx'; break; case DeliveryWay.ByDept: url = 'http://bbs.ccflow.org/showtopic-131376.aspx'; break; default: url = "http://ccbpm.mydoc.io/?v=5404&t=17906"; break; } window.open(url); } //通用的设置岗位的方法。for admin. *********************************************************** function OpenDot2DotStations() { var nodeID = GetQueryString("FK_Node"); var url = "../../../Comm/RefFunc/Dot2Dot.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeStations"; url += "&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Station&EnsOfM=BP.Port.Stations"; url += "&DefaultGroupAttrKey=FK_StationType&NodeID=" + nodeID + "&PKVal=" + nodeID; OpenEasyUiDialogExtCloseFunc(url, '设置岗位', w, h, function () { Baseinfo.stas = getStas(); }); } //设置岗位-左右结构. function OpenBranchesAndLeafStations() { var nodeID = GetQueryString("FK_Node"); var url = "../../../Comm/RefFunc/BranchesAndLeaf.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeStations&Dot2DotEnName=BP.WF.Template.NodeStation&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Station&EnsOfM=BP.Port.Stations&DefaultGroupAttrKey=FK_StationType&NodeID=" + nodeID + "&PKVal=" + nodeID; OpenEasyUiDialogExtCloseFunc(url, '设置岗位', w * 1.5, h, function () { Baseinfo.stas = getStas(); }); } /* * 获取节点绑定的岗位 */ function getStas() { var ens = new Entities("BP.WF.Template.NodeStations"); ens.Retrieve("FK_Node", GetQueryString("FK_Node")); ens = $.grep(ens, function (obj, i) { return obj.FK_Node != undefined }); return ens; } //绑定部门 ************************************************ function BindDeptTree() { var nodeID = GetQueryString("FK_Node"); var rootNo = 0; var webUser = new WebUser(); if (webUser.CCBPMRunModel != 0) rootNo = webUser.OrgNo; var url = "../../../Comm/RefFunc/Branches.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeDepts&Dot2DotEnName=BP.WF.Template.NodeDept&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Dept&EnsOfM=BP.Port.Depts&DefaultGroupAttrKey=&RootNo=" + rootNo + "&NodeID=" + nodeID + "&PKVal=" + nodeID; OpenEasyUiDialogExtCloseFunc(url, '绑定部门', w, h, function () { Baseinfo.depts = getDepts(); }); } function BindDeptTreeGroup() { var nodeID = GetQueryString("FK_Node"); var webUser = new WebUser(); var rootNo = 0; if (webUser.CCBPMRunModel == 0 || webUser.CCBPMRunModel == 2) rootNo = webUser.OrgNo; if (webUser.CCBPMRunModel == 1) { var orgs = new Entities("BP.WF.Port.Admin2Group.Orgs"); orgs.RetrieveCond("No", "=", "ParentNo"); if (orgs.length != 0) { rootNo = orgs[0].No; } } var url = "../../../Comm/RefFunc/Branches.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeDepts&Dot2DotEnName=BP.WF.Template.NodeDept&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Dept&EnsOfM=BP.Port.Depts&DefaultGroupAttrKey=&RootNo=" + rootNo + "&NodeID=" + nodeID + "&PKVal=" + nodeID; OpenEasyUiDialogExtCloseFunc(url, '绑定部门', w, h, function () { Baseinfo.depts = getDepts(); }); } //绑定用户组: for admin. *********************************************************** function OpenDot2DotTeams() { var nodeID = GetQueryString("FK_Node"); var url = "../../../Comm/RefFunc/Dot2Dot.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeTeams"; url += "&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Team&EnsOfM=BP.Port.Teams"; url += "&DefaultGroupAttrKey=FK_TeamType&NodeID=" + nodeID + "&PKVal=" + nodeID; OpenEasyUiDialogExtCloseFunc(url, '设置用户组', w, h, function () { Baseinfo.stas = getStas(); }); } //设置岗位-左右结构. function OpenBranchesAndLeafTeams() { var nodeID = GetQueryString("FK_Node"); var url = "../../../Comm/RefFunc/BranchesAndLeaf.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeTeams&Dot2DotEnName=BP.WF.Template.NodeTeam&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Team&EnsOfM=BP.Port.Teams&DefaultGroupAttrKey=FK_TeamType&NodeID=" + nodeID + "&PKVal=" + nodeID; OpenEasyUiDialogExtCloseFunc(url, '设置用户组', w, h, function () { Baseinfo.stas = getStas(); }); } /* * 获取节点绑定的部门 */ function getDepts() { var ens = new Entities("BP.WF.Template.NodeDepts"); ens.Retrieve("FK_Node", GetQueryString("FK_Node")); ens = $.grep(ens, function (obj, i) { return obj.FK_Node != undefined }); return ens; } /* * 获取节点绑定的用户组 */ function getGroups() { var ens = new Entities("BP.WF.Template.NodeTeams"); ens.Retrieve("FK_Node", GetQueryString("FK_Node")); ens = $.grep(ens, function (obj, i) { return obj.FK_Node != undefined }); return ens; } /* * 获取节点绑定部门的负责人 */ function getDeptLeader() { var ens = getDepts(); var depts = new Entities("BP.Port.Depts"); for (var i = 0; i < ens.length; i++) { var en = ens[i]; depts.Retrieve("No", en.FK_Dept); } return depts; } /* * 获取节点绑定的组织 */ function getOrgs() { var ens = new Entities("BP.WF.Template.FlowOrgs"); // ens.Retrieve("FlowNo", flowNo); ens.Retrieve("FlowNo", GetQueryString("FK_Flow")); // alert(ens.length); return ens; ens = $.grep(ens, function (obj, i) { return obj.FlowNo != undefined }); return ens; } /* * 获取节点绑定的人员 */ function getEmps() { var ens = new Entities("BP.WF.Template.NodeEmps"); ens.Retrieve("FK_Node", GetQueryString("FK_Node")); ens = $.grep(ens, function (obj, i) { return obj.FK_Node != undefined }); return ens; } /* * 获取节点绑定岗位的用户组人员 */ function getTeamEmps() { var en = new Entity("BP.WF.Template.NodeTeam", GetQueryString("FK_Node")); var ens = new Entities("BP.Port.TeamEmps"); ens.Retrieve("FK_Team", en.FK_Team); ens = $.grep(ens, function (obj, i) { return obj.FK_Node != undefined }); return ens; } function changeOption() { var nodeID = GetQueryString("FK_Node"); var en = new Entity("BP.WF.Template.NodeSimple", nodeID); flowNo = en.FK_Flow; var obj = document.getElementById("changBar"); var sele = obj.options; var index = obj.selectedIndex; var optionKey = 0; if (index > 1) { optionKey = sele[index].value } var roleName = ""; switch (parseInt(optionKey)) { case DeliveryWay.ByStation: roleName = "0.ByStation.htm"; break; case DeliveryWay.ByDept: roleName = "1.ByDept.htm"; break; case DeliveryWay.BySQL: roleName = "2.BySQL.htm"; break; case DeliveryWay.ByBindEmp: roleName = "3.ByBindEmp.htm"; break; case DeliveryWay.BySelected: roleName = "4.BySelected.htm"; break; case DeliveryWay.BySelected_1: roleName = "41.BySelected.htm"; break; case DeliveryWay.ByPreviousNodeFormEmpsField: roleName = "5.ByPreviousNodeFormEmpsField.htm"; break; case DeliveryWay.ByPreviousNodeFormDepts: roleName = "52.ByPreviousNodeFormDepts.htm"; break; case DeliveryWay.ByPreviousNodeFormStationsAI: roleName = "53.ByPreviousNodeFormStationsAI.htm"; break; case DeliveryWay.ByPreviousNodeFormStationsOnly: roleName = "54.ByPreviousNodeFormStationsOnly.htm"; break; case DeliveryWay.BySelectEmpByOfficer: roleName = "55.BySelectEmpByOfficer.htm"; break; case DeliveryWay.ByPreviousNodeEmp: roleName = "6.ByPreviousNodeEmp.htm"; break; case DeliveryWay.ByStarter: roleName = "7.ByStarter.htm"; break; case DeliveryWay.BySpecNodeEmp: roleName = "8.BySpecNodeEmp.htm"; break; case DeliveryWay.ByDeptAndStation: roleName = "9.ByDeptAndStation.htm"; break; case DeliveryWay.ByStationAndEmpDept: roleName = "10.ByStationAndEmpDept.htm"; break; case DeliveryWay.BySpecNodeEmpStation: roleName = "11.BySpecNodeEmpStation.htm"; break; case DeliveryWay.BySQLAsSubThreadEmpsAndData: roleName = "12.BySQLAsSubThreadEmpsAndData.htm"; break; case DeliveryWay.ByDtlAsSubThreadEmps: roleName = "13.ByDtlAsSubThreadEmps.htm"; break; case DeliveryWay.ByStationOnly: roleName = "14.ByStationOnly.htm"; break; case DeliveryWay.ByFEE: roleName = "15.ByFEEp.htm"; break; case DeliveryWay.BySetDeptAsSubthread: roleName = "16.BySetDeptAsSubthread.htm"; break; case DeliveryWay.BySQLTemplate: roleName = "17.BySQLTemplate.htm"; break; case DeliveryWay.ByFromEmpToEmp: roleName = "18.ByFromEmpToEmp.htm"; break; case DeliveryWay.FindSpecDeptEmps: roleName = "19.FindSpecDeptEmpsInStationlist.htm"; break; case DeliveryWay.ByStationForPrj: roleName = "20.ByStationForPrj.htm"; break; case DeliveryWay.BySelectedForPrj: roleName = "21.BySelectedForPrj.htm"; break; case DeliveryWay.ByDeptLeader: roleName = "23.ByDeptLeader.htm"; break; case DeliveryWay.ByDeptShipLeader: roleName = "28.ByDeptShipLeader.htm"; break; case DeliveryWay.ByEmpLeader: roleName = "50.ByEmpLeader.htm"; break; case DeliveryWay.ByTeamOrgOnly: roleName = "24.ByTeamOrgOnly.htm"; break; case DeliveryWay.ByTeamOnly: roleName = "25.ByTeamOnly.htm"; break; case DeliveryWay.ByTeamDeptOnly: roleName = "26.ByTeamDeptOnly.htm"; break; case DeliveryWay.ByBindTeamEmp: roleName = "27.SelectEmpsByTeamStation.htm"; break; case DeliveryWay.BySelectedOrgs: roleName = "42.BySelectedOrgs.htm"; break; case DeliveryWay.BySelectedEmpsOrgModel: roleName = "43.BySelectedEmpsOrgModel.htm"; break; case DeliveryWay.BySelfUrl: //自定义url. roleName = "44.BySelfUrl.htm"; break; case DeliveryWay.ByAPIUrl: roleName = "45.ByAPIUrl.htm"; break; case DeliveryWay.BySenderParentDeptLeader: roleName = "46.BySenderParentDeptLeader.htm"; break; case DeliveryWay.BySenderParentDeptStations: roleName = "47.BySenderParentDeptStations.htm"; break; case DeliveryWay.ByCCFlowBPM: roleName = "100.ByCCFlowBPM.htm"; break; case DeliveryWay.ByGuest: roleName = "51.ByGuest.htm"; break; default: roleName = "0.ByStation.htm"; break; } // alert(roleName); SetHref( roleName + "?FK_Node=" + nodeID + "&FK_Flow=" + flowNo); } function SaveAndClose() { Save(); window.close(); } function SaveIt() { $("#Btn_Save").html("正在保存请稍后."); try { Save(); AfterSave(); } catch (e) { alert(e); return; } $("#Btn_Save").html("保存成功"); setTimeout(function () { $("#Btn_Save").html("保存."); }, 1000); } // 保存之后要做的事情. function AfterSave() { //清除. AccepterRole_ClearAllOrgStartFlowsCash(); } //打开窗体. function OpenEasyUiDialogExt(url, title, w, h, isReload) { OpenEasyUiDialog(url, "eudlgframe", title, w, h, "icon-property", true, null, null, null, function () { if (isReload == true) { Reload(); } }); } //高级设置. function AdvSetting() { var nodeID = GetQueryString("FK_Node"); var url = "AdvSetting.htm?FK_Node=" + nodeID + "&M=" + Math.random(); OpenEasyUiDialogExt(url, "高级设置", 600, 500, false); }