|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<el-dialog :visible.sync="visible" title="核酸检测登记" :close-on-click-modal="false" :close-on-press-escape="false" top="10vh"> |
|
|
|
<el-dialog :visible.sync="visible" title="核酸检测登记" :close-on-click-modal="false" :close-on-press-escape="false" top="10vh" width="55%" :before-close="handleClose"> |
|
|
|
<el-form> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="connect" :hidden="connectStatus">连接</el-button> |
|
|
@ -54,7 +54,7 @@ |
|
|
|
</el-form-item> --> |
|
|
|
</el-form> |
|
|
|
<template slot="footer"> |
|
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|
|
|
<el-button @click="handleClose">{{ $t('cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="dataFormSubmitHandle()" :disabled="btnAble">{{ $t('confirm') }}</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
@ -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.$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 = '' |
|
|
|
} |
|
|
|