|
|
|
@ -32,7 +32,8 @@ |
|
|
|
</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> |
|
|
|
@ -51,7 +52,8 @@ |
|
|
|
<el-table-column label="支付方式" prop="payTypeFlag" width="100"> |
|
|
|
<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> |
|
|
|
</el-table-column> |
|
|
|
@ -113,6 +115,25 @@ export default { |
|
|
|
// } |
|
|
|
// ] |
|
|
|
|
|
|
|
//批量更新组合项目 |
|
|
|
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) { |
|
|
|
@ -131,31 +152,32 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.batchEditAsb(body,'保存'); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
console.log(`/api/app/register-asbitem/many`,body) |
|
|
|
putapi(`/api/app/register-asbitem/many`,body) |
|
|
|
//未选组合项目 勾选情况 |
|
|
|
handleSelectionChange(val) { |
|
|
|
// this.selecteddata = val; |
|
|
|
this.asbItemChoosed = val; |
|
|
|
//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("onSubmit", res); |
|
|
|
console.log("addAbs", res); |
|
|
|
if (res.code == 1) { |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
if(msg) this.$message.success(`${msg}操作成功`); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({type: "error",message: `操作失败,原因:${err}`}); |
|
|
|
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` }); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//未选组合项目 勾选情况 |
|
|
|
handleSelectionChange(val) { |
|
|
|
// this.selecteddata = val; |
|
|
|
this.asbItemChoosed = val; |
|
|
|
//console.log(this.asbItemChoosed); |
|
|
|
}, |
|
|
|
|
|
|
|
// 添加组合项目 |
|
|
|
@ -163,11 +185,17 @@ export default { |
|
|
|
addAbs() { |
|
|
|
let body = [] |
|
|
|
let checked = true |
|
|
|
let payTypeFlag = '0' //默认个人支付 |
|
|
|
if (this.asbItemChoosed.length < 1) { |
|
|
|
alert("请选择要添加的组合项目") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.patientRegisterForm.id) { |
|
|
|
alert("请先保存人员体检基本信息!") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//性别、年龄判断 |
|
|
|
// "displayName": "身高体重", |
|
|
|
// "shortName": "哈f哈", |
|
|
|
@ -176,8 +204,8 @@ export default { |
|
|
|
// "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.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 |
|
|
|
@ -186,92 +214,88 @@ export default { |
|
|
|
} |
|
|
|
//console.log(222,checked) |
|
|
|
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) |
|
|
|
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("addAbs", res); |
|
|
|
if (res.code == 1) { |
|
|
|
console.log("delAbs", res); |
|
|
|
if (res.code != -1) { |
|
|
|
//项目类别过滤 组合项目,未过滤已选择的组合项目 |
|
|
|
this.getAsbItemByItemTypeAll() |
|
|
|
|
|
|
|
if(msg){ |
|
|
|
//未选项目中移除,已选项中添加 |
|
|
|
this.getPatientRegisterAbs(this.patientRegisterForm.id) |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
this.$message.success(`${msg}操作成功`); |
|
|
|
} |
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message({type: "error",message: `操作失败,原因:${err}`}); |
|
|
|
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` }); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//人员已选组合项目 勾选情况 |
|
|
|
selecteditems(val) { |
|
|
|
this.patientRegisterAbsChoosed = val |
|
|
|
}, |
|
|
|
|
|
|
|
//删除 人员已选中的组合项目 |
|
|
|
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6 |
|
|
|
delAbs() { |
|
|
|
let body = [] |
|
|
|
let checked = true |
|
|
|
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 |
|
|
|
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 |
|
|
|
if (chargeComplete) { |
|
|
|
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`) |
|
|
|
if (this.patientRegisterAbsChoosed.length < 1) return |
|
|
|
} |
|
|
|
|
|
|
|
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) { |
|
|
|
body.push({ |
|
|
|
RegisterAsbitemIds: this.patientRegisterAbsChoosed[i].id, |
|
|
|
}) |
|
|
|
registerAsbitemIds.push(this.patientRegisterAbsChoosed[i].id) |
|
|
|
} |
|
|
|
|
|
|
|
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() |
|
|
|
|
|
|
|
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]; |
|
|
|
@ -282,7 +306,13 @@ export default { |
|
|
|
} 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"); |
|
|
|
}, |
|
|
|
@ -304,22 +334,18 @@ 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) => { |
|
|
|
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); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
@ -427,18 +453,83 @@ 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}); |
|
|
|
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.patientRegister.patientRegisterAbs.splice(i, 1); |
|
|
|
i--; |
|
|
|
}) |
|
|
|
} |
|
|
|
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; |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//监听事件 |
|
|
|
@ -461,7 +552,7 @@ export default { |
|
|
|
|
|
|
|
//体检信息触发分组的保存 |
|
|
|
"patientRegister.saveTimes"(newVal, oldVal) { |
|
|
|
this.onSubmit('') |
|
|
|
this.onSubmit() |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|