| | |
| | | </basic-container> |
| | | </el-col> |
| | | <div |
| | | v-show="haveSEL == 'noDrive'" |
| | | :class="[ |
| | | $store.state.control.windowWidth >= 1024 |
| | | ? 'downSFZqudong' |
| | | : 'downSFZqudongS', |
| | | ]" |
| | | > |
| | | <a |
| | | href="http://223.82.109.183:2081/zhba/upload/20211201/64d8b76f3aecae93e18d015bbca89aba.rar" |
| | | >未安装身份证驱动,点击下载</a |
| | | <el-checkbox v-model="radio" :disabled="SFZloding" |
| | | >使用身份证设备</el-checkbox |
| | | > |
| | | <el-button |
| | | type="text" |
| | | v-show="haveSEL == 'noDrive' || haveSEL == 'noEquipment'" |
| | | @click="SFZopens" |
| | | :loading="SFZloding" |
| | | >{{ sfzButTitle }}</el-button |
| | | > |
| | | <!-- <div style="font-size: 14px">连接身份证设备失败</div> --> |
| | | <!-- v-show="haveSEL == 'noDrive'" --> |
| | | <!-- href="http://223.82.109.183:2081/zhba/upload/20211201/64d8b76f3aecae93e18d015bbca89aba.rar" --> |
| | | <!-- <a href="javascript;">未安装身份证驱动,点击下载</a> --> |
| | | </div> |
| | | </el-row> |
| | | </template> |
| | |
| | | // 表格数据 |
| | | defaults: {}, |
| | | // 身份证设备数据 |
| | | SFZloding: false, |
| | | sfzButTitle: "", |
| | | radio: false, //选择状态 |
| | | haveSEL: "", //设备状态 |
| | | cardShebei: "", |
| | | intTime: "", //自动获取身份证; |
| | | haveCardid: true, //读卡开关 |
| | | haveCardid: false, //读卡开关 |
| | | // 指纹数据 |
| | | isopen: false, //识别是否需要传指纹进去(解决异步传递后指纹DOM不存在的问题) |
| | | zhiwenImg: "", |
| | |
| | | }; |
| | | }, |
| | | watch: { |
| | | radio() { |
| | | if (this.radio) { |
| | | this.SFZloding = true; |
| | | this.olondSFZ(); |
| | | } else { |
| | | if (this.haveSEL != "noDrive" && this.haveSEL != "noEquipment") { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "关闭身份证设备识别!", |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | "form.tenantId"() { |
| | | if (this.form.tenantId !== "" && this.initFlag) { |
| | | this.initData(this.form.tenantId); |
| | |
| | | this.deptIds = this.userInfo.dept_id; |
| | | |
| | | // this.beginzhiwen(); |
| | | this.olondSFZ(); //检查身份证设备是否存在 |
| | | // this.olondSFZ(); //检查身份证设备是否存在 |
| | | }, |
| | | methods: { |
| | | openccc() { |
| | |
| | | } |
| | | } |
| | | }, |
| | | SFZopens() { |
| | | if (this.haveSEL == "noDrive") { |
| | | let url = |
| | | "http://223.82.109.183:2081/zhba/upload/20211201/64d8b76f3aecae93e18d015bbca89aba.rar"; |
| | | window.open(url, "_self"); |
| | | } else if (this.haveSEL == "noEquipment") { |
| | | this.radio = true; |
| | | } |
| | | }, |
| | | olondSFZ() { |
| | | // console.log(123456); |
| | | var that = this; |
| | | // // 开始连接设备 |
| | | // //调用对应的连接方法,并赋值给result |
| | | let lodings = (val) => { |
| | | setTimeout((res) => { |
| | | that.SFZloding = val; |
| | | }, 1000); |
| | | }; |
| | | this.cardShebei = CertCtl.connect((res) => { |
| | | let k = ""; |
| | | try { |
| | |
| | | } catch (error) { |
| | | k = res; |
| | | } |
| | | // console.log(k); |
| | | // console.log(res); |
| | | if (k == "") { |
| | | that.haveSEL = "noDrive"; |
| | | console.log("连接身份证设备失败,请安装驱动"); |
| | | // console.log("连接身份证设备失败,请安装驱动"); |
| | | that.sfzButTitle = "未安装身份证驱动,点击下载"; |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "连接身份证设备失败,请重新连接设备!", |
| | | }); |
| | | that.radio = false; |
| | | lodings(false); |
| | | return; |
| | | } |
| | | if (k.resultFlag == 0) { |
| | | that.haveSEL = "connectionSucceeded"; |
| | | console.log("连接身份证设备成功"); |
| | | // console.log("连接身份证设备成功"); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "连接身份证设备成功!", |
| | | }); |
| | | lodings(false); |
| | | } else { |
| | | that.haveSEL = "noEquipment"; |
| | | console.log("连接身份证设备失败,请重新连接设备"); |
| | | that.sfzButTitle = "连接身份证设备失败,请重试"; |
| | | // console.log("连接身份证设备失败,请重新连接设备!"); |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "连接身份证设备失败,请重新连接设备!", |
| | | }); |
| | | that.radio = false; |
| | | lodings(false); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }, 2000); |
| | | }, |
| | | beginSFZ() { |
| | | if (this.haveSEL == "connectionSucceeded") { |
| | | if (this.haveSEL == "connectionSucceeded" && this.radio) { |
| | | this.haveCardid = false; |
| | | if (this.intTime) { |
| | | clearInterval(this.intTime); |
| | |
| | | } else { |
| | | this.setIntervals(); |
| | | } |
| | | } else { |
| | | clearInterval(this.intTime); |
| | | } |
| | | }, |
| | | closeSFZ(val) { |