//部門與隊列級聯
$(document).ready(function(){
$("#deptId").change(function(){
var deptId = $("#deptId").val();
var url = "../leavewordMgr/leaveword.do?act=queue&deptId=" + deptId;
$.ajax({
url: url,
type: 'post',
dataType:($.browser.msie)?"text":"xml",//接受資料格式
timeout: 50000,
error: function(){
alert("Access database error!");
},
success: function(data){
var xml;
if(typeof data == "string"){
xml = new ActiveXObject("Microsoft.XMLDOM"); //ie6,ie7需要,firefox,ie8不需要
xml.async = false;
xml.loadXML(data);
}else{
xml = data;
}
var queue = document.getElementById("queueId");
queue.options.length = 0; //清空隊列
if(deptId!="999"){
queue.add(new Option("所有類型","999"));
$(xml).find("property").each(function(){
var value=$(this).find("value").text();
var text=$(this).find("text").text();
queue.add(new Option(text,value));
});
}
}
});
});
});
function setRate() {
$.ajax({
url:'setRateProcess.jsp',
type: 'POST',
data:{flowrate:document.getElementById('flowrate').value},
dataType:'json',
success: function(msg) {
if (msg.resultCode == "0") {
alert('設定成功');
window.close();
} else {
alert("設定失敗");
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
alert('設定失敗');
}
});
}