  //打开影像
   function openImage(flag){
		var caseSource = $("#caseSource").val();
		var claimNo = $("#claim-no").val();
		var iscommon= $("#isBpo").val();
		if(flag=="1"){//赔案影像
			if("1"==caseSource && iscommon=="Y"){
				callEcm(claimNo,"");
			}else{
				window.open('../inspection/clmtask/imageInfo.do?claimNo='+claimNo,"影像");
			}
		}
		if(flag=="2"){
			if("1"==$("#caseSource").val()){
				callEcm(claimNo,"2");
			}else{
				window.open('../inspection/clmtask/imageInfo.do?claimNo='+claimNo+'&flag=2',"保单影像");
			}
		}
   }

var syncType=true;
var syncSaveType = false;

$(function(){ 	
	closeBtn();	
});

//	选择需要查看的行
	function selectDeceitReason(flag){
		
		$("#tzsbut").css("color","#ccc");
		$("#tzsbut").unbind("click");
		$(flag).css("background-color", "#e5e5e5").siblings().css("background-color", "#FFFFFF");
		var claimNo=$(flag).find("td:eq(0)").find("input:eq(0)").val();
		var isBpo=$(flag).find("td:eq(0)").find("input:eq(1)").val();
		var pid=$(flag).find("td:eq(1)").find("input:eq(0)").val();
		var caseSource=$(flag).find("td:eq(1)").find("input:eq(1)").val();
		$("#claim-no").val(claimNo);
		$("#caseSource").val(caseSource);
		$("#isBpo").val(isBpo);
		
		//caseSource:1产险\2寿险\3健康险
		//channelType:0健康险\1寿险\2产险
		var channelType = "0";
		if ("1" == caseSource) {
			channelType = "2";
		} else if ("2" == caseSource) {
			channelType = "1";
		}
		$("#claimNo").text("赔案号："+claimNo);
		$(".top_nav_se a").css("color","#007aff");
		$("#SHcon2").show();
		$("#pa").bind("click",function(){
//			openWindow('../adjustmentGengduo/dispatcherClmInfo.do',claimNo);
			skip2OtherPage('../humanaudit/humanAuditClaim.do',claimNo,pid,"03",channelType);
		});
		$("#bd").bind("click",function(){
			skip2OtherPage("../claim/commonsearch/policyListQuery.do",claimNo,pid,"03",channelType);
		});
		$("#hmd").bind("click",function(){
			skip2OtherPage("../humanaudit/queryClaimBlacklist.do",claimNo,pid,"03",channelType);
		});
		$("#ls").bind("click",function(){
			skip2OtherPage("../claim/commonsearch/clmhistoryQuery.do",claimNo,pid,"03",channelType);
		});
		$("#dc").bind("click",function(){
			skip2OtherPage("../humanaudit/queryInvTask.do",claimNo,pid,"03",channelType);
		});
		$("#hq").bind("click",function(){
			skip2OtherPage("../humanaudit/queryCoopTask.do",claimNo,pid,"03",channelType);
		});
		selectDeceitReasonInfo(claimNo);
	}
	
//	function skip2OtherPage(url,claimNo,pid,pageFrom,channelType){
//		var params = new Array();
//		params["claimNo"] = claimNo;
//		params["pid"] = pid;
//		params["pageFrom"] = pageFrom;
//		params["channelType"] = channelType;
//		SkipByPost(url, params);
//	}
	
//	选择查看
	function selectDeceitReasonInfo(claimNo){
		if(syncType){
			syncType =false;
			addDeceitReason();
			$.ajax({
				type:"POST",
				url:"queryClaimConsultFeedbackList.do",
				contentType:"application/json; charset=UTF-8",
				data:'{"claimNo":"'+claimNo+'"}',
				error:function(){
					alert("查询协谈信息出错");
					syncType = true;
				},
				success:function(data){
					if(data.successFlag=='Y'){
						createTab(data);
						syncType = true;
						closeBtn();
					}else{
						alert(data.errorMsg);
						syncType = true;
					}
				}
			});
		}
	}
		
