|
|
|
@ -40,17 +40,17 @@ |
|
|
|
<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" /> |
|
|
|
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" size="small" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" prop="amount"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].amount" /> |
|
|
|
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].amount" size="small" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="支付方式" prop="payTypeFlag" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="patientRegister.patientRegisterAbs[scope.$index].payTypeFlag"> |
|
|
|
<el-select v-model="patientRegister.patientRegisterAbs[scope.$index].payTypeFlag" size="small"> |
|
|
|
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" |
|
|
|
width="100" /> |
|
|
|
</el-select> |
|
|
|
@ -115,7 +115,7 @@ export default { |
|
|
|
// ] |
|
|
|
|
|
|
|
//批量更新组合项目 |
|
|
|
batchEditAsb(body, msg) { |
|
|
|
async batchEditAsb(body, msg) { |
|
|
|
console.log(`/api/app/registerasbitem/updatemany`, body) |
|
|
|
postapi(`/api/app/registerasbitem/updatemany`, body) |
|
|
|
.then((res) => { |
|
|
|
@ -134,15 +134,18 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//更新所选组合项目 |
|
|
|
onSubmit(msg) { |
|
|
|
let body = [],insBody=[] |
|
|
|
if(!this.patientRegisterForm.id) return |
|
|
|
async onSubmit(msg) { |
|
|
|
let body = [], insBody = [] |
|
|
|
if (!this.patientRegisterForm.id) { |
|
|
|
alert("请先保存人员体检基本信息!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.patientRegister.patientRegisterAbs.length < 1) { |
|
|
|
alert("暂无可操作的数据") |
|
|
|
return |
|
|
|
} |
|
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
|
if(this.patientRegister.patientRegisterAbs[i].id){ |
|
|
|
if (this.patientRegister.patientRegisterAbs[i].id) { |
|
|
|
body.push({ |
|
|
|
registerAsbitemId: this.patientRegister.patientRegisterAbs[i].id, |
|
|
|
input: { |
|
|
|
@ -153,12 +156,12 @@ export default { |
|
|
|
groupPackageId: this.patientRegister.patientRegisterAbs[i].groupPackageId |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
insBody.push({ |
|
|
|
asbitemId: this.patientRegister.patientRegisterAbs[i].id, |
|
|
|
asbitemId: this.patientRegister.patientRegisterAbs[i].asbitemId, |
|
|
|
patientRegisterId: this.patientRegisterForm.id, |
|
|
|
standardPrice: this.patientRegister.patientRegisterAbs[i].price, |
|
|
|
chargePrice: this.patientRegister.patientRegisterAbs[i].price, |
|
|
|
standardPrice: this.patientRegister.patientRegisterAbs[i].standardPrice, |
|
|
|
chargePrice: this.patientRegister.patientRegisterAbs[i].chargePrice, |
|
|
|
payTypeFlag:this.patientRegister.patientRegisterAbs[i].payTypeFlag, |
|
|
|
isCharge: this.patientRegister.patientRegisterAbs[i].isCharge, |
|
|
|
amount: this.patientRegister.patientRegisterAbs[i].amount, |
|
|
|
@ -166,14 +169,17 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
if(body.length > 0 && insBody.length > 0){ |
|
|
|
this.batchAddAsb(insBody, ''); |
|
|
|
this.batchEditAsb(body, msg); |
|
|
|
}else if(body.length > 0 && insBody.length < 1){ |
|
|
|
this.batchEditAsb(body, msg); |
|
|
|
}else if(body.length < 1 && insBody.length > 0){ |
|
|
|
this.batchAddAsb(insBody, msg); |
|
|
|
|
|
|
|
//if (body.length > 0 ) await this.batchEditAsb(body, msg); |
|
|
|
if (body.length > 0 && insBody.length > 0){ |
|
|
|
await this.batchEditAsb(body, ''); |
|
|
|
await this.batchAddAsb(insBody,msg); |
|
|
|
}else if (body.length > 0 && insBody.length < 1){ |
|
|
|
await this.batchEditAsb(body, msg); |
|
|
|
}else if (body.length < 1 && insBody.length > 0){ |
|
|
|
await this.batchAddAsb(insBody,msg); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//未选组合项目 勾选情况 |
|
|
|
@ -206,16 +212,12 @@ export default { |
|
|
|
let body = [] |
|
|
|
let checked = true |
|
|
|
let payTypeFlag = '0' //默认个人支付 |
|
|
|
let lfind = -1 |
|
|
|
if (this.asbItemChoosed.length < 1) { |
|
|
|
alert("请选择要添加的组合项目") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.patientRegisterForm.id) { |
|
|
|
alert("请先保存人员体检基本信息!") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//性别、年龄判断 |
|
|
|
// "displayName": "身高体重", |
|
|
|
// "shortName": "哈f哈", |
|
|
|
@ -234,9 +236,10 @@ 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({ |
|
|
|
let pojo = { |
|
|
|
asbitemId: this.asbItemChoosed[i].id, |
|
|
|
patientRegisterId: this.patientRegisterForm.id, |
|
|
|
standardPrice: this.asbItemChoosed[i].price, |
|
|
|
@ -244,10 +247,15 @@ export default { |
|
|
|
payTypeFlag, |
|
|
|
isCharge: "N", |
|
|
|
amount: 1 |
|
|
|
}) |
|
|
|
} |
|
|
|
body.push(pojo) |
|
|
|
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.asbItemChoosed[i].displayName }) |
|
|
|
lfind = arrayExistObj(this.dict.asbItem, 'id', this.asbItemChoosed[i].id) |
|
|
|
if (lfind > -1) this.dict.asbItem.splice(lfind, 1) |
|
|
|
} |
|
|
|
|
|
|
|
if (this.patientRegisterForm.id) this.batchAddAsb(body, '添加组合项目'); |
|
|
|
|
|
|
|
this.batchAddAsb(body, '添加组合项目'); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
@ -285,12 +293,24 @@ export default { |
|
|
|
let body = {} |
|
|
|
let registerAsbitemIds = [] |
|
|
|
let chargeComplete = '' |
|
|
|
let lfind = -1 |
|
|
|
|
|
|
|
if (this.patientRegisterAbsChoosed.length < 1) { |
|
|
|
alert("请选择要移除的组合项目") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) { |
|
|
|
//未在数据库中,直接删除 |
|
|
|
if (!this.patientRegisterAbsChoosed[i].id) { |
|
|
|
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegisterAbsChoosed[i].asbitemId) |
|
|
|
if (lfind > -1) this.patientRegister.patientRegisterAbs.splice(lfind, 1) |
|
|
|
|
|
|
|
this.patientRegisterAbsChoosed.splice(i, 1) |
|
|
|
i-- |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
if (this.patientRegisterAbsChoosed[i].isCharge == 'Y' || this.patientRegisterAbsChoosed[i].checkCompleteFlag != '0') { |
|
|
|
chargeComplete += this.patientRegisterAbsChoosed[i].asbitemName + ',' |
|
|
|
this.patientRegisterAbsChoosed.splice(i, 1) |
|
|
|
@ -298,8 +318,11 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//刷新 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
|
|
|
|
if (chargeComplete) { |
|
|
|
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`) |
|
|
|
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` }); |
|
|
|
if (this.patientRegisterAbsChoosed.length < 1) return |
|
|
|
} |
|
|
|
|
|
|
|
@ -308,8 +331,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
body = { registerAsbitemIds } |
|
|
|
|
|
|
|
this.batchDelAsb(body, '删除组合项目'); |
|
|
|
if (registerAsbitemIds.length > 0 && this.patientRegisterForm.id) this.batchDelAsb(body, '删除组合项目'); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@ -353,18 +375,17 @@ export default { |
|
|
|
// }, |
|
|
|
|
|
|
|
//选中分组所包含的组合项目 |
|
|
|
getCustomerOrgGroupAsb(customerOrgGroupId, oldVal) { |
|
|
|
getCustomerOrgGroupAsb(customerOrgGroupId) { |
|
|
|
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.removeGroupPackageAsb(); |
|
|
|
|
|
|
|
//添加新套餐的组合项目 |
|
|
|
//添加新分组的组合项目; |
|
|
|
this.addCustomerOrgGroupAsb(customerOrgGroupId); |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -389,18 +410,18 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//添加新分组的组合项目 |
|
|
|
addCustomerOrgGroupAsb(groupPackageId) { |
|
|
|
async addCustomerOrgGroupAsb(groupPackageId) { |
|
|
|
let body = [] |
|
|
|
let payTypeFlag = '0' |
|
|
|
let lfind = -1 |
|
|
|
let editCount = 0 |
|
|
|
|
|
|
|
if (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1' |
|
|
|
console.log('this.patientRegister.customerOrgGroupAsb', this.patientRegister.customerOrgGroupAsb) |
|
|
|
for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) { |
|
|
|
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs,'asbitemId',this.patientRegister.customerOrgGroupAsb[i].asbitemId) |
|
|
|
if(lfind > - 1){ |
|
|
|
this.patientRegister.patientRegisterAbs[lfind] = groupPackageId |
|
|
|
editCount++ |
|
|
|
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegister.customerOrgGroupAsb[i].asbitemId) |
|
|
|
if (lfind > - 1) { |
|
|
|
this.patientRegister.patientRegisterAbs[lfind].groupPackageId = groupPackageId |
|
|
|
continue |
|
|
|
} |
|
|
|
let pojo = { |
|
|
|
@ -414,20 +435,38 @@ export default { |
|
|
|
groupPackageId: groupPackageId |
|
|
|
} |
|
|
|
body.push(pojo) |
|
|
|
this.patientRegister.patientRegisterAbs.push({...pojo,asbitemName:this.patientRegister.customerOrgGroupAsb[i].displayName}) |
|
|
|
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.patientRegister.customerOrgGroupAsb[i].displayName }) |
|
|
|
|
|
|
|
} |
|
|
|
console.log('this.patientRegister.patientRegisterAbs', this.patientRegister.patientRegisterAbs) |
|
|
|
// if (editCount > 0 && this.patientRegisterForm.id) await this.onSubmit(''); |
|
|
|
// if (body.length > 0 && this.patientRegisterForm.id) { |
|
|
|
// await this.batchAddAsb(body, '更换分组'); |
|
|
|
// } else { |
|
|
|
// //刷新 |
|
|
|
// this.getAsbItemByItemType() |
|
|
|
// } |
|
|
|
if(this.patientRegister.patientRegisterAbs.length > 0 && this.patientRegisterForm.id){ |
|
|
|
await this.onSubmit('更换分组'); |
|
|
|
} |
|
|
|
if(editCount>0) this.onSubmit() |
|
|
|
if (body.length > 0 && this.patientRegisterForm.id) this.batchAddAsb(body, '更换分组'); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//添加新套餐的组合项目 |
|
|
|
addMedicalPackageAsb(groupPackageId) { |
|
|
|
async addMedicalPackageAsb(groupPackageId) { |
|
|
|
let body = [] |
|
|
|
let payTypeFlag = '0' |
|
|
|
let lfind = -1 |
|
|
|
let editCount = 0 |
|
|
|
|
|
|
|
if (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1' |
|
|
|
for (let i = 0; i < this.patientRegister.medicalPackageAsb.length; i++) { |
|
|
|
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegister.medicalPackageAsb[i].id) |
|
|
|
if (lfind > - 1) { |
|
|
|
this.patientRegister.patientRegisterAbs[lfind].groupPackageId = groupPackageId |
|
|
|
editCount++ |
|
|
|
continue |
|
|
|
} |
|
|
|
let pojo = { |
|
|
|
asbitemId: this.patientRegister.medicalPackageAsb[i].id, |
|
|
|
patientRegisterId: this.patientRegisterForm.id, |
|
|
|
@ -439,27 +478,33 @@ export default { |
|
|
|
groupPackageId: groupPackageId |
|
|
|
} |
|
|
|
body.push(pojo) |
|
|
|
this.patientRegister.patientRegisterAbs.push({...pojo,asbitemName:this.patientRegister.medicalPackageAsb[i].displayName}) |
|
|
|
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.patientRegister.customerOrgGroupAsb[i].displayName }) |
|
|
|
} |
|
|
|
if (body.length > 0 && this.patientRegisterForm.id) this.batchAddAsb(body, '更换套餐'); |
|
|
|
|
|
|
|
if (editCount > 0 && this.patientRegisterForm.id) await this.onSubmit(''); |
|
|
|
if (body.length > 0 && this.patientRegisterForm.id) { |
|
|
|
await this.batchAddAsb(body, '更换分组'); |
|
|
|
} else { |
|
|
|
//刷新 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//移除旧分组或套餐的组合项目 |
|
|
|
removeGroupPackageAsb() { |
|
|
|
async removeGroupPackageAsb() { |
|
|
|
let body = {} |
|
|
|
let registerAsbitemIds = [] |
|
|
|
let chargeComplete = '' |
|
|
|
|
|
|
|
//体检基本信息未保存时,删除所有所选项目 |
|
|
|
if(!this.patientRegisterForm.id){ |
|
|
|
if (!this.patientRegisterForm.id) { |
|
|
|
this.patientRegister.patientRegisterAbs = [] |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//删除已选 分组或套餐的组合项目 ,如已收费或 已检时,将 groupPackageId 置为null |
|
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
|
if(!this.patientRegister.patientRegisterAbs[i].id){ |
|
|
|
if (!this.patientRegister.patientRegisterAbs[i].id) { |
|
|
|
this.patientRegister.patientRegisterAbs.splice(i, 1) |
|
|
|
i-- |
|
|
|
continue |
|
|
|
@ -469,7 +514,7 @@ export default { |
|
|
|
this.patientRegister.patientRegisterAbs[i].groupPackageId = null |
|
|
|
} else { |
|
|
|
//数据库有,才添加到待删除的数组中 |
|
|
|
if(this.patientRegister.patientRegisterAbs[i].id){ |
|
|
|
if (this.patientRegister.patientRegisterAbs[i].id) { |
|
|
|
registerAsbitemIds.push(this.patientRegister.patientRegisterAbs[i].id) |
|
|
|
} |
|
|
|
this.patientRegister.patientRegisterAbs.splice(i, 1) |
|
|
|
@ -478,19 +523,19 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
if (chargeComplete) { |
|
|
|
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`) |
|
|
|
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` }); |
|
|
|
} |
|
|
|
|
|
|
|
body = { registerAsbitemIds } |
|
|
|
if (registerAsbitemIds.length > 0) { |
|
|
|
this.batchDelAsb(body, ''); |
|
|
|
await this.batchDelAsb(body, ''); |
|
|
|
} |
|
|
|
|
|
|
|
let updateBody = [] |
|
|
|
if (this.patientRegister.patientRegisterAbs.length > 0) { |
|
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
|
//数据库有,才添加到待更新的数组中 |
|
|
|
if(this.patientRegister.patientRegisterAbs[i].id){ |
|
|
|
if (this.patientRegister.patientRegisterAbs[i].id) { |
|
|
|
updateBody.push({ |
|
|
|
registerAsbitemId: this.patientRegister.patientRegisterAbs[i].id, |
|
|
|
input: { |
|
|
|
@ -503,7 +548,7 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.batchEditAsb(updateBody, ''); |
|
|
|
await this.batchEditAsb(updateBody, ''); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
@ -545,18 +590,18 @@ export default { |
|
|
|
//监听事件 |
|
|
|
watch: { |
|
|
|
//分组改变,查出当前分组下对应的组合项目 |
|
|
|
"patientRegisterForm.customerOrgGroupId"(newVal, oldVal) { |
|
|
|
console.log("watch patientRegisterForm.customerOrgGroupId newVal:", newVal, " oldVal:", oldVal); |
|
|
|
if (newVal != oldVal) { |
|
|
|
this.getCustomerOrgGroupAsb(newVal); |
|
|
|
"patientRegister.customerOrgGroupChange"(newVal, oldVal) { |
|
|
|
console.log("watch patientRegister.customerOrgGroupChange newVal:", newVal, " oldVal:", oldVal); |
|
|
|
if (newVal != oldVal && newVal > 0) { |
|
|
|
this.getCustomerOrgGroupAsb(this.patientRegisterForm.customerOrgGroupId); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//套餐改变,查出当前套餐下对应的组合项目 |
|
|
|
"patientRegisterForm.medicalPackageId"(newVal, oldVal) { |
|
|
|
console.log("watch patientRegisterForm.medicalPackageId newVal:", newVal, " oldVal:", oldVal); |
|
|
|
if (newVal != oldVal) { |
|
|
|
this.getMedicalPackageAsb(newVal); |
|
|
|
"patientRegister.medicalPackageChange"(newVal, oldVal) { |
|
|
|
console.log("watch patientRegister.medicalPackageChange newVal:", newVal, " oldVal:", oldVal); |
|
|
|
if (newVal != oldVal && newVal > 0) { |
|
|
|
this.getMedicalPackageAsb(this.patientRegisterForm.medicalPackageId); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|