|
|
|
@ -32,13 +32,14 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mainareaBox"> |
|
|
|
<el-table :header-cell-style="{ background: '#eef1f6' }" :data="patientRegister.patientRegisterAbs" height="350" |
|
|
|
<el-table :data="patientRegister.patientRegisterAbs" height="350" |
|
|
|
:summary-method="getSummaries" show-summary |
|
|
|
@selection-change="selecteditems" size="small"> |
|
|
|
<!-- temporaryselection personnelUnit.nogroupselected--> |
|
|
|
<el-table-column type="selection"></el-table-column> |
|
|
|
<el-table-column label="已选组合项目" width="110" prop="asbitemName" /> |
|
|
|
<el-table-column label="标准价格" prop="standardPrice" /> |
|
|
|
<el-table-column label="实收价格" prop="chargePrice" > |
|
|
|
<el-table-column label="标准价格" prop="standardPrice" /> |
|
|
|
<el-table-column label="实收价格" prop="chargePrice"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" /> |
|
|
|
</template> |
|
|
|
@ -49,11 +50,12 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="支付方式" prop="payTypeFlag" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="patientRegister.patientRegisterAbs[scope.$index].payTypeFlag"> |
|
|
|
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" width="100"/> |
|
|
|
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" |
|
|
|
width="100" /> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
@ -62,13 +64,13 @@ |
|
|
|
<script> |
|
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { arrayFilter, arrayReduce ,arrayExistObj} from "../../utlis/proFunc"; |
|
|
|
import { arrayFilter, arrayReduce, arrayExistObj } from "../../utlis/proFunc"; |
|
|
|
export default { |
|
|
|
props: ["patientRegisterForm"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
itemType: [], //项目类别 |
|
|
|
itemTypeIds:'', //被选中的项目类别ID |
|
|
|
itemTypeIds: '', //被选中的项目类别ID |
|
|
|
asbItemChoosed: [], //勾选的 未选组合项目 |
|
|
|
|
|
|
|
//patientRegisterAbs:[], //体检人员所选组合项目 放vuex |
|
|
|
@ -78,7 +80,7 @@ export default { |
|
|
|
patientRegisterAbsRd: { |
|
|
|
id: null, //更新不需传 |
|
|
|
asbitemId: null, // string($uuid) 组合项目 |
|
|
|
asbitemName:'', //组合项目名称,更新不需传 |
|
|
|
asbitemName: '', //组合项目名称,更新不需传 |
|
|
|
patientRegisterId: null, //string($uuid) 登记流水号 |
|
|
|
standardPrice: 0, //number($double) 标准价格 |
|
|
|
chargePrice: 0, // number($double) 实收价格 |
|
|
|
@ -97,7 +99,7 @@ export default { |
|
|
|
mounted() { }, |
|
|
|
|
|
|
|
methods: { |
|
|
|
...mapActions(['getCustomerOrgGroup','getMedicalPackageAsb', 'getPatientRegisterAbs']), |
|
|
|
...mapActions(['getCustomerOrgGroup', 'getMedicalPackageAsb', 'getPatientRegisterAbs']), |
|
|
|
|
|
|
|
//保存按钮 |
|
|
|
// [ |
|
|
|
@ -113,44 +115,47 @@ export default { |
|
|
|
// } |
|
|
|
// ] |
|
|
|
|
|
|
|
onSubmit() { |
|
|
|
//批量更新组合项目 |
|
|
|
batchEditAsb(body,msg){ |
|
|
|
console.log(`/api/app/registerasbitem/updatemany`, body) |
|
|
|
postapi(`/api/app/registerasbitem/updatemany`, body) |
|
|
|
.then((res) => { |
|
|
|
console.log("onSubmit", res); |
|
|
|
if (res.code == 1) { |
|
|
|
if(msg){ |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
this.$message.success(`${msg}操作成功`); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` }); |
|
|
|
}); |
|
|
|
}, |
|
|
|
//更新所选组合项目 |
|
|
|
onSubmit() { |
|
|
|
let body = [] |
|
|
|
if(this.patientRegister.patientRegisterAbs.length < 1){ |
|
|
|
if (this.patientRegister.patientRegisterAbs.length < 1) { |
|
|
|
alert("暂无可操作的数据") |
|
|
|
return |
|
|
|
} |
|
|
|
for(let i=0;i<this.patientRegister.patientRegisterAbs.length;i++){ |
|
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
|
body.push({ |
|
|
|
registerAsbitemId:this.patientRegister.patientRegisterAbs[i].id, |
|
|
|
input:{ |
|
|
|
chargePrice:this.patientRegister.patientRegisterAbs[i].chargePrice, |
|
|
|
payTypeFlag:this.patientRegister.patientRegisterAbs[i].payTypeFlag, |
|
|
|
isCharge:this.patientRegister.patientRegisterAbs[i].isCharge, |
|
|
|
amount:this.patientRegister.patientRegisterAbs[i].amount, |
|
|
|
groupPackageId:this.patientRegister.patientRegisterAbs[i].groupPackageId |
|
|
|
registerAsbitemId: this.patientRegister.patientRegisterAbs[i].id, |
|
|
|
input: { |
|
|
|
chargePrice: this.patientRegister.patientRegisterAbs[i].chargePrice, |
|
|
|
payTypeFlag: this.patientRegister.patientRegisterAbs[i].payTypeFlag, |
|
|
|
isCharge: this.patientRegister.patientRegisterAbs[i].isCharge, |
|
|
|
amount: this.patientRegister.patientRegisterAbs[i].amount, |
|
|
|
groupPackageId: this.patientRegister.patientRegisterAbs[i].groupPackageId |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.batchEditAsb(body,'保存'); |
|
|
|
|
|
|
|
console.log(`/api/app/register-asbitem/many`,body) |
|
|
|
putapi(`/api/app/register-asbitem/many`,body) |
|
|
|
.then((res) => { |
|
|
|
console.log("onSubmit", res); |
|
|
|
if (res.code == 1) { |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({type: "error",message: `操作失败,原因:${err}`}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//未选组合项目 勾选情况 |
|
|
|
handleSelectionChange(val) { |
|
|
|
// this.selecteddata = val; |
|
|
|
@ -158,16 +163,39 @@ export default { |
|
|
|
//console.log(this.asbItemChoosed); |
|
|
|
}, |
|
|
|
|
|
|
|
//批量添加组合项目 |
|
|
|
batchAddAsb(body,msg){ |
|
|
|
console.log(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body) |
|
|
|
postapi(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body) |
|
|
|
.then((res) => { |
|
|
|
console.log("addAbs", res); |
|
|
|
if (res.code == 1) { |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
if(msg) this.$message.success(`${msg}操作成功`); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` }); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 添加组合项目 |
|
|
|
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6' |
|
|
|
addAbs() { |
|
|
|
addAbs() { |
|
|
|
let body = [] |
|
|
|
let checked = true |
|
|
|
if(this.asbItemChoosed.length < 1){ |
|
|
|
let payTypeFlag = '0' //默认个人支付 |
|
|
|
if (this.asbItemChoosed.length < 1) { |
|
|
|
alert("请选择要添加的组合项目") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.patientRegisterForm.id) { |
|
|
|
alert("请先保存人员体检基本信息!") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//性别、年龄判断 |
|
|
|
// "displayName": "身高体重", |
|
|
|
// "shortName": "哈f哈", |
|
|
|
@ -175,116 +203,118 @@ export default { |
|
|
|
// "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940", |
|
|
|
// "price": 0, |
|
|
|
//console.log('this.asbItemChoosed.length',this.asbItemChoosed.length) |
|
|
|
for(let i = 0;i<this.asbItemChoosed.length;i++){ |
|
|
|
if(this.patientRegisterForm.sexId == 'U') break //未选性别时,无需判断组合项目性别限制 |
|
|
|
if(this.asbItemChoosed[i].forSexId == 'U') continue |
|
|
|
if(this.asbItemChoosed[i].forSexId != this.patientRegisterForm.sexId){ |
|
|
|
for (let i = 0; i < this.asbItemChoosed.length; i++) { |
|
|
|
if (this.patientRegisterForm.sexId == '9') break //未选性别时,无需判断组合项目性别限制 |
|
|
|
if (this.asbItemChoosed[i].forSexId == '9') continue |
|
|
|
if (this.asbItemChoosed[i].forSexId != this.patientRegisterForm.sexId) { |
|
|
|
alert(`所选项目:${this.asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
checked = false |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
//console.log(222,checked) |
|
|
|
if(!checked) return |
|
|
|
|
|
|
|
for(let i = 0;i<this.asbItemChoosed.length;i++){ |
|
|
|
if (!checked) return |
|
|
|
if (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1' |
|
|
|
for (let i = 0; i < this.asbItemChoosed.length; i++) { |
|
|
|
body.push({ |
|
|
|
asbitemId: this.asbItemChoosed[i].id, |
|
|
|
patientRegisterId: this.patientRegisterForm.id, |
|
|
|
standardPrice: this.asbItemChoosed[i].price, |
|
|
|
chargePrice: this.asbItemChoosed[i].price, |
|
|
|
payTypeFlag: "0", |
|
|
|
payTypeFlag, |
|
|
|
isCharge: "N", |
|
|
|
amount: 1 |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
console.log(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body) |
|
|
|
postapi(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body) |
|
|
|
.then((res) => { |
|
|
|
console.log("addAbs", res); |
|
|
|
if (res.code == 1) { |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({type: "error",message: `操作失败,原因:${err}`}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.batchAddAsb(body,'添加组合项目'); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//人员已选组合项目 勾选情况 |
|
|
|
selecteditems(val) { |
|
|
|
this.patientRegisterAbsChoosed = val |
|
|
|
}, |
|
|
|
|
|
|
|
//批量删除组合项目 |
|
|
|
batchDelAsb(body,msg){ |
|
|
|
console.log(`/api/app/registerasbitem/deletemany`, body) |
|
|
|
postapi(`/api/app/registerasbitem/deletemany`, body) |
|
|
|
.then((res) => { |
|
|
|
console.log("delAbs", res); |
|
|
|
if (res.code != -1) { |
|
|
|
//项目类别过滤 组合项目,未过滤已选择的组合项目 |
|
|
|
this.getAsbItemByItemTypeAll() |
|
|
|
|
|
|
|
if(msg){ |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
this.$message.success(`${msg}操作成功`); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` }); |
|
|
|
}); |
|
|
|
}, |
|
|
|
//删除 人员已选中的组合项目 |
|
|
|
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6 |
|
|
|
delAbs(){ |
|
|
|
let body = [] |
|
|
|
let checked = true |
|
|
|
if(this.patientRegisterAbsChoosed.length < 1){ |
|
|
|
delAbs() { |
|
|
|
let body = {} |
|
|
|
let registerAsbitemIds = [] |
|
|
|
let chargeComplete = '' |
|
|
|
if (this.patientRegisterAbsChoosed.length < 1) { |
|
|
|
alert("请选择要移除的组合项目") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){ |
|
|
|
if(this.patientRegisterAbsChoosed[i].isCharge == 'Y') { |
|
|
|
alert(`所选项目:${this.patientRegisterAbsChoosed[i].displayName},已收费,不可删除!`) |
|
|
|
checked = false |
|
|
|
break |
|
|
|
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) { |
|
|
|
if (this.patientRegisterAbsChoosed[i].isCharge == 'Y' || this.patientRegisterAbsChoosed[i].checkCompleteFlag != '0') { |
|
|
|
chargeComplete += this.patientRegisterAbsChoosed[i].asbitemName + ',' |
|
|
|
this.patientRegisterAbsChoosed.splice(i, 1) |
|
|
|
i-- |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(!checked) return |
|
|
|
|
|
|
|
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){ |
|
|
|
body.push({ |
|
|
|
RegisterAsbitemIds: this.patientRegisterAbsChoosed[i].id, |
|
|
|
}) |
|
|
|
if (chargeComplete) { |
|
|
|
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`) |
|
|
|
if (this.patientRegisterAbsChoosed.length < 1) return |
|
|
|
} |
|
|
|
|
|
|
|
console.log(`/api/app/register-asbitem/many`,body) |
|
|
|
deletapi(`/api/app/register-asbitem/many`,body) |
|
|
|
.then((res) => { |
|
|
|
console.log("delAbs", res); |
|
|
|
if (res.code == 1) { |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) { |
|
|
|
registerAsbitemIds.push(this.patientRegisterAbsChoosed[i].id) |
|
|
|
} |
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({type: "error",message: `操作失败,原因:${err}`}); |
|
|
|
}); |
|
|
|
body = { registerAsbitemIds } |
|
|
|
|
|
|
|
this.batchDelAsb(body,'删除组合项目'); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//项目类别过滤 组合项目 |
|
|
|
getAsbItemByItemType() { |
|
|
|
//console.log('getAsbItemByItemType',typeof this.itemTypeIds,this.itemTypeIds) |
|
|
|
//项目类别过滤 组合项目,未过滤已选择的组合项目 |
|
|
|
getAsbItemByItemTypeAll() { |
|
|
|
console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds) |
|
|
|
let lv = ""; |
|
|
|
if (typeof this.itemTypeIds === "object") { |
|
|
|
lv = this.itemTypeIds[this.itemTypeIds.length - 1]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (lv) { |
|
|
|
this.dict.asbItem = arrayFilter(this.dict.asbItemAll, "itemTypeId", lv); |
|
|
|
} else { |
|
|
|
this.dict.asbItem = [...this.dict.asbItemAll]; |
|
|
|
} |
|
|
|
console.log('lv,this.dict.asbItem', lv, this.dict.asbItem) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//按项目类别显示组合项目,并过滤已选择的组合项目 |
|
|
|
getAsbItemByItemType() { |
|
|
|
this.getAsbItemByItemTypeAll() |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
arrayReduce(this.dict.asbItem,[...this.patientRegister.patientRegisterAbs],"id=asbitemId"); |
|
|
|
arrayReduce(this.dict.asbItem, [...this.patientRegister.patientRegisterAbs], "id=asbitemId"); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
@ -303,29 +333,25 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//选中分组所包含的组合项目 |
|
|
|
getCustomerOrgGroupAsb(customerOrgGroupId,oldVal) { |
|
|
|
console.log("getCustomerOrgGroupAsb"); |
|
|
|
getapi( |
|
|
|
`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${customerOrgGroupId}` |
|
|
|
).then((res) => { |
|
|
|
getCustomerOrgGroupAsb(customerOrgGroupId, oldVal) { |
|
|
|
console.log(`getCustomerOrgGroupAsb /api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`); |
|
|
|
getapi(`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`) |
|
|
|
.then((res) => { |
|
|
|
console.log("getCustomerOrgGroupAsb", res); |
|
|
|
if (res.code == 1) { |
|
|
|
this.patientRegister.customerOrgGroupAsb = res.data; |
|
|
|
|
|
|
|
//添加新套餐的组合项目 |
|
|
|
this.addCustomerOrgGroupAsb(customerOrgGroupId); |
|
|
|
|
|
|
|
//移除旧分组或套餐的组合项目 |
|
|
|
this.removeGroupPackageAsb(oldVal); |
|
|
|
|
|
|
|
//刷新显示 未选组合项目 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
//添加新套餐的组合项目 |
|
|
|
this.addCustomerOrgGroupAsb(customerOrgGroupId); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//选中套餐所包含的组合项目 |
|
|
|
getMedicalPackageAsb(medicalPackageId,oldVal) { |
|
|
|
getMedicalPackageAsb(medicalPackageId, oldVal) { |
|
|
|
console.log( |
|
|
|
`/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=${medicalPackageId}` |
|
|
|
); |
|
|
|
@ -353,7 +379,7 @@ export default { |
|
|
|
console.log('addCustomerOrgGroupAsb') |
|
|
|
let finded = false; |
|
|
|
for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) { |
|
|
|
finded = false; |
|
|
|
finded = false; |
|
|
|
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 |
|
|
|
@ -374,16 +400,16 @@ export default { |
|
|
|
amount: 1, // integer($int32) 数量 |
|
|
|
groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID |
|
|
|
}; |
|
|
|
console.log('i',i,asbItem) |
|
|
|
console.log('i', i, asbItem) |
|
|
|
|
|
|
|
//待添加的项目在 删除缓存中 存在,则将移至已选中后,删除缓存中的数据 |
|
|
|
let exist = arrayExistObj(this.patientRegisterAbsDel,'asbitemId',asbItem.asbitemId) |
|
|
|
if(exist > -1){ |
|
|
|
this.patientRegister.patientRegisterAbs.push({...this.patientRegisterAbsDel[exist]}) |
|
|
|
this.patientRegisterAbsDel.splice(exist,1) |
|
|
|
}else{ |
|
|
|
let exist = arrayExistObj(this.patientRegisterAbsDel, 'asbitemId', asbItem.asbitemId) |
|
|
|
if (exist > -1) { |
|
|
|
this.patientRegister.patientRegisterAbs.push({ ...this.patientRegisterAbsDel[exist] }) |
|
|
|
this.patientRegisterAbsDel.splice(exist, 1) |
|
|
|
} else { |
|
|
|
this.patientRegister.patientRegisterAbs.push(asbItem); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -396,7 +422,7 @@ export default { |
|
|
|
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],}) |
|
|
|
this.patientRegisterAbsEdit.push({ ...this.patientRegister.patientRegisterAbs[j], }) |
|
|
|
finded = true |
|
|
|
} |
|
|
|
} |
|
|
|
@ -415,11 +441,11 @@ export default { |
|
|
|
}; |
|
|
|
|
|
|
|
//待添加的项目在 删除缓存中 存在,则将移至已选中后,删除缓存中的数据 |
|
|
|
let exist = arrayExistObj(this.patientRegisterAbsDel,'asbitemId',asbItem.asbitemId) |
|
|
|
if(exist > -1){ |
|
|
|
this.patientRegister.patientRegisterAbs.push({...this.patientRegisterAbsDel[exist]}) |
|
|
|
this.patientRegisterAbsDel.splice(exist,1) |
|
|
|
}else{ |
|
|
|
let exist = arrayExistObj(this.patientRegisterAbsDel, 'asbitemId', asbItem.asbitemId) |
|
|
|
if (exist > -1) { |
|
|
|
this.patientRegister.patientRegisterAbs.push({ ...this.patientRegisterAbsDel[exist] }) |
|
|
|
this.patientRegisterAbsDel.splice(exist, 1) |
|
|
|
} else { |
|
|
|
this.patientRegisterAbsAdd.push(asbItem); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -427,41 +453,106 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//移除旧分组或套餐的组合项目 |
|
|
|
removeGroupPackageAsb(groupPackageId) { |
|
|
|
removeGroupPackageAsb() { |
|
|
|
let body = {} |
|
|
|
let registerAsbitemIds = [] |
|
|
|
let chargeComplete = '' |
|
|
|
|
|
|
|
//删除已选 分组或套餐的组合项目 ,如已收费或 已检时,将 groupPackageId 置为null |
|
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
|
if (this.patientRegister.patientRegisterAbs[i].groupPackageId == groupPackageId) { |
|
|
|
//要移除的分组 尚未保存时,则不需要添加至删除缓冲中 |
|
|
|
if(!this.patientRegister.patientRegisterAbs[i].id){ |
|
|
|
this.patientRegisterAbsDel.push({id: this.patientRegister.patientRegisterAbs[i].id}); |
|
|
|
} |
|
|
|
this.patientRegister.patientRegisterAbs.splice(i, 1); |
|
|
|
i--; |
|
|
|
if (this.patientRegister.patientRegisterAbs[i].isCharge == 'Y' || this.patientRegister.patientRegisterAbs[i].checkCompleteFlag != '0') { |
|
|
|
chargeComplete += this.patientRegister.patientRegisterAbs[i].asbitemName + ',' |
|
|
|
this.patientRegister.patientRegisterAbs[i].groupPackageId = null |
|
|
|
} else{ |
|
|
|
registerAsbitemIds.push(this.patientRegister.patientRegisterAbs[i].id) |
|
|
|
this.patientRegister.patientRegisterAbs.splice(i, 1) |
|
|
|
i-- |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (chargeComplete) { |
|
|
|
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`) |
|
|
|
} |
|
|
|
|
|
|
|
body = { registerAsbitemIds } |
|
|
|
if(registerAsbitemIds.length > 0){ |
|
|
|
this.batchDelAsb(body,''); |
|
|
|
} |
|
|
|
|
|
|
|
let updateBody = [] |
|
|
|
if (this.patientRegister.patientRegisterAbs.length > 0) { |
|
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
|
updateBody.push({ |
|
|
|
registerAsbitemId: this.patientRegister.patientRegisterAbs[i].id, |
|
|
|
input: { |
|
|
|
chargePrice: this.patientRegister.patientRegisterAbs[i].chargePrice, |
|
|
|
payTypeFlag: this.patientRegister.patientRegisterAbs[i].payTypeFlag, |
|
|
|
isCharge: this.patientRegister.patientRegisterAbs[i].isCharge, |
|
|
|
amount: this.patientRegister.patientRegisterAbs[i].amount, |
|
|
|
groupPackageId: this.patientRegister.patientRegisterAbs[i].groupPackageId |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.batchEditAsb(updateBody,''); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//自定义计算列 |
|
|
|
getSummaries(param) { |
|
|
|
const { columns, data } = param; |
|
|
|
const sums = []; |
|
|
|
columns.forEach((column, index) => { |
|
|
|
if (index === 1) { |
|
|
|
sums[index] = '合计'; |
|
|
|
return; |
|
|
|
} |
|
|
|
if(index == 0 || index == 4 || index == 5){ |
|
|
|
sums[index] = ''; |
|
|
|
return; |
|
|
|
} |
|
|
|
const values = data.map(item => Number(item[column.property])); |
|
|
|
if (!values.every(value => isNaN(value))) { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr); |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr; |
|
|
|
} else { |
|
|
|
return prev; |
|
|
|
} |
|
|
|
}, 0); |
|
|
|
sums[index] += ' 元'; |
|
|
|
} else { |
|
|
|
sums[index] = 'N/A'; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return sums; |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//监听事件 |
|
|
|
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,oldVal); |
|
|
|
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,oldVal); |
|
|
|
this.getMedicalPackageAsb(newVal, oldVal); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//体检信息触发分组的保存 |
|
|
|
"patientRegister.saveTimes"(newVal, oldVal){ |
|
|
|
this.onSubmit('') |
|
|
|
"patientRegister.saveTimes"(newVal, oldVal) { |
|
|
|
this.onSubmit() |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|