ReadCard.jsp 9.42 KB
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>个人登记信息查询</title>
	
	<style type="text/css">
		.gradient{
		    background: -moz-linear-gradient(top, #000000 0%, #ffffff 100%);
		    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff));
		    background: -webkit-linear-gradient(top, #000000 0%,#ffffff 100%);
		    background: -o-linear-gradient(top, #000000 0%,#ffffff 100%);
		    background: -ms-linear-gradient(top, #000000 0%,#ffffff 100%);
		    background: linear-gradient(to bottom, #000000 0%,#ffffff 100%);
		}
	
	</style>
	
	<script type="text/javascript" src="${ctxStatic}/readcard/jBox/jquery.jBox-2.3.min.js"></script>
	<script type="text/javascript" src="${ctxStatic}/readcard/js/baseISSObject.js"></script>
	<script type="text/javascript" src="${ctxStatic}/readcard/js/baseISSOnline.js"></script>
	<script type="text/javascript" src="${ctxStatic}/readcard/js/common.js"></script>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交,请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误,请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			views();
			var imgdata = $("#id_img_perstext").val();
			$("#id_img_per").attr("src","data:image/jpg;base64,"+imgdata);
			<c:if test="${not empty regBasePerson}">
				changeZjzlByRylx($("#rylxtext"));
			</c:if>
	});
		function readValue(){
			var sczt = $("#veritysczt_text").val();
			if(sczt == '1'){
				var si_code = "";
				var params = new Object();
				var interHis = new Object();
				var rylx = $("#rylxtext").val();
				var zjzl = $("#zjzltext").val();
				var zjh = $("#zjhtext").val();
				var rymc = $("#rymctext").val();
				var sczt = $("#veritysczt_text").val(); 
				var id = $("#id").val();
				var pcode = $("#pcode").val();
				 
				var veritydata_label = $("#veritydata_label").html();
				interHis.rymc = rymc;
				interHis.zjhm = zjh;
				interHis.jkmc = veritydata_label;
				interHis.rylx = rylx;
				
			    if(rylx == '1'){
					if(zjzl != '1'){
						alert("使用集成接口验证数据,请选择正确的证件种类"); 
						return;
					}
					si_code = 'out/rkjzxxcx';
					params.sfzh = zjh;
					params.name = rymc; 
				}else{
					var rylx_text = $("#rylxtext").find("option:selected").text();;
					alert("集成接口未开通人员类型【"+rylx_text+"】的数据接口");
					return;
				}
				$('#t_zjzl').val($("#zjzltext").data("select2").val());
				$('#t_rylx').val($("#rylxtext").data("select2").val());
				$("#rylxtext").attr("disabled","disabled");
				$("#zjzltext").attr("disabled","disabled");
				verityswzm(params,interHis);
			}
		}
		
		//身份证
		function isCardNo(card){
		   // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X 
		   var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
		   if(reg.test(card) === false){
			   $(".error").remove();
		 	   $("<label for='name' class='error'>身份证输入不合法!</label>").insertAfter("#zjhtext");
		       return false;
		   }else{
			   return true;
		   }
		}
		
		//组织机构代码 
		function isOrgon(OrgCode){
			var reg = /^[a-zA-Z\d]{8}\-[a-zA-Z\d]$/;
		 	if(reg.test(OrgCode) === false){
		 		$(".error").remove();
		 		$("<label for='name' class='error'>组织机构代码输入不合法!</label>").insertAfter("#zjhtext");
		        return false;
		   }else{
			   return true;
		   }
		}
		
		//营业执照 
		function isIng(ingCode){
			var reg = /^\d{15}$|^[0-9a-zA-Z]{18}$/;
			//var reg = /(^\d{15}$)|(^\d{18}$)/;
		 	if(reg.test(ingCode) === false){
		 		$(".error").remove();
		 		$("<label for='name' class='error'>营业执照输入不合法!</label>").insertAfter("#zjhtext");
		        return false;
		   }else{
			   return true;
		   }
		}
		
		//其他证件只能以数字开头 
		function isOther(ingCode){
			var reg = /^[0-9].*$/;
		 	if(reg.test(ingCode) === false){
		 		$(".error").remove();
		 		$("<label for='name' class='error'>【其他】证件类型只能以数字开头!</label>").insertAfter("#zjhtext");
		        return false;
		    }else{
			    return true;
		    }
		}
		
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}
		
		function personSubmit(){
			$(".error").remove();
			 
			if($("#rymctext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#rymctext");
				return;
			}
			if($("#zjzltext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zjzltext");
				return;
			}
			if($("#zjhtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zjhtext");
				return;
			}
			
			var codeVal = $("#zjhtext").attr("value");
			var rymcVal = $("#rymctext").attr("value");
			//证件号验证 
			var zjzl = $("#zjzltext").val();
			if(zjzl == "1" && !isCardNo(codeVal)){
				return;
			}
			if(zjzl == "4" && !isCardNo(codeVal)){
				return;
			}
			if(zjzl == "6" && !isOrgon(codeVal)){
				return;
			}
			if(zjzl == "7" && !isIng(codeVal)){
				return;
			}
			
		}
		function setCertificateData(result)
		{
			$("#zjhtext").val(result.Certificate.IDNumber);
			imgData =result.Certificate.Base64Photo;
			$("#id_img_perstext").val(imgData);
			$("#id_img_per").attr("src","data:image/jpg;base64,"+imgData);
			$("#fzjgtext").val(result.Certificate.IDIssued);
			$("#rymctext").val(result.Certificate.Name);
			if(result.Certificate.Sex=="男"){
				$("#xbtext").data("select2").val("1");
			}else{
				$("#xbtext").data("select2").val("2");
			}
			$("#rylxtext").data("select2").val("1");
			$("#zjzltext").data("select2").val("1");
			$("#dz").val(result.Certificate.Address);
		}
		
		function changeZjzlByRylx(obj){
			var va = $(obj).data("select2").val();
			$("#zjzltext").data("select2").val("");
			$("#interhis_id").val("");
			if( va == '2010' || va == '2020' || va == '2030' || va == '2040'){
				$("#zjzltext").data("select2").val("10");
				$("#veritydata_label").html("民政社会组织核验");
				//$("#zjzltext").attr("disabled","disabled");
			}else if(va == '2050' || va == '2060'){
				$("#zjzltext").data("select2").val("1301");
				$("#veritydata_label").html("银保监机构核验");
				//$("#zjzltext").attr("disabled","disabled");
			}else if(va == '1' ){
				$("#zjzltext").data("select2").val("1");
				$("#veritydata_label").html("公安公民身份核验");
				//$("#zjzltext").attr("disabled","disabled");
			}else if(va == '2' ){
				$("#zjzltext").data("select2").val("10");
				$("#veritydata_label").html("市场监管企业核验");
				//$("#zjzltext").attr("disabled",false);
			}else if(va == '3' ||va == '4' ){
				$("#zjzltext").data("select2").val("10");
				$("#veritydata_label").html("中编办部门核验");
				//$("#zjzltext").attr("disabled",false);
			}else{
				$("#veritydata_label").html("数据核验状态");
			}
		}
		
		function clearInterId(){
			$("#interhis_id").val("");
		}

		 function getDjxx(){
			//弹出窗口的宽度; 
			var iWidth=700; 
			//弹出窗口的高度;
	       	var iHeight=800;
	       	//获得窗口的垂直位置 
	       	var iTop = (window.screen.height - 30 - iHeight) / 2;
	       	//获得窗口的水平位置 
	       	var iLeft = (window.screen.width - 10 - iWidth) / 2;
	       
	       	var qlrmc = $('#rymctext').val();
	       	var zjh = $('#zjhtext').val();
			var zjzl = $('#zjzltext').val();
       		var url = "${ctx}/reg/bus/regBusQlr/DjxxSelect?qlrmc="+qlrmc+"&zjh="+zjh+"&zjzl="+zjzl;
       		window.open(url, "窗口", "width=" + iWidth + ", height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + ",toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no,alwaysRaised=yes,depended=yes"); 
		 }
	</script>
</head>
<body>

	
		<form:form id="searchForm"  modelAttribute="regBusQlr"  action="#"  onsubmit="getDjxx()" method="post" class="breadcrumb form-search">
		<ul class="ul-form">
			
			<li><label style="width:90px;">人员名称:</label>
			  <form:input id="rymctext" path="qlrmc" htmlEscape="false" maxlength="100" class="input-large"  />
			</li>
			<li><label style="width:90px;">证件类型:</label>
				<form:select path="zjzl" id="zjzltext" class="input-small ">
					<form:options items="${fns:getDictList('reg_bus_zjlx')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					
				</form:select>
			</li>
			<li><label style="width:90px;">证件号码:</label>
			    <form:input id="zjhtext" path="zjh" htmlEscape="false" maxlength="100" class="input-xlarge"/>
			</li>	
			</ul>
			<br>
			<div align="center">
				<input id="button_readID" class="btn btn-primary" type="button" value="读取身份证信息"/>&nbsp;&nbsp;&nbsp;
			
			<input id="btnCancel" class="btn btn-primary" type="submit" value=" 查 询 " onclick="location.reload()"/>&nbsp;&nbsp;&nbsp;
			
			</div>
		<br>
		
	</form:form>
	
</body>
</html>