/**
下拉框联动
一级下拉框:工序
二级下拉框:缸号
三级下拉框:成分
**/
//工序下拉框变动
function processChange(){
var process = document.getElementById("wp").value;
clearOthers();
hiddenAutoTable();
if(process == ""){
var x = document.getElementById("vatNo");
if(vatnoArray.length > 0){
for(i=0;i < vatnoArray.length;i++){
x.remove(1);
}
}
x = document.getElementById("content");
if(contentArray.length > 0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
return false;
}
if(xmlHttp == null){
createXMLHttp();
}
var url = "MtgSPC?action=loadVatno";//加载缸号
var queryString = "process=" + encodeURIComponent(process);
xmlHttp.open("POST",url,false);
xmlHttp.onreadystatechange = afterLoadVatnoCallback;
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
function afterLoadVatnoCallback(){
var vatnoString;
if(xmlHttp.readyState == 4){
if(xmlHttp.responseText){
var node = xmlHttp.responseXML.documentElement;
var result = node.getElementsByTagName("result");
if(result[0].firstChild != null && result[0].firstChild.nodeValue != ""){
vatnoString = result[0].firstChild.nodeValue;
vatnoString = vatnoString.substring(0,vatnoString.length-1);
var x = document.getElementById("vatNo");
var y;
if(vatnoArray.length>0){
for(i=0;i < vatnoArray.length;i++){
x.remove(1);
}
}
vatnoArray = new Array();
vatnoArray = vatnoString.split("$");
for(i=0;i<vatnoArray.length;i++){
y = document.createElement('option');
y.text = vatnoArray[i];
y.value = vatnoArray[i];
try{
x.add(y,null);
}catch(ex){
x.add(y);
}
}
var x = document.getElementById("content");
if(contentArray.length>0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
}
}
}
}
//缸号下拉框变动
function vatnoChange(){
var vatno = document.getElementById("vatNo").value;
clearOthers();
hiddenAutoTable();
if(vatno == ""){
var x = document.getElementById("content");
if(contentArray.length > 0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
return false;
}
if(xmlHttp == null){
createXMLHttp();
}
var url = "MtgSPC?action=loadComposition";//加载成分
var queryString = "process=" + encodeURIComponent(document.getElementById("wp").value) + "&vatno=" + encodeURIComponent(vatno);
xmlHttp.open("POST",url,false);
xmlHttp.onreadystatechange = afterLoadContentCallback;
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
function afterLoadContentCallback(){
var contentString;
if(xmlHttp.readyState == 4){
if(xmlHttp.responseText){
var node = xmlHttp.responseXML.documentElement;
var result = node.getElementsByTagName("result");
if(result[0].firstChild != null && result[0].firstChild.nodeValue != ""){
contentString = result[0].firstChild.nodeValue;
var result = node.getElementsByTagName("result");
contentString = result[0].firstChild.nodeValue;
contentString = contentString.substring(0,contentString.length-1);
var x = document.getElementById("content");
var y;
if(contentArray.length>0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
contentArray = new Array();
contentArray = contentString.split("$");
for(i=0;i<contentArray.length;i++){
y = document.createElement('option');
y.text = contentArray[i];
y.value = contentArray[i];
try{
x.add(y,null);
}catch(ex){
x.add(y);
}
}
}
}
}
}
下拉框联动
一级下拉框:工序
二级下拉框:缸号
三级下拉框:成分
**/
//工序下拉框变动
function processChange(){
var process = document.getElementById("wp").value;
clearOthers();
hiddenAutoTable();
if(process == ""){
var x = document.getElementById("vatNo");
if(vatnoArray.length > 0){
for(i=0;i < vatnoArray.length;i++){
x.remove(1);
}
}
x = document.getElementById("content");
if(contentArray.length > 0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
return false;
}
if(xmlHttp == null){
createXMLHttp();
}
var url = "MtgSPC?action=loadVatno";//加载缸号
var queryString = "process=" + encodeURIComponent(process);
xmlHttp.open("POST",url,false);
xmlHttp.onreadystatechange = afterLoadVatnoCallback;
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
function afterLoadVatnoCallback(){
var vatnoString;
if(xmlHttp.readyState == 4){
if(xmlHttp.responseText){
var node = xmlHttp.responseXML.documentElement;
var result = node.getElementsByTagName("result");
if(result[0].firstChild != null && result[0].firstChild.nodeValue != ""){
vatnoString = result[0].firstChild.nodeValue;
vatnoString = vatnoString.substring(0,vatnoString.length-1);
var x = document.getElementById("vatNo");
var y;
if(vatnoArray.length>0){
for(i=0;i < vatnoArray.length;i++){
x.remove(1);
}
}
vatnoArray = new Array();
vatnoArray = vatnoString.split("$");
for(i=0;i<vatnoArray.length;i++){
y = document.createElement('option');
y.text = vatnoArray[i];
y.value = vatnoArray[i];
try{
x.add(y,null);
}catch(ex){
x.add(y);
}
}
var x = document.getElementById("content");
if(contentArray.length>0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
}
}
}
}
//缸号下拉框变动
function vatnoChange(){
var vatno = document.getElementById("vatNo").value;
clearOthers();
hiddenAutoTable();
if(vatno == ""){
var x = document.getElementById("content");
if(contentArray.length > 0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
return false;
}
if(xmlHttp == null){
createXMLHttp();
}
var url = "MtgSPC?action=loadComposition";//加载成分
var queryString = "process=" + encodeURIComponent(document.getElementById("wp").value) + "&vatno=" + encodeURIComponent(vatno);
xmlHttp.open("POST",url,false);
xmlHttp.onreadystatechange = afterLoadContentCallback;
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
function afterLoadContentCallback(){
var contentString;
if(xmlHttp.readyState == 4){
if(xmlHttp.responseText){
var node = xmlHttp.responseXML.documentElement;
var result = node.getElementsByTagName("result");
if(result[0].firstChild != null && result[0].firstChild.nodeValue != ""){
contentString = result[0].firstChild.nodeValue;
var result = node.getElementsByTagName("result");
contentString = result[0].firstChild.nodeValue;
contentString = contentString.substring(0,contentString.length-1);
var x = document.getElementById("content");
var y;
if(contentArray.length>0){
for(i=0;i < contentArray.length;i++){
x.remove(1);
}
}
contentArray = new Array();
contentArray = contentString.split("$");
for(i=0;i<contentArray.length;i++){
y = document.createElement('option');
y.text = contentArray[i];
y.value = contentArray[i];
try{
x.add(y,null);
}catch(ex){
x.add(y);
}
}
}
}
}
}