Browse Source

tjdj

master
pengjun 2 years ago
parent
commit
67b4f7f4bc
  1. 79
      src/components/patientRegister/PatientRegisterItem.vue

79
src/components/patientRegister/PatientRegisterItem.vue

@ -100,8 +100,55 @@ export default {
...mapActions(['getCustomerOrgGroup','getMedicalPackageAsb', 'getPatientRegisterAbs']), ...mapActions(['getCustomerOrgGroup','getMedicalPackageAsb', 'getPatientRegisterAbs']),
// //
onSubmit(val) {
// [
// {
// "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "input": {
// "chargePrice": 0,
// "payTypeFlag": "string",
// "isCharge": "string",
// "amount": 0,
// "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// }
// ]
onSubmit() {
let body = []
if(this.patientRegister.patientRegisterAbs.length < 1){
alert("暂无可操作的数据")
return
}
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
}
})
}
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}`});
});
}, },
// //
@ -155,7 +202,7 @@ export default {
console.log(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body) console.log(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body)
postapi(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body) postapi(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body)
.then((res) => { .then((res) => {
console.log("medicalPackageAsb", res);
console.log("addAbs", res);
if (res.code == 1) { if (res.code == 1) {
// //
this.getPatientRegisterAbs(this.patientRegisterForm.id) this.getPatientRegisterAbs(this.patientRegisterForm.id)
@ -177,6 +224,7 @@ export default {
}, },
// //
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
delAbs(){ delAbs(){
let body = [] let body = []
let checked = true let checked = true
@ -185,33 +233,26 @@ export default {
return return
} }
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){
if(this.patientRegisterAbsChoosed[i].forSexId != this.patientRegisterForm.sexId){
alert(`所选项目:${this.patientRegisterAbsChoosed[i].displayName},不适合当前人员性别`)
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){
if(this.patientRegisterAbsChoosed[i].isCharge == 'Y') {
alert(`所选项目:${this.patientRegisterAbsChoosed[i].displayName},已收费,不可删除!`)
checked = false checked = false
break break
} }
} }
//console.log(222,checked)
if(!checked) return if(!checked) return
for(let i = 0;i<this.asbItemChoosed.length;i++){
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){
body.push({ body.push({
asbitemId: this.asbItemChoosed[i].id,
patientRegisterId: this.patientRegisterForm.id,
standardPrice: this.asbItemChoosed[i].price,
chargePrice: this.asbItemChoosed[i].price,
payTypeFlag: "0",
isCharge: "N",
amount: 1
RegisterAsbitemIds: this.patientRegisterAbsChoosed[i].id,
}) })
} }
console.log(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body)
postapi(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body)
console.log(`/api/app/register-asbitem/many`,body)
deletapi(`/api/app/register-asbitem/many`,body)
.then((res) => { .then((res) => {
console.log("medicalPackageAsb", res);
console.log("delAbs", res);
if (res.code == 1) { if (res.code == 1) {
// //
this.getPatientRegisterAbs(this.patientRegisterForm.id) this.getPatientRegisterAbs(this.patientRegisterForm.id)

Loading…
Cancel
Save