散记
function SetTenancyTax()
{
var obj = document.getElementById("ddlGdsType");
var objvalue = obj.options[obj.selectedIndex].value;
if (objvalue == "租赁单品" || objvalue == "租赁类品")
{
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.Open("post","fmIntroduceGdsGetData.aspx?Function=GetSyscfg&sType="+escape("采购管理")+"&sClass="+escape("采购管理参数")+"&sName="+escape("租赁商品默认税率"),false);
xmlhttp.Send();
var sValue = xmlhttp.responseText;
delete(xmlhttp)
xmlhttp=null;
if (sValue == "") return;
obj = document.getElementById("ddlSaleTax");
var b = false;
for(var i=0;i<obj.options.length;i++)
{
if (obj.options[i].value==sValue)
{
obj.selectedIndex=i;
b=true;
break;
}
}
if(!b)
{
var ooption = document.createElement("option");
ooption.text=sValue+"%";
ooption.value=sValue;
obj.add(ooption);
ooption.selected="selected";
}
obj = document.getElementById("ddlInTax");
b=false;
for(var i=0;i<obj.options.length;i++)
{
if (obj.options[i].value==sValue)
{
obj.selectedIndex=i;
b=true;
break;
}
}
if(!b)
{
var ooption = document.createElement("option");
ooption.text=sValue+"%";
ooption.value=sValue;
obj.add(ooption);
ooption.selected="selected";
}
}
}