var clmFinish;//直接点完成操作时先保存数据
/**不受理弹出页面*/
function notGrantOpPage(type){
	//索赔事故性质
	var spsg="";
	if(type=='1'){
		if($("#shenggu").is(".re_icon1_cur")){
			spsg =spsg+"01_";
		}
		if($("#shangchang").is(".re_icon2_cur")){
			spsg =spsg+"02_";
		}
		if($("#zhongda").is(".re_icon3_cur")){
			spsg =spsg+"03_";
		}
		if($("#menzhen").is(".re_icon4_cur")){
			spsg =spsg+"04_";
		}
		if($("#zhuyuanyiliao").is(".re_icon5_cur")){
			spsg =spsg+"05_";
		}
		if($("#zhuyuanbutie").is(".re_icon6_cur")){
			spsg =spsg+"06_";
		}
		if($("#nvxingshengyu").is(".re_icon7_cur")){
			spsg =spsg+"07_";
		}
		if($("#dentisty").is(".re_icon8_cur")){
			spsg =spsg+"08_";
		}
		if($("#onculist").is(".re_icon9_cur")){
			spsg =spsg+"09_";
		}
		if($("#dabing").is(".re_icon10_cur")){
			spsg =spsg+"10_";
		}
		if($("#jinji").is(".re_icon11_cur")){
			spsg =spsg+"11_";
		}
		if($("#drug").is(".re_icon12_cur")){
			spsg =spsg+"12_";
		}
		if($("#tijian").is(".re_icon13_cur")){
			spsg =spsg+"13";
		}
		if($("#woman-disease").is(".re_icon14_cur")){
			spsg =spsg+"14_";
		}
		if($("#aizibing").is(".re_icon15_cur")){
			spsg =spsg+"15_";
		}
		if($("#jinjiyiliao").is(".re_icon16_cur")){
			spsg =spsg+"16_";
		}
		if($("#yijianyimiao").is(".re_icon17_cur")){
			spsg =spsg+"17_";
		}
		if($("#xiantianxingjibing").is(".re_icon18_cur")){
			spsg =spsg+"18_";
		}
		if($("#xinxueguan").is(".re_icon19_cur")){
			spsg =spsg+"19_";
		}
		if($("#guzhe").is(".re_icon20_cur")){
			spsg =spsg+"20_";
		}
	}else{
		spsg = getclmAccTypeStr();
	}
	
	if(spsg==""){
		alert("请选择索赔事故性质");
		return;
	}
	$("#spsgxz").val(spsg);
	//疾病诊断选择结果
//	var jbdataform = getFormJson("jbdataform");
	
	var clmIlls =new Array;
	$("#jbresultData").find("tr").each(function(){
		var obj = $(this);
		var illCode =obj.find("td[id=illCode]").html();
		var illName =obj.find("td[id=illName]").html();
		clmIlls.push({illCode:illCode,illName:illName,claimNo:$("#claimNo").val()});
	});
	var jbname = JSON.stringify(clmIlls);
	$("#jbnameselect").val(jbname);
	$("#divsqqdlist").html("");//清空当前数据防止重复提交
	//先把索赔资料数据解析
	$("#resConfig").find("tr").each(function() {
		var jbSpArrtemp = new Array(); //初始索赔性质数组
		var obj = $(this);
		jbSpArrtemp.push(obj.attr("id"));
		jbSpArrtemp.push(obj.attr("name"));
		
		obj.find("td span").each(function(){
			if($(this).attr("name")=="yj"){
				jbSpArrtemp.push($(this).attr("class"));
			}else{
				jbSpArrtemp.push($(this).attr("class"));
			}
			

		});
		jbSpArrtemp.push(obj.attr("code"));
		if(obj.attr("style")!=null){
			if(obj.attr("style").length>2){//表示为隐藏属性
				jbSpArrtemp.push("0");
			}else{
				jbSpArrtemp.push("1");
			}
		}else{
			jbSpArrtemp.push("1");
		}
		//7-8原件个数、复印件个数
		var piece = obj.find("td:eq(1) input[name='piece'] ").val();
		var pieces = obj.find("td:eq(2) input[name='piece'] ").val();
		if (isNaN(piece)) {
			piece = 0;
		}
		if (isNaN(pieces)) {
			pieces = 0;
		}
		jbSpArrtemp.push(piece);//原件个数
		jbSpArrtemp.push(pieces);//复印件个数
		
		
		$("#divsqqdlist").append("<input id=\"spqdlist\" name=\"spqdlist\" type=\"hidden\" value="+jbSpArrtemp+"></input>");
	});
	
	//$("#accidentaddrtype").val($("#divaccidentaddrtype_code").val());
	selectCheck("accidentaddrtype");
	$.ajax({
        cache: true,
        sync : true,
        type: "POST",
        url:"saveAccidentInfo.do",
        data:$('#formAccidentInfo').serialize(),// 你的formid
        async: false,
        error: function(request) {
           throw Excetion("保存失败！");
        },
        success: function(data) {
        	$.ajax({
        		type:"POST",
        		url:"notGrantOpquery.do",
        		data:{claimNo:$("#claimNo").val()},// 你的formid
        		error:function(data){
        			alert("查询被保险人信息出错");
        		},
        		success :function(data){
        			var insureName = data.insureName;
        			var xzName = data.xzName;
        			var policyno = data.policyno;
        			var reportName = data.reportName;
        			var idcard = data.idcard;
        			var currentDate = data.currentDate;
        			var branchName = data.branchName;
        			var clmAccAndReportType = data.clmAccAndReportType;
        			$("#notGrantOp").find("#policyno").html(policyno);
        			$("#notGrantOp").find("#insureName").html(insureName);
        			$("#notGrantOp").find("#reportName").html(reportName);
        			$("#notGrantOp").find("#idcard").html(idcard);
        			$("#notGrantOp").find("#currentDate").val(currentDate);
        			$("#notGrantOp").find("#clmAccAndReportType").html(xzName);
        			$("#notGrantOp").find("#branchName").html(branchName);
        			//REQHOP1-161014-1427 理赔通知书优化 lujibin 20161226 
        			$("#notGrantOp").find("#name1").val(data.appName);
        			$("#notGrantOp").find("#cNo1").val(data.claimNo);
        			$("#notGrantOp").find("#cDate1").val(data.applyDate);
        			$("#notGrantOp").find("#iName1").val(insureName);
        			$("#notGrantOp").find("#pid1").val(idcard);
        			$("#notGrantOp").find("#iName2").val(insureName);
        			$("#notGrantOp").find("#pid2").val(idcard);
        			$("#notGrantOp").find("#p0000001InfoTel").val(data.p0000001InfoTel);
        			//REQHOP1-161014-1427 理赔通知书优化 lujibin 20161226 
        			
        			showDiv('notGrantOp');
        		}
        	});
        }
    });
}
/**不受理操作*/
function notGrantOp(){
	//alert("赔案号："+$("#claimNo").val());
	var reason=$("#reason").val();
	if(reason==""||reason==null){
		alert("不予受理原因不能为空");
		return;
	}
	if(confirm("确定要打印并不受理该案件吗？")){
		$.ajax({
	        type: "POST",
	        url:"notGrantOp.do",
	        data:{claimNo:$("#claimNo").val()},// 你的formid
	        error: function(request) {
	            alert("操作失败！");
	        },
	        success: function(data) {
	        	printBYCL();
	        	
	        	
	        }
	    });
	}
}
//查询赔案操作轨迹
function queryClaimTrack(claimNo){
	$("#historyTrack").find("p").remove();
	$.ajax({
		type:"POST",
		url:"queryClaimTrack.do",
		data:{"claimNo":claimNo},
		error :function(){
			alert("查询赔案操作轨迹失败，请稍后再试！");
			return ;
		},
		success :function(data){
			$("#historyTrackClaim").text(claimNo+" 历史轨迹");
			if(data ==""){
				alert("查询赔案操作没有相关内容！");
				return ;
			}
			for ( var i= 0; i < data.length; i++) {
				var t=data[i];
				var p=$("<p class=\"sild_open_his\"><span class=\"sild_open_his_icon\">" +
						t.operateType+"</span><span>"+jsonDateFormat(t.operateBegDate,10)+"-"+jsonDateFormat(t.operateEndDate,10)+
						"	</span><span>"+t.operator+"</span></p>");
				$("#historyTrack").append($(p));
			}
			showDiv('open1');
		}
	});
}
//时间显示工具
function jsonDateFormat(date,length){
    var datetime = new Date();
    datetime.setTime(date);
    var year = datetime.getFullYear();
    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
    var hour = datetime.getHours()< 10 ? "0" + datetime.getHours() : datetime.getHours();
    var minute = datetime.getMinutes()< 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
    var second = datetime.getSeconds()< 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
    if(length==10){
    	return year + "-" + month + "-" + date;
    }else{
    	return year + "-" + month + "-" + date+" "+hour+":"+minute+":"+second;
    }
}
//被保险人
function clmInsureQuery(){
	SkipByPost("clmInsureQuery.do",{claimNo:$("#claimNo").val()});
}

