var mygrid_log; var pager; var jsonPage; var jsonPageObj; var pageTotal; var pageShowCount = 15; var curPage = 1; var s0=""; var s1=""; var s2=""; var s3=""; var s4=""; var s5=""; var s6=""; var s7=""; var s8=0; var newHeaderArgs; var newWidthArgs; var newColAlignArgs; var newColSortArgs; var newColTypeArgs; function $(id){ return document.getElementById(id); } function initWinScreen() { var winScreenHeight = 0; var winScreenWidth = 0; if(window.screen.height) { winScreenHeight = window.screen.height; } if(window.screen.width) { winScreenWidth = window.screen.width; } if(winScreenWidth >= 1440 && winScreenWidth >= 900) { document.getElementById("mygrid_container_log").style.height = "420px"; } else if(winScreenWidth >= 1366 && winScreenWidth >= 768) { document.getElementById("mygrid_container_log").style.height = "300px"; } else if(winScreenWidth >= 1024 && winScreenWidth >= 768) { document.getElementById("mygrid_container_log").style.height = "300px"; } } function initLog() { //getUserSetting getUserGridSetting(); mygrid_log = new dhtmlXGridObject('mygrid_container_log'); mygrid_log.setImagePath("../images/"); mygrid_log.setSkin("xp"); // s0=""; s1=""; s2=""; s3=""; s4=""; s5=""; s6=""; s8 = 0; strCNTR = dhtmlxAjax.getSync("../FeeCodes/TopCtnAdapter.aspx?cntr=cntr&val="+newGuid()); sCNTR = strCNTR.xmlDoc.responseText; jsonCtnObj = null; if(sCNTR.trim() != "") { jsonCtnObj = eval('(' + sCNTR + ')'); for(var i=0;i= 0){ oHead = document.getElementsByTagName('head').item(0); oScript = document.createElement( "script" ); oScript.language = "javascript"; oScript.type = "text/javascript"; oScript.id = scriptid; oScript.defer = true; oScript.text = jsVal; oHead.appendChild(oScript); } } function createGrid() { mygrid_log.attachEvent("onRowDblClicked", function(rId,cInd) { var selectedId = mygrid_log.getSelectedRowId(); var sRowIndex = mygrid_log.getRowIndex(selectedId); var sCell = mygrid_log.cellByIndex(sRowIndex,1).getValue(); // 21+s8 var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 var openType = "_blank"; var openUrl = ""; if (sCell.trim() == "海运出口") { openUrl = "../baseinfo/opseaebaseinfo.aspx?handle=check&bsno=" + selectedId; } else if (sCell.trim() == "海运进口" || sCell.trim() == "海运进口散货") { openUrl = "../baseinfo/opseaibaseinfo.aspx?handle=check&bsno=" + selectedId; } window.open (openUrl,openType,openSet); }); } //封装查询条件为Json LWP 2012-9-28 function getUserGridSetting() { s0 = ""; //表头暂时不加箱型循环 var urlVal = "ProfitReportGridSource.aspx?handle=setting&RangeViewId=" + $("hid_rangeView").value + "&val=" + newGuid() + "&tbNO=" + $("tbNO").value + "&ddlCUSTOMERNAME=" + escape($("hd_comboCUSTOMERNAME").value) + "&ddlSALE=" + escape($("hd_comboSALE").value) + "&ddlVESSEL=" + escape($("hd_comboVESSEL").value) + "&ddlVOYNO=" + escape($("hd_comboVOYNO").value) + "&tbETD=" + $("tbETD").value + "&tbETD2=" + $("tbETD2").value + "&tbACCDATE=" + $("tbACCDATE").value + "&hidsel=" + $("hid_sel").value + "&cntr=" + s0 + "&ddlBSTYPE=" + escape($("ddlBSTYPE").value) + "&ddlFEETYPE=" + $("ddlFeeType").value + "&ddlBSSTATUS=" + $("ddlBSSTATUS").value + "&subcompany=" + escape($("hd_comboSubcompany").value) + "&goodname=" + escape($("hd_comboGOODSNAME").value) + "&tradetype=" + escape($("hd_comboTradeType").value) + "&bssource=" + escape($("hd_comboBSSOURCE").value); var loader = dhtmlxAjax.getSync(urlVal); var loadVal = loader.xmlDoc.responseText; jsonPage = loadVal; if(IsNum(jsonPage)){ jsonPageObj = null; }else{ jsonPageObj = eval('(' + loadVal + ')'); } } function PagerView(id){ var self = this; this.id = id; this.container = null; this.index = 1; // 当前页码, 从1开始 this.size = pageShowCount; // 每页显示记录数 this.maxButtons = 9; // 显示的分页按钮数量 this.itemCount = 0; // 记录总数 this.pageCount = 0; // 总页数 /** * 控件使用者重写本方法, 获取翻页事件, 可用来向服务器端发起AJAX请求. * @param index: 被点击的页码. */ this.onclick = function(index){ }; /** * 内部方法. */ this._onclick = function(index){ self.index = index; self.onclick(index); self.render(); }; /** * 在显示之前计算各种页码变量的值. */ this.calculate = function(){ self.pageCount = parseInt(Math.ceil(self.itemCount / self.size)); self.index = parseInt(self.index); if(self.index > self.pageCount){ self.index = self.pageCount; } }; /** * 渲染分页控件. */ this.render = function(){ if(self.id != undefined){ var div = document.getElementById(self.id); div.view = self; self.container = div; } self.calculate(); var start, end; start = Math.max(1, self.index - parseInt(self.maxButtons/2)); end = Math.min(self.pageCount, start + self.maxButtons - 1); start = Math.max(1, end - self.maxButtons + 1); var str = ""; str += "
\n"; if(self.pageCount > 1){ if(self.index != 1){ str += '|<'; str += '<<'; }else{ str += '|<'; str += '<<'; } } for(var i=start; i<=end; i++){ if(i == this.index){ str += '' + i + ""; }else{ str += '' + i + ""; } } if(self.pageCount > 1){ if(self.index != self.pageCount){ str += '>>'; str += '>|'; }else{ str += '>>'; str += '>|'; } } str += ' 一共' + self.pageCount + '页, ' + self.itemCount + '条记录 '+'   每页显示: '+""; str += "
\n"; self.container.innerHTML = str; var a_list = self.container.getElementsByTagName('a'); for(var i=0; i编辑标题"; // s += "重新排序"; // //s += "修改用户信息"; // //s += "删除该条记录"; // s = s.replace(/{id}/g, id); // s = s.replace(/{sname}/g, sname); // var s = "保存"; // var s = "
保存
取消
"; var s = "
修改标题
编辑显示
"; menu.innerHTML = s; menu.onmouseover = function(){over=true;}; menu.onmouseout = function(){over=false;}; } function hideMenu(){ if(menu){ document.body.removeChild(menu); menu = null; } } function refresh(sname){ var req = getReq(); req.open("GET", sname+"?refresh=1&id=", true); /*req.onreadystatechange = function(){ if(req.readyState==4) { el("bod").innerHTML = req.responseText; } };*/ req.send(null); } function showInfo(id,sname){ hideMenu(); shideBody(); el("tit").innerHTML = "查看用户的详细信息"; el("bod").innerHTML = "loading..."; el("bot").innerHTML = ""; var req = getReq(); req.open("GET", sname+"?getinfo=1&id="+id, true); req.onreadystatechange = function(){ if(req.readyState==4){ el("bod").innerHTML = req.responseText; } }; req.send(null); } var shield; function shideBody() { shield = document.createElement("DIV"); shield.id = "shield"; shield.style.position = "absolute"; shield.style.left = "0px"; shield.style.top = "0px"; shield.style.width = "100%"; shield.style.height = document.documentElement.scrollHeight+"px"; shield.style.background = "#333333"; shield.style.textAlign = "center"; shield.style.zIndex = "10"; shield.style.filter = "alpha(opacity=0)"; shield.style.opacity = 0; document.body.appendChild(shield); this.setOpacity = function(obj,opacity){ if(opacity>=1)opacity=opacity/100; try{ obj.style.opacity=opacity; }catch(e){} try{ if(obj.filters.length>0 && obj.filters("alpha")){ obj.filters("alpha").opacity=opacity*150; }else{ obj.style.filter="alpha(opacity=\""+(opacity*150)+"\")"; } }catch(e){} } var c = 0; this.doAlpha = function(){ if (++c > 20){clearInterval(ad);return 0;} setOpacity(shield,c); } var ad = setInterval("doAlpha()",1); el("divh").style.display = ""; el("divh").style.marginTop = -75+document.documentElement.scrollTop + "px"; } function cancelShide() { if(el("divh")) { el("divh").style.display = "none"; } if(shield) { document.body.removeChild(shield); shield = null; } } function getReq() { var oHttpReq = null; if(window.ActiveXObject) oHttpReq = new ActiveXObject("MSXML2.XMLHTTP"); else if(window.createRequest) oHttpReq = window.createRequest(); else oHttpReq = new XMLHttpRequest(); return oHttpReq; } function removeRow(e) { e.style.backgroundColor = "#ff0000"; setTimeout(function(){e.style.backgroundColor = "#ffcccc";},100); setTimeout(function(){e.style.backgroundColor = "MistyRose";},300); setTimeout(function(){e.style.display = "none";},450); } //是否为数字 function IsNum(val){ var re = /^[-\+]?\d+(\.\d+)?$/; if (!re.test(val)){ return false; }else{ return true; } } function getPageOption(){ var pageCountArg = new Array(); pageCountArg.push(15); pageCountArg.push(30); pageCountArg.push(50); pageCountArg.push(100); pageCountArg.push(200); var optionStr = ""; for(var i = 0;i"+pageCountArg[i]+""; }else{ optionStr += ""; } } return optionStr; ; } function changeShowCount(id){ var selectObj = $(id); var selVal = selectObj.options[selectObj.selectedIndex].value; pageShowCount = selVal; openNewDiv(); } var docEle = function() { return document.getElementById(arguments[0]) || false; } function openNewDiv(_id) { var m = "mask"; if (docEle(_id)) document.removeChild(docEle(_id)); if (docEle(m)) document.removeChild(docEle(m)); // 新激活图层 var newDiv = document.createElement("div"); newDiv.id = _id; newDiv.style.position = "absolute"; newDiv.style.zIndex = "9999"; newDiv.style.width = "200px"; newDiv.style.height = "100px"; newDiv.style.top = "100px"; newDiv.style.left = (parseInt(document.body.scrollWidth) - 300) / 2 + "px"; // 屏幕居中 newDiv.style.background = "#EFEFEF"; newDiv.style.border = "1px solid #860001"; newDiv.style.padding = "5px"; newDiv.innerHTML = "
      您已更改了视图设置 是否保存


            "; document.body.appendChild(newDiv); // mask图层 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "1"; newMask.style.width = document.body.scrollWidth + "px"; newMask.style.height = document.body.scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#000"; newMask.style.filter = "alpha(opacity=40)"; newMask.style.opacity = "0.40"; document.body.appendChild(newMask); // 关闭mask和新图层 var saveButton = document.createElement("a"); saveButton.href = "#"; saveButton.innerHTML = "确定"; saveButton.className="regular"; saveButton.onclick = function() { change(); //document.body.removeChild(docEle(_id)); //document.body.removeChild(docEle(m)); //return false; } newDiv.appendChild(saveButton); //newDiv.innerHTML += "      "; var cancelButton = document.createElement("a"); cancelButton.href = "#"; cancelButton.innerHTML = "取消"; cancelButton.className="regular"; cancelButton.onclick = function() { document.body.removeChild(docEle(_id)); document.body.removeChild(docEle(m)); unSaveGrid(); return false; } newDiv.appendChild(cancelButton); } function unSaveGrid() { mygrid_log = new dhtmlXGridObject('mygrid_container_log'); mygrid_log.setImagePath("../images/"); mygrid_log.setSkin("xp"); // s0=""; s1=""; s2=""; s3=""; s4=""; s5=""; s6=""; s8 = 0; var strCNTR = dhtmlxAjax.getSync("../FeeCodes/TopCtnAdapter.aspx?cntr=cntr&val="+newGuid()); var sCNTR = strCNTR.xmlDoc.responseText; var jsonCtnObj = null; if(sCNTR.trim() != "") { jsonCtnObj = eval('(' + sCNTR + ')'); for(var i=0;i"+jsonCtnObj.ctns[i].ctn+""; } } } // var TargeVal = ""; if(jsonPageObj != null){ for(var i=0;i"+jsonPageObj.columns[i].description+""; } } var editObj = "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
保存
" + "
重命名
" + "
保存
取消
"; newDiv.innerHTML = editObj; document.body.appendChild(newDiv); // mask图层 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "1"; newMask.style.width = document.body.scrollWidth + "px"; newMask.style.height = document.body.scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#000"; newMask.style.filter = "alpha(opacity=40)"; newMask.style.opacity = "0.40"; document.body.appendChild(newMask); // 关闭mask和新图层 } var sourceObj; var targetObj; /* function $(id){ return document.getElementById(id); } */ function add(){ sourceObj = $("sel_LogColumns"); targetObj = $("sel_VisiableColumns"); for(var i=0;i 1){ sourceObj.remove(i); sourceObj.add(optionObj,i-1); }else{ sourceObj.remove(i); sourceObj.add(optionObj,0); } } } } function down(){ sourceObj = $("sel_VisiableColumns"); var cacheArg = new Array(); for(var i=0;i 0){ document.body.removeChild(docEle("dvColumnSet")); document.body.removeChild(docEle("mask")); }else{ document.body.removeChild(docEle("dvColumnSet")); document.body.removeChild(docEle("mask")); return } var jsonLogObj = ""; jsonLogObj = "{\"$type\":\"DSWeb.Models.JsonColumnGroupEntity, DSWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\",\"ShowCount\":"+pageShowCount+",\"JsonColumnEntities\":["; var tempGroupJson = ""; for(var i=0;i 1){ alert("请单选要重命名的项"); }else if(iSelectCount < 1){ alert("未选中要重命名的项"); }else{ $("txt_rename").value = selObj.options[selIndex].text; } } function saveRename(){ var selObj = $("sel_VisiableColumns"); var txtRenameVal = $("txt_rename").value; if(txtRenameVal.trim() != ""){ if (selIndex >= 0) { s0 = ""; //表头暂时不加箱型循环 var urlVal = "ProfitReportGridSource.aspx?handle=rename&RangeViewId=" + $("hid_rangeView").value + "&old_header=" + escape(selObj.options[selIndex].text.trim()) + "&new_header=" + escape(txtRenameVal.trim()) + "&val=" + newGuid() + "&tbNO=" + $("tbNO").value + "&ddlCUSTOMERNAME=" + escape($("hd_comboCUSTOMERNAME").value) + "&ddlSALE=" + escape($("hd_comboSALE").value) + "&ddlVESSEL=" + escape($("hd_comboVESSEL").value) + "&ddlVOYNO=" + escape($("hd_comboVOYNO").value) + "&tbETD=" + $("tbETD").value + "&tbETD2=" + $("tbETD2").value + "&tbACCDATE=" + $("tbACCDATE").value + "&hidsel=" + $("hid_sel").value + "&cntr=" + s0 + "&ddlBSTYPE=" + escape($("ddlBSTYPE").value) + "&ddlFEETYPE=" + $("ddlFeeType").value + "&ddlBSSTATUS=" + $("ddlBSSTATUS").value + "&subcompany=" + escape($("hd_comboSubcompany").value) + "&goodname=" + escape($("hd_comboGOODSNAME").value) + "&tradetype=" + escape($("hd_comboTradeType").value) + "&bssource=" + escape($("hd_comboBSSOURCE").value); var loader = dhtmlxAjax.getSync(urlVal); var loadVal = loader.xmlDoc.responseText; var saveState = loadVal; if(saveState == 1) { selObj.options[selIndex].text = txtRenameVal.trim(); } else { alert("重命名失败"); } } } initLog(); } function time_custom(a,b,order){ a=a.split(":") b=a.split(":") if (a[0]==b[0]) return (a[1]>b[1]?1:-1)*(order=="asc"?1:-1); else return (a[0]>b[0]?1:-1)*(order=="asc"?1:-1); } String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); } //复选框全选事件 LWP 2012-9-29 function checkall() { var checkStatus = $("ck_all").checked; if(checkStatus == 1) { //var iCount = mygrid_log.getGridObj().getRowsNum(); var iCount = mygrid_log.getRowsNum(); for(var i=0;i < iCount;i++) { //mygrid_log.getGridObj().cellByIndex(i,0).setValue(1); mygrid_log.cellByIndex(i,0).setValue(1); } } else { //var iCount = mygrid_log.getGridObj().getRowsNum(); var iCount = mygrid_log.getRowsNum(); for(var i=0;i < iCount;i++) { //mygrid_log.getGridObj().cellByIndex(i,0).setValue(0); mygrid_log.cellByIndex(i,0).setValue(0); } } } //设置列表信息 LWP 2012-9-27 function editGridSetting(){ var openSet = "height=500, width=800, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-500)/2 + ",Left= "+(screen.width-800)/2 var openType = "_blank"; var ddltype = $("ddlBSTYPE").value; // if(ddltype == "op_seae") // { // var openUrl = "../UserSettings/ReportGridEdit.aspx?handle=reportgrid&templatetype=opseae"; // } // if(ddltype == "op_seai") // { // var openUrl = "../UserSettings/ReportGridEdit.aspx?handle=reportgrid&templatetype=opseai"; // } // if(ddltype == "all") // { var openUrl = "../UserSettings/ReportGridEdit.aspx?handle=seareportallgrid&templatetype=All"; // } window.open (openUrl,openType,openSet); } //-------------------------------------------------------------------------------------------------------------- function areaUpdate() { newHeaderArgs =""; newWidthArgs =""; newColAlignArgs =""; newColSortArgs =""; newColTypeArgs =""; initLog(); } function ShowDetailSelect() { $("hid_sel").value = "all"; initLog(); initMenu(); getSum(); } function ShowDelSelect() { $("hid_sel").value = ""; // $("tbNO").value = ""; $("hd_comboCUSTOMERNAME").value = ""; $("hd_comboSALE").value = ""; $("hd_comboVESSEL").value = ""; $("hd_comboVOYNO").value = ""; $("tbETD").value = ""; $("tbETD2").value = ""; $("tbACCDATE").value = ""; $("hid_sel").value = ""; //$("ddlBSTYPE").value = ""; //$("ddlFeeType").value = ""; $("hd_comboSubcompany").value = ""; $("hd_comboBSSOURCE").value = ""; // comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value); comboSALE.setComboText($("hd_comboSALE").value); comboVESSEL.setComboText($("hd_comboVESSEL").value); comboVOYNO.setComboText($("hd_comboVOYNO").value); comboSubcompany.setComboText($("hd_comboSubcompany").value); comboBSSOURCE.setComboText($("hd_comboBSSOURCE").value); // $("divSumFee1").innerHTML = ""; $("divSumFee2").innerHTML = ""; $("divSumFee3").innerHTML = ""; $("divSumFee4").innerHTML = ""; $("divSumFee5").innerHTML = ""; $("divSumFee6").innerHTML = ""; $("divSumFee7").innerHTML = ""; $("divSumFee8").innerHTML = ""; $("divSumFee9").innerHTML = ""; $("divSumFee10").innerHTML = ""; $("divSumCtn").innerHTML = ""; // initLog(); initMenu(); } function getSum() { if ($("hid_sel").value.trim() != "") { var urlVal = "ProfitReportGridSource.aspx?handle=getsum&RangeViewId=" + $("hid_rangeView").value + "&show_page=" + pageShowCount + "&cur_page=1&tbNO=" + $("tbNO").value + "&ddlCUSTOMERNAME=" + escape($("hd_comboCUSTOMERNAME").value) + "&ddlSALE=" + escape($("hd_comboSALE").value) + "&ddlVESSEL=" + escape($("hd_comboVESSEL").value) + "&ddlVOYNO=" + escape($("hd_comboVOYNO").value) + "&tbETD=" + $("tbETD").value + "&tbETD2=" + $("tbETD2").value + "&tbACCDATE=" + $("tbACCDATE").value + "&hidsel=" + $("hid_sel").value + "&cntr=" + s0 + "&ddlBSTYPE=" + escape($("ddlBSTYPE").value) + "&ddlFEETYPE=" + $("ddlFeeType").value + "&ddlBSSTATUS=" + $("ddlBSSTATUS").value + "&subcompany=" + escape($("hd_comboSubcompany").value) + "&goodname=" + escape($("hd_comboGOODSNAME").value) + "&tradetype=" + escape($("hd_comboTradeType").value) + "&bssource=" + escape($("hd_comboBSSOURCE").value) + "&val=" + newGuid(); var loader = dhtmlxAjax.getSync(urlVal); var loadVal = loader.xmlDoc.responseText; // var selGroup = new Array(); selGroup = loadVal.split(","); $("divSumFee1").innerHTML = selGroup[0].toString().trim(); $("divSumFee2").innerHTML = selGroup[1].toString().trim(); $("divSumFee3").innerHTML = selGroup[2].toString().trim(); $("divSumFee4").innerHTML = selGroup[3].toString().trim(); $("divSumFee5").innerHTML = selGroup[4].toString().trim(); $("divSumFee6").innerHTML = selGroup[5].toString().trim(); $("divSumFee7").innerHTML = selGroup[6].toString().trim(); $("divSumFee8").innerHTML = selGroup[7].toString().trim(); $("divSumFee9").innerHTML = selGroup[8].toString().trim(); $("divSumFee10").innerHTML = selGroup[9].toString().trim(); $("divSumCtn").innerHTML = selGroup[10].toString().trim(); } } this.newGuid = function(){ 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 setExcel() { if(confirm('确定要导出报表吗?')) { s0=""; s1=""; s2=""; s3=""; s4=""; s5=""; s6=""; s8 = 0; strCNTR = dhtmlxAjax.getSync("../FeeCodes/TopCtnAdapter.aspx?cntr=cntr&val="+newGuid()); sCNTR = strCNTR.xmlDoc.responseText; jsonCtnObj = null; if(sCNTR.trim() != "") { jsonCtnObj = eval('(' + sCNTR + ')'); for(var i=0;i 0) { s2 = s2 + 2; } var s3 = s1.substring(s2); if (s2 > 0) { comboCUSTOMERNAME.setComboText(s3); $("hd_comboCUSTOMERNAME").value = s3; } else { comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value); } } }); comboCUSTOMERNAME.setComboText($("hd_comboCUSTOMERNAME").value); comboCUSTOMERNAME.attachEvent("onKeyPressed", function (keyCode) { if (keyCode != "8") { var arrayArg = new Array(); setTimeout(function () { var filterCount = 0; var is = -1; var ishd = $("hd_comboCUSTOMERNAME").value.trim(); if ("" != comboCUSTOMERNAME.getComboText().trim()) { while ("undefined" != typeof comboCUSTOMERNAME.getOptionByIndex(filterCount)) { var comboValue = comboCUSTOMERNAME.getOptionByIndex(filterCount).text.toUpperCase(); //.value; var enterValue = comboCUSTOMERNAME.getComboText().trim().toUpperCase(); $("hd_comboCUSTOMERNAME").value = comboCUSTOMERNAME.getComboText().trim().toUpperCase(); if (comboValue.indexOf(enterValue) == 0) { comboCUSTOMERNAME.selectOption(filterCount, true, true); is = filterCount; break; } ++filterCount; } // if (is == -1) { // $("hd_comboCUSTOMERNAME").value = ishd; // alert("无此内容,请重新选择!"); // } } }, 10); } }); comboCUSTOMERNAME.attachEvent("onSelectionChange", function () { $("hd_comboCUSTOMERNAME").value = comboCUSTOMERNAME.getComboText().trim(); var s1 = comboCUSTOMERNAME.getComboText().trim(); if (s1 == "") { $("hd_comboCUSTOMERNAME").value = ""; } }); } function initComboSALE()//揽货人 { //生成 comboSALE = dhtmlXComboFromSelect("ddlSALE"); comboSALE.loadXML("../FeeCodes/OPAdapter.aspx?mask=0&pos=0&rName=isSaleMan&userID=" + $("h_uid").value); comboSALE.setOptionWidth(200); comboSALE.attachEvent("onChange", function () { comboSALE.setComboText($("hd_comboSALE").value); }); comboSALE.attachEvent("onBlur", function () { var s1 = comboSALE.getComboText().trim(); var s2 = s1.indexOf("|"); if (s1 == "") { $("hd_comboSALE").value = ""; comboSALE.setComboText($("hd_comboSALE").value); } else { if (s2 > 0) { s2 = s2 + 2; } var s3 = s1.substring(s2); if (s2 > 0) { comboSALE.setComboText(s3); $("hd_comboSALE").value = s3; } else { comboSALE.setComboText($("hd_comboSALE").value); } } }); comboSALE.setComboText($("hd_comboSALE").value); comboSALE.attachEvent("onKeyPressed", function (keyCode) { if (keyCode != "8") { var arrayArg = new Array(); setTimeout(function () { var filterCount = 0; var is = -1; var ishd = $("hd_comboSALE").value.trim(); if ("" != comboSALE.getComboText().trim()) { while ("undefined" != typeof comboSALE.getOptionByIndex(filterCount)) { var comboValue = comboSALE.getOptionByIndex(filterCount).text.toUpperCase(); //.value; var enterValue = comboSALE.getComboText().trim().toUpperCase(); $("hd_comboSALE").value = comboSALE.getComboText().trim().toUpperCase(); if (comboValue.indexOf(enterValue) == 0) { comboSALE.selectOption(filterCount, true, true); is = filterCount; break; } ++filterCount; } if (is == -1) { $("hd_comboSALE").value = ishd; alert("无此内容,请重新选择!"); } } }, 10); } }); comboSALE.attachEvent("onSelectionChange", function () { $("hd_comboSALE").value = comboSALE.getComboText().trim(); var s1 = comboSALE.getComboText().trim(); if (s1 == "") { $("hd_comboSALE").value = ""; } }); } function initComboVESSEL()//船名 { comboVESSEL = dhtmlXComboFromSelect("ddlVESSEL"); comboVESSEL.loadXML("../FeeCodes/TCodeVesselAdapter.aspx?mask=0&pos=0"); // comboVOYNO = dhtmlXComboFromSelect("ddlVOYNO"); var strVESSEL = $("hd_comboVESSEL").value; comboVOYNO.loadXML("../FeeCodes/TCodeVoynoAdapter.aspx?mask=0&pos=0&strVESSEL=" + strVESSEL); } function initComboVESSEL2()//船名 { comboVESSEL.setOptionWidth(200); comboVESSEL.setComboText($("hd_comboVESSEL").value); comboVESSEL.attachEvent("onKeyPressed", function (keyCode) { if (keyCode != "8") { var arrayArg = new Array(); setTimeout(function () { var filterCount = 0; if ("" != comboVESSEL.getComboText().trim()) { while ("undefined" != typeof comboVESSEL.getOptionByIndex(filterCount)) { var comboValue = comboVESSEL.getOptionByIndex(filterCount).text.toUpperCase(); //.value; var enterValue = comboVESSEL.getComboText().toUpperCase(); $("hd_comboVESSEL").value = comboVESSEL.getComboText().toUpperCase(); if (comboValue.indexOf(enterValue) == 0) { comboVESSEL.selectOption(filterCount, true, true); $("hd_comboVESSEL").value = comboVESSEL.getComboText().trim(); break; } ++filterCount; } } }, 10); } }); comboVESSEL.attachEvent("onBlur", function () { $("hd_comboVESSEL").value = comboVESSEL.getComboText().trim(); $("hd_comboVOYNO").value = ""; initComboVOYNO(); }); comboVESSEL.attachEvent("onChange", function () { comboVESSEL.setComboText($("hd_comboVESSEL").value); }); comboVESSEL.attachEvent("onSelectionChange", function () { $("hd_comboVESSEL").value = comboVESSEL.getComboText().trim(); }); } function initComboVOYNO()//航次 { var strVESSEL; try { strVESSEL = comboVESSEL.getSelectedValue().trim(); //$("hd_comboVESSEL").value; } catch (e) { strVESSEL = ""; } //var strVESSEL=comboVESSEL.getSelectedValue().trim();//$("hd_comboVESSEL").value; comboVOYNO.loadXML("../FeeCodes/TCodeVoynoAdapter.aspx?mask=0&pos=0&strVESSEL=" + strVESSEL); comboVOYNO.setComboText($("hd_comboVOYNO").value); comboVOYNO.setOptionWidth(200); comboVOYNO.attachEvent("onChange", function () { comboVOYNO.setComboText($("hd_comboVOYNO").value); }); comboVOYNO.attachEvent("onKeyPressed", function (keyCode) { if (keyCode != "8") { var arrayArg = new Array(); setTimeout(function () { var filterCount = 0; if ("" != comboVOYNO.getComboText().trim()) { while ("undefined" != typeof comboVOYNO.getOptionByIndex(filterCount)) { var comboValue = comboVOYNO.getOptionByIndex(filterCount).text.toUpperCase(); //.value; var enterValue = comboVOYNO.getComboText().trim().toUpperCase(); $("hd_comboVOYNO").value = comboVOYNO.getComboText().trim().toUpperCase(); if (comboValue.indexOf(enterValue) == 0) { comboVOYNO.selectOption(filterCount, true, true); break; } ++filterCount; } } }, 10); } }); comboVOYNO.attachEvent("onSelectionChange", function () { $("hd_comboVOYNO").value = comboVOYNO.getComboText().trim(); }); } function initComboSubcompany()//分公司-部门 { comboSubcompany = dhtmlXComboFromSelect("list_subcompany"); comboSubcompany.loadXML("../FeeCodes/CompanysAdapter.aspx?mask=0&pos=0&ISDISABLE=0&ISDELETED=0"); comboSubcompany.attachEvent("onBlur", function () { var s1 = comboSubcompany.getComboText().trim(); var s2 = s1.indexOf("|"); if (s1 == "") { $("hd_comboSubcompany").value = ""; comboSubcompany.setComboText($("hd_comboSubcompany").value); } else { if (s2 > 0) { s2 = s2 + 2; } var s3 = s1.substring(s2); if (s2 > 0) { comboSubcompany.setComboText(s3); $("hd_comboSubcompany").value = s3; } else { comboSubcompany.setComboText($("hd_comboSubcompany").value); } } }); comboSubcompany.setOptionWidth(200); comboSubcompany.setComboText($("hd_comboSubcompany").value); comboSubcompany.attachEvent("onKeyPressed", function (keyCode) { if (keyCode != "8") { var arrayArg = new Array(); setTimeout(function () { var filterCount = 0; var is = -1; var ishd = $("hd_comboSubcompany").value.trim(); if ("" != comboSubcompany.getComboText().trim()) { while ("undefined" != typeof comboSubcompany.getOptionByIndex(filterCount)) { var comboValue = comboSubcompany.getOptionByIndex(filterCount).text.toUpperCase(); //.value; var enterValue = comboSubcompany.getComboText().trim().toUpperCase(); $("hd_comboSubcompany").value = comboSubcompany.getComboText().trim().toUpperCase(); if (comboValue.indexOf(enterValue) == 0) { comboSubcompany.selectOption(filterCount, true, true); is = filterCount; break; } ++filterCount; } if (is == -1) { $("hd_comboSubcompany").value = ishd; alert("无此内容,请重新选择!"); } } }, 10); } }); comboSubcompany.attachEvent("onChange", function () { comboSubcompany.setComboText($("hd_comboSubcompany").value); }); comboSubcompany.attachEvent("onSelectionChange", function () { $("hd_comboSubcompany").value = comboSubcompany.getComboText().trim(); }); } function initcomboTradeType()//贸易方式 { comboTradeType = dhtmlXComboFromSelect("ddlTradeType"); var keytype = "贸易方式"; comboTradeType.loadXML("../FeeCodes/TcodeTradeTypeAdapter.aspx?mask=0&pos=0&keytype=" + escape(keytype)); comboTradeType.setOptionWidth(200); comboTradeType.attachEvent("onChange", function () { comboTradeType.setComboText($("hd_comboTradeType").value); }); comboTradeType.attachEvent("onBlur", function () { var s1 = comboTradeType.getComboText().trim(); if (s1 == "") { $("hd_comboTradeType").value = ""; comboTradeType.setComboText($("hd_comboTradeType").value); } else { comboTradeType.setComboText(s1); $("hd_comboTradeType").value = s1; } }); comboTradeType.setComboText($("hd_comboTradeType").value); comboTradeType.attachEvent("onSelectionChange", function () { $("hd_comboTradeType").value = comboTradeType.getComboText().trim(); }); } function initComboGOODSNAME()//货物描述类型 { comboGOODSNAME = dhtmlXComboFromSelect("ddlGOODSNAME"); comboGOODSNAME.loadXML("../FeeCodes/TCodeGoodsAdapter.aspx?mask=0&pos=0"); comboGOODSNAME.setOptionWidth(200); comboGOODSNAME.attachEvent("onChange", function () { comboGOODSNAME.setComboText($("hd_comboGOODSNAME").value); }); comboGOODSNAME.attachEvent("onBlur", function () { var s1 = comboGOODSNAME.getComboText().trim(); var s2 = s1.indexOf("|"); var selVal = ""; if (s1 == "") { $("hd_comboGOODSNAME").value = ""; comboGOODSNAME.setComboText($("hd_comboGOODSNAME").value); } else { if (s2 > 0) { s2 = s2 + 2; } var s3 = s1.substring(s2); if (s2 > 0) { comboGOODSNAME.setComboText(s3); $("hd_comboGOODSNAME").value = s3; } else { comboGOODSNAME.setComboText($("hd_comboGOODSNAME").value); } } }); comboGOODSNAME.setComboText($("hd_comboGOODSNAME").value); comboGOODSNAME.attachEvent("onKeyPressed", function (keyCode) { if (keyCode != "8") { var arrayArg = new Array(); setTimeout(function () { var is = -1; var ishd = $("hd_comboGOODSNAME").value.trim(); var filterCount = 0; if ("" != comboGOODSNAME.getComboText().trim()) { while ("undefined" != typeof comboGOODSNAME.getOptionByIndex(filterCount)) { var comboValue = comboGOODSNAME.getOptionByIndex(filterCount).text.toUpperCase(); //.value; var enterValue = comboGOODSNAME.getComboText().trim().toUpperCase(); $("hd_comboGOODSNAME").value = comboGOODSNAME.getComboText().trim().toUpperCase(); if (comboValue.indexOf(enterValue) == 0) { comboGOODSNAME.selectOption(filterCount, true, true); is = filterCount; break; } ++filterCount; } // if (is == -1) { // $("hd_comboGOODSNAME").value = ishd; // alert("无此内容,请重新选择!"); // } } }, 10); } }); comboGOODSNAME.attachEvent("onSelectionChange", function () { $("hd_comboGOODSNAME").value = comboGOODSNAME.getComboText().trim(); }); } var comboBSSOURCE; function initComboBSSOURCE()//市场来源大类 { comboBSSOURCE = dhtmlXComboFromSelect("ddlBSSOURCE"); comboBSSOURCE.loadXML("../FeeCodes/TCodeSourceAdapter.aspx?mask=0&pos=0&userID=" + $("hdUserID").value.trim()); comboBSSOURCE.readonly(true); comboBSSOURCE.setComboText($("hd_comboBSSOURCE").value); comboBSSOURCE.attachEvent("onChange", function () { comboBSSOURCE.setComboText($("hd_comboBSSOURCE").value); }); comboBSSOURCE.attachEvent("onSelectionChange", function () { $("hd_comboBSSOURCE").value = comboBSSOURCE.getComboText().trim(); }); } function getOnload()//市场来源大类 { initWinScreen(); initLog(); initMenu(); initComboCUSTOMERNAME(); initComboSALE(); initComboVESSEL(); initComboVESSEL2(); initComboVOYNO(); initComboSubcompany(); initcomboTradeType(); initComboGOODSNAME(); initComboBSSOURCE(); }