//创建协谈列表	
function createTab(data){
	$("#changeTab table").remove();
	for ( var i = 0; i < data.auditConsultList.length; i++) {
		var a =data.auditConsultList[i];
		var tr='<tr><th width="11%"><span class="radio_no" claimNo="'+a.claimNo+'" consultType="'+a.consultType+'" clmConsultNo="'+a.clmConsultNo+'"></span></th>'+
		'<td width="6%">'+fmtNull(a.consultTypeDesc)+'</td>'+
		'<td width="14%">申请日期：'+jsonDateFormat(a.applyDate,10)+'</td>'+
		'<td width="69%">核赔员：'+fmtNull(a.applyNo)+' '+fmtNull(a.applyName)+'</td>'+
		'</tr>';
		$("#SHcon2 table").append(tr);
	}	
	//$("#SHcon2 table").append('<tr><td></td><td><a class="txt_blue" id="addnew" style="display:none;" href="#">新增</a></td><td></td><td></td></tr>');
	
	$(".radio_yes,.radio_no").unbind('click');
	$(".radio_yes,.radio_no").click(function(){ 
		if($(this).is(".radio_yes")){
			$(this).removeClass("radio_yes");
			$(this).addClass("radio_no"); 
		}

		if($(this).is(".radio_no")){
			var obj=  $(".radio_yes");
			obj.removeClass("radio_yes");          
			obj.addClass("radio_no"); 
			$(this).removeClass("radio_no");
			$(this).addClass("radio_yes");
			checkRadio(); 
		}
	});
	
}
//补充资料列表修改信息
function getTzsForJson(){
	var jsonStr = '';
	$("#changeTab span").each(function(i){
		var c = $(this).attr('class')=='check_yes'?'2':'1';
		if(i>0){
			jsonStr+=",{";
		}
		jsonStr+='"resourceState":"'+c+'","resourceMemo":"'+$("#changeTab input:eq("+i+")").val()+'","objId":"'+$("#changeTab input:eq("+i+")").attr("objId")+'"}';
	});
	if(jsonStr!=''){
		jsonStr="{"+jsonStr;
	}
	return jsonStr;
}