function insureQuery(claimNo,pid){
	SkipByPost("clmInsureQuery.do",{claimNo:claimNo,pid:pid});
}

function insureQueryPolicy(claimNo,pid,pname){
	if(pid==null || pname==null || pid=="" || pname=="" ){
		//弹出被保险人信息
		$("#isBpo").val("Y");
		$("#bpoClaimno").val(claimNo);
		showDiv('open2');
	}else{
		$("#isBpo").val("N");
		showLoading();//加载进度条
		SkipByPost("clmInsureQuery.do",{claimNo:claimNo,pid:pid,claimAccType:0});
		
	}
	
}

function policyInfoquery(policyNo,claimNo,pid,classcode,policyInterSource,sGrpattr,branchid,claimAccType,familyFlag){
	SkipByPost("policyInfo.do",{policyNo:policyNo,claimNo:claimNo,pid:pid,classcode:classcode,policyInterSource:policyInterSource,sGrpattr:sGrpattr,branchid:branchid,familyFlag:familyFlag});
}


function callpdEcm(pdh,unitcode,queryType){
	$.ajax({
		type:"POST",
		url:getRootPath()+"/ecm/ecmquery.do",
		data:{"claimNo":pdh,"unitcode":unitcode,"queryType":queryType},
		error :function(){
			alert("调用产险新影像服务失败！");
			return ;
		},
		success :function(data){
			url=data.url;
			var params={};
			params["format"]=data.format;
			params["code"]=data.code;
//			  params["xml"]="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><root><BASE_DATA><USER_CODE>999</USER_CODE><USER_NAME>super</USER_NAME><USER_ORG_CODE>3010100</USER_ORG_CODE><USER_SUBORG_CODE>3010100</USER_SUBORG_CODE><ORG_CODE>3010100</ORG_CODE><COM_CODE>3010100</COM_CODE><ORG_NAME>上海分公司</ORG_NAME><ROLE_CODE>RYX_JYCL</ROLE_CODE><SECURITY_INFO><SYSTEM_ID>27</SYSTEM_ID><STR_TXT>kg63kau7gm</STR_TXT><STR_MTXT>b3f5b8410ac9c37efe59eefb671e1471</STR_MTXT></SECURITY_INFO></BASE_DATA><META_DATA><BATCH><APP_CODE>CL_RYX</APP_CODE><APP_NAME>人意险理赔</APP_NAME><ORG_CODE>3010100</ORG_CODE><BUSI_NO>ESHH0102014000159</BUSI_NO><INS_TYPE></INS_TYPE><SYSTEM_ID>27</SYSTEM_ID><CLASSIFY_LIMIT></CLASSIFY_LIMIT><OPERAT_TYPE></OPERAT_TYPE></BATCH></META_DATA></root>";
			params["xml"]=data.xml;
			//alert(data.xml);
			openNewByPost(url,params);
		}
	});
}
/**报案完成操作*/
function clmFinishOperator(optype){
	
	var prompt = "确定要报案完成操作？";
	var isTcbB = $("#isTcbB").val();//是否有团长补B款
	var isDirectPayment = $("#isDirectPayment").val();//是否是直付案件
	if("1" == isDirectPayment && "Y" == isTcbB){
		prompt = "该案件为健康险团长补B款直付案件！";
	}
	
	//高端选择
	var highEnd="Y";
	if($("#high").is('.check_yes')){
		highEnd="N";
	}
	
	clmFinish="1";
	if(optype=="pay"){//赔案信息
		try {
			savepayInfo("1");
		} catch (e) {
			alert("赔案信息错误！");
		}
		
	}else if(optype=="accdent"){//出险信息
		try {
			if(saveAccidentInfo("1")==null){
				if(confirm(prompt)==true){
					$.ajax({
				        type: "POST",
				        url:"clmFinishOperator.do",
				        sync:true,
				        data:{claimNo:$("#claimNo").val(),highEnd:highEnd,policyNo:$("#policyNo").val(),isSendFlag:$("#isSendFlag").val()},// 你的formid
				        error: function(data) {
				            alert("操作失败！"+data.adapterErrorCode);
				        },
				        success: function(data) {
				        	if(data.errorCode=='02'){
				        		if(data.errorMsg!=null && data.errorMsg!=""){
					        		alert(data.errorMsg);
//					        		window.location="query.do";//报案重复继续往下走
					        		
					        	}else{
					        		alert("操作成功！");
					        		if($("#spsgxz").val().indexOf("01")!=-1){
					        			stopPayment("stopPayment");
					        		}else{
					        		window.location="query.do";
					        		}
					        	}
				        	}else {
				        		if(data.errorMsg!=null && data.errorMsg!=""&&data.estate=="2"){
					        		alert(data.errorMsg);
//					        		window.location="query.do";//报案重复继续往下走
					        		
					        	}else if(data.errorMsg!=null && data.errorMsg!=""){
					        		alert(data.errorMsg);
					        		window.location="query.do";//报案重复继续往下走
					        	}else{
					        		alert("操作成功！");
					        		if($("#spsgxz").val().indexOf("01")!=-1){
					        			stopPayment("stopPayment");
					        		}else{
					        		window.location="query.do";
					        		}
					        	}
							}
				        	
				        
				        }
				    });
				}
			}
		} catch (e) {
			alert("出险信息错误！");
		}
	}
	
	clmFinish=null;
}
//下拉框复值用于所有下拉
function selectCheck(valueId){
	if($("#"+valueId).val()==null || $("#"+valueId).val()==""){
		$("#"+valueId).val($("#div"+valueId+"_code").val());
	}else if($("#div"+valueId+"_code").length>0 && $("#div"+valueId+"_code").val()!=""){
		$("#"+valueId).val($("#div"+valueId+"_code").val());
	}
}
//日期比较
function dateCheck(mindate,maxdate){
	//jAlert("mindate:"+mindate+",maxdate"+maxdate);
	d1Arr=mindate.split("-");
	d2Arr=maxdate.split("-");
	v1=new Date(d1Arr[0],d1Arr[1],d1Arr[2]);
	v2=new Date(d2Arr[0],d2Arr[1],d2Arr[2]);
	if(v2>v1){
		return true;
	}else{
		return false;
	}
}
//邮箱校验
function emailCheck(str){
	var pattern =/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
   var flag=pattern.test(str);  
   if(!flag){
       alert("邮箱格式不规则！");  
       return false;  
   }  
}
//移动电话校验
function checkPhone(obj){
	var reg = new RegExp("^[0-9]*$");
    var obj = obj.value;
	 if(!reg.test(obj.value)){
	     alert("请输入正确定电话!");
	 }
}
//缴费停止通知书
function stopPayment(divname){
	
	showDiv(divname);
	$.ajax({
		type:"POST",
		url:"querystopPayment.do",
		data:{claimNo:$("#claimNo").val()},// 你的formid
		error:function(data){
			alert("查询被保险人信息出错");
		},
		success :function(data){
			var insureName = data.insureName;
			var policyno = data.policyno; 
			var reportDate = data.reportDate; 
			var reportName = data.reportName;
			var idcard = data.idcard;
			var currentDate = data.currentDate;
			$("#"+divname).find("#idcard").html(idcard);
			$("#"+divname).find("#reportName").html(reportName);
			$("#"+divname).find("#insureName").html(insureName);
			$("#"+divname).find("#reportDate").html(reportDate);
			$("#"+divname).find("#currentDate").val(currentDate);
			$("#"+divname).find("#clmAccName").html(data.clmAccName);
			$("#"+divname).find("#policyno").val(policyno);
			if(policyno!=null && policyno!=""){
				var policynos=policyno.split(",");
				if(policynos.length>5){
						var pol="";
						for ( var j = 0; j < policynos.length; j++) {
							if(j>0&&j%5==0){
								var inputs=$("<br/><input type=\"text\" class=\"input_bot_line w_b90\" value='"+pol+"'>");
								$("#policynos").append(inputs);
								pol="";
							}
							pol+=policynos[j]+",";
						}
						if(pol!=""&& pol!=null){
//							var inputs=$("<br/>保单号：<input type=\"text\" class=\"input_bot_line w_b90\" value='"+pol.substring(0, pol.length-1)+"'>");
							var p=pol.substring(0, pol.length-1);
							var inputs=$("<br/><input type=\"text\" class=\"input_bot_line w_b90\" value='"+p+"'>");
							$("#policynos").append(inputs);
						}
				}else{
//					var inputs=$("保单号：<input type=\"text\" class=\"input_bot_line w_b90\" value="+policyno.substring(0, pol.length-1)+">");
					var p=policyno.substring(0, policyno.length-1);
					var inputs=$("<input type=\"text\" class=\"input_bot_line w_b90\" value='"+p+"'>");
					$("#policynos").append(inputs);
				}
				
			}
			
//			$("#insureName").val(insureName);
//			$("#reportName").val(reportName);
//			$("#idcard").val(idcard);
//			$("#insureName2").html(insureName);
			
			
		}
	});
}
/**短信内容展示*/
function showSmsContent(claimNo){
	
	  var sms_clmPerson;
	   var sms_salesman;
	   var sms_clmPerson2;
	   var sms_salesman2;
	   if($('#clmPerson').attr('class')=="check_yes"){
		   sms_clmPerson = 1;

	   }else{
			sms_clmPerson = 0;
	   }
	   
	   if($('#salesman').attr('class')=="check_yes"){
		   sms_salesman = 1;
		  
	   }else{
			sms_salesman = 0;
	   }
	   
	   if($('#clmPerson2').attr('class')=="check_yes"){
		   sms_clmPerson2 = 1;

	   }else{
			sms_clmPerson2 = 0;
	   }
	   
	   if($('#salesman2').attr('class')=="check_yes"){
		   sms_salesman2 = 1;
		  
	   }else{
			sms_salesman2 = 0;
	   }
	   var operator = $("#operator").val();
	
	$.ajax({
        cache: true,
        type: "POST",
        url:"showsmscontent.do",
        data:{"claimNo":claimNo,"sms_clmPerson":sms_clmPerson,"sms_clmPerson2":sms_clmPerson2,"sms_salesman":sms_salesman,"sms_salesman2":sms_salesman2,"operator":operator},
        async: false,
        error: function(request) {
            alert("展示短信失败！");
            $("#endcasebutton").disabled=false;
        },
        success: function(data) {
        	
        	var ba_ms = data[0];
        	var ba_ms2 = data[1];
        	var sp_ms = data[2];
        	var sp_ms2 = data[3];
        
        	var baoanren1_html = $("#baoanren1").html();
        	var baoanren2_html = $("#baoanren2").html();
        	
        	//alert(ba_ms);
        	$("#ba_ms").html(ba_ms);//报案人短信内容
        	if(ba_ms2==null){//报案人和业务员是同一个人，只给业务员发，用报案人的手机号码
        		yewuyuan1.style.display='none';
        		baoanren1_html = baoanren1_html.replace("报案人","业务员");
        		$("#baoanren1").html(baoanren1_html);
        	}else{
        		$("#ba_ms2").html(ba_ms2);
        	}
        	
        	$("#sp_ms").html(sp_ms);//索赔资料短信内容

        	if(ba_ms2==null){//报案人和业务员是同一个人，只给业务员发，用报案人的手机号码
        		yewuyuan2.style.display='none';
        		baoanren2_html = baoanren2_html.replace("报案人","业务员");
        		$("#baoanren2").html(baoanren2_html);
        	}else{
        		$("#sp_ms2").html(sp_ms2);
        	}
        	
        	$("#phoneno").html(data[4]);
        	$("#phoneno2").html(data[4]);
        	
        	var ba_ms_html = $("#ba_ms").html();
        	if (ba_ms_html != '') {
        		ba_ms_html = ba_ms_html.replace("12312312312","<input type=\"text\" id=\"phone3\" name=\"phone3\" class=\"input input_bot_line i_s_100\" />");

        	}
        	$("#ba_ms").html(ba_ms_html);
        	
        	
        	
        	var ba_ms2_html = $("#ba_ms2").html();
        	if (ba_ms2_html != '') {
        		ba_ms2_html = ba_ms2_html.replace("尊敬的","尊敬的<input type=\"text\" id=\"yname\" name=\"yname\" class=\"input input_bot_line i_s_100\" />");
        		ba_ms2_html = ba_ms2_html.replace("12312312312","<input type=\"text\" id=\"phone1\" name=\"phone1\" class=\"input input_bot_line i_s_100\" />");

        	}
        	$("#ba_ms2").html(ba_ms2_html);
        	
        	var sp_ms_html = $("#sp_ms").html();
        	if (sp_ms_html != '') {
        		sp_ms_html = sp_ms_html.replace("12312312312","<input type=\"text\" id=\"phone2\" name=\"phone2\" class=\"input input_bot_line i_s_100\" />");

        	}
        	$("#sp_ms").html(sp_ms_html);
        	
        	var sp_ms2_html = $("#sp_ms2").html();
        	if (sp_ms2_html != '') {
        		sp_ms2_html = sp_ms2_html.replace("尊敬的","尊敬的<input type=\"text\" id=\"yname2\" name=\"yname2\" class=\"input input_bot_line i_s_100\" />");
        		sp_ms2_html = sp_ms2_html.replace("12312312312","<input type=\"text\" id=\"phone\" name=\"phone\" class=\"input input_bot_line i_s_100\" />");

        	}
        	$("#sp_ms2").html(sp_ms2_html);
        	
        	showDiv('openMse');
        }
    });
	
	
}

