function saveP0000009Info(){
	var objId = $("#objId").val();
	var reason = $("#reason").val();
	var describes = $("#describes").val();
	var printDate = $("#printDate").val();
	var infoTel=$("#p0000009InfoTel").val();
	var jsonStr = '{"objId":"' + objId +'","printDate":"' +printDate+'","reason":"' +reason+'","describes":"' +describes+'","infoTel":"'+infoTel+'"}';
	$.ajax({
		type:"POST",
		contentType:"application/json; charset=UTF-8",
		url:"saveLpjdnoticeInfo.do",
		data:jsonStr,
		error :function(){
			alert("系统错误，请稍后再试。");
		},
		success :function(data){
			if(data=="00"){
				alert("理赔决定通知单保存成功。");
			}else{
				alert("理赔决定通知单保存失败。");
			}
		}
	});
}


function printP0000009Info(){
	var objId = $("#objId").val();
	$.ajax({
		type:"POST",
		url:"printP0000009Info.do",
		data:"objId="+objId,
		error :function(){
			alert("系统错误，请稍后再试。");
		},
		success :function(data){
			if(data=="00"){
				alert("打印通知单成功。");
			}else{
				alert("打印通知单失败。");
			}
		}
	});
	
}


function showP0000009(url,claimNo){
//	url = "ajaxLpjdNoticeInfo.do";
	$.ajax({
		type:"POST",
		url:url,
		data:{"claimNo":claimNo},
		error :function(){
			alert("系统错误，请稍后再试。");
		},
		success :function(data){
			
			var companyName=$("#P0000009companyNameTitle").html();
			if(companyName.indexOf("太保安联健康保险股份有限公司")!=-1){
				if(data.companyName!=undefined){
					companyName=companyName.replace("太保安联健康保险股份有限公司",data.companyName);
					$("#P0000009companyNameTitle").html(companyName);
					var companyNametwo=$(".txtC").html();
					companyNametwo=companyNametwo.replace("太保安联健康保险股份有限公司",data.companyName);
					$(".txtC").html(companyNametwo);
				}
			}
			
			
			
			$("#objIdP0000009").val(data.noticeInfo.noticep09.objId);
			$("#claimNoP0000009").val(data.noticeInfo.noticep09.claimNo);
			$("#applicantNameP0000009").val(data.noticeInfo.noticep09.applicantName);
			$("#insuredNameP0000009").val(data.noticeInfo.noticep09.insuredName);
			$("#insuredPidP0000009").val(data.noticeInfo.noticep09.insuredPid);
			$("#policyNoP0000009").val(data.noticeInfo.noticep09.policyNo);
			$("#accTypeNameP0000009").val(data.noticeInfo.noticep09.accTypeName);
			$("#reasonP0000009").val(data.noticeInfo.noticep09.reason);
			$("#describesP0000009").val(data.noticeInfo.noticep09.describes);
			$("#branchNameP0000009").html(data.noticeInfo.noticep09.branchName);
			$("#printDateP0000009").val(data.noticeInfo.noticep09.printDate);
			$("#p0000009InfoTel").val(data.noticeInfo.noticep09.infoTel);
			$("#bodyP0000009").html("");
			var tr = "";
			var auditPolicys = data.noticeInfo.auditPolicy;
			for ( var i = 0; i < auditPolicys.length; i++) {
				var isRefundStr = "";
				var isTerminationPolStr = auditPolicys[i].ap.isTerminationPol=='Y'?'终止、':'';
				var isClauseStr = auditPolicys[i].ap.isClause=='Y'?'解约、':'';
				var isRenewalStr = auditPolicys[i].ap.isRenewal=='Y'?'续保、':'';
				if(auditPolicys[i].ap.isRefund=="1"){
					isRefundStr = "退还全额保费、";
				}else if (auditPolicys[i].ap.isRefund=="2"){
					isRefundStr = "退还现金价值、";
				}else if (auditPolicys[i].ap.isRefund=="3"){
					isRefundStr = "退还未满期保费、";
				}else if (auditPolicys[i].ap.isRefund=="4"){
					isRefundStr = "不退费、";
				}
				var detail = isTerminationPolStr+isClauseStr+isRefundStr+isRenewalStr;
				detail=detail.substring(0, detail.length-1);
				
				tr = tr +"<tr><td>"+auditPolicys[i].ap.policyNo+"</td><td>"+auditPolicys[i].className+"</td>"+
	               "<td>"+ detail+"</td></tr>";
			}
			$("#bodyP0000009").append(tr);
			showDiv("P0000009");
			
		}
	});
}

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

