
function queryLeaveInfo(){
	$("#queryLeaveInfoForm").submit();
	
}

function saveLeaveInfo(empNo,num){
	var tr = $("#leaveInfoTbl").find("tr:eq("+num+")");
	var outStartDate = $(tr).find("INPUT[id='outStartDate']").val();
	var outEndDate = $(tr).find("INPUT[id='outEndDate']").val();
	var stu = $(tr).find("SPAN[id='spanstatus']").html();
	var status = "";
	if(stu=="在职"){
		status = "1";
	}else if(stu=="休假"){
		status = "2";
	}else if(stu=="公出"){
		status = "3";
	}else if(stu=="离职"){
		status = "4";
	}else{
		status = "0";
	}
	$("#status").val(status);
	var str = "code="+empNo+"&&outStartDate="+outStartDate+"&&outEndDate="+outEndDate+"&&status="+$("#status").val();
	$.ajax({
		type:"POST",
		url:"operLeaveInfo.do",
		data:str,
		error :function(){
			alert("员工状态操作失败。");
		},
		success :function(data){
			if(data=="00"){
				alert("员工状态操作成功。");
			}else{
				alert("员工状态操作失败。");
			}
		}
	});
}
function changeDate(flag,status){
	var tr = $("#leaveInfoTbl").find("tr:eq("+status+")");
	var outStartDate = $(tr).find("INPUT[id='outStartDate']");
	var outEndDate = $(tr).find("INPUT[id='outEndDate']");
	if(flag=='1'){
		$(outStartDate).val("");
		$(outEndDate).val("");
		$(outStartDate).attr("disabled",true);
		$(outEndDate).attr("disabled",true);
	}else if(flag=='4'){
		$(outStartDate).val("");
		$(outEndDate).val("");
		$(outStartDate).attr("disabled",true);
		$(outEndDate).attr("disabled",true);
	}else{
		$(outStartDate).attr("disabled",false);
		$(outEndDate).attr("disabled",false);
	}
}