From 533df59646caccad8bbca69c2f73307a4d06053b Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Wed, 25 Oct 2023 17:45:38 +0800 Subject: [PATCH] org --- src/assets/css/global_input.css | 2 +- .../customerOrg/customerOrgGroupAsbitem.vue | 7 +- .../patientRegister/PatientRegisterItem.vue | 7 +- .../patientRegister/PatientRegisterList.vue | 151 +++++++++--------- .../patientRegisterAsbItem.vue | 12 +- src/store/index.js | 2 +- src/views/customerOrg/customerOrgGroup.vue | 114 +++++++++++-- 7 files changed, 197 insertions(+), 98 deletions(-) diff --git a/src/assets/css/global_input.css b/src/assets/css/global_input.css index 23b7a8d..fb01251 100644 --- a/src/assets/css/global_input.css +++ b/src/assets/css/global_input.css @@ -44,7 +44,7 @@ input[type="number"]::-webkit-outer-spin-button { margin: 0 !important; } -/* 下拉框选中颜色 */ +/* select 下拉框选中颜色 */ .el-select-dropdown__item.hover, .el-select-dropdown__item:hover { background-color: #CCF9CB; /* 原始 默认 #F5F7FA */ } diff --git a/src/components/customerOrg/customerOrgGroupAsbitem.vue b/src/components/customerOrg/customerOrgGroupAsbitem.vue index 1b8734b..65cb222 100644 --- a/src/components/customerOrg/customerOrgGroupAsbitem.vue +++ b/src/components/customerOrg/customerOrgGroupAsbitem.vue @@ -327,8 +327,8 @@ export default { //表格强制刷新 refreshTable(tableRef){ this.$nextTick(() => { - this.$refs[tableRef].doLayout() - }) + this.$refs[tableRef].doLayout() + }) }, //初始数据 @@ -709,6 +709,9 @@ export default { this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney = (this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2) + this.customerOrgGroupAsbitems[index].asbitemMoney = + (this.customerOrgGroupAsbitems[index].price * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2) + this.customerOrgGroupAsbitems[index].discount = (this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * 100 / this.customerOrgGroupAsbitems[index].price).toFixed(2) //this.getSummaries() }, diff --git a/src/components/patientRegister/PatientRegisterItem.vue b/src/components/patientRegister/PatientRegisterItem.vue index f284750..7650269 100644 --- a/src/components/patientRegister/PatientRegisterItem.vue +++ b/src/components/patientRegister/PatientRegisterItem.vue @@ -85,7 +85,7 @@
- @@ -195,6 +195,11 @@ export default { created(){ this.quickAsb = deepCopy(this.dict.asbItemQuick) }, + updated(){ + this.$nextTick(() => { + this.$refs['patientRegister_patientRegisterAbs'].doLayout() + }) + }, mounted() { // if(this.patientRegisterForm.id){ // this.getPatientRegisterAbs(this.patientRegisterForm.id) diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 1848a8a..e31a14d 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -23,20 +23,20 @@ :row-class-name="handleRowClassName" > - @@ -590,7 +590,7 @@ export default { let body = deepCopy(this.form); delete body.id; delete body.customerOrgId; - delete body.isComplete; + delete body.isComplete; if (this.form.id) { //编辑 @@ -626,6 +626,90 @@ export default { } }); }, + + computePrice(){ + if(!this.form.id){ + this.$message.warning("尚未保存信息,不可执行此操作!") + return + } + let customerOrgGroupId = this.form.id + let customerOrgGroupAsbitems = [] //分组包含的套餐 + + + getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId} + `).then(res => { + if(res.code != -1){ + customerOrgGroupAsbitems = res.data; + + if(customerOrgGroupAsbitems.length < 1){ + this.$message.warning("当前分组尚未设置组合项目,不可执行此操作!") + }else{ + let body = { + customerOrgGroupId, + details:this.madeNewGroupAsbitems(customerOrgGroupAsbitems,this.form.price) + } + console.log('body',body) + return postapi('/api/app/customerorggroupdetail/createcustomerorggroupdetailmany',body) + } + } + }).then(res =>{ + if(res.code != -1){ + this.$message.success("操作成功"); + + //触发分组明细刷新 + this.form.id = '' + //要做延时处理,否则不会触发监听 + setTimeout(() => { + this.form.id = customerOrgGroupId; + this.onSubmit('form') + }, 100) + + } + }) + + }, + + madeNewGroupAsbitems(oldGroupAsbitems,newTotal){ + newTotal = Number(newTotal).toFixed(2) + let newGroupAsbitems = [] + let oldTotal = 0 + oldGroupAsbitems.forEach(e =>{ + oldTotal += Number(e.customerOrgGroupDetailMoney) + }) + oldTotal = oldTotal.toFixed(2) + + let discount = 0 + if(oldTotal != 0) discount = (newTotal * 100 /oldTotal).toFixed(2) + + oldTotal = 0 + oldGroupAsbitems.forEach(e =>{ + e.customerOrgGroupDetailPrice = (e.customerOrgGroupDetailPrice * discount/100).toFixed(2) + e.customerOrgGroupDetailMoney = (e.customerOrgGroupDetailPrice * e.customerOrgGroupDetailAmount).toFixed(2) + oldTotal += Number(e.customerOrgGroupDetailMoney) + }) + oldTotal = oldTotal.toFixed(2) + + let didTotal = newTotal - oldTotal + if(didTotal != 0){ + for(let i = 0;i{ + newGroupAsbitems.push({ + customerOrgGroupId:e.customerOrgGroupId, + asbitemId:e.asbitemId, + price:e.customerOrgGroupDetailPrice, + amount:e.customerOrgGroupDetailAmount + }) + }) + + return newGroupAsbitems + }, + }, };