var tree_company; function $(id){ return document.getElementById(id); } function createTree(){ tree_company = new dhtmlXTreeObject("treeBox","100%","100%",0); tree_company.setSkin('dhx_skyblue'); tree_company.setImagePath("../images/csh_dhx_skyblue/"); var url = "WorkFlowGridSource.aspx?handle=companytree&uid="+newGuid(); tree_company.loadJSON(url); tree_company.attachEvent("onSelect", function(id){ }); tree_company.enableCheckBoxes(true); // setTimeout(function(){ // var id = $("h_moduleid").value; // // tree.selectItem(id,false); // tree.openItem(id); // },100); } function newGuid(){ var guid = ""; for (var i = 1; i <= 32; i++){ var n = Math.floor(Math.random()*16.0).toString(16); guid += n; if((i==8)||(i==12)||(i==16)||(i==20)) guid += "-"; } return guid.toUpperCase(); } function focusOnTree(){; // if(tree != null){ // if($("h_moduleid").value != ""){ // var id = $("h_moduleid").value; // } // } } function assignTo(){ var compArg = new Array(); var selCompanyObj = $("sel_company"); if(tree_company != null){ if(tree_company.getAllChecked().indexOf(",") >= 0){ //modArg = tree.getAllChecked().split(","); alert("指定错误,只能指定一个模块作为父模块"); return; }else{ compArg.push(tree_company.getAllChecked()); } if(selCompanyObj.options.length < 1){ var varItem = new Option(tree_company.getItemText(compArg[0]), compArg[0]); selCompanyObj.options.add(varItem); window.opener.document.getElementById("txt_company").value = tree_company.getItemText(compArg[0]); window.opener.document.getElementById("h_compid").value = compArg[0]; //var parentId = window.opener.document.getElementById("h_parentid").value; }else{ alert("已指定父模块信息,不能重复添加,请先移除后再添加"); return; } } } function removeAssign(){ var compList = $("sel_company"); if(compList.options.length > 0){ if(compList.value.trim() == ""){ alert("没有要操作的审核人信息"); }else{ for(var i=0;i