diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index 15bf157..d4205ea 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -208,10 +208,10 @@ - - - + + + @@ -568,12 +568,12 @@ class="el-table__body-wrapper tbody" highlight-current-row @row-click="rowick" @row-dblclick="patientDblclick" ref="patientList"> - - + + - {{ scope.row.customerOrgName == scope.row.departmentName ? '':scope.row.departmentName }} + {{ scope.row.customerOrgName == scope.row.departmentName ? '' : scope.row.departmentName }} @@ -584,8 +584,8 @@ - - + + @@ -614,9 +614,9 @@ - - - + + + 取消 @@ -1071,7 +1071,7 @@ export default { hc_warn_mode: '1', //0-仅提醒;1-提醒并决择;2-有互斥项目时不允许保存 - dictSalesman:[] // + dictSalesman: [] // }; }, @@ -1321,9 +1321,9 @@ export default { }) // 业务员 {operatorTypes:["1","3"]} - postapi('/api/identity/users/GetListByOperatorType',{operatorTypes:["0","1","2","3","4"]}) + postapi('/api/identity/users/GetListByOperatorType', { operatorTypes: ["0", "1", "2", "3", "4"] }) .then(res => { - if (res.code > -1) { + if (res.code > -1) { this.dictSalesman = res.data } }) @@ -1694,6 +1694,31 @@ export default { }) }, + // 新增/编辑读身份证的区分处理 + readCardAfter(idNos) { + return new Promise((resolve, reject) => { + if (this.form.id) { + resolve() + } else { + if ((this.form.patientName && this.form.patientName != idNos.Name) || (this.form.idNo && this.form.idNo != idNos.IDCode)) { + this.$confirm("当前人员姓名和身份证号与读取身份证信息不一致, 是否以读取到身份证的信息更新当前人员?", "提示", { + confirmButtonText: "是", + cancelButtonText: " 否 ", + type: "warning", + }) + .then(() => { + resolve() + }) + .catch(err => { + reject(err) + }) + } else { + resolve() + } + } + }) + }, + //读取身份证信息 peopleIcCard() { if (!this.$peisAPI) { @@ -1705,17 +1730,23 @@ export default { let lres = JSON.parse(res) 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 - this.form.sexId = idNos.sexId - this.form.age = idNos.age - this.form.nationId = idNos.nationId - this.form.idNo = idNos.IDCode - this.form.address = idNos.Address - this.peoplePhoto = 'data:image/bmp;base64,' + idNos.Photo - // this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo - // isNameContinue 身份证号查重后是否姓名查重 - this.changeIdNo('N') // 触发身份证查询档案号(Y:身份证没查到,再按名字查,N:仅按身份证号查) + + // 如果是编辑状态,则加身份证与之前登记的人员信息相等提示 + this.readCardAfter(idNos) + .then(() => { + this.form.patientName = idNos.Name + this.form.birthDate = idNos.birthDate + this.form.sexId = idNos.sexId + this.form.age = idNos.age + this.form.nationId = idNos.nationId + this.form.idNo = idNos.IDCode + this.form.address = idNos.Address + this.peoplePhoto = 'data:image/bmp;base64,' + idNos.Photo + // this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo + // isNameContinue 身份证号查重后是否姓名查重 + this.changeIdNo('N') // 触发身份证查询档案号(Y:身份证没查到,再按名字查,N:仅按身份证号查) + }) + } else { this.$message.error({ showClose: true, message: `${lres.message}` }) } @@ -2059,7 +2090,7 @@ export default { this.$message.warning({ showClose: true, message: fields[Object.keys(fields)[0]][0].message }); return false } - + // 手机号非必填时,如有填手机号,也要再验证手机号是否合法 if (this.form['mobileTelephone']) { if (!isValidMobileNumber(this.form['mobileTelephone'])) { diff --git a/src/components/patientRegister/PatientRegisterEditQuery.vue b/src/components/patientRegister/PatientRegisterEditQuery.vue index 8edee28..e8c2219 100644 --- a/src/components/patientRegister/PatientRegisterEditQuery.vue +++ b/src/components/patientRegister/PatientRegisterEditQuery.vue @@ -46,7 +46,7 @@ import { mapState, mapActions } from "vuex"; import { getapi, postapi, putapi, deletapi } from "@/api/api"; -import { getPagePriv,checkPagePriv, objCopy, setNull, dddw,checkIDCode, parseID, birthdayToAge,ageToBirthday, deepCopy, arrayFilter, arrayReduce,parsIcCardtoLocal, photoParse, savePeoplePhoto, arrayExistObj } from "../../utlis/proFunc"; +import { getPagePriv,checkPagePriv, objCopy, setNull, dddw,checkIDCode, parseID, birthdayToAge,ageToBirthday, deepCopy, arrayFilter, arrayReduce,parsIcCardtoLocal, photoParse, arrayExistObj } from "../../utlis/proFunc"; import PatientRegisterForChoose from "./PatientRegisterForChoose.vue"; export default { components: { diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 47995ba..337f8a3 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -1923,7 +1923,7 @@ export default { } // 2、扫身份证查询时,无照片自动更新照片(参数控制) - if (upPhotoParam != "N" && photo) { + if (upPhotoParam == "Y" && photo) { if (!e.photo) { savePeoplePhoto(e.id, photo); } diff --git a/src/components/patientRegister/PatientRegisterRecoverList.vue b/src/components/patientRegister/PatientRegisterRecoverList.vue index 394ab4a..b2b2109 100644 --- a/src/components/patientRegister/PatientRegisterRecoverList.vue +++ b/src/components/patientRegister/PatientRegisterRecoverList.vue @@ -544,7 +544,7 @@ export default { } // 2、扫身份证查询时,无照片自动更新照片(参数控制) - if (upPhotoParam != "N" && photo) { + if (upPhotoParam == "Y" && photo) { if (!e.photo) { savePeoplePhoto(e.id, photo); } diff --git a/src/components/patientRegister/patientRegisterQuery.vue b/src/components/patientRegister/patientRegisterQuery.vue index 048f738..a99a08f 100644 --- a/src/components/patientRegister/patientRegisterQuery.vue +++ b/src/components/patientRegister/patientRegisterQuery.vue @@ -289,6 +289,8 @@ export default { this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" }) return } + this.btnClear() + this.$peisAPI.peopleIcCard().then(res => { console.log('peopleIcCard', res) let lres = JSON.parse(res) diff --git a/src/components/patientRegister/patientRegisterRecoverListQuery.vue b/src/components/patientRegister/patientRegisterRecoverListQuery.vue index a7fd125..11e8feb 100644 --- a/src/components/patientRegister/patientRegisterRecoverListQuery.vue +++ b/src/components/patientRegister/patientRegisterRecoverListQuery.vue @@ -691,7 +691,7 @@ export default { } // 2、扫身份证查询时,无照片自动更新照片(参数控制) - if (upPhotoParam != "N" && photo) { + if (upPhotoParam == "Y" && photo) { if (!e.photo) { savePeoplePhoto(e.id, photo); } diff --git a/src/utlis/proApi.js b/src/utlis/proApi.js index 1f1748e..de117c2 100644 --- a/src/utlis/proApi.js +++ b/src/utlis/proApi.js @@ -1,20 +1,20 @@ -const {getapi, postapi, putapi, deletapi} = require('../api/api'); +const { getapi, postapi, putapi, deletapi } = require('../api/api'); // 这种方式一般不推荐使用,因为同步(阻塞)方式 响应页面响应 //获取登记人员 所登记的组合项目 -const getPrAsb = async (id) =>{ +const getPrAsb = async (id) => { let result = { code: -1, - message:'', - data:[] + message: '', + data: [] } - if(!id) return result - + if (!id) return result + try { let res = await getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`) - if(res.code != -1){ + if (res.code != -1) { // console.log(`getPrAsb:PatientRegisterId=${id}:data:`,res.data) result.code = 1 result.message = "success" @@ -41,16 +41,17 @@ async function savePeoplePhoto(peopleId, photoBase64) { photo: photoBase64.split(",")[1], }; - - try { - lres = await postapi(`/api/app/patient-register/up-load-img`, uploadPhoto) - let body = { - patientRegisterId: peopleId, - photo: lres.data, - } - await postapi(`/api/app/patient-register/update-photo`, body) - + postapi(`/api/app/patient-register/up-load-img`, uploadPhoto) + .then(res => { + if (res.code > -1) { + let body = { + patientRegisterId: peopleId, + photo: res.data, + } + postapi(`/api/app/patient-register/update-photo`, body) + } + }) } catch (error) { lres = { code: -1, msg: error } } @@ -76,7 +77,7 @@ function photoParse(photo) { module.exports = { - getPrAsb,savePeoplePhoto,photoParse + getPrAsb, savePeoplePhoto, photoParse }