|
|
|
@ -1,45 +1,63 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-table :data="dataTransOpts.tableM.patient_poison" border height="465" row-key="id" size="small" |
|
|
|
highlight-current-row ref="patientPoison"> |
|
|
|
<el-table-column prop="poisonId" label="接害因素" min-width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.poisonId" size="small" style="width:220px" clearable filterable |
|
|
|
:filter-method="filterMethod"> |
|
|
|
<el-option-group v-for="group in postion" :key="group.poisonTypeName" :label="group.poisonTypeName"> |
|
|
|
<el-option v-for="item in group.poisonDtos" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
<!--组件主体--> |
|
|
|
<div> |
|
|
|
<el-table :data="dataTransOpts.tableM.patient_poison" border :height="height" row-key="id" size="small" |
|
|
|
highlight-current-row ref="patientPoison"> |
|
|
|
<el-table-column prop="poisonName" label="接害因素" min-width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input placeholder="请选接害因素" v-model="scope.row.poisonName" size="small" disabled> |
|
|
|
<el-button slot="append" icon="el-icon-search" @click="btnDispPoison(scope.$index)" |
|
|
|
style="font-size: 20px;"></el-button> |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="occupationalAbnormalId" label="接害因素检查结论" min-width="130" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.occupationalAbnormalId" size="small" clearable filterable |
|
|
|
:filter-method="filterMethod"> |
|
|
|
<el-option v-for="item in occupationalAbnormal" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="lastModifierName" label="修改人员" min-width="80" align="center" /> |
|
|
|
<el-table-column prop="lastModificationTime" label="修改时间" min-width="150" align="center" /> |
|
|
|
<el-table-column prop="creatorName" label="创建人员" min-width="80" align="center" /> |
|
|
|
<el-table-column prop="creationTime" label="创建时间" min-width="150" align="center" /> |
|
|
|
<el-table-column fixed="right" width="30" align="center"> |
|
|
|
<template slot="header"> |
|
|
|
<div style="display: flex;justify-content:space-between;"> |
|
|
|
<div></div> |
|
|
|
<div> |
|
|
|
<i class="el-icon-plus" @click="btnAdd" style="font-size: 24px;color: blue;cursor:pointer;"></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<i class="el-icon-delete" @click="deleteRow(scope.$index)" |
|
|
|
style="font-size: 24px;color: red;cursor:pointer;"></i> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<!--弹窗--> |
|
|
|
<div> |
|
|
|
<el-dialog title="选择接害因素" :visible.sync="dialogPoison" width="400px" :close-on-click-modal="false" |
|
|
|
:append-to-body="true"> |
|
|
|
<div style="height: 320px;"> |
|
|
|
<el-select v-model="choosedPoison" size="small" style="width:380px;" clearable filterable |
|
|
|
:filter-method="filterMethod" value-key="id"> |
|
|
|
<el-option-group v-for="group in poison" :key="group.poisonTypeName" :label="group.poisonTypeName"> |
|
|
|
<el-option v-for="item in group.poisonDtos" :key="item.id" :label="item.displayName" :value="item" /> |
|
|
|
</el-option-group> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="occupationalAbnormalId" label="接害因素检查结论" min-width="130" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.occupationalAbnormalId" size="small" clearable filterable |
|
|
|
:filter-method="filterMethod"> |
|
|
|
<el-option v-for="item in occupationalAbnormal" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="lastModifierName" label="修改人员" min-width="80" align="center" /> |
|
|
|
<el-table-column prop="lastModificationTime" label="修改时间" min-width="150" align="center" /> |
|
|
|
<el-table-column prop="creatorName" label="创建人员" min-width="80" align="center" /> |
|
|
|
<el-table-column prop="creationTime" label="创建时间" min-width="150" align="center" /> |
|
|
|
<el-table-column fixed="right" width="30" align="center"> |
|
|
|
<template slot="header"> |
|
|
|
<div style="display: flex;justify-content:space-between;"> |
|
|
|
<div></div> |
|
|
|
<div> |
|
|
|
<i class="el-icon-plus" @click="btnAdd" style="font-size: 24px;color: blue;cursor:pointer;"></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<i class="el-icon-delete" @click="deleteRow(scope.$index)" |
|
|
|
style="font-size: 24px;color: red;cursor:pointer;"></i> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="btnOkPoison">确定</el-button> |
|
|
|
<el-button @click="dialogPoison = false">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
@ -49,26 +67,19 @@ import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { getPagePriv, checkPagePriv, objCopy, deepCopy, arrayExistObj } from "../../utlis/proFunc"; |
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
props: ["refFunc"], |
|
|
|
props: ["refFunc","height"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pagePriv: { |
|
|
|
routeUrlorPageName: 'customerOrg', //当前页面归属路由或归属页面权限名称 |
|
|
|
privs: [] // 页面权限 |
|
|
|
}, |
|
|
|
postion: [ |
|
|
|
{ |
|
|
|
poisonTypeName: "职业史", |
|
|
|
poisonDtos: [ |
|
|
|
{ |
|
|
|
id: "3a12ad8e-3b84-75a2-415e-c03ed69bda66", |
|
|
|
displayName: "噪声,粉尘", |
|
|
|
simpleCode: "ZS,FC" |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
], // 毒害因素 |
|
|
|
poisonList: [], |
|
|
|
poison: [], // 毒害因素 |
|
|
|
occupationalAbnormal: [], //结论 |
|
|
|
currRow: 0, |
|
|
|
choosedPoison: {}, |
|
|
|
dialogPoison: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -81,7 +92,7 @@ export default { |
|
|
|
|
|
|
|
//挂载完成 |
|
|
|
mounted() { |
|
|
|
this.dictInit() |
|
|
|
this.dictInit() |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
@ -95,23 +106,23 @@ export default { |
|
|
|
dictInit() { |
|
|
|
|
|
|
|
//职业病 接害因素 |
|
|
|
postapi("/api/app/Poison/GetPoisonWithTypeList").then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.dict.postion = res.data; |
|
|
|
this.postion = res.data; |
|
|
|
this.dict.postionList = [] |
|
|
|
this.dict.postion.forEach(e => { |
|
|
|
e.poisonDtos.forEach(e2 => { |
|
|
|
this.dict.postionList.push({ |
|
|
|
poisonTypeName: e.poisonTypeName, |
|
|
|
id: e2.id, |
|
|
|
displayName: e2.displayName, |
|
|
|
simpleCode: e2.simpleCode |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
// postapi("/api/app/Poison/GetPoisonWithTypeList").then(res => { |
|
|
|
// if (res.code > -1) { |
|
|
|
// this.dict.poison = res.data; |
|
|
|
// this.poison = res.data; |
|
|
|
// this.dict.poisonList = [] |
|
|
|
// this.dict.poison.forEach(e => { |
|
|
|
// e.poisonDtos.forEach(e2 => { |
|
|
|
// this.dict.poisonList.push({ |
|
|
|
// poisonTypeName: e.poisonTypeName, |
|
|
|
// id: e2.id, |
|
|
|
// displayName: e2.displayName, |
|
|
|
// simpleCode: e2.simpleCode |
|
|
|
// }) |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
//职业病检查结论 |
|
|
|
postapi("/api/app/OccupationalAbnormal/GetList").then((res) => { |
|
|
|
@ -122,29 +133,49 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 显示选择症状项目 |
|
|
|
btnDispPoison(index) { |
|
|
|
this.currRow = index |
|
|
|
this.poisonList = deepCopy(this.dict.poisonList) |
|
|
|
this.dataTransOpts.tableM.patient_poison.forEach((e, i) => { |
|
|
|
if (i != index) { |
|
|
|
let lfind = arrayExistObj(this.poisonList, 'id', e.poisonId) |
|
|
|
if (lfind > -1) this.poisonList.splice(lfind, 1) |
|
|
|
} |
|
|
|
}); |
|
|
|
this.poison = this.madeSelectGroup(this.poisonList) |
|
|
|
this.dialogPoison = true |
|
|
|
}, |
|
|
|
|
|
|
|
filterMethod(v) { |
|
|
|
// console.log('this.poisonList',v,this.poisonList) |
|
|
|
if (v) { |
|
|
|
let lv = v.toUpperCase() |
|
|
|
let postion = [] |
|
|
|
let postionList = this.dict.postionList.filter(e => { |
|
|
|
|
|
|
|
let poisonList = this.poisonList.filter(e => { |
|
|
|
return e.poisonTypeName.indexOf(lv) > -1 || e.displayName.indexOf(lv) > -1 || e.simpleCode.indexOf(lv) > -1 |
|
|
|
}) |
|
|
|
postionList.forEach(e => { |
|
|
|
let lfind = arrayExistObj(postion, "poisonTypeName", e.poisonTypeName) |
|
|
|
if (lfind == -1) { |
|
|
|
postion.push({ poisonTypeName: e.poisonTypeName, poisonDtos: [{ id: e.id, displayName: e.displayName, simpleCode: e.simpleCode }] }) |
|
|
|
} else { |
|
|
|
postion[lfind]['poisonDtos'].push({ id: e.id, displayName: e.displayName, simpleCode: e.simpleCode }) |
|
|
|
} |
|
|
|
}); |
|
|
|
this.postion = postion |
|
|
|
|
|
|
|
this.poison = this.madeSelectGroup(poisonList) |
|
|
|
} else { |
|
|
|
this.postion = deepCopy(this.dict.postion) |
|
|
|
this.poison = this.madeSelectGroup(this.poisonList) |
|
|
|
} |
|
|
|
console.log('filterMethod', v) |
|
|
|
// console.log('filterMethod', this.poison) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 列表数据生成 分组 select |
|
|
|
madeSelectGroup(poisonList) { |
|
|
|
let poison = [] |
|
|
|
poisonList.forEach(e => { |
|
|
|
let lfind = arrayExistObj(poison, "poisonTypeName", e.poisonTypeName) |
|
|
|
if (lfind == -1) { |
|
|
|
poison.push({ poisonTypeName: e.poisonTypeName, poisonDtos: [{ id: e.id, displayName: e.displayName, simpleCode: e.simpleCode }] }) |
|
|
|
} else { |
|
|
|
poison[lfind]['poisonDtos'].push({ id: e.id, displayName: e.displayName, simpleCode: e.simpleCode }) |
|
|
|
} |
|
|
|
}); |
|
|
|
return poison |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
@ -166,13 +197,24 @@ export default { |
|
|
|
|
|
|
|
//新增联系方式 |
|
|
|
btnAdd() { |
|
|
|
this.postion = deepCopy(this.dict.postion) |
|
|
|
this.poison = deepCopy(this.dict.poison) |
|
|
|
this.dataTransOpts.tableM.patient_poison.push({ |
|
|
|
patientRegisterId: this.patientRegisterId, |
|
|
|
poisonId: '' |
|
|
|
poisonId: '', |
|
|
|
poisonName:'', |
|
|
|
occupationalAbnormalId:null |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 确定选择症状 |
|
|
|
btnOkPoison() { |
|
|
|
// console.log('this.choosedPoison',this.choosedPoison) |
|
|
|
this.dataTransOpts.tableM.patient_poison[this.currRow]['poisonId'] = this.choosedPoison.id |
|
|
|
this.dataTransOpts.tableM.patient_poison[this.currRow]['poisonName'] = this.choosedPoison.displayName |
|
|
|
this.dialogPoison = false |
|
|
|
console.log('this.dataTransOpts.tableM.patient_poison',this.dataTransOpts.tableM.patient_poison) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
@ -207,7 +249,10 @@ export default { |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-icon-search:before { |
|
|
|
color: #00F; |
|
|
|
} |
|
|
|
|
|
|
|
.btnClass { |
|
|
|
width: 110px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
}</style> |