|
|
|
@ -1,28 +1,20 @@ |
|
|
|
<template> |
|
|
|
<div style="margin-left: 10px;"> |
|
|
|
<div> |
|
|
|
<span>项目类别</span> |
|
|
|
<el-select |
|
|
|
v-model="value" |
|
|
|
placeholder="请选择" |
|
|
|
style="margin-left: 20px" |
|
|
|
@change="getAsbItemByItemType" |
|
|
|
clearable |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in itemType" |
|
|
|
:key="item.id" |
|
|
|
:label="item.displayName" |
|
|
|
:value="item.id" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<span>项目类别</span> |
|
|
|
<el-cascader |
|
|
|
:options="dict.itemTypeTree" |
|
|
|
:props="{ checkStrictly: true ,expandTrigger: 'hover',...customerOrg.treeprops}" |
|
|
|
:show-all-levels="false" |
|
|
|
clearable filterable |
|
|
|
@change="getAsbItemByItemType"> |
|
|
|
</el-cascader> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mainareaBox"> |
|
|
|
<el-table |
|
|
|
:header-cell-style="{ background: '#eef1f6' }" |
|
|
|
:data="asbItem" height="350" |
|
|
|
:data="dict.asbItem" height="350" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
> |
|
|
|
<el-table-column type="selection"></el-table-column> |
|
|
|
@ -51,12 +43,11 @@ |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mainareaBox"> |
|
|
|
<el-table |
|
|
|
:header-cell-style="{ background: '#eef1f6' }" |
|
|
|
:data="patientRegisterAbs" height="350" |
|
|
|
:data="patientRegister.patientRegisterAbs" height="350" |
|
|
|
@selection-change="selecteditems" |
|
|
|
> |
|
|
|
<!-- temporaryselection personnelUnit.nogroupselected--> |
|
|
|
@ -82,11 +73,10 @@ export default { |
|
|
|
return { |
|
|
|
itemType: [], //项目类别 |
|
|
|
|
|
|
|
asbItemAll: [], //所有的组合项目 |
|
|
|
asbItem: [], //显示的 未选组合项目 |
|
|
|
|
|
|
|
asbItemChoosed: [], //勾选的 未选组合项目 |
|
|
|
|
|
|
|
patientRegisterAbs:[], //体检人员所选组合项目 |
|
|
|
//patientRegisterAbs:[], //体检人员所选组合项目 放vuex |
|
|
|
patientRegisterAbsChoosed:[], //勾选的 体检人员所选组合项目 |
|
|
|
|
|
|
|
patientRegisterAbsRd:{ |
|
|
|
@ -96,94 +86,30 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(['dict', 'patientRegister','personnelUnit']), |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
this.getItemType(); |
|
|
|
this.getAbsItemAll(); |
|
|
|
...mapState(['dict','customerOrg','patientRegister','personnelUnit']), |
|
|
|
}, |
|
|
|
|
|
|
|
mounted(){ |
|
|
|
|
|
|
|
mounted(){ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
//保存按钮 |
|
|
|
Onsubmit() { |
|
|
|
if (!this.personnelUnit.customerOrgGroupId) { |
|
|
|
alert("请先选择单位分组"); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
postapi("/api/app/customer-org-group-detail/many", this.addrulst).then( |
|
|
|
(res) => { |
|
|
|
this.$message.success("操作成功"); |
|
|
|
console.log(this.addrulst); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
//移除按钮 |
|
|
|
addselecteditems() { |
|
|
|
//personnelUnit.nogroupselected |
|
|
|
if (this.rightselctedata.length == 0) { |
|
|
|
this.$message.warning("已选数据为空无法移动"); |
|
|
|
} else { |
|
|
|
let count = this.rightselctedata.length - 1; |
|
|
|
for (var i = count; i >= 0; i--) { |
|
|
|
// this.personnelUnit.nogroupselected.splice(i, 1); |
|
|
|
if ( |
|
|
|
// !this.rightselctedata.includes(this.rightselctedata[i].displayName) |
|
|
|
[...new Set(this.rightselctedata)] |
|
|
|
) { |
|
|
|
this.asbItem.push(this.rightselctedata[i]); |
|
|
|
this.personnelUnit.nogroupselected.splice(i, 1); |
|
|
|
|
|
|
|
} |
|
|
|
// this.asbItem.push(this.rightselctedata[i]); |
|
|
|
} |
|
|
|
// this. |
|
|
|
this.rightselctedata.forEach((item) => { |
|
|
|
this.addrulst.push({ |
|
|
|
asbitemId: item.id, |
|
|
|
price: item.price, |
|
|
|
customerOrgGroupId: this.personnelUnit.customerOrgGroupId, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//右侧勾选按钮 |
|
|
|
selecteditems(val) { |
|
|
|
this.rightselctedata = val; |
|
|
|
// this.personnelUnit.nogroupselected = val; |
|
|
|
console.log(this.rightselctedata); |
|
|
|
|
|
|
|
}, |
|
|
|
// 添加按钮 |
|
|
|
removedata() { |
|
|
|
if (this.asbItemChoosed.length == 0) { |
|
|
|
this.$message.warning("未选数据为空无法移动"); |
|
|
|
} else { |
|
|
|
this.saveornot = false; |
|
|
|
let count = this.asbItemChoosed.length - 1; |
|
|
|
for (var i = count; i >= 0; i--) { |
|
|
|
// this.asbItem.splice(i, 1); |
|
|
|
// this.personnelUnit.nogroupselected.push(this.asbItemChoosed[i]); |
|
|
|
if ([...new Set(this.asbItemChoosed)]) { |
|
|
|
this.asbItem.splice(i, 1); |
|
|
|
this.personnelUnit.nogroupselected.push(this.asbItemChoosed[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.asbItemChoosed.forEach((item) => { |
|
|
|
this.addrulst.push({ |
|
|
|
asbitemId: item.id, |
|
|
|
price: item.price, |
|
|
|
customerOrgGroupId: this.personnelUnit.customerOrgGroupId, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 左侧未选 |
|
|
|
@ -192,87 +118,40 @@ export default { |
|
|
|
this.asbItemChoosed = val; |
|
|
|
console.log(this.asbItemChoosed); |
|
|
|
}, |
|
|
|
|
|
|
|
//获取所有组合项目 |
|
|
|
getAbsItemAll() { |
|
|
|
getapi("/api/app/asbitem/in-filter?Filter").then((res) => { |
|
|
|
this.asbItemAll = res.data.items; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//项目类别过滤 组合项目 |
|
|
|
getAsbItemByItemType(v) { |
|
|
|
if(v){ |
|
|
|
this.asbItem = [...this.asbItemAll] |
|
|
|
}else{ |
|
|
|
this.asbItem = arrayFilter(this.asbItemAll,'itemTypeId',v) |
|
|
|
//console.log('getAsbItemByItemType',typeof v) |
|
|
|
let lv = '' |
|
|
|
if(typeof v === "object"){ |
|
|
|
lv = v[v.length - 1] |
|
|
|
} |
|
|
|
|
|
|
|
//刷新显示 未选组合项目 |
|
|
|
arrayReduce(this.asbItem,[...this.patientRegisterAbs],'id=asbitemId') |
|
|
|
}, |
|
|
|
|
|
|
|
//获取所有项目类别 |
|
|
|
getItemType() { |
|
|
|
getapi("/api/app/item-type/by-code-all").then((res) => { |
|
|
|
this.itemType = res.data; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//获取当前列表数据 |
|
|
|
listeninglist() { |
|
|
|
getapi( |
|
|
|
`/api/app/customer-org-group/${this.personnelUnit.customerOrgGroupId}` |
|
|
|
).then((res) => { |
|
|
|
this.personnelUnit.form = res.data; |
|
|
|
console.log(res); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//获取分组所包含的组合项目 |
|
|
|
getCustomerOrgGroupAsb(){ |
|
|
|
console.log('getCustomerOrgGroupAsb'); |
|
|
|
if(!this.patientRegisterForm.customerOrgGroupId || this.patientRegisterForm.customerOrgGroupId == this.dict.personOrgId ){ |
|
|
|
return |
|
|
|
if(lv){ |
|
|
|
this.dict.asbItem = arrayFilter(this.dict.asbItemAll,'itemTypeId',lv) |
|
|
|
}else{ |
|
|
|
this.dict.asbItem = [...this.dict.asbItemAll] |
|
|
|
} |
|
|
|
getapi(`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.patientRegisterForm.customerOrgGroupId}`) |
|
|
|
.then((res) => { |
|
|
|
console.log('getCustomerOrgGroupAsb',res); |
|
|
|
if(res.code == 1){ |
|
|
|
this.patientRegister.customerOrgGroupAsb = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//获取套餐所包含的组合项目 |
|
|
|
getMedicalPackageAsb(){ |
|
|
|
if(!this.patientRegisterForm.medicalPackageId || this.patientRegisterForm.medicalPackageId == this.dict.personOrgId ){ |
|
|
|
return |
|
|
|
} |
|
|
|
getapi(`/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=${this.patientRegisterForm.medicalPackageId}`) |
|
|
|
.then((res) => { |
|
|
|
console.log('medicalPackageAsb',res); |
|
|
|
if(res.code == 1){ |
|
|
|
this.patientRegister.medicalPackageAsb = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
arrayReduce(this.dict.asbItem,[...this.patientRegister.patientRegisterAbs],'id=asbitemId') |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//获取体检登记的组合项目 api/app/register-asbitem/in-patient-register-id/3a0c3094-6f37-f5cc-9811-2bc249c081ce |
|
|
|
getPatientRegisterAbs(patientRegisterId){ |
|
|
|
getPatientRegisterAbs(patientRegisterId){ |
|
|
|
//console.log('getPatientRegisterAbs',patientRegisterId) |
|
|
|
getapi(`/api/app/register-asbitem/in-patient-register-id/${patientRegisterId}`) |
|
|
|
.then((res) => { |
|
|
|
console.log('patientRegisterAbs',res); |
|
|
|
console.log('getPatientRegisterAbs',res.data); |
|
|
|
if(res.code == 1){ |
|
|
|
this.patientRegisterAbs = res.data |
|
|
|
this.patientRegister.patientRegisterAbs = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//体检登记的组合项目创建 |
|
|
|
registerAsbitem(body){ |
|
|
|
console.log('registerAsbitem') |
|
|
|
postapi(`api/app/register-asbitem?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`,body) |
|
|
|
.then((res) => { |
|
|
|
console.log('medicalPackageAsb',res); |
|
|
|
@ -289,20 +168,12 @@ export default { |
|
|
|
|
|
|
|
//新增触发 |
|
|
|
'patientRegister.addTimes'(newVal, oldVal) { |
|
|
|
//console.log('patientRegister.addTimes newVal:',newVal,' oldVal:',oldVal) |
|
|
|
console.log('watch patientRegister.addTimes newVal:',newVal,' oldVal:',oldVal) |
|
|
|
if (newVal != oldVal) { |
|
|
|
this.patientRegisterAbs = [] |
|
|
|
this.patientRegister.patientRegisterAbs = [] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//编辑触发 |
|
|
|
'patientRegister.patientRegisterRd.id'(newVal, oldVal) { |
|
|
|
console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal) |
|
|
|
if (newVal != oldVal) { |
|
|
|
this.getPatientRegisterAbs(newVal); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|