diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index 6936940..a60a808 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -1017,26 +1017,23 @@ export default { //选择单位 async changeCustomerOrgId(v) { console.log('changeCustomerOrgId', v, this.form.customerOrgParentId) - let customerOrgId = "" + let customerOrgId = "", customerOrgParentId = "" if (Array.isArray(v) && v.length > 0) { customerOrgId = v[v.length - 1] - this.form.customerOrgParentId = v[0] + customerOrgParentId = v[0] } else { customerOrgId = v // 后台顶级单位ID未获取正确(再获取一次) let pids = getTreePids(this.patientRegister.customerOrgTreeAll, "treeChildren", "parentId", "id", customerOrgId) if (Array.isArray(pids) && pids.length > 0) { if (pids.length == 1) { - this.form.customerOrgParentId = customerOrgId + customerOrgParentId = customerOrgId } else { - this.form.customerOrgParentId = pids[1] + customerOrgParentId = pids[1] } } } this.preCustomerOrgId = customerOrgId // let customerOrgParentId = await this.getParentCustomerOrgId(customerOrgId) - let customerOrgParentId = this.form.customerOrgParentId - - if (customerOrgParentId) { if (customerOrgParentId == this.dict.personOrgId) { @@ -1046,24 +1043,25 @@ export default { this.getCustomerOrgRegisterList(customerOrgParentId) } - // 需要触发 修改 分组/套餐 - this.form.customerOrgGroupId = null - this.form.medicalPackageId = null - // 清除套餐分组标识 - this.dataTransOpts.tableM.register_check_asbitem.forEach(e => { - e.isBelongGroupPackage = 'N' - }); + // 需要触发 修改 分组/套餐 顶级ID 没有变时,不改变套餐与分组 + if (customerOrgParentId != this.form.customerOrgParentId) { + this.form.customerOrgGroupId = null + this.form.medicalPackageId = null + // 清除套餐分组标识 + this.dataTransOpts.tableM.register_check_asbitem.forEach(e => { + e.isBelongGroupPackage = 'N' + }); - if (customerOrgParentId == this.dict.personOrgId) { - this.patientRegister.customerOrgGroup = [] - } + if (customerOrgParentId == this.dict.personOrgId) { + this.patientRegister.customerOrgGroup = [] + } - if (this.form.customerOrgParentId == this.dict.personOrgId) { - this.changeMedicalPackageId() - } else { - this.changeCustomerOrgGroupId() + if (this.form.customerOrgParentId == this.dict.personOrgId) { + this.changeMedicalPackageId() + } else { + this.changeCustomerOrgGroupId() + } } - } }, @@ -1492,12 +1490,12 @@ export default { this.guidePrint('0001', false) this.labelPrint(false) - }) + }) .catch((err) => { // if (err == "cancel") { // this.$message.info({ showClose: true, message: "已取消操作" }); // } - }); + }); } } }