feat:新增 企业风险管控一张表

wuyanfu
kongyeqing 2023-06-27 17:35:11 +08:00
parent a930cbf338
commit 6ecdc5c471
3 changed files with 291 additions and 137 deletions

View File

@ -6,11 +6,16 @@ export default class MeasuresReportService extends BaseService<any>{
super()
}
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.system+'/user/list';
const url = this.prefix.prevention+'/risk/control/list';
return this.get(url,params,true)
}
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.system+'/user/list';
const url = this.prefix.prevention+'/risk/control';
return this.deleteBatch(url,params,{},true)
}
public selectById(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/task/list';
return this.get(url,params,true)
}
}

View File

@ -1,7 +1,6 @@
<div class="common-box dis-flex ">
<div class="common-tree-box" v-if="treeData">
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
</el-tree>
<div class="common-tree-box">
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
</div>
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
@ -10,8 +9,8 @@
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
:footerActions="footerActions" :actions="tableActions">
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
@ -27,7 +26,7 @@
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
<el-button type="text" @click="deleteData([scope.row])">查看执行纪律</el-button>
<el-button type="text" @click="showSubModal(scope.row.id)">查看执行纪律</el-button>
</template>
</el-table-column>
</el-table>
@ -36,8 +35,23 @@
</div>
</div>
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
:before-close="handleClose">
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
<!-- 查看执行记录 -->
<el-dialog :close-on-click-modal="false" :show-close="false" :visible.sync="showProtable" width="940px">
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
style="width: 100%">
<template v-for="item in proTableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
</el-table>
</TableComponent>
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
</div>

View File