//保存或完成
function saveThis(type){
	if(syncSaveType){
		return;
	}
	var isError = 'N';
	//选定列表信息
	var jsonStr ='{"operateType":"'+type+'",'
		        +'"clmConsultNo":"'+$(".radio_yes").attr("clmconsultno")+'",'
			    +'"claimNo":"'+$(".radio_yes").attr("claimno")+'",'
			    +'"consultStatus":"'+$("#consultStatus").val()+'",'
//			    +'"consultStatus":"2",'
			    +'"consultType":"'+$(".radio_yes").attr("consulttype")+'"';
	//拼接提交的数据 1.补充资料  2.理赔体检  3.通知单  4.法务会签
	if($(".radio_yes").attr("consulttype") == '1'){
		$("#changeTab span").each(function(i){
			var c = $(this).attr('class')=='check_yes'?'2':'1';
			if (c == '1') {
				var tempResourceMemo = $("#changeTab input:eq("+i+")").val();
				if (tempResourceMemo == null || tempResourceMemo == '') {
					$("#changeTab input:eq("+i+")").focus();
					isError = 'Y';
					alert("补充资料未提供时，资料备注不能为空！");
					return;
				}
			}
		});
		jsonStr +=',"auditConsultResurceList":['+getTzsForJson()+']}';
	}else if($(".radio_yes").attr("consulttype") == '2'){
		var tempApplyDate = $("#applyDate").val();
		var tempCheckupAddress = $("#changeTab input:eq(1)").val();
		var tempCheckupApplicant = $("#changeTab input:eq(2)").val();
		var tempCheckupResult = $("#changeTab textarea:eq(1)").val();
		if (tempApplyDate == null || tempApplyDate == '') {
			alert("体检日期不能为空，请录入！");
			$("#applyDate").focus();
			isError = 'Y';
			return;
		}
		if (tempCheckupAddress == null || tempCheckupAddress == '') {
			alert("体检地点不能为空，请录入！");
			$("#changeTab input:eq(1)").focus();
			isError = 'Y';
			return;
		}
		if (tempCheckupApplicant == null || tempCheckupApplicant == '') {
			alert("体检员/陪检员不能为空，请录入！");
			$("#changeTab input:eq(2)").focus();
			isError = 'Y';
			return;
		}
		if (tempCheckupResult == null || tempCheckupResult == '') {
			alert("体检结果不能为空，请录入！");
			$("#changeTab textarea:eq(1)").focus();
			isError = 'Y';
			return;
		}
		jsonStr +=',"checkupDate":"'+$("#applyDate").val()+'",'
				 +'"checkupAddress":"'+$("#changeTab input:eq(1)").val()+'",'
				 +'"checkupApplicant":"'+$("#changeTab input:eq(2)").val()+'",'
				 +'"checkupResult":"'+$("#changeTab textarea:eq(1)").val()+'"}';
	}else if($(".radio_yes").attr("consulttype") == '3'){
		var isNeedModifyClmResult = $("#changeTab span:eq(0)").attr("class")=="check_no"?"N":"Y";
		jsonStr +=',"isNeedModifyClmResult":"'+isNeedModifyClmResult+'",'
		+'"consultFeedback":"'+$("#changeTab textarea:eq(2)").val()+'"}';
		
	}else if($(".radio_yes").attr("consulttype") == '4'){
		jsonStr +=',"coopFeedbackContent":"'+$("#changeTab textarea:eq(1)").val()+'"}';
	}else if($(".radio_yes").attr("consulttype") == '8'){
	//团长补B款直付服务需求 hl 开始
		jsonStr +=',"coopFeedbackContent":"'+$("#changeTab textarea:eq(1)").val()+'"}';
	}
	//团长补B款直付服务需求 hl 结束
	
	//验证
	var result = $('textarea:last').val();
	if($(".radio_yes").attr("consulttype") == '2'&&type=='3'){
		 if( result==''|| result==undefined){
			 alert("请输入体检结果");
			 isError = 'Y';
			 return;
		 }
		 if( result.replace(/\s*/,'')==''){
			 alert("体检结果不能为空");
			 isError = 'Y';
			 return;
		 }
		 if( result!=''&&result.length > 200){
			 alert("体检结果内容过长，请精简");
			 isError = 'Y';
			 return;
		 }
	}else if($(".radio_yes").attr("consulttype") == '3'&&type=='3'){
		 if( result==''|| result==undefined){
			 alert("请输入协谈结果");
			 isError = 'Y';
			 return;
		 }
		if( result.replace(/\s*/,'')==''){
			 alert("协谈结果不能为空");
			 isError = 'Y';
			 return;
		 }
		 if( result!=''&& result.length > 200){
			 alert("协谈结果内容过长，请精简");
			 isError = 'Y';
			 return;
		 }
		
	}else if($(".radio_yes").attr("consulttype") == '4'&&type=='3'){
		 if( result==''|| result==undefined){
			 alert("请输入会签结果");
			 isError = 'Y';
			 return;
		 }
		 if( result.replace(/\s*/,'')==''){
			 alert("会签结果不能为空");
			 isError = 'Y';
			 return;
		 }
		 if( result!=''&& result.length > 200){
			 alert("会签结果内容过长，请精简");
			 isError = 'Y';
			 return;
		 }
	}else if($(".radio_yes").attr("consulttype") == '8' &&type=='3'){
	//团长补B款直付服务需求 hl 开始
		if( result==''|| result==undefined){
			 alert("请输入其他任务结果");
			 isError = 'Y';
			 return;
		 }
		 if( result.replace(/\s*/,'')==''){
			 alert("其他任务结果不能为空");
			 isError = 'Y';
			 return;
		 }
		 if( result!=''&& result.length > 200){
			 alert("其他任务结果内容过长，请精简");
			 isError = 'Y';
			 return;
		 }
	//团长补B款直付服务需求 hl 结束
	}
    if (isError == 'N') {
    	syncSaveType = true;
    	//AJAX提交
    	 $.ajax({
    		 type:"POST",
    		 url:"saveClaimConsultFeedbackInfo.do",
    		 dataType:"json",
    		 contentType:"application/json; charset=UTF-8",
    		 data:jsonStr,			
    		 error:function(){
    			 alert("保存失败！");
    			 syncSaveType = false;
    			 return;
    		 },
    		 success:function(data){
    			 if(data.successFlag=='Y'){
    				 $("#consultStatus").val(data.consultStatus);
    				 checkRadio();
    				 alert("保存成功");
    				 syncSaveType = false;
    			 }else{
    				 alert(data.errorMsg);
    				 syncSaveType = false;
    			 }
    		 }
    	 });
    }
}



