Commit a9f76729 authored by 任鸿志's avatar 任鸿志

feat(Readcards): 优化实体卡号输入逻辑

- 增加对 11 位和 21 位卡号的处理
- 修改 18 位卡号的处理逻辑,明确为身份证
- 调整 64 位以上卡号的处理条件
parent 1086f385
...@@ -108,7 +108,18 @@ export default { ...@@ -108,7 +108,18 @@ export default {
}, },
// 输入框回车事件 // 输入框回车事件
handleEnterModal() { handleEnterModal() {
if(this.form.physicalCard.toString().length === 11){
this.form.physicalCard= this.form.physicalCard.substring(3)
this.form.physicalCardType = 'PATIENT_ID'
this.$emit('getyibaoinfo', this.form)
}
if(this.form.physicalCard.toString().length === 21){
this.form.physicalCard= this.form.physicalCard.substring(3)
this.form.physicalCardType = 'ID_CARD'
this.$emit('getyibaoinfo', this.form)
}
if (this.form.physicalCard.toString().length === 28) { if (this.form.physicalCard.toString().length === 28) {
this.loadingapplyList=true this.loadingapplyList=true
// 电子医保码 // 电子医保码
...@@ -127,13 +138,13 @@ export default { ...@@ -127,13 +138,13 @@ export default {
// 输入患者id // 输入患者id
this.form.physicalCardType = 'PATIENT_ID' this.form.physicalCardType = 'PATIENT_ID'
this.$emit('getyibaoinfo', this.form) this.$emit('getyibaoinfo', this.form)
}else if (this.form.physicalCard.toString().length > 64) { }else if (this.form.physicalCard.toString().length >= 64) {
// 截取前64位获取电子健康卡编码 // 截取前64位获取电子健康卡编码
this.form.physicalCard = this.form.physicalCard.toString().substring(0, 64) this.form.physicalCard = this.form.physicalCard.toString().substring(0, 64)
this.form.physicalCardType = 'ELECTRONIC_HEALTH_CARD' this.form.physicalCardType = 'ELECTRONIC_HEALTH_CARD'
this.$emit('getyibaoinfo', this.form) this.$emit('getyibaoinfo', this.form)
} else if (this.form.physicalCard.toString().length === 18) { } else if (this.form.physicalCard.toString().length === 18) {
// 就诊卡 // 身份证
this.form.physicalCardType = 'ID_CARD' this.form.physicalCardType = 'ID_CARD'
this.$emit('getyibaoinfo', this.form) this.$emit('getyibaoinfo', this.form)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment