diff --git a/src/main.js b/src/main.js index d8a2486..6eb8d51 100644 --- a/src/main.js +++ b/src/main.js @@ -66,7 +66,7 @@ Vue.use(VCharts) // 配置是否启用考勤功能 -export const attendanceEnable = true +export const attendanceEnable = false new Vue({ el: '#app', diff --git a/src/main.js b/src/main.js index d8a2486..6eb8d51 100644 --- a/src/main.js +++ b/src/main.js @@ -66,7 +66,7 @@ Vue.use(VCharts) // 配置是否启用考勤功能 -export const attendanceEnable = true +export const attendanceEnable = false new Vue({ el: '#app', diff --git a/src/views/dashboard/components/passSevenDay.vue b/src/views/dashboard/components/passSevenDay.vue index 79ecef6..14dae01 100644 --- a/src/views/dashboard/components/passSevenDay.vue +++ b/src/views/dashboard/components/passSevenDay.vue @@ -12,7 +12,7 @@ } this.chartSettings = { labelMap: { - 'total': '测温人数' + 'total': '通行人数' }, metrics: ['total'], dimension: ['date'] diff --git a/src/main.js b/src/main.js index d8a2486..6eb8d51 100644 --- a/src/main.js +++ b/src/main.js @@ -66,7 +66,7 @@ Vue.use(VCharts) // 配置是否启用考勤功能 -export const attendanceEnable = true +export const attendanceEnable = false new Vue({ el: '#app', diff --git a/src/views/dashboard/components/passSevenDay.vue b/src/views/dashboard/components/passSevenDay.vue index 79ecef6..14dae01 100644 --- a/src/views/dashboard/components/passSevenDay.vue +++ b/src/views/dashboard/components/passSevenDay.vue @@ -12,7 +12,7 @@ } this.chartSettings = { labelMap: { - 'total': '测温人数' + 'total': '通行人数' }, metrics: ['total'], dimension: ['date'] diff --git a/src/views/memberManage/addPerson.vue b/src/views/memberManage/addPerson.vue index 3b47da6..07cd00e 100644 --- a/src/views/memberManage/addPerson.vue +++ b/src/views/memberManage/addPerson.vue @@ -437,31 +437,76 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { this.personForm = { diff --git a/src/main.js b/src/main.js index d8a2486..6eb8d51 100644 --- a/src/main.js +++ b/src/main.js @@ -66,7 +66,7 @@ Vue.use(VCharts) // 配置是否启用考勤功能 -export const attendanceEnable = true +export const attendanceEnable = false new Vue({ el: '#app', diff --git a/src/views/dashboard/components/passSevenDay.vue b/src/views/dashboard/components/passSevenDay.vue index 79ecef6..14dae01 100644 --- a/src/views/dashboard/components/passSevenDay.vue +++ b/src/views/dashboard/components/passSevenDay.vue @@ -12,7 +12,7 @@ } this.chartSettings = { labelMap: { - 'total': '测温人数' + 'total': '通行人数' }, metrics: ['total'], dimension: ['date'] diff --git a/src/views/memberManage/addPerson.vue b/src/views/memberManage/addPerson.vue index 3b47da6..07cd00e 100644 --- a/src/views/memberManage/addPerson.vue +++ b/src/views/memberManage/addPerson.vue @@ -437,31 +437,76 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { this.personForm = { diff --git a/src/views/memberManage/addPersonIris.vue b/src/views/memberManage/addPersonIris.vue index 0a7fa9c..b669b3a 100644 --- a/src/views/memberManage/addPersonIris.vue +++ b/src/views/memberManage/addPersonIris.vue @@ -477,31 +477,77 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + debugger + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { const id = this.personForm.id @@ -634,6 +680,8 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.showSaveButton = true + this.canSave = true this.personForm.id = '' this.resetForm() this.isSave = false diff --git a/src/main.js b/src/main.js index d8a2486..6eb8d51 100644 --- a/src/main.js +++ b/src/main.js @@ -66,7 +66,7 @@ Vue.use(VCharts) // 配置是否启用考勤功能 -export const attendanceEnable = true +export const attendanceEnable = false new Vue({ el: '#app', diff --git a/src/views/dashboard/components/passSevenDay.vue b/src/views/dashboard/components/passSevenDay.vue index 79ecef6..14dae01 100644 --- a/src/views/dashboard/components/passSevenDay.vue +++ b/src/views/dashboard/components/passSevenDay.vue @@ -12,7 +12,7 @@ } this.chartSettings = { labelMap: { - 'total': '测温人数' + 'total': '通行人数' }, metrics: ['total'], dimension: ['date'] diff --git a/src/views/memberManage/addPerson.vue b/src/views/memberManage/addPerson.vue index 3b47da6..07cd00e 100644 --- a/src/views/memberManage/addPerson.vue +++ b/src/views/memberManage/addPerson.vue @@ -437,31 +437,76 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { this.personForm = { diff --git a/src/views/memberManage/addPersonIris.vue b/src/views/memberManage/addPersonIris.vue index 0a7fa9c..b669b3a 100644 --- a/src/views/memberManage/addPersonIris.vue +++ b/src/views/memberManage/addPersonIris.vue @@ -477,31 +477,77 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + debugger + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { const id = this.personForm.id @@ -634,6 +680,8 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.showSaveButton = true + this.canSave = true this.personForm.id = '' this.resetForm() this.isSave = false diff --git a/src/views/memberManage/listStaff.vue b/src/views/memberManage/listStaff.vue index 0ce1c91..2d1de6c 100644 --- a/src/views/memberManage/listStaff.vue +++ b/src/views/memberManage/listStaff.vue @@ -263,7 +263,7 @@ }, initAnnualLeave() { this.$confirm( - '此操作不可撤销!仍然要将所有员工的剩余年假设置为初始值吗?', + '此操作不可撤销!仍要将所有员工的剩余年假设置为初始值吗?', '确认操作', { confirmButtonText: '确定', diff --git a/src/main.js b/src/main.js index d8a2486..6eb8d51 100644 --- a/src/main.js +++ b/src/main.js @@ -66,7 +66,7 @@ Vue.use(VCharts) // 配置是否启用考勤功能 -export const attendanceEnable = true +export const attendanceEnable = false new Vue({ el: '#app', diff --git a/src/views/dashboard/components/passSevenDay.vue b/src/views/dashboard/components/passSevenDay.vue index 79ecef6..14dae01 100644 --- a/src/views/dashboard/components/passSevenDay.vue +++ b/src/views/dashboard/components/passSevenDay.vue @@ -12,7 +12,7 @@ } this.chartSettings = { labelMap: { - 'total': '测温人数' + 'total': '通行人数' }, metrics: ['total'], dimension: ['date'] diff --git a/src/views/memberManage/addPerson.vue b/src/views/memberManage/addPerson.vue index 3b47da6..07cd00e 100644 --- a/src/views/memberManage/addPerson.vue +++ b/src/views/memberManage/addPerson.vue @@ -437,31 +437,76 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { this.personForm = { diff --git a/src/views/memberManage/addPersonIris.vue b/src/views/memberManage/addPersonIris.vue index 0a7fa9c..b669b3a 100644 --- a/src/views/memberManage/addPersonIris.vue +++ b/src/views/memberManage/addPersonIris.vue @@ -477,31 +477,77 @@ }) }, readIDCard() { - window.frames['iframeIDCard'].ReadCard() - if (window.frames['iframeIDCard'].result) { - this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo - this.personForm.name = window.frames['iframeIDCard'].Name - // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } - this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) - this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) - this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture - this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' - var nationName = window.frames['iframeIDCard'].Nation + '族' - for (var item of this.nationList) { - if (item.name === nationName) { - this.personForm.nation = item.value - break - } + var _this = this + this.ws = _this.$root.ws + if (this.ws === null) { + this.ws = new WebSocket(_this.$root.wsURL) + // 注册各类回调 + this.ws.onopen = function() { + _this.ws.send('ReadIdCard') } - this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt - this.personForm.ext.address = window.frames['iframeIDCard'].Address + this.ws.onclose = function() { + _this.$message.info('与ICS连接断开') + _this.$root.ws = null + } + this.ws.onerror = function() { + _this.$message.error('与ICS通信发生错误') + } + _this.$root.ws = this.ws } else { - this.$message.warning('读卡失败') + this.ws.send('ReadIdCard') } - // const baseUrl = getProject().register_url - // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo - // window.location.href = url + this.ws.onmessage = function(receiveMsg) { + var data = JSON.parse(receiveMsg.data) + if (data !== '') { + _this.personForm.idCardNo = data.IdCardNo + _this.personForm.name = data.Name + // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + _this.personForm.sex = parseInt(data.Sex) + var birth = data.Birthday + _this.personForm.birthday = birth.substring(0, 3) + '-' + birth.substring(4, 5) + '-' + birth.substring(6, 7) + _this.photo = data.Photo + _this.personForm.nation = data.Nation + var nationName = data.Nation + for (var item of _this.nationList) { + debugger + if (item.name === nationName) { + _this.personForm.nation = item.value + break + } + } + _this.personForm.ext.certificationUnit = data.Authority + _this.personForm.ext.address = data.Address + } else { + _this.$message.warning('读卡失败') + } + } }, + // readIDCard() { + // window.frames['iframeIDCard'].ReadCard() + // if (window.frames['iframeIDCard'].result) { + // this.personForm.idCardNo = window.frames['iframeIDCard'].CardNo + // this.personForm.name = window.frames['iframeIDCard'].Name + // // if (window.frames['iframeIDCard'].Sex === '2') { this.personForm.sex = '女' } else { this.personForm.sex = '男' } + // this.personForm.sex = parseInt(window.frames['iframeIDCard'].Sex) + // this.personForm.birthday = window.frames['iframeIDCard'].Born.substring(0, 4) + '-' + window.frames['iframeIDCard'].Born.substring(4, 6) + '-' + window.frames['iframeIDCard'].Born.substring(6, 8) + // this.photo = 'data:image/png;base64,' + window.frames['iframeIDCard'].Picture + // this.personForm.nation = window.frames['iframeIDCard'].Nation + '族' + // var nationName = window.frames['iframeIDCard'].Nation + '族' + // for (var item of this.nationList) { + // if (item.name === nationName) { + // this.personForm.nation = item.value + // break + // } + // } + // this.personForm.ext.certificationUnit = window.frames['iframeIDCard'].IssuedAt + // this.personForm.ext.address = window.frames['iframeIDCard'].Address + // } else { + // this.$message.warning('读卡失败') + // } + // // const baseUrl = getProject().register_url + // // // const url = 'openIE:' + baseUrl + '?token=' + token + '_id=' + id + '_idCardNo=' + idCardNo + // // window.location.href = url + // }, // 重置表单 resetForm() { const id = this.personForm.id @@ -634,6 +680,8 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.showSaveButton = true + this.canSave = true this.personForm.id = '' this.resetForm() this.isSave = false diff --git a/src/views/memberManage/listStaff.vue b/src/views/memberManage/listStaff.vue index 0ce1c91..2d1de6c 100644 --- a/src/views/memberManage/listStaff.vue +++ b/src/views/memberManage/listStaff.vue @@ -263,7 +263,7 @@ }, initAnnualLeave() { this.$confirm( - '此操作不可撤销!仍然要将所有员工的剩余年假设置为初始值吗?', + '此操作不可撤销!仍要将所有员工的剩余年假设置为初始值吗?', '确认操作', { confirmButtonText: '确定', diff --git a/static/IDCard/IDCardReader.htm b/static/IDCard/IDCardReader.htm index 67cb566..04b5107 100644 --- a/static/IDCard/IDCardReader.htm +++ b/static/IDCard/IDCardReader.htm @@ -40,7 +40,7 @@ var result = null; function ReadCard() { -debugger + debugger CVR_IDCard.ReadContentType = 1; var strReadResult=CVR_IDCard.ReadCard(); if (strReadResult == "0")