大理访客登记改
diff --git a/src/main/resources/templates/visitormanage/addVisitorCheck.html b/src/main/resources/templates/visitormanage/addVisitorCheck.html
index 6155f25..48d092c 100644
--- a/src/main/resources/templates/visitormanage/addVisitorCheck.html
+++ b/src/main/resources/templates/visitormanage/addVisitorCheck.html
@@ -129,6 +129,14 @@
</button>
</el-col>
+ <el-col :span="8" :offset="16">
+ <button type="button" style="margin-left: 48px" class="btn btn-info"
+ @click="getidcard(searchDoorForm)"
+ id="searchDoorlist_qrycardbtn">
+ 读卡查询
+ </button>
+
+ </el-col>
</el-row>
</el-form>
@@ -234,6 +242,10 @@
savevisitor: function (formName) {
searchDoorlist_commonQuery(this, this.searchDoorForm, formName);
},
+ getidcard: function (froName) {
+ var _self = this;
+ readidno(_self,this.searchDoorForm,froName);
+ },
deptchange: function (deptcode) {
var _self = this;
@@ -290,9 +302,12 @@
})
this.searchDoorForm.allocatStartDate = '';
this.searchDoorForm.allocatEndDate = '';
+ openidreader();
}
});
+ var localcardservice = "http://localhost:2011/localcardservice/?callback=?";
+
// 对Date的扩展,将 Date 转化为指定格式的String
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
@@ -553,4 +568,62 @@
function refreshThisTable() {
$("#searchDoorlist_qrybtn").click();
}
+
+ /**
+ * 打开身份证读卡器
+ */
+ function openidreader(){
+ var jsonparam;
+ jsonparam = $.parseJSON('{"action":"openidreader"}');
+ $.ajax({
+ url: localcardservice,
+ data: jsonparam,
+ dataType:'jsonp',
+ jsonp: "callback",
+ success: function(data) {
+ if(data.retcode != 0){
+ // 打开失败
+ alert("打开失败");
+ }else{
+ // 打开成功
+ alert("打开成功");
+ }
+ },
+ error: function(d,msg) {
+ alert("连接错误")
+ }
+ });
+ }
+
+ /**
+ * 读取身份证号
+ */
+ function readidno(_self, searchDoor, formName){
+ var jsonparam;
+ jsonparam = $.parseJSON('{"action":"readidno"}');
+ $.ajax({
+ url: localcardservice,
+ data: jsonparam,
+ dataType:'jsonp',
+ jsonp: "callback",
+ success: function(data) {
+ console.log(data.retmsg);
+ if(data.retcode == 0){
+ // 读取成功
+ var idcard =data.retmsg;
+ var list=[];
+ list =idcard.split("|");
+ _self.searchDoorForm.idno=;
+ _self.searchDoorForm.visitorname="123456789123456789";
+ }else{
+ alert("读取失败");
+ }
+ },
+ error: function(d,msg) {
+ console.log(msg);
+ alert("读取错误");
+ }
+ });
+ }
+
</script>
\ No newline at end of file