ReadCard.jsp
9.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<%@ 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="读取身份证信息"/>
<input id="btnCancel" class="btn btn-primary" type="submit" value=" 查 询 " onclick="location.reload()"/>
</div>
<br>
</form:form>
</body>
</html>