function calcAdjSubsidy() {

	if($("#resCode").val()=='02'||$("#resCode").val()=='05'){
		
		if($("#assRate").val()=='' && $("#assAmt").val()==''){
			alert("请填写通融给付率或通融给付金额！");
			return;
		}
	}else{
		if(adjSubsidyForm.reqAdmissionDate.value==""){
			alert("入院日期为空！");
			return;
		}
		if(adjSubsidyForm.reqDischargeDate.value==""){
			alert("出院日期为空！");
			return;
		}
		if(adjSubsidyForm.hospitalizedDays.value==""){
			alert("入院天数为空！");
			return;
		}
		if(adjSubsidyForm.subsidyAmt.value==""){
			alert("日补贴金额为空！");
			return;
		}
	}
	var request=getFormJson("adjSubsidyForm");
//	alert(JSON.stringify(request));
	$.ajax({
		type : "POST",
		url : "calcAdjSubsidy.do",
		contentType:"application/json; charset=UTF-8",
		data : JSON.stringify(request),
		success : function(data) {
//			alert(data.calcClmAmt);
			$("#calcClmAmt").val(data.calcClmAmt);
			$("#realClmAmt").val(data.calcClmAmt);
			$("#afterPayRemainDays").val(data.afterPayRemainDays);
			$("#inWaitingPeriod").val(data.inWaitingPeriod);
			$("#inBackPeriod").val(data.inBackPeriod);
			$("#usedPayDays").val(data.usedPayDays);
			$("#usedHospDays").val(data.usedHospDays);
			$("#usedLmtPayDays").val(data.usedLmtPayDays);
		},
		error : function() {
			alert("补贴类计算出错！");
		}
	});
}

function completeAdjSubsidy(){
	
	if(adjSubsidyForm.reqAdmissionDate.value==""){
		alert("入院日期为空！");
		return;
	}
	if(adjSubsidyForm.reqDischargeDate.value==""){
		alert("出院日期为空！");
		return;
	}
	if(adjSubsidyForm.hospitalizedDays.value==""){
		alert("入院天数为空！");
		return;
	}
	if(adjSubsidyForm.subsidyAmt.value==""){
		alert("日补贴金额为空！");
		return;
	}
	if(adjSubsidyForm.deductionDays.value>adjSubsidyForm.hospitalizedDays.value){
		alert("扣减天数不能大于入院天数！");
		return;
	}
	if($("#realClmAmt").val()=='' || $("#afterPayRemainDays").val()==''){
		alert("计算结果为空！");
		return;
	}
	var inWaitingPeriod = $("#inWaitingPeriod").val();
	if(inWaitingPeriod=='1' && !confirm("事故发生于等待期内，是否完成理算？")){
		return;
	}
	var inBackPeriod = $("#inBackPeriod").val();
	if(inBackPeriod=='1' && !confirm("事故发生于追溯期内，是否完成理算？")){
		return;
	}
	adjSubsidyForm.submit();
}

