Browse Source

增加列表刷新;增加自动获取手机号;

origin/feature/monitoring
ZhaoTongYao 4 years ago
parent
commit
d018fd8392
  1. 4
      src/views/modules/epidemic/persontesting.vue
  2. 32
      src/views/modules/epidemic/reader.vue

4
src/views/modules/epidemic/persontesting.vue

@ -59,7 +59,7 @@
<el-table-column prop="testingTime" label="核酸检测时间" header-align="center" align="center"></el-table-column> <el-table-column prop="testingTime" label="核酸检测时间" header-align="center" align="center"></el-table-column>
<!-- <el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>--> <!-- <el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>--> <!-- <el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>-->
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column> <!-- <el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column> -->
<!-- <el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>--> <!-- <el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>--> <!-- <el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="delFlag" label="逻辑删除标识" header-align="center" align="center"></el-table-column>--> <!-- <el-table-column prop="delFlag" label="逻辑删除标识" header-align="center" align="center"></el-table-column>-->
@ -83,7 +83,7 @@
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<person-look v-if="lookVisible" ref="personLook" @refreshDataList="getDataList"></person-look> <person-look v-if="lookVisible" ref="personLook" @refreshDataList="getDataList"></person-look>
<reader ref="reader"></reader> <reader ref="reader" @refreshDataList="getDataList"></reader>
</div> </div>
</el-card> </el-card>
</template> </template>

32
src/views/modules/epidemic/reader.vue

@ -1,5 +1,5 @@
<template> <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>
<el-form-item> <el-form-item>
<el-button @click="connect" :hidden="connectStatus">连接</el-button> <el-button @click="connect" :hidden="connectStatus">连接</el-button>
@ -54,7 +54,7 @@
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<template slot="footer"> <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> <el-button type="primary" @click="dataFormSubmitHandle()" :disabled="btnAble">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
@ -86,7 +86,7 @@ export default {
// result: '' // result: ''
}, },
imageSrc: '', imageSrc: '',
connectStatus: false // connectStatus: false, //
} }
}, },
computed: { computed: {
@ -124,11 +124,15 @@ export default {
this.btnAble = false this.btnAble = false
this.visible = true this.visible = true
this.connect() this.connect()
this.$refs['dataForm'].resetFields() this.$nextTick(() => {
this.imageSrc = '' this.$refs['dataForm'].resetFields()
this.imageSrc = ''
})
}, },
handleClose () { handleClose () {
// this.disconnect() // this.disconnect()
this.visible = false
this.$emit('refreshDataList')
}, },
formatDate (str) { formatDate (str) {
return str.substring(0,4) + '-' + str.substring(4,6) + '-' + str.substring(6,8) return str.substring(0,4) + '-' + str.substring(4,6) + '-' + str.substring(6,8)
@ -156,6 +160,9 @@ export default {
// message: res.errorMsg, // message: res.errorMsg,
// type: 'success' // type: 'success'
// }) // })
if (!this.dataForm.idcard) {
this.getMobileById(res.certNumber)
}
this.dataForm.name = res.partyName this.dataForm.name = res.partyName
this.dataForm.sex = res.gender this.dataForm.sex = res.gender
this.dataForm.nation = res.nation, this.dataForm.nation = res.nation,
@ -165,8 +172,11 @@ export default {
this.dataForm.organ = res.certOrg this.dataForm.organ = res.certOrg
this.dataForm.imgCode = res.identityPic this.dataForm.imgCode = res.identityPic
this.imageSrc = 'data:image/png;base64,' + this.dataForm.imgCode this.imageSrc = 'data:image/png;base64,' + this.dataForm.imgCode
console.log('读卡成功', this.dataForm.idcard)
} else { } else {
this.$message.error(res.errorMsg) // this.$message.error(res.errorMsg)
this.$refs['dataForm'].resetFields()
this.imageSrc = ''
} }
}).catch(() => { }).catch(() => {
this.$message.error('读取失败') this.$message.error('读取失败')
@ -200,6 +210,14 @@ export default {
this.$message.error('断开失败') 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 () { dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
@ -218,7 +236,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
// this.visible = false // this.visible = false
// this.$emit('refreshDataList') this.$emit('refreshDataList')
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.imageSrc = '' this.imageSrc = ''
} }

Loading…
Cancel
Save