You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/PriceSearch/js/searchCombo.js

508 lines
17 KiB
JavaScript

3 years ago
var comboCARRIER;//<2F><><EFBFBD><EFBFBD>˾
var comboPODLOAD;//<2F><><EFBFBD>˸<EFBFBD>
var comboPORTDISCHARGE;//ж<><D0B6><EFBFBD>۽<EFBFBD><DBBD><EFBFBD><EFBFBD><EFBFBD>
var comboDESTINATION;//Ŀ<>ĸ<EFBFBD>
var comboLANE; //<2F><><EFBFBD><EFBFBD>
var clientAjaxRequestUrl = "../..";
//var clientAjaxRequestUrl = "http://localhost:12646";
//var clientAjaxRequestUrl = "http://hmw028167.chinaw3.com";
//<2F><><EFBFBD><EFBFBD>ȥ<EFBFBD>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }
function $(id)
{
return document.getElementById(id);
}
function initcomboCARRIER(){
//<2F><><EFBFBD><EFBFBD>˾
comboCARRIER = dhtmlXComboFromSelect("sel_carrier");
comboCARRIER.loadXML(clientAjaxRequestUrl+"/FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=webcrmclientadapter&type=FCL&companyid="+$("hdCompanyid").value);
}
function initcomboCARRIER2(){
//<2F><><EFBFBD><EFBFBD>˾
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("<22>޴<EFBFBD><DEB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>");
}
}},10);}});
comboCARRIER.attachEvent("onSelectionChange", function()
{
$("hd_comboCARRIER").value = comboCARRIER.getComboText();
});
}
function initComboPODLOAD()//<2F><><EFBFBD>˸<EFBFBD>==װ<><D7B0><EFBFBD><EFBFBD>
{
comboPODLOAD = dhtmlXComboFromSelect("sel_portload");
comboPODLOAD.loadXML(clientAjaxRequestUrl+"/FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=tcodeloadportadapter&type=FCL&companyid="+$("hdCompanyid").value);
}
function initComboPODLOAD2()//<2F><><EFBFBD>˸<EFBFBD>==װ<><D7B0><EFBFBD><EFBFBD>
{
comboPODLOAD.setOptionWidth(200);
comboPODLOAD.attachEvent("onChange", function()
{
comboPODLOAD.setComboText($("hd_comboPODLOAD").value);
});
comboPODLOAD.attachEvent("onBlur", function()
{
var s1 = comboPODLOAD.getComboText();
if(s1=="")
{
$("hd_comboPODLOAD").value="";
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("<22>޴<EFBFBD><DEB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>");
}
}
},10);
}
});
comboPODLOAD.attachEvent("onSelectionChange", function()
{
$("hd_comboPODLOAD").value = comboPODLOAD.getComboText();
});
}
function initComboPORTDISCHARGE()//ж<><D0B6><EFBFBD><EFBFBD>
{
comboPORTDISCHARGE = dhtmlXComboFromSelect("sel_discharge");
comboPORTDISCHARGE.loadXML(clientAjaxRequestUrl+"/FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=tcodedisportadapter&type=FCL&companyid="+$("hdCompanyid").value);
}
function initComboPORTDISCHARGE2()//ж<><D0B6><EFBFBD><EFBFBD>
{
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("<22>޴<EFBFBD><DEB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>");
}
}
},10);
}
});
comboPORTDISCHARGE.attachEvent("onSelectionChange", function()
{
$("hd_comboPORTDISCHARGE").value = comboPORTDISCHARGE.getComboText();
});
}
function initcomboDESTINATION()//Ŀ<>ĸ<EFBFBD>
{
comboDESTINATION = dhtmlXComboFromSelect("sel_destination");
comboDESTINATION.loadXML(clientAjaxRequestUrl+"/FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=destination&type=FCL&companyid="+$("hdCompanyid").value);
}
function initcomboDESTINATION2()//Ŀ<>ĸ<EFBFBD>
{
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("<22>޴<EFBFBD><DEB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>");
}
}
},10);
}
});
comboDESTINATION.attachEvent("onSelectionChange", function()
{
$("hd_comboDESTINATION").value = comboDESTINATION.getComboText();
});
}
function initComboLANE()//<2F><><EFBFBD><EFBFBD>
{
comboLANE = dhtmlXComboFromSelect("sel_lane");
comboLANE.loadXML(clientAjaxRequestUrl+"/FeeCodes/CrmPriceCarrierAdapter.aspx?mask=0&pos=0&yunjia=tcodelanesadapter&type=FCL&companyid="+$("hdCompanyid").value);
}
function initComboLANE2()//<2F><><EFBFBD><EFBFBD>
{
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("<22>޴<EFBFBD><DEB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>");
}
}
},10);}});
comboLANE.attachEvent("onSelectionChange", function()
{
$("hd_comboLANE").value = comboLANE.getComboText();
});
}
function initCombos() {
//alert(" 1 ");
getlbGG();
//
initcomboCARRIER();//<2F><><EFBFBD><EFBFBD>˾
initcomboCARRIER2();//<2F><><EFBFBD><EFBFBD>˾
initComboPODLOAD();//<2F><><EFBFBD>˸<EFBFBD>
initComboPODLOAD2();//<2F><><EFBFBD>˸<EFBFBD>
initComboPORTDISCHARGE();//ж<><D0B6><EFBFBD>۽<EFBFBD><DBBD><EFBFBD><EFBFBD><EFBFBD>
initComboPORTDISCHARGE2();//ж<><D0B6><EFBFBD>۽<EFBFBD><DBBD><EFBFBD><EFBFBD><EFBFBD>
initcomboDESTINATION();//Ŀ<>ĸ<EFBFBD>
initcomboDESTINATION2();//Ŀ<>ĸ<EFBFBD>
initComboLANE();//<2F><><EFBFBD><EFBFBD>
initComboLANE2();//<2F><><EFBFBD><EFBFBD>
}
//-------------------------------------------------------------------------------------------------------------------------------
function getlbGG()
{
var uid = $("hid_id").value;
if(uid=="")
{
document.getElementById('lbGG').style.visibility = "hidden";
document.getElementById('divGG').style.visibility = "hidden";
//document.getElementById('lbGG').setAttribute('disabled','disabled');
//document.getElementById('divGG').setAttribute('disabled','disabled');
}
else
{
var url3 = clientAjaxRequestUrl+"/Message/SysAnnounceClientGridSource.aspx?handle=getlbgg&uid="+newGuid()+"&clientgid="+uid;
var loader3 = dhtmlxAjax.getSync(url3);
var strAnnounce = loader3.xmlDoc.responseText;
//strAnnounce=strAnnounce.replace("/<2F><><EFBFBD><EFBFBD>/ig","<22>ҵ<EFBFBD><D2B5><EFBFBD>Ϣ");
strAnnounce=strAnnounce.substr(2);
$("lbGG").value+=strAnnounce;
//
url3 = clientAjaxRequestUrl+"/Message/SysAnnounceClientGridSource.aspx?handle=getconfig&uid="+newGuid()+"&clientgid="+uid;
loader3 = dhtmlxAjax.getSync(url3);
strAnnounce = loader3.xmlDoc.responseText;
$("hdtimeCount").value=strAnnounce;
//
recycleCountAnnounceEB($("hdtimeCount").value);
}
}
function ShowDetailGG()
{
var uid = $("hid_id").value;
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>
var url2 = clientAjaxRequestUrl+"/Message/SysAnnounceClientGridSource.aspx?handle=isclose&uid="+newGuid()+"&clientgid="+uid;
var loader2 = dhtmlxAjax.getSync(url2);
var strISDELETE = loader2.xmlDoc.responseText;
//
window.open(clientAjaxRequestUrl+"/Message/SysAnnounceClient.aspx?clientgid="+uid,"_blank","height=500, width=900, center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no");
}
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 recycleCountAnnounceEB(timeCountEB)
{
var uid = $("hid_id").value;
var startTimesEB = new Date();
var isShowEB = 0;
setInterval(function()
{
//var frameObjEB = null;
//frameObjEB = parent.document.getElementById("FormEBPL").contentWindow;
//frameObjEB = document.getElementById("FormEBPL").contentWindow;
if(document.getElementById("scrAnnounceEB") == null)
{
var urlEB0 = "js/popAnnounceEB.js?uid="+newGuid();
var loaderEB0 = dhtmlxAjax.getSync(urlEB0);
var jsValEB0 = loaderEB0.xmlDoc.responseText;
var oHeadEB = document.getElementsByTagName('HEAD').item(0);
var oScriptEB = document.createElement( "script" );
oScriptEB.language = "javascript";
oScriptEB.type = "text/javascript";
oScriptEB.id = "scrAnnounceEB";
oScriptEB.defer = true;
oScriptEB.text = jsValEB0;
oHeadEB.appendChild(oScriptEB);
}
var AnnounceCountObjEB = null;
var urlEB = clientAjaxRequestUrl+"/Message/SysAnnounceClientGridSource.aspx?handle=getannouncetotal&uid="+newGuid()+"&clientgid="+uid;
var loaderEB = dhtmlxAjax.getSync(urlEB);
var AnnounceValEB = loaderEB.xmlDoc.responseText;
if(AnnounceValEB != "")
{
AnnounceCountObjEB = eval('(' + AnnounceValEB + ')');
if(AnnounceCountObjEB!=null)
{
var msgIntervalEB = 3;//AnnounceCountObjEB.totals[0].interval;
if(isShowEB==0)
{
msgIntervalEB = 0;
}
//
if(AnnounceCountObjEB.totals[0].total != 0)
{
//var oldUrlEB = parent.document.getElementById("FormEBPL").contentWindow.location.href;
var oldUrlEB =window.location.href;
var doubleUrlEB = 0;
if(oldUrlEB.indexOf("//") >= 0)
{
doubleUrlEB = oldUrlEB.indexOf("//")+2;
}
var tempUrlEB = oldUrlEB.substring(doubleUrlEB,oldUrlEB.substring(doubleUrlEB,oldUrlEB.length).indexOf("/")+doubleUrlEB);
//var newUrlEB = oldUrlEB.substring(0,doubleUrlEB)+tempUrlEB+"/"+"Message/SysAnnounceClient.aspx";
var newUrlEB = clientAjaxRequestUrl+"/Message/SysAnnounceClient.aspx";
//alert(newUrlEB);
//$("dvAnnounce").innerText = "<22><><EFBFBD><EFBFBD>("+AnnounceCountObjEB.totals[0].total+")";
var currentTimesEB = new Date();
var spaceTimesEB = currentTimesEB.getTime() - startTimesEB.getTime();
var daysEB = Math.floor(spaceTimesEB/(24*3600*1000));
//<2F><><EFBFBD><EFBFBD>Сʱ
var leaveEB1 = spaceTimesEB%(24*3600*1000);
var hoursEB= Math.floor(leaveEB1/(3600*1000));
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var leaveEB2= leaveEB1%(3600*1000);
var minutesEB=Math.floor(leaveEB2/(60*1000));
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var leaveEB3=leaveEB2%(60*1000);
var secondsEB=Math.round(leaveEB3/1000);
//alert(minutesEB+"+"+msgIntervalEB)
if(msgIntervalEB > 0)
{
if(minutesEB >= msgIntervalEB)
{
startTimesEB = new Date();
isShowEB=1;
openPopEB("<22><><EFBFBD><EFBFBD>("+AnnounceCountObjEB.totals[0].total+")",AnnounceCountObjEB,AnnounceCountObjEB.totals[0].total,newUrlEB);
}
}
else
{
isShowEB=1;
openPopEB("<22><><EFBFBD><EFBFBD>("+AnnounceCountObjEB.totals[0].total+")",AnnounceCountObjEB,AnnounceCountObjEB.totals[0].total,newUrlEB);
}
}
else
{
//$("dvAnnounce").innerText = "<22><><EFBFBD><EFBFBD>("+AnnounceCountObjEB.totals[0].total+")";
}
}
}
},timeCountEB);
}