//点击单选按钮
function checkRadio(){
	$("#changeTab table").remove();
	$.ajax({
		type:"POST",
		url:"queryClaimConsultFeedbackInfo.do",
		contentType:"application/json; charset=UTF-8",
		data:'{"claimNo":"'+$(".radio_yes").attr('claimno')+'","clmConsultNo":"'+$(".radio_yes").attr('clmconsultno')+'"}',
		error:function(){
			alert("查询协谈信息出错");
		},
		success:function(data){
			if(data.successFlag=='Y'){
				createDivContext(data);
				findtzd();
			}else{
				alert(data.errorMsg);
			}
		}
	});
	
}
//查询是否有通知单
function findtzd(){
	var noticeType="0"+$(".radio_yes").attr('consulttype');
	if(noticeType==03){
		noticeType="04";
	}else if(noticeType==04){
		noticeType="03";
	}
	$.ajax({
		type:"POST",
		url:"queryClaimNoticeRecord.do",
		contentType:"application/json; charset=UTF-8",
		data:'{"claimNo":"'+$(".radio_yes").attr('claimno')+'","clmConsultNo":"'+$(".radio_yes").attr('clmconsultno')+'","noticeType":"'+noticeType+'"}',
		error:function(){
			alert("查询通知单信息出错");
		},
		success:function(data){
			if(data!=null  && data!=undefined && data!=""){
				$("#tzsbut").css("color","#007aff");
				$("#tzsbut").unbind("click");
				var claimNo=data.claimNo;
				var consultNo=data.clmConsultNo;
				var noticeNo=data.noticeNo;
				$("#tzsbut").click(function(){
					var openUrl = null;
					if(data.noticeType=='01'){
						openUrl = "../claim/notice/supplementInfo.do?claimNo="+claimNo+"&consultNo="+consultNo;
					}else if(data.noticeType=='02'){
						openUrl = "../claim/notice/supplementCheckUpInfo.do?claimNo="+claimNo+"&consultNo="+consultNo;
					}else if(data.noticeType=='03'){
						openUrl = "../claim/notice/noticeP0000003Info.do?claimNo="+claimNo+"&consultNo="+consultNo;
					}else if(data.noticeType=='04'){
						if (noticeNo == 'P0000002') {
							openUrl = "../claim/notice/noticeP0000002Info.do?claimNo="+claimNo+"&consultNo="+consultNo;
						} else if (noticeNo == 'P0000006') {
							openUrl = "../claim/notice/claimExclusionsInfo.do?claimNo="+claimNo+"&consultNo="+consultNo;
						} else if (noticeNo == 'P0000007') {
							openUrl = "../claim/notice/payMentAgreementInfo.do?claimNo="+claimNo+"&consultNo="+consultNo;
						} else if (noticeNo == 'P0000008') {
							openUrl = "../claim/notice/queryNoticeP0000008.do?claimNo="+claimNo+"&consultNo="+consultNo;
						} else if (noticeNo == 'P0000009') {
							openUrl = "../claim/notice/lpjdnoticeInfo.do?claimNo="+claimNo+"&consultNo="+consultNo;
						} else if (noticeNo == 'P0000011') {
							openUrl = "../claim/notice/canoticeInfo.do?claimNo="+claimNo+"&consultNo="+consultNo;
						}
					}
					if (openUrl != null) {
						window.open(openUrl, "wind_print_notice");
					}
				});
			}else{
				$("#tzsbut").css("color","#ccc");
				$("#tzsbut").unbind("click");
			}
		}
	});
}

//清空表单
function clearTable(){
	$("textarea:eq(0)").html('');
}

//新增
function addDeceitReason(){
	$("#SHcon2 tr").remove();
}	



