
function printP0000002Info(){
    var haveEmail = $("#haveEmail").val();
    var isMail=$("#isMail").val();
    if(isMail=='Y'){
    	if(haveEmail == 'Y'){
    		if(!confirm("客户选择电子邮件方式接收，是否继续打印？")){
    			return ;
    		}
    	}else if(haveEmail == 'N'){
    		if(!confirm("客户选择电子邮件方式接收，但邮箱地址为空，是否继续打印？")){
    			return ;
    		}
    	}
   }
//	if(haveEmail == 'Y'){
//		if(!confirm("客户选择电子邮件方式接收，是否继续打印？")){
//			return ;
//		}
//	}else if(haveEmail == 'N'){
//		if(!confirm("客户选择电子邮件方式接收，但邮箱地址为空，是否继续打印？")){
//			return ;
//		}
//	}
	var objId = $("#p0000002").find("#p0000002objId").val();
	var newDate = $("#p0000002").find("#newDate").val();
	$.ajax({
		type:"POST",
		url:"/claimserver/claim/notice/printP0000002Info.do",
		data:"objId="+objId+"&newDate="+newDate,
		error :function(){
			alert("系统错误，请稍后再试。");
		},
		success :function(data){
			if(data=="00"){
				alert("打印通知单成功。");
			}else{
				alert("打印通知单失败。");
			}
		}
	});
	
}

function showNoticeP0000002(claimNo){
	//var claimNo = $("#claimNo").val();
	$.ajax({
		type:"POST",
		url:"/claimserver/claim/notice/endCaseNoticeP0000002Info.do",
		data:{"claimNo":claimNo},
		error :function(){
			alert("系统错误，请稍后再试。");
		},
		success :function(data){
			var companyName=$("#p0000002companyNameTitle").html();
			companyName=companyName.replace("太保安联健康保险股份有限公司",data.companyName);
			$("#p0000002companyNameTitle").html(companyName);
			
			
			$("#p0000002").find("#p0000002objId").val(data.objId);
			$("#p0000002").find("#p0000002claimNo").html(data.claimNo);
			$("#p0000002").find("#p0000002applicantName").html(data.applicantName);
			$("#p0000002").find("#p0000002insuredName").html(data.insuredName);
			$("#p0000002").find("#p0000002insuredName2").html(data.insuredName);
			$("#p0000002").find("#p0000002clmAccAndReportType").html(data.clmAccAndReportType);
			$("#p0000002").find("#p0000002insuredPid").html(data.insuredPid);
			$("#p0000002").find("#p0000002accidentDate").html(data.accidentDate);
			$("#p0000002").find("#newDate").val(data.newDate);
			var list = data.list;
			$("#apVoList tr").remove();
			for(var i = 0; i< list.length; i++){
				var a = list[i];
				var tr="<tr><td>"+a.ap.policyNo+"</td><td>"+a.className +"</td><td>"+isTerminationPol(a.ap.isTerminationPol)+isRenewal(a.ap.isRenewal)+isClause(a.ap.isClause)+"</td></tr>";
				$("#apVoList").append(tr);
			}
			showDiv("p0000002");
		}
	});
}


function isTerminationPol(isTerminationPol){
	if(isTerminationPol=="Y"){
		return "终止";
	}else{
		return "";
	}
}

function isRenewal(isRenewal){
	if(isRenewal =="N"){
		return "不予续保";
	}else{
		return "";
	}
}

function isClause(isClause){
	if(isClause =="Y"){
		return "险种解约";
	}else{
		return "";
	}
}