From fbff145d6dd903d389cd33c439bceb2670969fd8 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Sat, 27 Apr 2024 20:47:54 +0800 Subject: [PATCH] dj --- .../patientRegister/PatientRegisterEdit.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index ec3b960..2f2df4f 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -950,7 +950,7 @@ export default { this.$peisAPI.peopleIcCard().then(res => { console.log('peopleIcCard', res) let lres = JSON.parse(res) - if (lres.code >= 0) { + if (lres.code >= -1) { let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation) this.form.patientName = idNos.Name this.form.birthDate = idNos.birthDate @@ -963,6 +963,8 @@ export default { this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo this.changeIdNo() // 触发身份证查询档案号 + }else{ + this.$message.error({showClose:true,message:`${lres.message}`}) } }) }, @@ -1458,7 +1460,7 @@ export default { .then(res => { console.log('this.$peisAPI.photoGrah 原始返回结果', res) let lres = JSON.parse(res) - if (lres.code == 1) { + if (lres.code > -1) { let uploadPhoto = { patientRegisterId: this.form.id, photo: lres.data.Photo, @@ -1470,7 +1472,7 @@ export default { this.$message.error({ showClose: true, message: "上传照片错误" + lres.code}) } }).then(res => { - if (res.code == 1) { + if (res && res.code > -1) { let body = { patientRegisterId: this.form.id, photo: res.data, @@ -1479,13 +1481,14 @@ export default { return postapi(`/api/app/patient-register/update-photo`, body); } }).then(res => { - if (res.code != -1) { + if (res && res.code > -1) { //console.log('拍照',res.data) this.patientRegister.patientRegisterRd.photo = res.data.photo console.log("操作成功"); } }).catch(err => { console.log('this.$peisAPI.photoGrah', err) + this.$message.error({ showClose: true, message: `照片操作错误 ${err}`}) }) },