function sendSmsContent(claimNo){
	   var sms_clmPerson;
	   var sms_salesman;
	   var sms_clmPerson2;
	   var sms_salesman2;
	   if($('#clmPerson').attr('class')=="check_yes"){
		   sms_clmPerson = 1;

	   }else{
			sms_clmPerson = 0;
	   }
	   
	   if($('#salesman').attr('class')=="check_yes"){
		   sms_salesman = 1;
		  
	   }else{
			sms_salesman = 0;
	   }
	   
	   if($('#clmPerson2').attr('class')=="check_yes"){
		   sms_clmPerson2 = 1;

	   }else{
			sms_clmPerson2 = 0;
	   }
	   
	   if($('#salesman2').attr('class')=="check_yes"){
		   sms_salesman2 = 1;
		  
	   }else{
			sms_salesman2 = 0;
	   }
	   var operator = $("#operator").val();
	   var operator2 = $("#operator2").val();
	   var yname = $("#yname").val();
	   var yname2 = $("#yname2").val();
	   var phone = $("#phone").val();
	   var phone1 = $("#phone1").val();
	   var phone2 = $("#phone2").val();
	   var phone3 = $("#phone3").val();
	   
	   if(sms_salesman=='1'){
			 if(operator!=null && operator.length!=11){
      			   alert("请输入11位手机号码");
      			   return ;
      		   }
		 }
	   if(sms_salesman2=='1'){
			 if(operator2!=null && operator2.length!=11){
    			   alert("请输入11位手机号码");
    			   return ;
    		   }
		 }
	  
	
	$.ajax({
       cache: true,
       type: "POST",
       url:"showsmscontent.do",
       data:{"claimNo":claimNo,"sms_clmPerson":sms_clmPerson,"sms_clmPerson2":sms_clmPerson2,"sms_salesman":sms_salesman,"sms_salesman2":sms_salesman2,"operator":operator,"operator2":operator2,"yname":yname,"yname2":yname2,"phone":phone,"phone1":phone1,"phone2":phone2,"phone3":phone3},
       async: false,
       error: function(request) {
           alert("发送短信失败！");
       },
       success: function(data) {
      
       	
       	if(sms_clmPerson=='1' || sms_salesman=='1' || sms_clmPerson2=='1' || sms_salesman2=='1'){
				if(data){
					 closeDiv('openMse');
	        		 alert("短信发送成功！");
	        		 $('#clmPerson').attr('class',"check_no");
	        		 $('#salesman').attr('class',"check_no");
	        		 $('#clmPerson2').attr('class',"check_no");
	        		 $('#salesman2').attr('class',"check_no");
	        		 $("#operator").val('');
				}
       	}
       }
   });
}


/**不予受理通知书打印*/
function printBYCL(){
	var param={};
	var appName = $("#notGrantOp").find("#name1").val();
	var claimNo = $("#notGrantOp").find("#cNo1").val();
	var policyno = $("#notGrantOp").find("#policyno").html();
	var insureName = $("#notGrantOp").find("#insureName").html();
	var reportName = $("#notGrantOp").find("#reportName").html();
	var idcard = $("#notGrantOp").find("#idcard").html();
	var reason =$("#notGrantOp").find("#reason").val();
	var currentDate = $("#notGrantOp").find("#currentDate").val();
	var clmAccAndReportType = $("#notGrantOp").find("#clmAccAndReportType").html();
	var branchName = $("#notGrantOp").find("#branchName").html();
	
	param['claimNo']=claimNo;
	param['idcard']=idcard;
	param['insureName']=insureName;
	param['currentDate']=currentDate;
	param['policyno']=policyno;
	param['reason'] = reason;
	param['reportName'] = reportName;
	param['clmAccAndReportType'] = clmAccAndReportType;
	param['branchName'] = branchName;
	param['infoTel']=$("#p0000001InfoTel").val();
	param['appName']=appName;
	$.ajax({
		 type: "POST", 
	     url: "printBYSL.do",
	     data:param,
	     async : false,
	     success:function(data){
	    	 if(data =='0000000'){
	    		 alert("操作成功");
	    	     window.location="query.do";
	    	 }else{
	    		 alert("操作失败");
	    	 }
	     },
	     error:function(data){
	    	alert("操作失败") ;
	     }
	});
}

