|
|
@ -62,7 +62,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { mapState, mapActions } from "vuex"; |
|
|
import { mapState, mapActions } from "vuex"; |
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { arrayFilter, arrayReduce } from "../../utlis/proFunc"; |
|
|
|
|
|
|
|
|
import { arrayFilter, arrayReduce ,arrayExistObj} from "../../utlis/proFunc"; |
|
|
export default { |
|
|
export default { |
|
|
props: ["patientRegisterForm"], |
|
|
props: ["patientRegisterForm"], |
|
|
data() { |
|
|
data() { |
|
|
@ -73,9 +73,6 @@ export default { |
|
|
|
|
|
|
|
|
//patientRegisterAbs:[], //体检人员所选组合项目 放vuex |
|
|
//patientRegisterAbs:[], //体检人员所选组合项目 放vuex |
|
|
patientRegisterAbsChoosed: [], //勾选的 体检人员所选组合项目 |
|
|
patientRegisterAbsChoosed: [], //勾选的 体检人员所选组合项目 |
|
|
|
|
|
|
|
|
patientRegisterAbsAdd: [], //体检人员 待新增的组合项目 |
|
|
|
|
|
patientRegisterAbsEdit: [], //体检人员 待编辑的组合项目 |
|
|
|
|
|
patientRegisterAbsDel: [], //体检人员 待删除的组合项目 |
|
|
patientRegisterAbsDel: [], //体检人员 待删除的组合项目 |
|
|
|
|
|
|
|
|
patientRegisterAbsRd: { |
|
|
patientRegisterAbsRd: { |
|
|
@ -102,7 +99,9 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
//...mapActions(['getMedicalPackageAsb','getMedicalPackageAsb']), |
|
|
//...mapActions(['getMedicalPackageAsb','getMedicalPackageAsb']), |
|
|
//保存按钮 |
|
|
//保存按钮 |
|
|
Onsubmit() { }, |
|
|
|
|
|
|
|
|
onSubmit(val) { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
//移除按钮 |
|
|
//移除按钮 |
|
|
addselecteditems() { }, |
|
|
addselecteditems() { }, |
|
|
//右侧勾选按钮 |
|
|
//右侧勾选按钮 |
|
|
@ -200,12 +199,11 @@ export default { |
|
|
console.log('addCustomerOrgGroupAsb') |
|
|
console.log('addCustomerOrgGroupAsb') |
|
|
let finded = false; |
|
|
let finded = false; |
|
|
for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) { |
|
|
for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) { |
|
|
finded = false; |
|
|
|
|
|
console.log('i',i,finded) |
|
|
|
|
|
|
|
|
finded = false; |
|
|
for (let j = 0; j < this.patientRegister.patientRegisterAbs.length; j++) { |
|
|
for (let j = 0; j < this.patientRegister.patientRegisterAbs.length; j++) { |
|
|
if (this.patientRegister.customerOrgGroupAsb[i].asbitemId == this.patientRegister.patientRegisterAbs[j].asbitemId) { |
|
|
if (this.patientRegister.customerOrgGroupAsb[i].asbitemId == this.patientRegister.patientRegisterAbs[j].asbitemId) { |
|
|
this.patientRegister.patientRegisterAbs[j].groupPackageId = groupPackageId |
|
|
this.patientRegister.patientRegisterAbs[j].groupPackageId = groupPackageId |
|
|
this.patientRegisterAbsEdit.push({ ...this.patientRegister.patientRegisterAbs[j], }) |
|
|
|
|
|
|
|
|
this.patientRegisterAbsEdit.push({ ...this.patientRegister.patientRegisterAbs[j] }) |
|
|
finded = true |
|
|
finded = true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -223,8 +221,15 @@ export default { |
|
|
groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID |
|
|
groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID |
|
|
}; |
|
|
}; |
|
|
console.log('i',i,asbItem) |
|
|
console.log('i',i,asbItem) |
|
|
this.patientRegister.patientRegisterAbs.push(asbItem); |
|
|
|
|
|
this.patientRegisterAbsAdd.push(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{ |
|
|
|
|
|
this.patientRegister.patientRegisterAbs.push(asbItem); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -254,8 +259,15 @@ export default { |
|
|
amount: 1, // integer($int32) 数量 |
|
|
amount: 1, // integer($int32) 数量 |
|
|
groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID |
|
|
groupPackageId: groupPackageId, // string($uuid) 分组或者套餐ID |
|
|
}; |
|
|
}; |
|
|
this.patientRegister.patientRegisterAbs.push(asbItem); |
|
|
|
|
|
this.patientRegisterAbsAdd.push(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{ |
|
|
|
|
|
this.patientRegisterAbsAdd.push(asbItem); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -264,7 +276,10 @@ export default { |
|
|
removeGroupPackageAsb(groupPackageId) { |
|
|
removeGroupPackageAsb(groupPackageId) { |
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) { |
|
|
if (this.patientRegister.patientRegisterAbs[i].groupPackageId == groupPackageId) { |
|
|
if (this.patientRegister.patientRegisterAbs[i].groupPackageId == groupPackageId) { |
|
|
this.patientRegisterAbsDel.push({id: this.patientRegister.patientRegisterAbs[i].id,}); |
|
|
|
|
|
|
|
|
//要移除的分组 尚未保存时,则不需要添加至删除缓冲中 |
|
|
|
|
|
if(!this.patientRegister.patientRegisterAbs[i].id){ |
|
|
|
|
|
this.patientRegisterAbsDel.push({id: this.patientRegister.patientRegisterAbs[i].id}); |
|
|
|
|
|
} |
|
|
this.patientRegister.patientRegisterAbs.splice(i, 1); |
|
|
this.patientRegister.patientRegisterAbs.splice(i, 1); |
|
|
i--; |
|
|
i--; |
|
|
} |
|
|
} |
|
|
@ -289,6 +304,11 @@ export default { |
|
|
this.getMedicalPackageAsb(newVal,oldVal); |
|
|
this.getMedicalPackageAsb(newVal,oldVal); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//体检信息触发分组的保存 |
|
|
|
|
|
"patientRegister.saveTimes"(newVal, oldVal){ |
|
|
|
|
|
this.onSubmit('') |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|