From 8fb8d8bcbd7685a51b709deb40740f45ce257347 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Thu, 6 Jul 2023 17:07:58 +0800 Subject: [PATCH] choosegroup --- src/components/customerOrg/ContactPerson.vue | 20 +- .../patientRegister/PatientRegisterItem.vue | 209 +++++++----------- 2 files changed, 81 insertions(+), 148 deletions(-) diff --git a/src/components/customerOrg/ContactPerson.vue b/src/components/customerOrg/ContactPerson.vue index ba63e05..a6e3750 100644 --- a/src/components/customerOrg/ContactPerson.vue +++ b/src/components/customerOrg/ContactPerson.vue @@ -150,28 +150,14 @@ > diff --git a/src/components/patientRegister/PatientRegisterItem.vue b/src/components/patientRegister/PatientRegisterItem.vue index 07a4031..c71b950 100644 --- a/src/components/patientRegister/PatientRegisterItem.vue +++ b/src/components/patientRegister/PatientRegisterItem.vue @@ -2,69 +2,59 @@
项目类别 - +
- + - +
- 添加 + 添加
- 移除 + 移除
- 保存 + 保存
- + - - - - - + + + + + + + + + +
@@ -78,25 +68,26 @@ export default { data() { return { itemType: [], //项目类别 - + itemTypeIds:'', //被选中的项目类别ID asbItemChoosed: [], //勾选的 未选组合项目 //patientRegisterAbs:[], //体检人员所选组合项目 放vuex patientRegisterAbsChoosed: [], //勾选的 体检人员所选组合项目 - patientRegisterAbsNew: [], //体检人员 待新增的组合项目 + patientRegisterAbsAdd: [], //体检人员 待新增的组合项目 patientRegisterAbsEdit: [], //体检人员 待编辑的组合项目 patientRegisterAbsDel: [], //体检人员 待删除的组合项目 patientRegisterAbsRd: { - id: null, + id: null, //更新不需传 asbitemId: null, // string($uuid) 组合项目 + asbitemName:'', //组合项目名称,更新不需传 patientRegisterId: null, //string($uuid) 登记流水号 standardPrice: 0, //number($double) 标准价格 chargePrice: 0, // number($double) 实收价格 payTypeFlag: "0000", // string 支付方式,比如是自费、免费、单位支付 isCharge: "N", // string 是否已收费 - lisRequestId: null, // string($uuid)LIS申请ID + //lisRequestId: null, // string($uuid)LIS申请ID amount: 1, // integer($int32) 数量 groupPackageId: null, // string($uuid) 分组或者套餐ID }, //单个添加的组合项目 @@ -106,18 +97,18 @@ export default { ...mapState(["dict", "customerOrg", "patientRegister", "personnelUnit"]), }, - mounted() {}, + mounted() { }, methods: { //...mapActions(['getMedicalPackageAsb','getMedicalPackageAsb']), //保存按钮 - Onsubmit() {}, + Onsubmit() { }, //移除按钮 - addselecteditems() {}, + addselecteditems() { }, //右侧勾选按钮 - selecteditems(val) {}, + selecteditems(val) { }, // 添加按钮 - removedata() {}, + removedata() { }, // 左侧未选 handleSelectionChange(val) { @@ -127,12 +118,12 @@ export default { }, //项目类别过滤 组合项目 - getAsbItemByItemType(v) { + getAsbItemByItemType() { //console.log('getAsbItemByItemType',typeof v) let lv = ""; - if (typeof v === "object") { - lv = v[v.length - 1]; - } + if (typeof this.itemTypeIds === "object") { + lv = this.itemTypeIds[itemTypeIds.length - 1]; + } if (lv) { this.dict.asbItem = arrayFilter(this.dict.asbItemAll, "itemTypeId", lv); @@ -141,11 +132,7 @@ export default { } //刷新显示 未选组合项目 - arrayReduce( - this.dict.asbItem, - [...this.patientRegister.patientRegisterAbs], - "id=asbitemId" - ); + arrayReduce(this.dict.asbItem,[...this.patientRegister.patientRegisterAbs],"id=asbitemId"); }, //体检登记的组合项目创建 @@ -163,7 +150,7 @@ export default { }, //选中分组所包含的组合项目 - getCustomerOrgGroupAsb(customerOrgGroupId) { + getCustomerOrgGroupAsb(customerOrgGroupId,oldVal) { console.log("getCustomerOrgGroupAsb"); getapi( `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${customerOrgGroupId}` @@ -176,20 +163,16 @@ export default { this.addCustomerOrgGroupAsb(customerOrgGroupId); //移除旧分组或套餐的组合项目 - this.removeGroupPackageAsb(customerOrgGroupId); + this.removeGroupPackageAsb(oldVal); //刷新显示 未选组合项目 - arrayReduce( - this.dict.asbItem, - [...this.patientRegister.patientRegisterAbs], - "id=asbitemId" - ); + this.getAsbItemByItemType() } }); }, //选中套餐所包含的组合项目 - getMedicalPackageAsb(medicalPackageId) { + getMedicalPackageAsb(medicalPackageId,oldVal) { console.log( `/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=${medicalPackageId}` ); @@ -204,44 +187,32 @@ export default { this.addMedicalPackageAsb(medicalPackageId); //移除旧分组或套餐的组合项目 - this.removeGroupPackageAsb(medicalPackageId); + this.removeGroupPackageAsb(oldVal); //刷新显示 未选组合项目 - arrayReduce( - this.dict.asbItem, - [...this.patientRegister.patientRegisterAbs], - "id=asbitemId" - ); + this.getAsbItemByItemType() } }); }, //添加新分组的组合项目 addCustomerOrgGroupAsb(groupPackageId) { + console.log('addCustomerOrgGroupAsb') let finded = false; - for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.lenth; i++) { + for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) { finded = false; - for ( - let j = 0; - j < this.patientRegister.patientRegisterAbs.lenth; - j++ - ) { - if ( - this.patientRegister.customerOrgGroupAsb[i].asbitemId == - this.patientRegister.patientRegisterAbs[j].asbitemId - ) { - this.patientRegister.patientRegisterAbs[j].groupPackageId = - groupPackageId; - this.patientRegisterAbsEdit.push({ - ...this.patientRegister.patientRegisterAbs[j], - }); - finded = true; - break; + console.log('i',i,finded) + for (let j = 0; j < this.patientRegister.patientRegisterAbs.length; j++) { + if (this.patientRegister.customerOrgGroupAsb[i].asbitemId == this.patientRegister.patientRegisterAbs[j].asbitemId) { + this.patientRegister.patientRegisterAbs[j].groupPackageId = groupPackageId + this.patientRegisterAbsEdit.push({ ...this.patientRegister.patientRegisterAbs[j], }) + finded = true } } if (!finded) { let asbItem = { - asbitemId: this.patientRegister.customerOrgGroupAsb[i].asbitemId, // string($uuid) 组合项目 + asbitemId: this.patientRegister.customerOrgGroupAsb[i].id, // string($uuid) 组合项目 + asbitemName: this.patientRegister.customerOrgGroupAsb[i].displayName, // string($uuid) 组合项目 patientRegisterId: this.patientRegisterForm.id, //string($uuid) 登记流水号 standardPrice: this.patientRegister.customerOrgGroupAsb[i].price, //number($double) 标准价格 chargePrice: this.patientRegister.customerOrgGroupAsb[i].price, // number($double) 实收价格 @@ -251,7 +222,8 @@ export default { amount: 1, // integer($int32) 数量 groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID }; - this.patientRegister.customerOrgGroupAsb.push(); + console.log('i',i,asbItem) + this.patientRegister.patientRegisterAbs.push(asbItem); this.patientRegisterAbsAdd.push(asbItem); } } @@ -260,29 +232,19 @@ export default { //添加新套餐的组合项目 addMedicalPackageAsb(groupPackageId) { let finded = false; - for (let i = 0; i < this.patientRegister.medicalPackageAsb.lenth; i++) { + for (let i = 0; i < this.patientRegister.medicalPackageAsb.length; i++) { finded = false; - for ( - let j = 0; - j < this.patientRegister.patientRegisterAbs.lenth; - j++ - ) { - if ( - this.patientRegister.medicalPackageAsb[i].asbitemId == - this.patientRegister.patientRegisterAbs[j].asbitemId - ) { - this.patientRegister.patientRegisterAbs[j].groupPackageId = - groupPackageId; - this.patientRegisterAbsEdit.push({ - ...this.patientRegister.patientRegisterAbs[j], - }); - finded = true; - break; + for (let j = 0; j < this.patientRegister.patientRegisterAbs.length; j++) { + if (this.patientRegister.medicalPackageAsb[i].asbitemId == this.patientRegister.patientRegisterAbs[j].asbitemId) { + this.patientRegister.patientRegisterAbs[j].groupPackageId = groupPackageId + this.patientRegisterAbsEdit.push({...this.patientRegister.patientRegisterAbs[j],}) + finded = true } } if (!finded) { let asbItem = { - asbitemId: this.patientRegister.medicalPackageAsb[i].asbitemId, // string($uuid) 组合项目 + asbitemId: this.patientRegister.medicalPackageAsb[i].id, // string($uuid) 组合项目 + asbitemName: this.patientRegister.medicalPackageAsb[i].displayName, // string($uuid) 组合项目 patientRegisterId: this.patientRegisterForm.id, //string($uuid) 登记流水号 standardPrice: this.patientRegister.medicalPackageAsb[i].price, //number($double) 标准价格 chargePrice: this.patientRegister.medicalPackageAsb[i].price, // number($double) 实收价格 @@ -292,7 +254,7 @@ export default { amount: 1, // integer($int32) 数量 groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID }; - this.patientRegister.customerOrgGroupAsb.push(asbItem); + this.patientRegister.patientRegisterAbs.push(asbItem); this.patientRegisterAbsAdd.push(asbItem); } } @@ -300,14 +262,9 @@ export default { //移除旧分组或套餐的组合项目 removeGroupPackageAsb(groupPackageId) { - for (let i = 0; i < this.patientRegister.patientRegisterAbs.lenth; i++) { - if ( - this.patientRegister.patientRegisterAbs[i].groupPackageId == - groupPackageId - ) { - this.patientRegisterAbsDel.push({ - id: this.patientRegister.patientRegisterAbs[i].id, - }); + for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { + if (this.patientRegister.patientRegisterAbs[i].groupPackageId == groupPackageId) { + this.patientRegisterAbsDel.push({id: this.patientRegister.patientRegisterAbs[i].id,}); this.patientRegister.patientRegisterAbs.splice(i, 1); i--; } @@ -319,27 +276,17 @@ export default { watch: { //分组改变,查出当前分组下对应的组合项目 "patientRegisterForm.customerOrgGroupId"(newVal, oldVal) { - console.log( - "watch patientRegisterForm.customerOrgGroupId newVal:", - newVal, - " oldVal:", - oldVal - ); + console.log("watch patientRegisterForm.customerOrgGroupId newVal:",newVal," oldVal:",oldVal); if (newVal != oldVal) { - this.getCustomerOrgGroupAsb(newVal); + this.getCustomerOrgGroupAsb(newVal,oldVal); } }, //套餐改变,查出当前套餐下对应的组合项目 "patientRegisterForm.medicalPackageId"(newVal, oldVal) { - console.log( - "watch patientRegisterForm.medicalPackageId newVal:", - newVal, - " oldVal:", - oldVal - ); + console.log("watch patientRegisterForm.medicalPackageId newVal:",newVal," oldVal:",oldVal); if (newVal != oldVal) { - this.getMedicalPackageAsb(newVal); + this.getMedicalPackageAsb(newVal,oldVal); } }, },