|
|
|
@ -64,7 +64,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="身份证号" prop="idNo"> |
|
|
|
<el-input v-model="form.idNo" @change="changeIdNo" size="small"></el-input> |
|
|
|
<el-input v-model="form.idNo" placeholder="身份证号" @change="changeIdNo" size="small"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
@ -411,7 +411,7 @@ |
|
|
|
</div> |
|
|
|
<!--人员登记组合项目明细 register_check_asbitem--> |
|
|
|
<div> |
|
|
|
<PatientRegisterItem :prForm="form" :prAsbOpraOpts="prAsbOpraOpts" :triggerHeadSave="triggerHeadSave" |
|
|
|
<PatientRegisterItem :prForm="form" :prAsbOpraOpts="prAsbOpraOpts" |
|
|
|
:refreshFormId="refreshFormId" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -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") { |
|
|
|
|