diff --git a/src/views/modules/epidemic/persontesting.vue b/src/views/modules/epidemic/persontesting.vue
index e380432..4583452 100644
--- a/src/views/modules/epidemic/persontesting.vue
+++ b/src/views/modules/epidemic/persontesting.vue
@@ -59,7 +59,7 @@
-
+
@@ -83,7 +83,7 @@
-
+
diff --git a/src/views/modules/epidemic/reader.vue b/src/views/modules/epidemic/reader.vue
index 5cccffe..4067e81 100644
--- a/src/views/modules/epidemic/reader.vue
+++ b/src/views/modules/epidemic/reader.vue
@@ -1,5 +1,5 @@
-
+
连接
@@ -54,7 +54,7 @@
-->
- {{ $t('cancel') }}
+ {{ $t('cancel') }}
{{ $t('confirm') }}
@@ -86,7 +86,7 @@ export default {
// result: ''
},
imageSrc: '',
- connectStatus: false // 是否已经连接设备
+ connectStatus: false, // 是否已经连接设备
}
},
computed: {
@@ -124,11 +124,15 @@ export default {
this.btnAble = false
this.visible = true
this.connect()
- this.$refs['dataForm'].resetFields()
- this.imageSrc = ''
+ this.$nextTick(() => {
+ this.$refs['dataForm'].resetFields()
+ this.imageSrc = ''
+ })
},
handleClose () {
// this.disconnect()
+ this.visible = false
+ this.$emit('refreshDataList')
},
formatDate (str) {
return str.substring(0,4) + '-' + str.substring(4,6) + '-' + str.substring(6,8)
@@ -156,6 +160,9 @@ export default {
// message: res.errorMsg,
// type: 'success'
// })
+ if (!this.dataForm.idcard) {
+ this.getMobileById(res.certNumber)
+ }
this.dataForm.name = res.partyName
this.dataForm.sex = res.gender
this.dataForm.nation = res.nation,
@@ -165,8 +172,11 @@ export default {
this.dataForm.organ = res.certOrg
this.dataForm.imgCode = res.identityPic
this.imageSrc = 'data:image/png;base64,' + this.dataForm.imgCode
+ console.log('读卡成功', this.dataForm.idcard)
} else {
- this.$message.error(res.errorMsg)
+ // this.$message.error(res.errorMsg)
+ this.$refs['dataForm'].resetFields()
+ this.imageSrc = ''
}
}).catch(() => {
this.$message.error('读取失败')
@@ -200,6 +210,14 @@ export default {
this.$message.error('断开失败')
})
},
+ getMobileById (idcard) {
+ this.$http.get(`/custom/persontesting/getMobileByIdCard?idcard=${idcard}`).then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg)
+ }
+ this.dataForm.mobile = res.data || ''
+ }).catch(() => {})
+ },
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
@@ -218,7 +236,7 @@ export default {
duration: 500,
onClose: () => {
// this.visible = false
- // this.$emit('refreshDataList')
+ this.$emit('refreshDataList')
this.$refs['dataForm'].resetFields()
this.imageSrc = ''
}