From a04be7f0ee30f4098b040758582b28a8ca45fcf3 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Thu, 9 May 2024 23:02:27 +0800 Subject: [PATCH] dj seo --- .../patientRegister/PatientRegisterEdit.vue | 47 ++++++++----------- .../patientRegister/PatientRegisterItem.vue | 2 +- .../patientRegister/PatientRegisterList.vue | 5 +- .../patientRegister/patientRegisterQuery.vue | 2 +- 4 files changed, 23 insertions(+), 33 deletions(-) diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index b0cbb12..5842ca4 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -64,7 +64,7 @@ - + @@ -411,7 +411,7 @@
-
@@ -962,6 +962,7 @@ export default { } this.preCustomerOrgId = this.patientRegister.query.customerOrgId if (!patientRegisterId) { //添加 + this.peoplePhoto = '' // 清掉照片 objCopy(this.formInit, this.form); this.form.registerCheckAsbitems = [] this.form.medicalCenterId = this.peisid; //体检中收 @@ -1127,7 +1128,7 @@ export default { 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 + // this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo this.changeIdNo() // 触发身份证查询档案号 } else { @@ -1250,6 +1251,7 @@ export default { if (!this.form.idNo) return this.Query(this.form.idNo) let ret = parseID(this.form.idNo) + // console.log('changeIdNo',ret) if (ret.age != -1) { this.form.birthDate = new Date(ret.birthday) this.form.age = ret.age @@ -1368,12 +1370,13 @@ export default { // 组装基本信息保存的参数体 madePrBody() { //赋值 + let body = deepCopy(this.form); // // console.log('this.form',this.form) - // // console.log('body',body) + // console.log('body',this.form,body) if (this.form.birthDate) { try { - body.birthDate = moment(body.birthDate).format("yyyy-MM-DD") + body.birthDate = moment(new Date(this.form.birthDate)).format("yyyy-MM-DD") } catch (error) { // this.form.birthDate != "Invalid date" body.birthDate = null @@ -1445,7 +1448,8 @@ export default { this.$message.warning({ showClose: true, message: "身份证号填写不合法!" }); return false } - let body = this.madePrBody() + let body = this.madePrBody() + // console.log('madePrBody',body) body.registerCheckAsbitems = deepCopy(this.dataTransOpts.tableM.register_check_asbitem) if (this.form.id) { @@ -1459,7 +1463,7 @@ export default { postapi(`/api/PatientRegister/CreatePatientRegister`, body) .then(res => { if (res.code > -1) { - objCopy(res.data, this.form) + objCopy(res.data, this.form) // 日期类型复制会有问题(记得要特殊处理) this.dataTransOpts.tableS.patient_register = deepCopy(res.data) @@ -1477,7 +1481,7 @@ export default { // this.refreshRegister(Object.assign({}, res.data)) //一般读身份证照片时,会出现这种情况 - if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo); + if (this.peoplePhoto && this.peoplePhoto.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.peoplePhoto); // 新增保存时,提示是否打条码 if (!body.id) { @@ -1521,7 +1525,7 @@ export default { return; } this.dataTransOpts.tableS.patient_register.id = '' - this.patientRegister.photo = '/pic/Photo.jpg' + this.peoplePhoto = '/pic/Photo.jpg' this.patientRegister.patientRegisterId = ''; this.form.id = ''; this.form.patientId = '00000000-0000-0000-0000-000000000000'; @@ -1595,7 +1599,7 @@ export default { photo: lres.data.Photo, }; this.peoplePhoto = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg' : lres.data.PhotoFormat};base64,${lres.data.Photo}` - this.patientRegister.photo = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg' : lres.data.PhotoFormat};base64,${lres.data.Photo}` + // this.patientRegister.photo = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg' : lres.data.PhotoFormat};base64,${lres.data.Photo}` return postapi(`/api/app/patient-register/up-load-img`, uploadPhoto) } else { this.$message.error({ showClose: true, message: "上传照片错误" + lres.code }) @@ -1967,24 +1971,7 @@ export default { this.dataTransOpts.refresh.patient_register.S++ // this.dataTransOpts.refresh.register_check_asbitem.D++ }, - - //触发人员信息保存(更新) - triggerHeadSave() { - //id不为空则编辑 api/patientregister/updatepatientregister - let body = this.madePrBody() - // // console.log(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body); - postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => { - if (res.code != -1) { - // console.log("操作成功"); - //一般读身份证照片时,会出现这种情况 - if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo); - objCopy(this.form, this.patientRegister.patientRegisterRd); - - this.refreshRegister(Object.assign({}, this.form)) - } - }); - - }, + // 新增保存基本信息产生新的ID,等明细保存后,再更新表单form.id refreshFormId() { @@ -2020,6 +2007,10 @@ export default { // 阻止回车键的默认行为(换行) event.preventDefault(); + // 如果是身份证,则计算出生与年龄 + let placeholder = input.getAttribute('placeholder') + if(placeholder == '身份证号') this.changeIdNo() + // 跳至下一个输入框 for (let j = i + 1; j < inputs.length; j++) { if (inputs[j].getAttribute('disabled') != "disabled") { diff --git a/src/components/patientRegister/PatientRegisterItem.vue b/src/components/patientRegister/PatientRegisterItem.vue index 1ff51ab..84280e4 100644 --- a/src/components/patientRegister/PatientRegisterItem.vue +++ b/src/components/patientRegister/PatientRegisterItem.vue @@ -179,7 +179,7 @@ import { getPagePriv, checkPagePriv, arrayFilter, arrayReduce, arrayExistObj, dd export default { - props: ["prForm", "prAsbOpraOpts", "triggerHeadSave", "refreshFormId"], + props: ["prForm", "prAsbOpraOpts", "refreshFormId"], data() { return { pagePriv: { diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index f2f7147..ca6cf77 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -64,8 +64,7 @@
{{ dddw(dict.nation, "id", scope.row[dropCol[index].prop], "displayName") }}
-
+
{{ scope.row[dropCol[index].prop] ? moment(scope.row[dropCol[index].prop]).format('yyyy-MM-DD') : '' }}
@@ -321,7 +320,7 @@ export default { { label: "介绍人", prop: "salesman", minWidth: 80, align: "center" }, { label: "是否VIP", prop: "isVip", minWidth: 80, align: "center" }, { label: "登记人", prop: "creatorName", minWidth: 80, align: "center" }, - { label: "登记日期", prop: "creationTime", minWidth: 80, align: "center" }, + { label: "登记日期", prop: "creationTime", minWidth: 130, align: "center" }, { label: "是否上传", prop: "isUpload", minWidth: 80, align: "center" }, { label: "高原/健康", prop: "qztlType", minWidth: 90, align: "center" }, { label: "行车", prop: "qztlIsMain", minWidth: 50, align: "center" }, diff --git a/src/components/patientRegister/patientRegisterQuery.vue b/src/components/patientRegister/patientRegisterQuery.vue index 82935cd..dc30228 100644 --- a/src/components/patientRegister/patientRegisterQuery.vue +++ b/src/components/patientRegister/patientRegisterQuery.vue @@ -216,7 +216,7 @@ export default { event.preventDefault(); // 如果按下的是回车查询 - console.log(input.getAttribute('placeholder'),input.value) + // console.log(input.getAttribute('placeholder'),input.value) let placeholder = input.getAttribute('placeholder') switch (placeholder) { case '条码号':