var commonGridObj_orderlist; var comboVESSEL;//船名 var comboVOYNO;//航次 var comboCUSTOMERNAME;//委托单位 var comboOP;//操作人员 var s0=""; var sortName = ""; var sortIndex = ""; var newHeaderArgs; var newWidthArgs; var newColAlignArgs; var newColSortArgs; var newColTypeArgs; function $(id){ return document.getElementById(id); } function createGrid(type) { // //header // var headerArgs_orderlist = new Array("","业务状态","费用状态","委托方式","录入人","录入日期", // "船名","航次","主提单号","开船日期","发货人","委托单位","集装箱","订舱代理","揽货人","操作","单证","客服","航线","装货港","卸货港","交货地","目的地", // "会计期间","分提单号","委托编号","运单号","装运方式","场站","截港日期","预抵日期", // "运输条款","品名","货物毛重","货物尺码","件数","包装","箱TEU","船公司","报关行","承运车队", // "发票号","业务来源","来源明细","订舱类型","订舱编号","装箱类型","仓库","截单日期","集港日期","其他箱型"); // //width // var widthArgs_orderlist = new Array("40","70","70","70","70","120", // "150","70","150","120","120","120","120","120","70","70","70","70","120","150","150","150","150","70","150","150","100","100","100","120","120", // "100","100","100","100","100","100","100","120","120","120", // "100","100","100","100","150","100","120","120","120","60"); // // //column align // var colAlignArgs_orderlist = new Array("center","center","left","left","left","left", // "left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left","left", // "left","left","left","left","left","left","left","left","left","left", // "left","left","left","left","left","left","left","left","left","left"); // // //column sort // var colSortArgs_orderlist = new Array("na","bsstatus","feestatus","ordertype","inputby","bsdate", // "vessel","voyno","mblno","etd","shipperid","customername","cntrtotal","forwarder","sale","op","doc","custservice","lane","portload","portdischarge","placedelivery","destination", // "accdate","hblno","custno","transno","bltype","yard","closingdate","eta","service","goodsname","kgs","cbm","pkgs","kindpkgs","teu","carrier", // "customser","trucker","invno","bssource","bssourcedetail","ordtype","orderno","packingtype","warehouse","closedocdate", // "intoportdate","otcntr"); // //column type // var colTypeArgs_orderlist = new Array("ch","ro","ro","ro","ro","ro", // "ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro", // "ro","ro","ro","ro","ro","ro","ro","ro","ro","ro", // "ro","ro","ro","ro","ro","ro","ro","ro","ro","ro"); // var oldSortArg = new Array("na","bsstatus","feestatus","ordertype","inputby","bsdate", // "vessel","voyno","mblno","etd","shipperid","customername","cntrtotal","forwarder","sale","op","doc","custservice","lane","portload","portdischarge","placedelivery","destination", // "accdate","hblno","custno","transno","bltype","yard","closingdate","eta","service","goodsname","kgs","cbm","pkgs","kindpkgs","teu","carrier", // "customser","trucker","invno","bssource","bssourcedetail","ordtype","orderno","packingtype","warehouse","closedocdate", // "intoportdate","otcntr"); // //alert(headerArgs_orderlist);alert(widthArgs_orderlist);alert(colAlignArgs_orderlist);alert(colSortArgs_orderlist);alert(colTypeArgs_orderlist); //获取自定义列表样式 //if(document.getElementById("origopseae") == null){ var url = "../UserSettings/UserGridSource/OrigOpSeaeGrid.js?uid="+newGuid(); var loader = dhtmlxAjax.getSync(url); var jsVal = loader.xmlDoc.responseText; var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement( "script" ); oScript.language = "javascript"; oScript.type = "text/javascript"; oScript.id = "origopseae"; oScript.defer = true; oScript.text = jsVal; oHead.appendChild(oScript); //} // var searchJson = ""; if(type == 2){ var _begintime = $("txt_beginetd").value.trim(); if(_begintime.trim() != ""){ if(!validateDateTime(_begintime)){ alert("起始时间格式错误"); return; } } var _endtime = $("txt_endetd").value.trim(); if(_endtime.trim() != ""){ if(!validateDateTime(_endtime)){ alert("结束时间格式错误"); return; } } var _customer = $("h_customer").value.trim(); var _vessel = $("h_vessel").value.trim(); var _voyno = $("h_voyno").value.trim(); var _op = $("h_operator").value.trim(); var _checkno = $("txt_no").value.trim(); var _bstype = comboBsType.getSelectedValue();//业务类型 var searchJson = ""; //begin searchJson +="{"; searchJson += "["; //如果查询条件设置了起始时间和结束时间则判断结束时间是否大于起始时间 if(_begintime != "" && _endtime != ""){ if(_begintime.length > 9 && _endtime.length > 9){ var status = DateTimeEqual(_begintime,_endtime); if(status == 0){ searchJson += "\"btime\":\""+_begintime+"\"," searchJson += "\"etime\":\""+_endtime+"\"," }else if(status == -1){ alert("时间设置错误,起始时间不能大于结束时间,请修改!"); return; } // else if(status == -2){ // alert("时间设置错误,起始时间不能等于结束时间,请修改!"); // return; // } } else{ alert("时间格式有问题,长度应大于9个字符,请修改!"); return; } }else{ searchJson += "\"btime\":\""+_begintime+"\"," searchJson += "\"etime\":\""+_endtime+"\"," } searchJson += "\"cus\":\""+_customer+"\","; searchJson += "\"vessel\":\""+_vessel+"\","; searchJson += "\"voyno\":\""+_voyno+"\","; searchJson += "\"op\":\""+_op+"\","; searchJson += "\"bty\":\""+_bstype+"\","; searchJson += "\"no\":\""+_checkno+"\""; searchJson += "]"; searchJson +="}"; } s0=""; 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 1 && commonGridObj_orderlist.sortType.length > 1){ if(searchcacheName != ""){ commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort="+commonGridObj_orderlist.sortValue+"&sortindex="+commonGridObj_orderlist.sortType+"&cntr="+s0+"&searchcachename="+searchcacheName); }else{ if(searchJson.trim() != ""){ commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&sort="+commonGridObj_orderlist.sortValue+"&sortindex="+commonGridObj_orderlist.sortType+"&cntr="+s0); }else{ commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort="+commonGridObj_orderlist.sortValue+"&sortindex="+commonGridObj_orderlist.sortType+"&cntr="+s0); } } }else{ if(searchcacheName != ""){ commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort=etd&sortindex=desc"+"&cntr="+s0+"&searchcachename="+searchcacheName); }else{ if(searchJson.trim() != ""){ commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&sort=etd&sortindex=desc"+"&cntr="+s0); }else{ commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort=etd&sortindex=desc"+"&cntr="+s0); } } } if(searchcacheName != ""){ commonGridObj_orderlist.setMultiple("&searchcachename="+searchcacheName); } commonGridObj_orderlist.setSourceType("json"); commonGridObj_orderlist.setSkin("xp"); commonGridObj_orderlist.setImageUrl("../images/"); commonGridObj_orderlist.loadafter = true; // commonGridObj_orderlist.after = function () { //提取原始模板 var url = "../UserSettings/UserGridSource/OrigOpSeaeGrid.js?uid=" + newGuid(); var loader = dhtmlxAjax.getSync(url); var jsVal = loader.xmlDoc.responseText; var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement("script"); oScript.language = "javascript"; oScript.type = "text/javascript"; oScript.id = "origopseae"; oScript.defer = true; oScript.text = jsVal; oHead.appendChild(oScript); // s0 = ""; 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.length; i++) { if (jsonCtnObj.ctns[i].ctn != "") { s0 += ",CNTR" + (i + 1); headerArgs_orderlist[headerArgs_orderlist.length] = jsonCtnObj.ctns[i].ctn; widthArgs_orderlist[widthArgs_orderlist.length] = "50"; colAlignArgs_orderlist[colAlignArgs_orderlist.length] = "left"; colSortArgs_orderlist[colSortArgs_orderlist.length] = "na"; colTypeArgs_orderlist[colTypeArgs_orderlist.length] = "ro"; } } } // var arg = new Array(); if (newColSortArgs.length == colSortArgs_orderlist.length) { for (var i = 0; i < colSortArgs_orderlist.length; i++) { var oIndex = i; var nIndex = 0; var iCount = 0; if (colSortArgs_orderlist[i] != newColSortArgs[i]) { for (var k = 0; k < colSortArgs_orderlist.length; k++) { if (colSortArgs_orderlist[k] == newColSortArgs[i]) { nIndex = k; //arg.push(nIndex+"#"+oIndex); //alert(commonGridObj_orderlist.getGridObj().getColumnLabel(nIndex)+"#"+commonGridObj_orderlist.getGridObj().getColumnLabel(oIndex)); commonGridObj_orderlist.getGridObj().moveColumn(nIndex, oIndex); var title = headerArgs_orderlist[nIndex]; var width = widthArgs_orderlist[nIndex]; var sort = colSortArgs_orderlist[nIndex]; var colType = colTypeArgs_orderlist[nIndex]; var align = colAlignArgs_orderlist[nIndex]; //var index = i; headerArgs_orderlist[nIndex] = headerArgs_orderlist[oIndex]; widthArgs_orderlist[nIndex] = widthArgs_orderlist[oIndex]; colSortArgs_orderlist[nIndex] = colSortArgs_orderlist[oIndex]; colTypeArgs_orderlist[nIndex] = colTypeArgs_orderlist[oIndex]; colAlignArgs_orderlist[nIndex] = colAlignArgs_orderlist[oIndex]; headerArgs_orderlist[oIndex] = title; widthArgs_orderlist[oIndex] = width; colSortArgs_orderlist[oIndex] = sort; colTypeArgs_orderlist[oIndex] = colType; colAlignArgs_orderlist[oIndex] = align; //alert(commonGridObj_orderlist.getGridObj().getColumnLabel(nIndex)+"#"+commonGridObj_orderlist.getGridObj().getColumnLabel(oIndex)); commonGridObj_orderlist.getGridObj().moveColumn(oIndex + 1, nIndex + 1); // alert(commonGridObj_orderlist.getGridObj().getColumnLabel(oIndex)+"##"+oIndex+"##wd:"+widthArgs_orderlist[oIndex]) //Set AllCheckBox // if(headerArgs_orderlist[nIndex] == "checkboxs"){ // commonGridObj_orderlist.getGridObj().setColLabel(nIndex,""); // } var tempWidth = widthArgs_orderlist[nIndex]; commonGridObj_orderlist.getGridObj().setColWidth(nIndex, tempWidth); iCount++; //alert(headerArgs_orderlist); break; } } } else { // if(headerArgs_orderlist[i] == "checkboxs"){ // commonGridObj_orderlist.getGridObj().setColLabel(i,""); // } var tempWidth = newWidthArgs[i]; commonGridObj_orderlist.getGridObj().setColWidth(i, tempWidth); } } } finishLoading(); }; commonGridObj_orderlist.initGrid(); //if(commonGridObj_orderlist.getGridObj().getColumnLabel(0) != null){ setTimeout(function(){ initLoading(); commonGridObj_orderlist.bind(); },500); //} //commonGridObj_orderlist.bind(); commonGridObj_orderlist.isSort = true; commonGridObj_orderlist.setSearch(searchJson); commonGridObj_orderlist.initPageByHandle("list"); commonGridObj_orderlist.isDBClickEvent = true; commonGridObj_orderlist.sortEventFun(); commonGridObj_orderlist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd) { var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 var openType = "_blank"; var openUrl = "../shipping/edit.aspx?handle=edit&id="+rId; window.open (openUrl,openType,openSet); }); commonGridObj_orderlist.clickEvent = function() { commonGridObj_orderlist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd) { var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 var openType = "_blank"; var openUrl = "../shipping/edit.aspx?handle=edit&id="+rId; window.open (openUrl,openType,openSet); }); } // commonGridObj_orderlist.sortEventFun = function(){ // commonGridObj_orderlist.getGridObj().attachEvent("onBeforeSorting", function(ind,type,direction){ // if(type == "na" || type == "checkboxs"){ // return false; // }else{ // //alert(type);alert(direction);alert(ind); // commonGridObj_orderlist.setSortValue(type,direction); // commonGridObj_orderlist.getGridObj().clearAll(); // commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort="+type+"&sortindex="+direction+"&cntr="+s0); // if(commonGridObj_orderlist.loadafter){ // commonGridObj_orderlist.loadafter = false; // commonGridObj_orderlist.after = function(){ // } // } // commonGridObj_orderlist.bind(); // // // return true; // } // }); // } // commonGridObj_orderlist.getGridObj().attachEvent("onBeforeSorting", function(ind,type,direction){ // if(type == "na" || type == "checkboxs"){ // return false; // }else{ // //alert(type);alert(direction);alert(ind); // commonGridObj_orderlist.setSortValue(type,direction); // commonGridObj_orderlist.getGridObj().clearAll(); // // commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort="+type+"&sortindex="+direction+"&cntr="+s0); // // if(commonGridObj_orderlist.loadafter){ // commonGridObj_orderlist.loadafter = false; // commonGridObj_orderlist.after = function(){ // } // } // // commonGridObj_orderlist.bind(); // // //alert("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&uid="+commonGridObj_orderlist.newGuid()+"&sort="+type+"&sortindex="+direction+"&cntr="+s0); // //createGrid(); // // return true; // } // }); // } function initCombo(){ CustomerCombo(); OperatorCombo(); VesselCombo(); VoynoCombo(); createComboBsType();//业务类型 } function createComboBsType(){//业务类型 comboBsType = dhtmlXComboFromSelect("sel_bstype"); } function CustomerCombo(){ comboCustomer = new TCombo("sel_customer","../FeeCodes/WebCrmClientAdapter.aspx?mask=0&pos=0&strIS=ISCONTROLLER",true,true,false,true,"h_customer"); comboCustomer.initComboEvent(); comboCustomer.bind(); } function OperatorCombo(){ var strUserID = $("h_uid").value.trim(); comboOperator = new TCombo("sel_op","../FeeCodes/OPAdapter.aspx?mask=0&pos=0&rName=isOperator&userID="+strUserID,true,true,false,true,"h_operator"); comboOperator.initComboEvent(); comboOperator.bind(); } function VesselCombo(){ comboVessel = new TCombo("sel_vessel","../FeeCodes/TCodeVesselAdapter.aspx?mask=0&pos=0",true,false,false,true,"h_vessel"); comboVessel.initComboEvent(); comboVessel.bind(); } function VoynoCombo(){ var strVessel = $("h_vessel").value; comboVoyno = new TCombo("sel_voyno","../FeeCodes/TCodeVoynoAdapter.aspx?mask=0&pos=0&strVESSEL="+strVessel,true,true,false,true,"h_voyno"); comboVoyno.initComboEvent(); if(strVessel.trim() != ""){ comboVoyno.bind(); } } function initSearch(){ $("h_customer").value = ""; comboCustomer.setText($("h_customer").value); $("h_vessel").value = ""; comboVessel.setText($("h_vessel").value); $("h_voyno").value = ""; comboVoyno.setText($("h_voyno").value); $("h_operator").value = ""; comboOperator.setText($("h_operator").value); $("txt_beginetd").value = ""; $("txt_endetd").value = ""; $("txt_no").value = ""; if($("h_searchcache").value != ""){ $("h_searchcache").value = ""; } //清空业务类型 if(comboBsType != null){ comboBsType.setComboText("全部"); } createGrid(1); } function ShowDetailSelect(){ createGrid(); } function GetRange2(strgid) { var loader; var dates; var strR=""; // var getstrgid = commonGridObj_orderlist.getGridObj(); // var strgid = getstrgid.getSelectedRowId(); if ($("hdRangeV").value != $("hdRangeO").value){ if($("hdRangeO").value=="1"){//分公司 loader = dhtmlxAjax.getSync("../FeeCodes/RangeAdapter.aspx?RangeID=1&strGID="+strgid+"&RangeName=modOrderManagement&val="+newGuid());//委托管理列表 dates = loader.xmlDoc.responseText; if(dates==""){ //alert("您没有操作此数据的权限!"); return "您没有操作业务的权限!"; //0; } } else if ($("hdRangeO").value == "2") {//分公司 loader = dhtmlxAjax.getSync("../FeeCodes/RangeAdapter.aspx?RangeID=2&strGID=" + strgid + "&RangeName=modOrderManagement&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=modOrderManagement&val=" + newGuid()); //委托管理列表 dates = loader.xmlDoc.responseText; if (dates == "") { //alert("您没有操作此数据的权限!"); return "您没有操作数据的权限!"; //0; } } } return ""; } 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 deleteOrder() { var alt = ""; var strError1 = ""; var strError2 = ""; var strError3 = ""; var strError4 = ""; var strError5 = ""; // var orderGridObj = commonGridObj_orderlist.getGridObj(); var selRowID = orderGridObj.getCheckedRows(0); //所有选中的grid的id编号 //var selRowID = orderGridObj.getSelectedRowId(); var selGroup = new Array(); if(selRowID.indexOf(",") > 0){ selGroup = selRowID.split(","); }else{ if(selRowID != null){ selGroup.push(selRowID); } } //查看是否有被选中的费用项 if(selGroup.length > 0){ // if(selGroup.length > 1){ var delCount = 0; if(window.confirm("您确定删除已选中的委托信息")){ while(delCount < selGroup.length){ var rowIndex = orderGridObj.getRowIndex(selGroup[delCount]); var feeName = orderGridObj.cellByIndex(rowIndex,1).getValue(); var cusName = orderGridObj.cellByIndex(rowIndex, 2).getValue(); // strError1 = GetRange2(selGroup[delCount]); if (strError1.toString().trim() == "") { var urlVal = "SeaExportGridSource.aspx?handle=delete&bsno="+selGroup[delCount]+"&val="+commonGridObj_orderlist.newGuid()+"&tbNO="+escape($("txt_no").value)+"&VESSEL="+escape($("h_vessel").value)+"&VOYNO="+escape($("h_voyno").value)+"&tbETD="+$("txt_beginetd").value+"&tbETD2="+$("txt_endetd").value+"&CUSTOMERNAME="+escape($("h_customer").value)+"&ddlOP="+escape($("h_op").value+"&cntr="+s0); var loader = dhtmlxAjax.getSync(urlVal); var loadVal = loader.xmlDoc.responseText; if(loadVal > 0 ) { //alert("删除成功"); } else { if(loadVal == -1 || loadVal == -2) { strError2="删除失败!"; } if(loadVal == -3) { strError3 = "有业务为锁定状态,不允许删除此类业务!"; //业务封帐 } if(loadVal == -4) { strError4 = "您不是某些业务的操作,无删除此类业务的权限!"; } if(loadVal == -5) { strError5 = "些业务有与海运出口委托相关联的费用信息,不允许删除!"; } } } delCount++; } alt = strError1 + strError2 + strError3 + strError4 + strError5; if (alt.trim() != "") { alert(alt); } createGrid(1); } // }else{ // var delCount = 0; // while(delCount < selGroup.length){ // var rowIndex = orderGridObj.getRowIndex(selGroup[delCount]); // // var feeName = orderGridObj.cellByIndex(rowIndex,1).getValue(); // var cusName = orderGridObj.cellByIndex(rowIndex,2).getValue(); // // if(window.confirm("您确定要将所选委托信息删除")){ // // var urlVal = "SeaExportGridSource.aspx?handle=delete&bsno="+selGroup[delCount]+"&val="+commonGridObj_orderlist.newGuid()+"&tbNO="+escape($("txt_no").value)+"&VESSEL="+escape($("h_vessel").value)+"&VOYNO="+escape($("h_voyno").value)+"&tbETD="+$("txt_beginetd").value+"&tbETD2="+$("txt_endetd").value+"&CUSTOMERNAME="+escape($("h_customer").value)+"&ddlOP="+escape($("h_op").value+"&cntr="+s0); // var loader = dhtmlxAjax.getSync(urlVal); // var loadVal = loader.xmlDoc.responseText; // if(loadVal > 0 ){ // //alert("删除成功"); // createGrid(1); // } // else // { // if(loadVal == -1 || loadVal == -2) // { // alert("删除失败!"); // } // if(loadVal == -3) // { // alert("当前业务为锁定状态,不允许删除此业务!");//业务封帐 // } // //if(loadVal == -4) // //{ // //alert("您不是当前业务的操作,无删除此业务的权限!"); // //} // if(loadVal == -5) // { // alert("当前业务有与海运出口委托相关联的费用信息,不允许删除!"); // } // } // } // delCount++; // } // // } }else{ alert("请选择您要删除的委托信息"); } } function refreshOrder(){ window.location.href = window.location.href; } function addOrder(){ var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 var openType = "_blank"; var openUrl = "../shipping/edit.aspx?handle=add"; window.open (openUrl,openType,openSet); // var tempWin = window.open ("about:blank",openType,openSet); // tempWin.location = openUrl; } function addFullOrder(){ var orderGridObj = commonGridObj_orderlist.getGridObj(); var selRowID = orderGridObj.getSelectedRowId(); if(selRowID==null || selRowID==""){ alert("请先选择要操作的数据!"); }else{ var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 var openType = "_blank"; var openUrl = "../shipping/edit.aspx?handle=addfull&id="+selRowID; //window.open (openUrl,openType,openSet); var tempWin = window.open ("about:blank",openType,openSet); tempWin.location = openUrl; } } //校验时间格式 function validateDateTime(dateTimeObj){ var isValid = false; var parseToObj = new Date(dateTimeObj.replace(/-/g, "/")); if(!isNaN(parseToObj)){ isValid = true; } return isValid; } function DateTimeEqual(beginObj,endObj){ var isEqual = 0; var begin = new Date(beginObj.replace(/-/g, "/")); var end = new Date(endObj.replace(/-/g, "/")); if(Date.parse(begin) - Date.parse(end) > 0){ isEqual = -1;//起始时间大于结束时间 }else if(Date.parse(begin) - Date.parse(end) == 0){ isEqual = -2;//起始时间与结束时间相等 } return isEqual; } //根据条件查询付费申请信息 function search(){ createGrid(2); // var _begintime = $("tbETD").value.trim(); // // if(_begintime.trim() != ""){ // if(!validateDateTime(_begintime)){ // alert("起始时间格式错误"); // return; // } // } // var _endtime = $("tbETD2").value.trim(); // if(_endtime.trim() != ""){ // if(!validateDateTime(_endtime)){ // alert("结束时间格式错误"); // return; // } // } // // // var _customer = $("hd_comboCUSTOMERNAME").value.trim(); // var _vessel = $("hd_comboVESSEL").value.trim(); // var _voyno = $("hd_comboVOYNO").value.trim(); // var _op = $("hd_comboOP").value.trim(); // var _checkno = $("tbNO").value.trim(); // // var searchJson = ""; // //begin // searchJson +="{"; // searchJson += "["; // // //如果查询条件设置了起始时间和结束时间则判断结束时间是否大于起始时间 // if(_begintime != "" && _endtime != ""){ // if(_begintime.length > 9 && _endtime.length > 9){ // var status = DateTimeEqual(_begintime,_endtime); // if(status == 0){ // searchJson += "\"btime\":\""+_begintime+"\"," // searchJson += "\"etime\":\""+_endtime+"\"," // }else if(status == -1){ // alert("时间设置错误,起始时间不能大于结束时间,请修改!"); // return; // }else if(status == -2){ // alert("时间设置错误,起始时间不能等于结束时间,请修改!"); // return; // } // } // else{ // alert("时间格式有问题,长度应大于9个字符,请修改!"); // return; // } // }else{ // searchJson += "\"btime\":\""+_begintime+"\"," // searchJson += "\"etime\":\""+_endtime+"\"," // } // // searchJson += "\"cus\":\""+_customer+"\","; // searchJson += "\"vessel\":\""+_vessel+"\","; // searchJson += "\"voyno\":\""+_voyno+"\","; // searchJson += "\"op\":\""+_op+"\","; // searchJson += "\"no\":\""+_checkno+"\""; // searchJson += "]"; // searchJson +="}";//alert(searchJson); // // commonGridObj_orderlist.initGrid(); // commonGridObj_orderlist.loadafter = true; // commonGridObj_orderlist.after = function(){ // // var arg = new Array(); // // if(newColSortArgs.length == colSortArgs_orderlist.length){ // for(var i=0;i 1 && commonGridObj_orderlist.sortType.length > 1){ // // commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&sort="+commonGridObj_orderlist.sortValue+"&sortindex="+commonGridObj_orderlist.sortType+"&cntr="+s0); // }else{ // commonGridObj_orderlist.setSortValue("etd","desc"); // commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&sort=etd&sortindex=desc"+"&cntr="+s0); // } // //commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&cntr="+s0); // commonGridObj_orderlist.bind(); // commonGridObj_orderlist.setSearch(searchJson); // // commonGridObj_orderlist.initPageByHandle("list"); // commonGridObj_orderlist.isDBClickEvent = true; // // commonGridObj_orderlist.isSort = true; // // commonGridObj_orderlist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){ // var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 // var openType = "_blank"; // // var openUrl = "../shipping/edit.aspx?handle=edit&id="+rId; // window.open (openUrl,openType,openSet); // //var tempWin = window.open ("about:blank",openType,openSet); // //tempWin.location = openUrl; // }); // // commonGridObj_orderlist.clickEvent = function(){ // commonGridObj_orderlist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){ // var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-750)/2 + ",Left= "+(screen.width-1100)/2 // var openType = "_blank"; // // var openUrl = "../shipping/edit.aspx?handle=edit&id="+rId; // window.open (openUrl,openType,openSet); // //var tempWin = window.open ("about:blank",openType,openSet); // //tempWin.location = openUrl; // }); // } // // commonGridObj_orderlist.sortEventFun = function(){ // commonGridObj_orderlist.getGridObj().attachEvent("onBeforeSorting", function(ind,type,direction){ // if(type == "na"){ // return false; // }else{ // //alert(type);alert(direction);alert(commonGridObj_orderlist.getRequest()); // commonGridObj_orderlist.setSortValue(type,direction); // commonGridObj_orderlist.getGridObj().clearAll(); // if(commonGridObj_orderlist.loadafter){ // commonGridObj_orderlist.loadafter = false; // commonGridObj_orderlist.after = function(){ // } // } // commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&sort="+type+"&sortindex="+direction+"&cntr="+s0); // commonGridObj_orderlist.bind(); // return true; // } // }); // } // // commonGridObj_orderlist.getGridObj().attachEvent("onBeforeSorting", function(ind,type,direction){ // if(type == "na"){ // return false; // }else{ // //alert(type);alert(direction);alert(commonGridObj_orderlist.getRequest()); // commonGridObj_orderlist.setSortValue(type,direction); // commonGridObj_orderlist.getGridObj().clearAll(); // if(commonGridObj_orderlist.loadafter){ // commonGridObj_orderlist.loadafter = false; // commonGridObj_orderlist.after = function(){ // } // } // commonGridObj_orderlist.setRequest("SeaExportGridSource.aspx?handle=list&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_orderlist.newGuid()+"&sort="+type+"&sortindex="+direction+"&cntr="+s0); // commonGridObj_orderlist.bind(); // //createGrid(); // return true; // } // }); } String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); } function searchMultiple(){ // var openSet = "height=280, width=800, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-280)/2 + ",Left= "+(screen.width-800)/2 // var openType = "_blank"; // // var openUrl = "../search/multiplesearch.aspx?handle=opseae"; // window.open (openUrl,openType,openSet); printMessageBox(event); } function editOpSeae(){ var selArg = new Array(); var iCount = 0; for(var i=0;i" + "" + "
"+content+"
"; var v_top=(document.body.clientHeight-mesW.clientHeight)/2; v_top+=document.documentElement.scrollTop; styleStr="top:"+(v_top-180)+"px;left:"+(document.body.clientWidth/2-mesW.clientWidth/2)+"px;position:absolute;width:700px;margin-left:-300px;left:50%;z-index:9999;"; mesW.style.cssText=styleStr; document.body.appendChild(mesW); } //让背景渐渐变暗 function showBackground(obj,endInt){ if(isIe){ obj.filters.alpha.opacity+=5; if(obj.filters.alpha.opacity" // +"
" //// +" " // +"
" // +"
" // +" " // +" " // +"
" // +" "; messContent += "
" + "