

function getBytesLength(str) {
	if (null == str || '' == str) {
		return 0;
	}
	return str.replace(/[^\x00-\xff]/g, "**").length;
}

function saveBlacklist(){
	 var params={};
	 params["claimNo"] = $("#claimNo").val();
	 params["sSn"] = $("#sSn").val();
	 params["riskReason"] = $("#riskReason").val();
	 params["reasonCode"] = $("#reasonCode").val();
	 params["fxinfo"] = $("#fxinfo").val();
	 params["jtdescribe"] = $("#jtdescribe").val();
	 if ($("#reasonCode").val() == "" || $("#fxinfo").val() == "") {
		 alert("录入原因或风险信息为空，不可保存！");
		 return;
	 }
	 //校验长度
	 if ($("#fxinfo").val() != null && getBytesLength($("#fxinfo").val()) > 200) {
		 alert("风险信息不可超过200个字符！");
		 return;
	 }
	 if ($("#jtdescribe").val() != null && getBytesLength($("#jtdescribe").val()) > 100) {
		 alert("具体描述不可超过100个字符！");
		 return;
	 }
	//AJAX提交
	 $.ajax({
		 type:"POST",
		 url:"saveClaimBlacklist.do",
		 dataType:"json",
		 contentType:"application/json",
		 data:JSON.stringify(params),
		 error:function(){
			 alert("保存失败！");
			 return;
		 },
		 success:function(data){
			 alert(data.errorMsg);
		 }
	 });
}

function setLiValue(obj, no){
	$("#reasonCode").val(no);
	$("#blacklist_resoncode").html(no);
	$("#riskReason").val($("#" + obj.id).html());
}
function forwardAdit(claimNo){
	SkipByPost("../auditinfo/showauditdetail.do",{claimNo:claimNo});
}