/**停止收费通知书打印*/

function printTZSF(){
	var param={};
	var claimNo = $("#stopPayment").find("#claimNo").html();
	var idcard = $("#stopPayment").find("#idcard").html();
	var reportName = $("#stopPayment").find("#reportName").html();
	var insureName = $("#stopPayment").find("#insureName").html();
	var reportDate = $("#stopPayment").find("#reportDate").html();
	var currentDate = $("#stopPayment").find("#currentDate").val();
	var clmAccName = $("#stopPayment").find("#clmAccName").html();
	var policyno = $("#stopPayment").find("#policyno").val();
	param['claimNo']=claimNo;
	param['idcard']=idcard;
	param['reportName']=reportName;
	param['insureName']=insureName;
	param['reportDate']=reportDate;
	param['currentDate']=currentDate;
	param['clmAccName']=clmAccName;
	param['policyno']=policyno;
	$.ajax({
		 type: "POST", 
	     url: "printTZSF.do",
	     data:param,
	     async : false,
	     success:function(data){
	    	 if(data =='0000000'){
	    		 alert("操作成功");
		    	 window.location="query.do";
	    	 }else{
	    		 alert("操作失败");
	    	 }
	    	
	     },
	     error:function(data){
	    	alert("操作失败") ;
	     }
	});
}
function closeDivOverride(flag){
	closeDiv('stopPayment');
	window.location="query.do";
}

//ajax获取报案的是否存在索赔事故性质,多个下划线分隔
function getclmAccTypeStr(){
	var clmAccTypeStr = "";
	$.ajax({
        cache: true,
        type: "POST",
        url:"queryClmInsuranceCom.do",
        data:{claimNo:$('#claimNo').val(),type:"1"},// 你的formid
        async: false,
        error: function(request) {
            alert("操作失败！");
        },
        success: function(data) {
        	//索赔事故性质
            var clmAccList = data.clmAccList;
        	$.each(clmAccList, function(i, n){
        		if(i==0){
        			clmAccTypeStr = clmAccList[i].claimAccType;
        		}else{
        			clmAccTypeStr += "_"+clmAccList[i].claimAccType;
        		}
            });
         }
     }); 	
	return clmAccTypeStr;
}



