diff --git a/src/components/customerOrg/customerOrgGroupAsbitem.vue b/src/components/customerOrg/customerOrgGroupAsbitem.vue index 1201115..a8adf60 100644 --- a/src/components/customerOrg/customerOrgGroupAsbitem.vue +++ b/src/components/customerOrg/customerOrgGroupAsbitem.vue @@ -106,7 +106,7 @@ - @@ -154,13 +154,13 @@ - 取消 确定 + 取消 -
@@ -216,20 +216,13 @@ : "" }} - - - - +
- 取消 确定 + 取消
@@ -272,7 +265,7 @@ export default { customerOrgId:'', // 当前选中企业ID customerOrgDisp:[], // 显示单位 customerOrgRegisterList:[], //当前体检次数集合 - customerOrgRegister:'', // 当前选择体检次数 + customerOrgRegister:{}, // 当前选择体检次数 dialogVisible: false, @@ -881,8 +874,6 @@ export default { } }, - - //双击选分组,并确认复制 async groupRowDblclick(row) { await this.groupRowClick(row) diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index 107d92a..4de826a 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -525,11 +525,12 @@ 收费申请
- @@ -672,6 +673,129 @@ :close-on-click-modal="false">
+ + + + + + + + + + + + + + + + + + + + + + + + 确定 + 取消 + + + + + +
+
+
+ 体检单位: + + + {{ item.displayName }} + + +
+
+ 单位体检次数: + + + +
+
+ + > + + + + + + + + + + + + + + +
+
+ + 确定 + 取消 + +
+
+
@@ -897,6 +1021,24 @@ export default { thirdInterfaceId: '', // 网上预约用到 queueParams: {}, // 分诊排队参数 + //**复制分组与套餐相关数据 + //控制 复制套餐与分组页面 显示 + medicalPackageVisble: false, + groupVisble: false, + + customerOrgGroups: [], + + //选中套餐与分组所包含的组合项目 + curPackageId: '', + curGroupId: '', + packageAsbitems: [], + groupAsbitems: [], + + customerOrgId: '', + customerOrgDisp: [], + customerOrgAll: [], + customerOrgRegisterList: [], //当前体检次数集合 + customerOrgRegister: {}, // 当前选择体检次数 }; }, @@ -1357,24 +1499,25 @@ export default { getParentCustomerOrgId(v) { return new Promise((resolve, reject) => { let customerOrgParentId = null - if (Array.isArray(v) && v.length > 1) { + if (Array.isArray(v) && v.length > 0) { customerOrgParentId = v[0] return resolve(customerOrgParentId) } else { - let customerOrgId = v - if (Array.isArray(v) && v.length == 1) customerOrgId = v[0] - if (!customerOrgId) return resolve(customerOrgParentId) - if (typeof customerOrgId == 'string') { - getapi(`/api/app/customer-org/parent/${customerOrgId}`) - .then(res => { - if (res.code > -1) customerOrgParentId = res.data - }) - .finally(() => { - return resolve(customerOrgParentId) - }) - } else if (customerOrgId.length > 0) { - customerOrgParentId = customerOrgId[0] + if (!v) { return resolve(customerOrgParentId) + } else { + if (v == this.dict.personOrgId) { + return resolve(v) // 等于个人体检时,则直接返回 + } else { + getapi(`/api/app/customer-org/parent/${v}`) + .then(res => { + if (res.code > -1) customerOrgParentId = res.data + }) + .finally(() => { + return resolve(customerOrgParentId) + }) + } + } } }) @@ -3026,6 +3169,279 @@ export default { this.dialogWin.Label = true }, + // 复制分组时,设置当前顶级单位及体检次数 + setCurParentOrgId() { + // 获取顶级单位 + console.log('setCurParentOrgId_this.form.customerOrgId',this.form.customerOrgId) + this.getParentCustomerOrgId(this.form.customerOrgId) + .then(res => { + if (res) { + if (res != this.dict.personOrgId) { + this.customerOrgId = res + // 获取体检次数 + getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${res}`) + .then(res => { + if (res.code > -1) { + this.customerOrgRegisterList = res.data + if (res.data.length > 0) { + this.customerOrgRegister = res.data[res.data.length - 1] + this.getCustomerOrgGroupCopy(this.customerOrgRegister.id) + } + } + }) + } + } + }) + }, + + + //复制分组 + btnCopyGroup() { + console.log('this.customerOrgGroup', this.customerOrgGroup) + + this.customerOrgRegisterList = []; + this.customerOrgRegister = {}; + this.customerOrgGroups = []; + // 首次打开 复制分组 页面时,需获取顶级单位信息 + if (this.customerOrgAll.length == 0) { + getapi("/api/app/customer-org/parent-all") + .then(res => { + if (res.code > -1) { + this.customerOrgAll = res.data + this.customerOrgDisp = res.data + this.groupVisble = true + // 复制分组时,设置当前顶级单位及体检次数 + this.setCurParentOrgId() + } + }) + } else { + // 复制分组时,设置当前顶级单位及体检次数 + this.setCurParentOrgId() + this.groupVisble = true + } + }, + + //选中分组 + async groupRowClick(row) { + this.curGroupId = row.id + this.groupAsbitems = [] + try { + let res = await getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${row.id}`) + if (res.code != -1) this.groupAsbitems = res.data + } catch (error) { + console.log(error) + } + }, + + //双击选分组,并确认复制 + async groupRowDblclick(row) { + await this.groupRowClick(row) + this.copyGroup() + }, + + //复制分组(确认选中分组) + copyGroup() { + if (!this.curGroupId) { + this.$message.warning({ showClose: true, message: "请先选择要复制的套餐!" }) + return + } + console.log('this.packageAsbitems', this.groupAsbitems) + this.addAbs(deepCopy(this.groupAsbitems)) + this.groupVisble = false + }, + + + + //复制套餐 + btnCopyMedicalPackage() { + this.medicalPackageVisble = true + }, + + //选中套餐 + async packageRowClick(row) { + this.curPackageId = row.id + this.packageAsbitems = [] + try { + let res = await postapi('/api/app/medicalpackagedetail/getmedicalpackageinasbitem', { medicalPackageId: row.id }) + this.packageAsbitems = res.data + } catch (error) { + console.log(error) + } + }, + + //双击选套餐,并确认复制 + async rowDblclick(row) { + await this.packageRowClick(row) + this.copyMedicalPackage() + }, + + //复制套餐(确认选中套餐) + copyMedicalPackage() { + if (!this.curPackageId) { + this.$message.warning({ showClose: true, message: "请先选择要复制的套餐!" }) + return + } + console.log('this.packageAsbitems', this.packageAsbitems) + this.addAbs(deepCopy(this.packageAsbitems)) + this.medicalPackageVisble = false + }, + + // 过滤体检单位 + filterMethodOrg(keyWords) { + if (keyWords) { + this.customerOrgDisp = []; + this.customerOrgAll.forEach((item) => { + if ( + item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 || + item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 + // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + ) { + this.customerOrgDisp.push(item); + } + }); + } else { + this.customerOrgDisp = deepCopy(this.customerOrgAll); + } + }, + + //选择单位 + changeCustomerOrg(v) { + if (!v) { + this.customerOrgRegisterList = []; + this.customerOrgRegister = {}; + this.customerOrgGroups = []; + } else { + getapi( + `/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${v}` + ).then((res) => { + if (res.code != -1) { + this.customerOrgRegisterList = res.data; + if (res.data.length > 0) { + this.customerOrgRegister = res.data[res.data.length - 1]; + this.getCustomerOrgGroupCopy(this.customerOrgRegister.id); + } + } + }); + } + }, + + //选择体检次数 + changeTimes(v) { + this.getCustomerOrgGroup(v.id); + }, + + + //获取体检次数下的分组 + getCustomerOrgGroupCopy(customerOrgRegisterId) { + // this.isDrag = false; + // objCopy(this.formInit, this.form); + // this.form.customerOrgRegisterId = customerOrgRegisterId; + this.customerOrgGroups = []; + getapi( + `/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}` + ).then((res) => { + if (res.code != -1) { + this.customerOrgGroups = res.data; + this.customerOrgGroups.forEach((e) => { + e.customerOrgRegisterId = customerOrgRegisterId; + }); + } + }); + }, + + handleRowClassName({ row, rowIndex }) { + // highLightBg 为 'selected'的高亮 + //console.log(rowIndex, row) + //return row.highLightBg == 'selected' ? 'high-light-bg' : ''; + if (row.choosed) { + return 'current-row'; + } else { + return ''; + } + }, + + // 添加组合项目 + ///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6' + addAbs(asbItemChoosed) { + + if (asbItemChoosed.length < 1) { + this.$message.warning({ showClose: true, message: "该套餐或分组下无可复制的组合项目" }) + return + } + + //性别、年龄判断 + // "displayName": "身高体重", + // "shortName": "哈f哈", + // "forSexId": "F", + // "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940", + // "price": 0, + console.log('asbItemChoosed.length', asbItemChoosed.length) + let unChecks = [] //不适配项目名称 + for (let i = 0; i < asbItemChoosed.length; i++) { + if (this.form.sexId == 'U') break //未选性别时,无需判断组合项目性别限制 + if (asbItemChoosed[i].forSexId == 'A') continue + if (asbItemChoosed[i].forSexId != this.form.sexId) { + unChecks.push(asbItemChoosed[i].displayName) + asbItemChoosed[i].unCheck = true + } + } + + if (unChecks.length > 0) { + this.$message.warning({ showClose: true, message: `所选项目:${unChecks.toString()},不适合当前人员性别` }) + if (asbItemChoosed.length == unChecks.length) return + } + let payTypeFlag = '0' // 0: 个人,1:单位,2:免费 + if (this.form.customerOrgId != this.dict.personOrgId) payTypeFlag = '1' + asbItemChoosed.forEach(e => { + if (!e.unCheck) { + // 未在已选列表中,才选择添加 + let lfind = arrayExistObj(this.dataTransOpts.tableM.register_check_asbitem, 'asbitemId', e.id) + if (lfind < 0) { + let pojo = { + asbitemId: e.id, + asbitemName: e.displayName, + patientRegisterId: this.form.id, + standardPrice: e.price, + chargePrice: e.price, + payTypeFlag, + isCharge: "N", + checkCompleteFlag: '0', + discount: 100, + amount: 1, + total: e.price, + } + this.dataTransOpts.tableM.register_check_asbitem.push(pojo) + } + } + }); + + // 刷新左侧待选组合项目 + this.changeItemType(deepCopy(this.dataTransOpts.copyGroup.itemTypeIds)) + + }, + + + + //项目类别过滤 组合项目,未过滤已选择的组合项目 + changeItemType(data) { + //console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds) + this.dataTransOpts.copyGroup.itemTypeIds = data + let asbItemAll = deepCopy(this.dataTransOpts.copyGroup.asbItemAll) + let lv = ""; + if (typeof this.dataTransOpts.copyGroup.itemTypeIds == "object") { + if (this.dataTransOpts.copyGroup.itemTypeIds.length > 0) lv = this.dataTransOpts.copyGroup.itemTypeIds[this.dataTransOpts.copyGroup.itemTypeIds.length - 1]; + } + + if (lv) { + this.dataTransOpts.copyGroup.asbItem = arrayFilter(asbItemAll, "itemTypeId", lv); + } else { + this.dataTransOpts.copyGroup.asbItem = deepCopy(asbItemAll); + } + + arrayReduce(this.dataTransOpts.copyGroup.asbItem, this.dataTransOpts.tableM.register_check_asbitem, "id=asbitemId"); + //console.log('this.dataTransOpts.copyGroup.asbItem',this.dataTransOpts.copyGroup.asbItem,this.dataTransOpts.tableM.register_check_asbitem) + }, + //回车替代tab键 enterToTab() { this.$nextTick(() => { diff --git a/src/components/patientRegister/PatientRegisterItem.vue b/src/components/patientRegister/PatientRegisterItem.vue index c8a367a..77a561b 100644 --- a/src/components/patientRegister/PatientRegisterItem.vue +++ b/src/components/patientRegister/PatientRegisterItem.vue @@ -3,14 +3,14 @@
项目类别 -
-