| | |
| | | <template> |
| | | <basic-container> |
| | | <basic-container class="formsss"> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="obj" |
| | |
| | | |
| | | <script> |
| | | import CertCtl from "./sfzJS"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | computed: { |
| | | ...mapGetters(["userInfo", "cardInfor", "haveCardid", "useZhiWen"]), |
| | | }, |
| | | mounted() { |
| | | // console.log(CertCtl); |
| | | try { |
| | |
| | | return { |
| | | cardShebei: "", |
| | | intTime: "", //自动获取身份证; |
| | | isHaveCardid: false, |
| | | obj: {}, |
| | | option: { |
| | | // mockBtn: true, |
| | | // submitText: "完成", |
| | | // printBtn: true, |
| | | submitBtn: false, |
| | | disabled: true, |
| | | column: [ |
| | | { |
| | | label: "姓名", |
| | |
| | | setIntervals: function () { |
| | | let that = this; |
| | | this.intTime = setInterval(function () { |
| | | if (!that.isHaveCardid) { |
| | | if (!that.haveCardid) { |
| | | //定时读卡 |
| | | let result = CertCtl.readCert(); |
| | | if (result == "") { |
| | |
| | | //resultFlag为0代表读卡成功 |
| | | if (resultObj.resultFlag == "0") { |
| | | //回显相关数据 |
| | | console.log(resultObj, 123); |
| | | // console.log(resultObj, 123); |
| | | const data = resultObj.resultContent; |
| | | //赋值数据 |
| | | that.obj = { |
| | |
| | | id: data.certNumber, |
| | | qfjg: data.certOrg, |
| | | }; |
| | | that.isHaveCardid = true; |
| | | that.$store.commit("setCardInfor", that.obj); |
| | | that.$store.commit("setCardidState", true); |
| | | } else if (resultObj.resultFlag == "-1") { |
| | | if (resultObj.errorMsg == "端口打开失败") { |
| | | console.log("读卡器未连接"); |
| | | } else { |
| | | console.log(resultObj.errorMsg); |
| | | // console.log(resultObj.errorMsg); |
| | | //无卡片提醒 |
| | | } |
| | | } else if (resultObj.resultFlag == "-2") { |
| | | console.log(resultObj.errorMsg); |
| | |
| | | }, 1000); |
| | | }, |
| | | emptytChange() { |
| | | this.isHaveCardid = false; |
| | | this.$message.success("清空方法回调"); |
| | | this.$store.commit("setCardidState", false); |
| | | let zhiwen = { |
| | | featuredatas: "", |
| | | imgBMP: "", |
| | | url: "", |
| | | isoks: false, |
| | | clear: true, |
| | | }; |
| | | this.useZhiWen("setZhiwenData", zhiwen); |
| | | this.$message.success("清空身份证数据"); |
| | | }, |
| | | // useZhiWen: function (fn, vals) { |
| | | // //读取指纹实例 |
| | | // let val = vals || ""; |
| | | // var winzhiwen = document.getElementById("zhiwen").contentWindow; |
| | | // return winzhiwen[fn](val); |
| | | // }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .zhiwenMain { |
| | | width: 222px; |
| | | height: 196px; |
| | | width: 255px; |
| | | height: 205px; |
| | | // border: 1px solid rgba($color: #d3d3d3, $alpha: 1); |
| | | } |
| | | .imgss { |