function appendContext(htmlStr,data,type){
	for(var a in data.auditConsultResurceList){
		var b = data.auditConsultResurceList[a];
		var c = b.resourceState=='2'?'check_yes':'check_no';
		
		if(type =='3'){
			var memo = fmtNull(b.resourceMemo).length>30?fmtNull(b.resourceMemo).substring(0,30)+"...":fmtNull(b.resourceMemo);
			var desc = fmtNull(b.resourceDesc).length>25?fmtNull(b.resourceDesc).substring(0,25)+"...":fmtNull(b.resourceDesc);
			htmlStr+='<tr><td>'+fmtNull(b.resourceNo)+'</td>'+
			'<td>'+fmtNull(b.resourceName)+'</td>'+
			'<td title="'+fmtNull(b.resourceDesc)+'" style="cursor: pointer;">'+desc+'</td>'+
			'<td><span class="'+c+'"></span></td>'+
			'<td title="'+fmtNull(b.resourceMemo)+'" style="cursor: pointer;">'+memo+'</td>'+
			'</tr>';
		}else{
			htmlStr+='<tr><td>'+fmtNull(b.resourceNo)+'</td>'+
			'<td>'+fmtNull(b.resourceName)+'</td>'+
			'<td>'+fmtNull(b.resourceDesc)+'</td>'+
			'<td><span class="'+c+'"></span></td>'+
			'<td><input type="text" maxlengh="100" objId="'+b.objId+'" class="input i_s_260" value="'+fmtNull(b.resourceMemo)+'" /></td>'+
			'</tr>';
		}

	}
	htmlStr+='</table><input type="hidden" id="consultStatus" value="'+data.consultStatus+'" />';
	return htmlStr;
}

	
//根据理赔类型显示不同的界面	
function createDivContext(data){	
	//1补充资料
	if(data.consultType=='1'){
//		$("#addnew").show();
		var htmlStr='<table class="table_list" width="100%">'+
				'<tr>'+
				'<th width="12%">单证代码</th>'+
				'<th width="18%">单证名称</th>'+
				'<th width="27%">补充资料描述</th>'+
				'<th width="11%">是否已提供</th>'+
				'<th width="32%">备注</th>'+
				'</tr>';
		htmlStr=appendContext(htmlStr,data,data.consultStatus);
		$("#changeTab").html(htmlStr);
		if(data.consultStatus!='3'){
			syncSaveType = false;
			openBtn();
			$(".check_yes,.check_no").bind("click", function(){
				if($(this).is(".check_yes")){
					$(this).removeClass("check_yes");
					$(this).addClass("check_no"); 
				}else{
					$(this).removeClass("check_no");
					$(this).addClass("check_yes");
				}
			});			 
		}else{
			closeBtn();
		}
		
		
	//2理赔体检
	}else if(data.consultType=='2'){
//		$("#addnew").hide();
		$("#changeTab").html('<table width="100%" class="table_con"><tr><th width="14%">'+
				'体检要求：</th><td colspan="3"><textarea maxlength="200" class="textarea w_b90" disabled="disabled" >'+fmtNull(data.checkupAim)+'</textarea></td></tr></table><table width="100%" class="table_con">'+
				'<tr><th width="14%">体检日期：</th><td><div><input id="applyDate" class="input_time i_s_240" type="text" value="'+jsonDateFormat(data.checkupDate,10)+'" onclick="WdatePicker()"></div>'+
				'</td><th width="14%">体检地点：</th><td><input type="text" class="input i_s_240" value="'+fmtNull(data.checkupAddress)+'"/></td></tr></table><table width="100%" class="table_con">'+
				'<tr><th width="14%">体检员/陪检员：</th><td><input type="text" class="input i_s_240" value="'+fmtNull(data.checkupApplicant)+'"/></td></tr></table>'+
				'<table width="100%" class="table_con"><tr><th width="14%">体检结果：</th>'+
				'<td colspan="3"><textarea maxlength="200" class="textarea w_b90">'+fmtNull(data.checkupResult)+'</textarea></td></tr></table><input type="hidden" id="consultStatus" value="'+data.consultStatus+'" />');
		
		if(data.consultStatus!='3'){
			 openBtn();
		}else{
			 $("#changeTab input:eq(0)").removeAttr("onclick");
			 $("#changeTab input:eq(0)").attr("readonly","readonly");
			 $("#changeTab input:eq(1)").attr("readonly","readonly");
			 $("#changeTab input:eq(2)").attr("readonly","readonly");
			 $("textarea:eq(1)").attr("disabled","disabled");
			 closeBtn();
		}
		
		
	//3通知单
	}else if(data.consultType=='3'){
//		$("#addnew").hide();
		var result=data.isNeedModifyClmResult=='Y'?'check_yes':'check_no';
		$("#changeTab").html('<table width="100%" class="table_con"><tr><th width="14%">'+
			'理赔结论原因：</th> <td colspan="3"><textarea maxlength="200" class="textarea w_b90" readonly="readonly">'+fmtNull(data.consultClaimResultReason)+'</textarea></td> </tr> </table> <table width="100%" class="table_con"> <tr> '+
			'<th width="14%">协谈申请：</th> <td colspan="3"><textarea maxlength="200" class="textarea w_b90" readonly="readonly">'+fmtNull(data.consultContent)+'</textarea></td> </tr></table> <table width="100%" class="table_con"> <tr> <td width="19%"></td> '+
			'<td width="81%" style="display:none;"><span class="'+result+'"></span>是否需要修改理赔结论</td>  '+
			'</tr> </table> <table width="100%" class="table_con"> <tr> <th width="14%">协谈结果：</th> '+
			'<td colspan="3"><textarea maxlength="200" class="textarea w_b90">'+fmtNull(data.consultFeedback)+'</textarea></td></tr></table><input type="hidden" id="consultStatus" value="'+data.consultStatus+'" />');
			
		if(data.consultStatus!='3'){
			   $("textarea:eq(0)").attr("disabled","disabled");
			   $("textarea:eq(1)").attr("disabled","disabled");
				$(".check_yes,.check_no").bind("click", function(){
					  if($(this).is(".check_yes")){
							$(this).removeClass("check_yes");
							$(this).addClass("check_no"); 
						  
						  }
						  else{
								$(this).removeClass("check_no");
						        $(this).addClass("check_yes");
						}
				});	
			   openBtn();
			}else{
			   $("textarea:eq(0)").attr("disabled","disabled");
			   $("textarea:eq(1)").attr("disabled","disabled");
			   $("textarea:eq(2)").attr("disabled","disabled");
			   closeBtn();
		    }
	//4法务会签	
	}else if(data.consultType=='4'){
//		$("#addnew").hide();
		$("#changeTab").html('<table width="100%" class="table_con">'+
		'<tr>'+
		'<th width="14%">会签类型：</th>'+
		'<td><div class="input i_s_137 float_l">'+
		'<span id="hqlx" class="sel_text" >'+fmtNull(data.coopType)+'</span>'+                         
		'</td>'+
		'</tr>'+
		'</table>'+
		'<table width="100%" class="table_con">'+
		'<tr>'+
		'<th width="14%">会签要求：</th>'+
		'<td colspan="3"><textarea maxlength="200"   disabled="disabled" class="textarea w_b90">'+fmtNull(data.coopContent)+'</textarea></td>'+
		'</tr>'+     
		'</table>'+
		'<table width="100%" class="table_con">'+
		'<tr>'+
		'<th width="14%">会签结果：</th>'+
		'<td colspan="3"><textarea maxlength="200"  class="textarea w_b90">'+fmtNull(data.coopFeedbackContent)+'</textarea></td>'+
		'</tr>'+
		'</table><input type="hidden" id="consultStatus" value="'+data.consultStatus+'"/>');
		
		if(data.consultStatus!='3'){
			 openBtn();
		}else{
			 $("textarea:eq(1)").attr("disabled","disabled");
			 closeBtn();
		}
		
	}
	//团长补B款直付服务需求 开始 hl
	else if(data.consultType=='8'){
		$("#changeTab").html('<table width="100%" class="table_con">'+
		'<tr>'+
		'<th width="14%">类型：</th>'+
		'<td><div class="input i_s_137 float_l">'+
		'<span id="hqlx" class="sel_text" >'+fmtNull(data.coopType)+'</span>'+                         
		'</td>'+
		'</tr>'+
		'</table>'+
		'<table width="100%" class="table_con">'+
		'<tr>'+
		'<th width="14%">其他任务要求：</th>'+
		'<td colspan="3"><textarea maxlength="200"   disabled="disabled" class="textarea w_b90">'+fmtNull(data.coopContent)+'</textarea></td>'+
		'</tr>'+     
		'</table>'+
		'<table width="100%" class="table_con">'+
		'<tr>'+
		'<th width="14%">其他任务结果：</th>'+
		'<td colspan="3"><textarea maxlength="200"  class="textarea w_b90">'+fmtNull(data.coopFeedbackContent)+'</textarea></td>'+
		'</tr>'+
		'</table><input type="hidden" id="consultStatus" value="'+data.consultStatus+'"/>');
			
		if(data.consultStatus!='3'){
			 openBtn();
		}else{
			 $("textarea:eq(1)").attr("disabled","disabled");
			 closeBtn();
		}
	}
	//团长补B款直付服务需求 结束 hl
}	
	
//使按钮不可点击
function closeBtn(){
	$(".bot_btn_02").removeAttr("onclick");
	$(".bot_btn_03").removeAttr("onclick");
	$(".bot_btn_02").css("color","#ccc");
	$(".bot_btn_03").css("color","#ccc");
}

//恢复按钮点击
function openBtn(){
	$(".bot_btn_02").attr("onclick","saveThis('3')");
	$(".bot_btn_03").attr("onclick","saveThis('1')");
	$(".bot_btn_02").css("color","#007aff");
	$(".bot_btn_03").css("color","#007aff");
}

//转化null为空值
 function fmtNull(a){
	 if(a==null||a==undefined)
		 return "";
	 else	 
		 return a;
 }
	
//	时间显示工具
	function jsonDateFormat(date,length){
		if(date==null || date==""){
			return "";
		}
		if(isNaN(date)){
			return date;
		}
	    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;
	    }
	}