
function check() {
	$("#context").html("");
	var firstDate = $("#firstDate").val();
	var lastDate = $("#lastDate").val();
	var partnerType=$("#partnerType").val();
	var hospital=hsName;
	if(firstDate==""&&lastDate==""){
		alert("结案日期不能空");
		return;
	}
		$.ajax({
			type : "POST",
			url : "/claimserver/batchOperation/queryClaimData.do",
			data : {
				"firstDate" : firstDate,
				"lastDate" : lastDate,
				"hospital":hospital,
				"partnerType":partnerType,
			},
			error:function(){
				alert("查询数据失败，请稍后重试！");
			},
			success : function(data) {
				debugger;
				for ( var i = 0; i < data.length; i++) {
					$("#context").append(
							"<tr><td>"+data[i].gathering+"</td><td>"+data[i].hospital+"</td><td>" + data[i].claimNo
									+ "</td><td>" + data[i].accept + "</td><td>"
									+ data[i].name + "</td><td>" + data[i].bills
									+ "</td><td>" + data[i].claims + "</td></tr>");

				}

			}
		});
	
	

}

function change(sel){
	if(sel.value=="1"){
		$("#test").show();
	}else{
		$("#test").hide();
	}
	if(sel.value=="2"){
		$("#test1").show();
	}else{
		$("#test1").hide();
	}
}

function query() {
		$("#contexts").html("");
		
		var hospitalName= $("#hospitalName").val();
		if(hospitalName==""){
			alert("医院名不能为空");
			return;
		}
		$.ajax({
			type:"POST",
			url:"/claimserver/batchOperation/queryHospital.do",
			data:{"hospitalName":hospitalName},
			error:function(){
				alert("查询数据失败，请稍后重试！");
			},
			success:function(data){
				
				for ( var i = 0; i < data.length; i++) {
					$("#contexts").append("<tr onclick=\"choosEd(this)\" id="+data[i].objid+"><td>"+data[i].partnerName +"</td><td>"+data[i].partnerAddr+"</td><td>"+data[i].partnerType+"</td><td>"+data[i].contactPerson+"</td><td>"+data[i].contactPhone+"</td><td>+"+data[i].payMode+"</td></tr>");
				}
				
			}
				
		});
		
}

function confirm() {
	$("#hsName").val(hsName);
	closeDiv('openNoticeDoc');

}
//点击选中某行
var id="";
var hsName="";
function choosEd(obj){
	var tds=obj.childNodes;
	hsName=tds[0].innerHTML;
	$(obj).css("background-color", "#e5e5e5").siblings().css("background-color", "#FFFFFF");
	index=$(obj).index();
}

