var mygrid_log; var pager; var jsonPage; var jsonPageObj; var pageTotal; var pageShowCount = 15; var curPage = 1; function $(id){ return document.getElementById(id); } function initLog() { //getUserSetting getUserGridSetting(); mygrid_log = new dhtmlXGridObject('mygrid_container_log'); mygrid_log.setImagePath("../images/"); mygrid_log.setSkin("xp"); // var arrayHeader = new Array(); var arrayColWidth = new Array(); if(jsonPageObj != null){ for(var i = 0;i 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 = ""; if($("hid_sel").value=="") { str += "
\n"; str += '共' + self.itemCount + '条记录 '; str += "
\n"; } else { 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); } //function editInfo(id){ // hideMenu(); // shideBody(); // // el("tit").innerHTML = "编辑用户信息"; // el("bod").innerHTML = "loading..."; // el("bot").innerHTML = " "; // var tds = el("tr_"+id).getElementsByTagName("td"); // var boy = tds[2].innerHTML == "男"; // var s = ""; // s += ""; // s += ""; // s += ""; // s += "
姓名
性别
年龄
"; // el("bod").innerHTML = s; //} //function deleteInfo(id){ // hideMenu(); // if(!confirm("确定要删除该记录吗?"))return; // // removeRow(el("tr_"+id)); // // var req = getReq(); // req.open("GET", "default.aspx?delete=1&id="+id, true); // req.onreadystatechange = function(){}; // req.send(null); //} //function doEdit(id){ // var puts = el("bod").getElementsByTagName("input"); // if(isNaN(puts[3].value)){ // puts[3].select();return; // } // var tds = el("tr_"+id).getElementsByTagName("td"); // tds[1].innerHTML = puts[0].value; // tds[2].innerHTML = puts[1].checked?"男":"女"; // tds[3].innerHTML = puts[3].value; // // var data = "name="+ escape(tds[1].innerHTML); // data += "&sex="+ escape(tds[2].innerHTML); // data += "&age="+ escape(tds[3].innerHTML); // // var req = getReq(); // req.open("POST", "default.aspx?edit=1&id="+id, true); // req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); // req.onreadystatechange = function(){}; // req.send(data); // // cancelShide(); //} 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"); $("hdNAMES").value = "发布\t航线\t起运港\t卸货港\t目的港\t船公司\t[20GP]\t[40GP]\t[40HQ]\t[45HQ]\t中转港\t开航日\t航程\t挂靠港\t服务\t超重费\t生效期\t有效期\t品名\t备注\t分公司"; mygrid_log.setHeader("发布,航线,起运港,卸货港,目的港,船公司,20GP,40GP,40HQ,45HQ,中转港,开航日,航程,挂靠港,服务,超重费,生效期,有效期,品名,备注,分公司"); mygrid_log.setInitWidths("30,100,120,120,120,120,60,60,60,60,100,100,100,100,100,300,120,120,150,300,100"); mygrid_log.setColAlign("center,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left"); mygrid_log.setColSorting("str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str"); mygrid_log.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro"); mygrid_log.init(); setTimeout(function(){ mygrid_log.load("CrmPriceCarrierSellListGridSource.aspx?handle=list&show_page="+pageShowCount+"&cur_page=1&carrier="+escape($("hd_comboCARRIER").value)+"&podload="+escape($("hd_comboPODLOAD").value)+"&portdischarge="+escape($("hd_comboPORTDISCHARGE").value)+"&destination="+escape($("hd_comboDESTINATION").value)+"&lane="+escape($("hd_comboLANE").value)+"&strsel="+escape($("hid_sel").value),"json"); },300); initPage(); initMenu(); createGrid(); } function editColumnSetting(_id) { hideMenu(); 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 = "700px"; newDiv.style.height = "340px"; newDiv.style.top = "100px"; newDiv.style.left = (parseInt(document.body.scrollWidth) - 560) / 2 + "px"; // 屏幕居中 newDiv.style.background = "#EFEFEF"; newDiv.style.border = "1px solid #860001"; newDiv.style.padding = "5px"; getUserGridSetting(); 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){ var urlVal = "CrmPriceCarrierSellListGridSource.aspx?handle=rename&old_header="+escape(selObj.options[selIndex].text.trim())+"&new_header="+escape(txtRenameVal.trim())+"&val="+newGuid()+"&carrier="+escape($("hd_comboCARRIER").value)+"&podload="+escape($("hd_comboPODLOAD").value)+"&portdischarge="+escape($("hd_comboPORTDISCHARGE").value)+"&destination="+escape($("hd_comboDESTINATION").value)+"&lane="+escape($("hd_comboLANE").value)+"&strsel="+escape($("hid_sel").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,""); } //全选框 function checkall() { var checkStatus = $("ck_all").checked; if(checkStatus == 1) { var iCount = mygrid_log.getRowsNum(); for(var i=0;i < iCount;i++) { mygrid_log.cellByIndex(i,0).setValue(1); } } else { var iCount = mygrid_log.getRowsNum(); for(var i=0;i < iCount;i++) { mygrid_log.cellByIndex(i,0).setValue(0); } } } //----------------------------------------------------------------------------------------------------- function ShowDetailFresh() { initLog(); initMenu(); } function ShowDetailSelect() { $("hid_sel").value="1"; ShowDetailFresh(); //$("hid_sel").value=""; } function GetRange() { var loader; var dates; var strR=""; var strgid = mygrid_log.getSelectedRowId(); if ($("hdRangeV").value != $("hdRangeO").value) { if($("hdRangeO").value=="1")//分公司 { loader = dhtmlxAjax.getSync("../FeeCodes/RangeAdapter.aspx?RangeID=1&strGID="+strgid+"&RangeName=modCrmPriceCarrierSellList&val="+newGuid()); dates = loader.xmlDoc.responseText; if(dates=="") { alert("您没有操作此数据的权限!"); return 0; } } if($("hdRangeO").value=="2")//分公司 { loader = dhtmlxAjax.getSync("../FeeCodes/RangeAdapter.aspx?RangeID=2&strGID="+strgid+"&RangeName=modCrmPriceCarrierSellList&val="+newGuid()); dates = loader.xmlDoc.responseText; if(dates=="") { alert("您没有操作此数据的权限!"); return 0; } } else if ($("hdRangeO").value="3")//个人 { loader = dhtmlxAjax.getSync("../FeeCodes/RangeAdapter.aspx?RangeID=3&strGID="+strgid+"&RangeName=modCrmPriceCarrierSellList&val="+newGuid()); dates = loader.xmlDoc.responseText; if(dates=="") { alert("您没有操作此数据的权限!"); return 0; } } } } 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 setExcel() { if(confirm('确定要导出报表吗?')) { var loader = dhtmlxAjax.getSync("CrmPriceCarrierSellListGridSource.aspx?handle=excel&carrier="+escape($("hd_comboCARRIER").value)+"&podload="+escape($("hd_comboPODLOAD").value)+"&portdischarge="+escape($("hd_comboPORTDISCHARGE").value)+"&destination="+escape($("hd_comboDESTINATION").value)+"&lane="+escape($("hd_comboLANE").value)+"&strsel="+escape($("hid_sel").value)+"&val="+newGuid()); $("hdSQL").value = loader.xmlDoc.responseText; // document.getElementById("btExcel1").click(); } } 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 imgAddChangePic() { var pic1=document.getElementById("imgAdd"); var start=pic1.src.lastIndexOf("/"); var str=pic1.src.substring(start+1); if(str=="order_modify.gif") { pic1.src="../images/order_cancel.gif"; //pic1.alt="我是B图片"; } else if(str=="order_cancel.gif") { pic1.src="../images/order_modify.gif"; //pic1.alt="我是A图片"; } } function imgFreshChangePic() { var pic1=document.getElementById("imgFresh"); var start=pic1.src.lastIndexOf("/"); var str=pic1.src.substring(start+1); if(str=="btnFresh.gif") { pic1.src="../images/icons/progress.gif"; //pic1.alt="我是B图片"; } else if(str=="progress.gif") { pic1.src="../images/icons/btnFresh.gif"; //pic1.alt="我是A图片"; } } function imgEditChangePic() { var pic1=document.getElementById("imgEdit"); var start=pic1.src.lastIndexOf("/"); var str=pic1.src.substring(start+1); if(str=="audit.gif") { pic1.src="../images/order_delete.gif"; //pic1.alt="我是B图片"; } else if(str=="order_delete.gif") { pic1.src="../images/audit.gif"; //pic1.alt="我是A图片"; } } function imgDelChangePic() { var pic1=document.getElementById("imgDel"); var start=pic1.src.lastIndexOf("/"); var str=pic1.src.substring(start+1); if(str=="remove.gif") { pic1.src="../images/delete.gif"; //pic1.alt="我是B图片"; } else if(str=="delete.gif") { pic1.src="../images/icons/remove.gif"; //pic1.alt="我是A图片"; } } var comboCARRIER;//船公司 var comboPODLOAD;//启运港 var comboPORTDISCHARGE;//卸货港交货地 var comboDESTINATION;//目的港 var comboLANE;//航线 function initcomboCARRIER()//船公司 { comboCARRIER = dhtmlXComboFromSelect("ddlCARRIER"); comboCARRIER.loadXML("../FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=webcrmclientadapter&type=FCL&companyid="+$("hdCompanyid").value); } function initcomboCARRIER2()//船公司 { comboCARRIER.setOptionWidth(200); comboCARRIER.attachEvent("onChange", function(){comboCARRIER.setComboText($("hd_comboCARRIER").value);}); comboCARRIER.attachEvent("onBlur", function(){ var s1 = comboCARRIER.getComboText(); var s2 = s1.indexOf("|"); if(s1=="") { $("hd_comboCARRIER").value=""; comboCARRIER.setComboText($("hd_comboCARRIER").value); } else { if(s2>0) { s2=s2+2; } var s3 = s1.substring(s2); if(s2>0) { comboCARRIER.setComboText(s3); $("hd_comboCARRIER").value=s3; } else { comboCARRIER.setComboText($("hd_comboCARRIER").value); } } }); comboCARRIER.setComboText($("hd_comboCARRIER").value); comboCARRIER.attachEvent("onKeyPressed", function(keyCode) { if(keyCode!="8") { var arrayArg = new Array(); setTimeout(function(){ var is = -1; var ishd = $("hd_comboCARRIER").value; var filterCount = 0; if("" != comboCARRIER.getComboText()){ while("undefined" != typeof comboCARRIER.getOptionByIndex(filterCount)){ var comboValue = comboCARRIER.getOptionByIndex(filterCount).text.toUpperCase();//.value; var enterValue = comboCARRIER.getComboText().toUpperCase(); $("hd_comboCARRIER").value = comboCARRIER.getComboText().toUpperCase(); if(comboValue.indexOf(enterValue) == 0){ comboCARRIER.selectOption(filterCount,true,true); is=filterCount; break; } ++filterCount; } if(is==-1) { $("hd_comboCARRIER").value = ishd; alert("无此内容,请重新选择!"); } }},10);}}); comboCARRIER.attachEvent("onSelectionChange", function() { $("hd_comboCARRIER").value = comboCARRIER.getComboText(); }); } function initComboPODLOAD()//启运港==装货港 { comboPODLOAD = dhtmlXComboFromSelect("ddlPODLOAD"); comboPODLOAD.loadXML("../FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=tcodeloadportadapter&type=FCL&companyid="+$("hdCompanyid").value); } function initComboPODLOAD2()//启运港==装货港 { comboPODLOAD.setOptionWidth(200); comboPODLOAD.attachEvent("onChange", function() { comboPODLOAD.setComboText($("hd_comboPODLOAD").value); }); comboPODLOAD.attachEvent("onBlur", function() { comboPODLOAD.setComboText($("hd_comboPODLOAD").value); }); comboPODLOAD.setComboText($("hd_comboPODLOAD").value); comboPODLOAD.attachEvent("onKeyPressed", function(keyCode) { if(keyCode!="8") { var arrayArg = new Array(); setTimeout(function() { var filterCount = 0; var is = -1; var ishd = $("hd_comboPODLOAD").value; if("" != comboPODLOAD.getComboText()) { while("undefined" != typeof comboPODLOAD.getOptionByIndex(filterCount)) { var comboValue = comboPODLOAD.getOptionByIndex(filterCount).text.toUpperCase();//.value; var enterValue = comboPODLOAD.getComboText().toUpperCase(); $("hd_comboPODLOAD").value = comboPODLOAD.getComboText().toUpperCase(); if(comboValue.indexOf(enterValue) == 0) { comboPODLOAD.selectOption(filterCount,true,true); is=filterCount; break; } ++filterCount; } // if(is==-1) // { // $("hd_comboPODLOAD").value = ishd; // alert("无此内容,请重新选择!"); // } } },10); } }); comboPODLOAD.attachEvent("onSelectionChange", function() { $("hd_comboPODLOAD").value = comboPODLOAD.getComboText(); }); } function initComboPORTDISCHARGE()//卸货港 { comboPORTDISCHARGE = dhtmlXComboFromSelect("ddlPORTDISCHARGE"); comboPORTDISCHARGE.loadXML("../FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=tcodedisportadapter&type=FCL&companyid="+$("hdCompanyid").value); } function initComboPORTDISCHARGE2()//卸货港 { comboPORTDISCHARGE.setOptionWidth(200); comboPORTDISCHARGE.attachEvent("onChange", function() { comboPORTDISCHARGE.setComboText($("hd_comboPORTDISCHARGE").value); }); comboPORTDISCHARGE.attachEvent("onBlur", function() { comboPORTDISCHARGE.setComboText($("hd_comboPORTDISCHARGE").value); }); comboPORTDISCHARGE.setComboText($("hd_comboPORTDISCHARGE").value); comboPORTDISCHARGE.attachEvent("onKeyPressed", function(keyCode) { if(keyCode!="8") { var arrayArg = new Array(); setTimeout(function() { var filterCount = 0; var is = -1; var ishd = $("hd_comboPORTDISCHARGE").value; if("" != comboPORTDISCHARGE.getComboText()) { while("undefined" != typeof comboPORTDISCHARGE.getOptionByIndex(filterCount)) { var comboValue = comboPORTDISCHARGE.getOptionByIndex(filterCount).text.toUpperCase();//.value; var enterValue = comboPORTDISCHARGE.getComboText().toUpperCase(); $("hd_comboPORTDISCHARGE").value = comboPORTDISCHARGE.getComboText().toUpperCase(); if(comboValue.indexOf(enterValue) == 0) { comboPORTDISCHARGE.selectOption(filterCount,true,true); is=filterCount; break; } ++filterCount; } if(is==-1) { $("hd_comboPORTDISCHARGE").value = ishd; alert("无此内容,请重新选择!"); } } },10); } }); comboPORTDISCHARGE.attachEvent("onSelectionChange", function() { $("hd_comboPORTDISCHARGE").value = comboPORTDISCHARGE.getComboText(); }); } /* function initComboPORTDISCHARGE()//卸货港 { comboPORTDISCHARGE = dhtmlXComboFromSelect("ddlPORTDISCHARGE"); comboPORTDISCHARGE.loadXML("../FeeCodes/TCodeDisportAdapter.aspx?mask=0&pos=0&strSel="); } function initComboPORTDISCHARGE2()//卸货港 { comboPORTDISCHARGE.setOptionWidth(150); // comboPORTDISCHARGE.attachEvent("onOpen", function() // { // if(comboPORTDISCHARGE.getOptionByIndex(0) == null) // { // comboPORTDISCHARGE.loadXML("../FeeCodes/TCodeDisportAdapter.aspx?mask=0&pos=0&strSel="); // } // }); comboPORTDISCHARGE.attachEvent("onChange", function() { $("hd_comboPORTDISCHARGE").value = comboPORTDISCHARGE.getComboText().toUpperCase();//comboPORTDISCHARGE.getSelectedText(); comboPORTDISCHARGE.setComboText($("hd_comboPORTDISCHARGE").value); $("tbDESTINATION").value = $("hd_comboPORTDISCHARGE").value; }); comboPORTDISCHARGE.setComboText($("hd_comboPORTDISCHARGE").value); //检索 //comboPORTDISCHARGE.enableFilteringMode(true); comboPORTDISCHARGE.attachEvent("onKeyPressed", function(keyCode) { var arrayArg = new Array(); setTimeout(function() { var filterCount = 0; if("" != comboPORTDISCHARGE.getComboText()) { var enterValue = comboPORTDISCHARGE.getComboText().toUpperCase(); comboPORTDISCHARGE.loadXML("../FeeCodes/TCodeDisportAdapter.aspx?mask=0&pos=0&strSel="+enterValue); } },10); }); comboPORTDISCHARGE.attachEvent("onSelectionChange", function() { $("hd_comboPORTDISCHARGE").value = comboPORTDISCHARGE.getComboText(); $("tbDESTINATION").value = $("hd_comboPORTDISCHARGE").value; }); } */ function initcomboDESTINATION()//目的港 { comboDESTINATION = dhtmlXComboFromSelect("ddlDESTINATION"); comboDESTINATION.loadXML("../FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=destination&type=FCL&companyid="+$("hdCompanyid").value); } function initcomboDESTINATION2()//目的港 { comboDESTINATION.setOptionWidth(200); comboDESTINATION.attachEvent("onChange", function() { comboDESTINATION.setComboText($("hd_comboDESTINATION").value); }); comboDESTINATION.attachEvent("onBlur", function() { comboDESTINATION.setComboText($("hd_comboDESTINATION").value); }); comboDESTINATION.setComboText($("hd_comboDESTINATION").value); comboDESTINATION.attachEvent("onKeyPressed", function(keyCode) { if(keyCode!="8") { var arrayArg = new Array(); setTimeout(function() { var filterCount = 0; var is = -1; var ishd = $("hd_comboDESTINATION").value; if("" != comboDESTINATION.getComboText()) { while("undefined" != typeof comboDESTINATION.getOptionByIndex(filterCount)) { var comboValue = comboDESTINATION.getOptionByIndex(filterCount).text.toUpperCase();//.value; var enterValue = comboDESTINATION.getComboText().toUpperCase(); $("hd_comboDESTINATION").value = comboDESTINATION.getComboText().toUpperCase(); if(comboValue.indexOf(enterValue) == 0) { comboDESTINATION.selectOption(filterCount,true,true); is=filterCount; break; } ++filterCount; } if(is==-1) { $("hd_comboDESTINATION").value = ishd; alert("无此内容,请重新选择!"); } } },10); } }); comboDESTINATION.attachEvent("onSelectionChange", function() { $("hd_comboDESTINATION").value = comboDESTINATION.getComboText(); }); } function initComboLANE()//航线 { comboLANE = dhtmlXComboFromSelect("ddlLANE"); comboLANE.loadXML("../FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=tcodelanesadapter&type=FCL&companyid="+$("hdCompanyid").value); } function initComboLANE2()//航线 { comboLANE.setOptionWidth(200); comboLANE.attachEvent("onChange", function() { comboLANE.setComboText($("hd_comboLANE").value); }); comboLANE.attachEvent("onBlur", function(){ var s1 = comboLANE.getComboText(); var s2 = s1.indexOf("|"); if(s1=="") { $("hd_comboLANE").value=""; comboLANE.setComboText($("hd_comboLANE").value); } else { if(s2>0) { s2=s2+2; } var s3 = s1.substring(s2); if(s2>0) { comboLANE.setComboText(s3); $("hd_comboLANE").value=s3; } else { comboLANE.setComboText($("hd_comboLANE").value); } } }); comboLANE.setComboText($("hd_comboLANE").value); comboLANE.attachEvent("onKeyPressed", function(keyCode) { if(keyCode!="8") { var arrayArg = new Array(); setTimeout(function() { var filterCount = 0; var is = -1; var ishd = $("hd_comboLANE").value; if("" != comboLANE.getComboText()) { while("undefined" != typeof comboLANE.getOptionByIndex(filterCount)) { var comboValue = comboLANE.getOptionByIndex(filterCount).text.toUpperCase();//.value; var enterValue = comboLANE.getComboText().toUpperCase(); $("hd_comboLANE").value = comboLANE.getComboText().toUpperCase(); if(comboValue.indexOf(enterValue) == 0) { comboLANE.selectOption(filterCount,true,true); is=filterCount; break; } ++filterCount; } if(is==-1) { $("hd_comboLANE").value = ishd; alert("无此内容,请重新选择!"); } } },10);}}); comboLANE.attachEvent("onSelectionChange", function() { $("hd_comboLANE").value = comboLANE.getComboText(); }); } function bodyOnload() { initDialog(); initLog(); initMenu(); // initcomboCARRIER();//船公司 initcomboCARRIER2();//船公司 initComboPODLOAD();//启运港 initComboPODLOAD2();//启运港 initComboPORTDISCHARGE();//卸货港交货地 initComboPORTDISCHARGE2();//卸货港交货地 initcomboDESTINATION();//目的港 initcomboDESTINATION2();//目的港 initComboLANE();//航线 initComboLANE2();//航线 } //回车键控制 document.onkeypress=function() { if(event.keyCode==13) { ShowDetailSelect(); } } function imgEditChangePic() { var pic1=document.getElementById("imgEdit"); var start=pic1.src.lastIndexOf("/"); var str=pic1.src.substring(start+1); if(str=="audit.gif") { pic1.src="../images/order_delete.gif"; //pic1.alt="我是B图片"; } else if(str=="order_delete.gif") { pic1.src="../images/audit.gif"; //pic1.alt="我是A图片"; } } function ShowDetailUpdate() { var asid = mygrid_log.getSelectedRowId(); if(asid==null || asid=="") { alert("请先选中要操作的数据行!"); } else { var selectedId = mygrid_log.getSelectedRowId(); var URLs = "../PriceCarrier/CrmPriceCarrierInfo.aspx?handle=edit&id="+selectedId+"&isenabled=0"; ret = window.open(URLs,"_blank", "height=600, width=900, center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no"); } } function createGrid() { this.mygrid_log.attachEvent("onRowDblClicked", function(rId,cInd) { var selectedId = mygrid_log.getSelectedRowId(); var qs = new QueryString();//调用: var URLs = "../PriceCarrier/CrmPriceCarrierInfo.aspx?handle=edit&id="+selectedId+"&isenabled=0"; window.open(URLs,"_blank", "height=600, width=900, center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no"); }); } //蒙板--> function dialog() { this.width = 450; this.height = 360; this.title_height = 20; this.html = ''; this.title = ''; var self = this; var bgObj, msgObj, titleObj; this.close = function () { document.body.removeChild(document.getElementById("bgDiv")); document.getElementById("msgDiv").removeChild(document.getElementById("msgTitle")); document.body.removeChild(document.getElementById("msgDiv")); } this.show = function () { var msgw, msgh, bordercolor; msgw = self.width; msgh = self.height; bordercolor = "#336699"; titlecolor = "#99CCFF"; var sWidth, sHeight; sWidth = document.body.offsetWidth; sHeight = screen.height; bgObj = document.createElement("div"); bgObj.setAttribute('id', 'bgDiv'); bgObj.style.position = "absolute"; bgObj.style.top = "0"; bgObj.style.background = "#777"; bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; bgObj.style.opacity = "0.6"; bgObj.style.left = "0"; bgObj.style.width = sWidth + "px"; bgObj.style.height = sHeight + "px"; bgObj.style.zIndex = "10000"; document.body.appendChild(bgObj); msgObj = document.createElement("div") msgObj.setAttribute("id", "msgDiv"); msgObj.setAttribute("align", "center"); msgObj.style.background = "white"; msgObj.style.border = "1px solid " + bordercolor; msgObj.style.position = "absolute"; msgObj.style.left = "50%"; msgObj.style.top = "30%"; msgObj.style.font = "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif"; msgObj.style.marginLeft = "-225px"; msgObj.style.marginTop = -75 + document.documentElement.scrollTop + "px"; msgObj.style.width = msgw + "px"; msgObj.style.height = msgh + "px"; msgObj.style.textAlign = "center"; msgObj.style.lineHeight = "25px"; msgObj.style.zIndex = "10001"; titleObj = document.createElement("h4"); titleObj.setAttribute("id", "msgTitle"); titleObj.setAttribute("align", "center"); titleObj.style.margin = "0"; titleObj.style.padding = "3px"; titleObj.style.background = bordercolor; titleObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);"; titleObj.style.opacity = "0.75"; titleObj.style.border = "1px solid " + bordercolor; titleObj.style.height = self.title_height + "px"; titleObj.style.font = "12px Verdana, Geneva, Arial, Helvetica, sans-serif"; titleObj.style.color = "white"; titleObj.style.cursor = "pointer"; titleObj.innerHTML = self.title; //titleObj.onclick=function(){self.close();} document.body.appendChild(msgObj); document.getElementById("msgDiv").appendChild(titleObj); var txt = document.createElement("div"); txt.style.margin = "1em 0" txt.setAttribute("id", "msgTxt"); txt.innerHTML = self.html; document.getElementById("msgDiv").appendChild(txt); } } function msgBox() { var dg = new dialog(); dg.html = "程序正在提交,请稍等!"; //dg.html+=""; dg.width = 200; dg.height = 100; dg.title = "标题"; dg.show(); }