@ -9,54 +9,50 @@ import MeasureReportService from "@/service/measuresReport.service"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import UnitService from '@/service/unit.service';
import AreaService from '@/service/area.service';
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import UnitTreeComponent from '@/components/tree.component.vue';
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
ButtonListComponent,
UnitTreeComponent,
},
})
export default class MeasuresReportManagerComponent extends BaseRecordComponent<any> {
public tableService = new MeasureReportService();
public unitService = new UnitService();
public areaService = new AreaService();
public params = {} as any;
public treeData = [{
label: '一级 1',
children: [{
label: '二级 1-1',
children: [{
label: '三级 1-1-1'
}]
}]
}, {
label: '一级 2',
children: [{
label: '二级 2-1',
children: [{
label: '三级 2-1-1'
}]
}, {
label: '二级 2-2',
children: [{
label: '三级 2-2-1'
}]
}]
}, {
label: '一级 3',
children: [{
label: '二级 3-1',
children: [{
label: '三级 3-1-1'
}]
}, {
label: '二级 3-2',
children: [{
label: '三级 3-2-1'
}]
}]
}]
public treeData = [];
public areaList = {} as any;
public unitList = {} as any;
//
public measuresSelectData = {} as any;
//
public tasksSelectData = {} as any;
public proTableColumn = [] as any;
public showProtable = false;
public currentProTableData = { datas: [] } as any;
public subActions = [{
name: "取消",
value: "cancel"
}];
public formActions = [{
name: "查询",
@ -88,12 +84,12 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name:"区域名称",
key:"areaId",
name: "管控对象",
key: "controlName",
type: "text",
}, {
name:"单元名称",
key:"unitId",
name: "分析对象",
key: "analName",
type: "text",
}];
@ -102,44 +98,144 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
public selectData = [];
created() {
this.$store.state.prevention_measures_sort.map((item) => {
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
})
this.$store.state.prevention_task_type.map((item) => {
this.tasksSelectData[item.value] = this.treeSelectData(item.children)
})
}
//
public handleNodeClick(data) {
console.log(data)
this.params.unitId = "";
this.params.areaId = "";
if (data.areaId) {
this.params.unitId = data.id
} else {
this.params.areaId = data.id
}
this.getTableData()
}
public buildTable() {
this.tableColumn.push({name:'序号',key:"index"});
this.tableColumn.push({name:'状态',key:"status",render:(data)=>{
if(data.status==0){
return "<span class='noDraw'>未绘制</span>"
this.tableColumn.push({
name: '状态', key: "status", render: (data) => {
if (data.status == 1) {
return "<span class='noDraw'>未发布</span>"
} else {
return "<span>已绘制</span>"
return "<span>已发布</span>"
}
}});
this.tableColumn.push({name:'区域名称',key:"deptName",width:"200px"});
this.tableColumn.push({name:'单元名称',key:"deptName",width:"200px"});
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
if(data.status==0){
return "<span class='noDraw'>未绘制</span>"
}
});
this.tableColumn.push({
name: '区域名称', key: "areaName", width: "200px",
});
this.tableColumn.push({
name: '单元名称', key: "unitName", width: "200px",
});
this.tableColumn.push({ name: '管控对象', key: "analControlName", width: "200px" });
this.tableColumn.push({ name: '分析对象', key: "itemName", width: "200px" });
this.tableColumn.push({ name: '风险源', key: "itemRiskSource", width: "200px" });
this.tableColumn.push({
name: '事故后果', key: "itemSeriousResult", width: "250px",
render: (data) => {
if (data.itemSeriousResult) {
return data.itemSeriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
}
}
});
this.tableColumn.push({
name: '风险等级', key: "itemRiskLevel", render: (data) => {
return "<span class='color_" + data.itemRiskLevel + "'>" + (data.itemRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.itemRiskLevel]) : '') + "</span>"
}
});
this.tableColumn.push({
name: '管控措施分类', key: "measureFirstType", width: "200px", render: (data) => {
if (data.measureFirstType) {
return this.$store.getters.prevention_measures_sort_map[data.measureFirstType]
}
}
});
this.tableColumn.push({
name: '管控措施分类', key: "measureSecondType",
render: (data) => {
if (data.measureFirstType) {
const secondTypeItem = this.measuresSelectData[data.measureFirstType]
return this.selectName(secondTypeItem, data.measureSecondType)
}
}
});
this.tableColumn.push({ name: '管控措施分类', key: "measureThirdType" });
this.tableColumn.push({ name: '管控措施', key: "measureDescription" });
this.tableColumn.push({
name: '是否包保责任人任务', key: "insuranceDutyFlag", render: (data) => {
if (data.taskItem) {
return '是'
} else {
return "<span>已绘制</span>"
return '否'
}
}});
this.tableColumn.push({name:'管控措施分类',key:"person"});
this.tableColumn.push({name:'管控措施分类',key:"person"});
this.tableColumn.push({name:'管控措施分类',key:"person"});
this.tableColumn.push({name:'管控措施',key:"person"});
this.tableColumn.push({name:'隐患排查任务',key:"person"});
this.tableColumn.push({name:'隐患责任人',key:"person"});
this.tableColumn.push({name:'岗位',key:"person"});
this.tableColumn.push({name:'排查周期',key:"person"});
this.tableColumn.push({name:'单位',key:"person"});
}
});
this.tableColumn.push({
name: '任务类型', key: "taskType", render: (data) => {
if (data.taskType || data.taskType === 0) {
return this.$store.getters.prevention_task_type_map[data.taskType]
}
}
});
this.tableColumn.push({
name: '包保任务对应项', key: "taskItem", width: "200px", render: (data) => {
if (data.taskItem) {
if (!this.tasksSelectData[data.taskType] || this.tasksSelectData[data.taskType].length === 0) {
this.$store.state.prevention_task_type.map((item) => {
this.tasksSelectData[item.value] = this.treeSelectData(item.children)
})
}
const taskItemName = {} as any;
this.tasksSelectData[data.taskType].map((item) => {
taskItemName[item.id] = item.label
})
return taskItemName[data.taskItem]
}
}
});
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", width: "150px" });
this.tableColumn.push({ name: '隐患责任人', key: "taskChargeUserName" });
this.tableColumn.push({ name: '岗位', key: "taskExecutePostName" });
this.tableColumn.push({ name: '排查周期', key: "taskReviewCycleValue" });
this.tableColumn.push({
name: '单位', key: "taskReviewCycleUnit", render: (data) => {
return this.$store.getters.prevention_cycle_unit_map[data.taskReviewCycleUnit]
}
});
//
this.proTableColumn.push({ name: '序号', key: "index" });
this.proTableColumn.push({ name: '排查时间', key: "taskChargeUserName" });
this.proTableColumn.push({ name: '排查人', key: "taskChargeUserName" });
this.proTableColumn.push({ name: '排查内容', key: "taskChargeUserName" });
this.proTableColumn.push({ name: '排查结果', key: "taskChargeUserName" });
this.proTableColumn.push({ name: '是否为隐患', key: "taskChargeUserName" });
this.proTableColumn.push({ name: '隐患描述', key: "taskChargeUserName" });
this.proTableColumn.push({ name: '隐患归属人', key: "taskChargeUserName" });
}
//
public loadAreaData() {
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
res.data.datas.map(item => {
this.areaList[item.id] = item.name
})
})
}
//
public loadUnitData() {
this.unitService.selectByPage({ pageSize: 1000 }, false).then((res: any) => {
res.data.datas.map(item => {
this.unitList[item.id] = item.name
})
})
}
public callback(data) {
@ -198,6 +294,45 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
public handleSelectionChange(data) {
this.selectData = data;
}
public treeSelectData(data) {
return data.map((item) => {
return {
label: item.dictLabel,
id: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
})
}
public selectName(selectGroup, data) {
if (selectGroup && selectGroup.length > 0) {
const map = {};
selectGroup.forEach((item: any) => {
if (item.value) {
map[item.value] = item.name
} else if (item.id) {
map[item.id] = item.label
}
})
return map[data]
}
}
//
public showSubModal(id) {
this.showProtable = true
this.tableService.selectById({ controlId: id }).then((res: any) => {
this.currentProTableData.datas = res.data.datas
})
}
//--
public subCallback() {
this.showProtable = false
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>