var commonGridObj_user; var comboCustomer;//委托单位 var user_comp; function $(id){ return document.getElementById(id); } function getCompanyid() { var sArg = new Array(); if(ids.indexOf(",") >= 0) { sArg = ids.split(","); } else { sArg.push(ids); } // // for(var i=0;i= 0) { sArg = ids.split(","); } else { sArg.push(ids); } for(var i=0;i= 0) // { // selectedArg = selectedVal.split(","); // } // else // { // selectedArg.push(selectedVal); // } // // //取消选中 //// for(var i=0;i= 0) // { // selectedArg = selectedVal.split(","); // } // else // { // selectedArg.push(selectedVal); // } //取消选中 // for(var i=0;i","客户名称","分公司","是否所属分公司","是否共享","共享人","共享时间","撤销人","撤销时间");// //width var widthArgs_user = new Array("30","100","100","100","80","100","120","100","120"); //column align var colAlignArgs_user = new Array("center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_user = new Array("na","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_user = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro"); commonGridObj_user = new TGridCommon("mygrid_container_user","form1",headerArgs_user,widthArgs_user,colAlignArgs_user,colSortArgs_user,colTypeArgs_user); commonGridObj_user.setResponseUrl("ExchangesUnitShareGridSource.aspx"); var compVal = ""; var deptVal = ""; if($("h_compid").value.trim() != ""){ compVal = "&compname="+escape(user_comp.getItemText($("h_compid").value)); } // if($("h_deptid").value.trim() != ""){ // deptVal = "&deptname="+escape(user_comp.getItemText($("h_deptid").value)); // } commonGridObj_user.setRequest("../Shipping/ExchangesUnitShareGridSource.aspx?handle=userlist&id="+$("hdGid").value.trim()+compVal+deptVal+"&uid="+commonGridObj_user.newGuid()); commonGridObj_user.setSourceType("json"); commonGridObj_user.setSkin("xp"); commonGridObj_user.setImageUrl("../images/"); commonGridObj_user.initGrid(); commonGridObj_user.loadafter = true; commonGridObj_user.after = function(){ finishLoading(); }; commonGridObj_user.bind(); // commonGridObj_user.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){ // var openSet = "height=768, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-768)/2 + ",Left= "+(screen.width-1024)/2 // var openType = "_blank"; // var openUrl = "../Users/Edit.aspx?id="+rId+"&handle=edit"; // var tempWin = window.open ("about:blank",openType,openSet); // tempWin.location = openUrl; // }); // commonGridObj_user.dbclickEvent = function() // { // commonGridObj_user.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd) // { // var openSet = "height=768, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-768)/2 + ",Left= "+(screen.width-1024)/2 // var openType = "_blank"; // var openUrl = "../Users/Edit.aspx?id="+rId+"&handle=edit"; // var tempWin = window.open ("about:blank",openType,openSet); // tempWin.location = openUrl; // }); // } } 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 initLoading(){ $("progressBar").style.display = ""; } function finishLoading(){ $("progressBar").style.display = "none"; } String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); } function validateType(strObj){ var type = 0; var result = strObj.substring(0,strObj.indexOf("#")); var typeName = strObj.substring(strObj.indexOf("#")+1,strObj.length); switch(typeName){ case "user": type = 1; break; case "comp": type = 2; break; case "dept": type = 3; break; } return type; } function getID(strObj){ var uid = strObj.substring(0,strObj.indexOf("#")); return uid; } function searchUser(txtObjName){ var searchVal = $(txtObjName).value; var searchType = $("sel_type").value; var searchUserObj = null; var searchDeptObj = null; if(searchType == 1){ var url = "../Modules/ModuleGridSource.aspx?handle=checkdept&searchdept="+escape(searchVal)+"&uid="+newGuid(); var loader = dhtmlxAjax.getSync(url); var postStatus = loader.xmlDoc.responseText; if(postStatus != ""){ searchDeptObj = JSON.parse(postStatus,function(key,value){ return value; }); } if(user_comp != null){ for(var i=0;i 0){ if(window.confirm("确定要将选择的用户删除?")){ for(var j=0;j