隐患数据统计分析:隐患数量核对,点击图表每部分信息时,可显示隐患的筛选界面

main
15036302109 8 months ago
parent 0273532457
commit 22aa9b8a26

@ -71,6 +71,8 @@ FROM ehs_hidden_danger h LEFT JOIN sys_dept d ON h.dept_id = d.dept_id
<if test="assistDept != null and assistDept != ''"> and FIND_IN_SET( #{assistDept}, assist_dept )</if>
<if test="areaId != null and areaId != ''">and area_id = #{areaId}</if>
<if test="isTowns != null and isTowns != ''">and is_Towns = #{isTowns}</if>
<if test="enterpriseScale != null and enterpriseScale != ''">and enterprise_scale = #{enterpriseScale}</if>
<if test="economicType != null and economicType != ''">and economic_type = #{economicType}</if>
<if test="currMonth == 1">and DATE_FORMAT(NOW(), '%Y-%m') = DATE_FORMAT( h.check_time, '%Y-%m') </if>
<if test="overTime == 7 ">and (h.STATUS = 0 or h.STATUS = 5 ) AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) )>3 AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) ) &lt;= 7 </if>
<if test="overTime == 3 ">and (h.STATUS = 0 or h.STATUS = 5 ) AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) )>=0 AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) ) &lt; 3 </if>

@ -176,7 +176,8 @@ SELECT
resultType="map">
SELECT
ifnull(d.dict_label,'未知') 'name',
count( 1 ) 'value'
SUM(IFNULL(e.hd_count,0)) 'value',
enterprise_type 'enterpriseType'
FROM
ehs_hidden_danger e
LEFT JOIN sys_dict_data d ON e.enterprise_type = d.dict_value
@ -191,7 +192,8 @@ SELECT
resultType="map">
SELECT
ifnull(d.dict_label,'未知') 'name',
count( 1 ) 'value'
SUM(IFNULL(e.hd_count,0)) 'value',
economic_type 'economicType'
FROM
ehs_hidden_danger e
LEFT JOIN sys_dict_data d ON e.economic_type = d.dict_value
@ -206,7 +208,8 @@ SELECT
resultType="map">
SELECT
ifnull(d.dict_label,'未知') 'name',
count( 1 ) 'value'
SUM(IFNULL(e.hd_count,0)) 'value',
enterprise_scale 'enterpriseScale'
FROM
ehs_hidden_danger e
LEFT JOIN sys_dict_data d ON e.enterprise_scale = d.dict_value
@ -236,7 +239,8 @@ SELECT
resultType="map">
SELECT
ifnull(d.dict_label,'未知') 'name',
SUM(IFNULL(e.hd_count,0)) 'value'
SUM(IFNULL(e.hd_count,0)) 'value',
e.status
FROM
ehs_hidden_danger e
LEFT JOIN sys_dict_data d ON e.status = d.dict_value

@ -1,6 +1,7 @@
<template>
<div class="dap">
<indexHD ref="indexHDRef" ></indexHD>
<indexDanger ref="indexDangerRef"></indexDanger>
<div class="row">
<div class="left_top bcg">
<el-tabs v-model="activeName" @tab-click="handleClick">
@ -189,9 +190,10 @@ import {
getDangerList,
} from "@/api/ehs/ehsExamples";
import indexHD from "./indexHD";
import indexDanger from "./indexDanger"
export default {
name: "dap",
components: { indexHD},
components: { indexHD, indexDanger},
data() {
return {
activeName: "tj1", //tab
@ -341,6 +343,12 @@ export default {
option && this.myChart2.setOption(option);
// myChart.resize();
this.myChart2.on('click', (params) => {
const a = res.data.find((e) => {
return params.name == e.name;
})
this.$refs.indexDangerRef.openDialog1(a.status);
});
},
async hylyinit() {
let res = await getTrade();
@ -386,6 +394,12 @@ export default {
};
option && this.myChart3.setOption(option);
// myChart.resize();
this.myChart3.on('click', (params) => {
const a = res.data.find((e)=>{
return params.name == e.name;
})
this.$refs.indexDangerRef.openDialog4(a.enterpriseType);
});
},
async jjClassInit() {
let res = await getEconomics();
@ -431,6 +445,12 @@ export default {
};
option && this.myChart4.setOption(option);
// myChart.resize();
this.myChart4.on('click', (params) => {
const a = res.data.find((e) => {
return params.name == e.name;
});
this.$refs.indexDangerRef.openDialog3(a.economicType);
});
},
async scaleInit() {
let res = await getScale();
@ -478,6 +498,12 @@ export default {
// window.onresize = function() {
// this.myChart5.resize();
// };
this.myChart5.on('click', (params) => {
const a = res.data.find((e) => {
return params.name == e.name;
});
this.$refs.indexDangerRef.openDialog2(a.enterpriseScale);
});
},
},

@ -0,0 +1,423 @@
<template>
<el-dialog title="隐患信息查询" :visible.sync="open" width="1200px" @close="cancel" append-to-body>
<div class="app-container">
<el-table v-loading="loading" :data="ehsHiddenDangerList" @selection-change="handleSelectionChange" max-height="550" style="width: 100%" :row-class-name="tableRowClassName">
<el-table-column label="上报部门" align="center" prop="deptName" v-if="deptShow"/>
<el-table-column label="单位名称" align="center" prop="enterpriseName" >
<template slot-scope="scope">
<el-link type="primary" @click="handleUpdate(scope.row,true)">{{scope.row.enterpriseName}} </el-link>
</template>
</el-table-column>
<el-table-column label="行业领域" align="center" prop="enterpriseType">
<template slot-scope="scope">
<dict-tag :options="dict.type.enterprise_type" :value="scope.row.enterpriseType"/>
</template>
</el-table-column>
<el-table-column label="企业规模" align="center" prop="enterpriseScale">
<template slot-scope="scope">
<dict-tag :options="dict.type.enterprise_scale" :value="scope.row.enterpriseScale"/>
</template>
</el-table-column>
<el-table-column label="经济类型" align="center" prop="economicType">
<template slot-scope="scope">
<dict-tag :options="dict.type.economic_type" :value="scope.row.economicType"/>
</template>
</el-table-column>
<el-table-column label="企业现状" align="center" prop="enterpriseStatus" width="50">
<template slot-scope="scope">
<span> {{ (scope.row.enterpriseStatus !=null && scope.row.enterpriseStatus != "") ? statusOptions[scope.row.enterpriseStatus].label:""}}</span>
</template>
</el-table-column>
<el-table-column label="隐患数量" align="center" prop="hdCount" width="50"/>
<el-table-column label="隐患情况" align="center" prop="hiddenDangerDesc" />
<el-table-column label="排查时间" align="center" prop="checkTime" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="排查方式" align="center" prop="checkType"width="50">
<template slot-scope="scope">
<dict-tag :options="dict.type.check_type" :value="scope.row.checkType"/>
</template>
</el-table-column>
<el-table-column label="整改措施" align="center" prop="rectifyMeasure" />
<el-table-column label="要求整改时间" align="center" prop="rectifyTermTime" width="80">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.rectifyTermTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="整改进度" align="center" prop="status"width="50">
<template slot-scope="scope">
<dict-tag :options="dict.type.hidden_danger_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="整改时间" align="center" prop="rectifyTime" width="80">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.rectifyTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="整改责任人" align="center" prop="principalName" width="50"/>
<el-table-column label="监管部门" align="center" prop="regulatoryDept" />
<el-table-column label="监管部门责任人" align="center" prop="regulatoryName" width="50"/>
<el-table-column label="隐患级别" align="center" prop="hiddenDangerGrade"width="50">
<template slot-scope="scope">
<dict-tag :options="dict.type.hidden_danger_grade" :value="scope.row.hiddenDangerGrade"/>
</template>
</el-table-column>
<el-table-column label="是否督办" align="center" prop="isSupervise"width="50">
<template slot-scope="scope">
<el-switch v-model="scope.row.isSupervise==1" @change="val => {isSuperviseChange(val, scope.row);}" ></el-switch>
</template>
</el-table-column>
<el-table-column label="是否协办" align="center" prop="assistDept"width="50">
<template slot-scope="scope">
<el-link type="primary" @click="val => {assistDeptClick(val, scope.row);}" > {{(scope.row.assistDept=='' ||scope.row.assistDept==null)?"无协办单位": "显示协办单位" }} </el-link>
</template>
</el-table-column>
<el-table-column label="标签" align="center" prop="hiddenDangerLabel"width="50">
<template slot-scope="scope">
<dict-tag :options="dict.type.hidden_danger_label" :value="scope.row.hiddenDangerLabel"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listEhsHiddenDanger, superviseEhsHiddenDanger } from "@/api/ehs/ehsHiddenDanger";
import {listAllDept } from "@/api/system/dept";
import importUpload from "@/components/upload/upload";
export default {
name: "EhsHiddenDanger",
dicts: ['hidden_danger_type', 'hidden_danger_grade', 'hidden_danger_label', 'enterprise_type','enterprise_scale',
'economic_type','area_id', "hidden_danger_status","check_type", "ehs_yes_no"],
components:{ importUpload },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
ehsHiddenDangerList: [],
//
title: "",
//
open: false,
isReadOnly:false,//form
//
deptShow: false,
//
allDeptList: [],
currEnterpriseInfo:{},//
//
daterangeCheckTime: [],
//
daterangeRectifyTime: [],
openAssist:false,//
assistDeptList:"",//
currAssistHiddenDangerId :-1,//id
statusOptions: [{
value: '0',
label: '停业',
}, {
value: '1',
label: '正常经营',
}],
enterpriseSelectOpen:false,//
//
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseName: null,
enterpriseStatus: null,
enterpriseType: null,
hiddenDangerDesc: null,
checkTime: null,
checkType: null,
hiddenDangerImg: null,
rectifyMeasure: null,
status: null,
rectifyTime: null,
principalName: null,
rectifyImg: null,
regulatoryDept: null,
regulatoryName: null,
hiddenDangerGrade: null,
hiddenDangerType: null,
hiddenDangerLabel: null,
hiddenDangerLabelArray:null,
isTowns:null,
overTime:null,
address:null,
enterpriseScale:null,
economicType:null,
},
alertState: [{
value: '7',
label: '7天预警'
}, {
value: '3',
label: '3天预警'
}, {
value: '0',
label: '逾期告警'
}],
//
form: {},
formAssist:{},
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
};
},
created() {
this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
},
methods: {
/** 查询隐患信息列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCheckTime && '' != this.daterangeCheckTime) {
this.queryParams.params["beginCheckTime"] = this.daterangeCheckTime[0];
this.queryParams.params["endCheckTime"] = this.daterangeCheckTime[1];
}
if (null != this.daterangeRectifyTime && '' != this.daterangeRectifyTime) {
this.queryParams.params["beginRectifyTime"] = this.daterangeRectifyTime[0];
this.queryParams.params["endRectifyTime"] = this.daterangeRectifyTime[1];
}
listEhsHiddenDanger(this.queryParams).then(response => {
this.ehsHiddenDangerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 单位信息列表 */
getListAllDept() {
console.log(this.$store.state.user.deptId);
this.loading = true;
listAllDept().then(response => {
this.allDeptList = response.data;
this.loading = false;
});
},
//
cancel() {
this.daterangeCheckTime = [];
this.daterangeRectifyTime = [];
this.open = false;
this.openAssist = false;
this.reset();
},
//
reset() {
this.form = {
hiddenDangerId: null,
enterpriseName: null,
enterpriseStatus: null,
enterpriseType: null,
hiddenDangerDesc: null,
checkTime: null,
checkType: null,
hiddenDangerImg: null,
rectifyMeasure: null,
status: null,
rectifyTime: null,
principalName: null,
rectifyImg: null,
regulatoryDept: null,
regulatoryName: null,
hiddenDangerGrade: null,
hiddenDangerType: null,
hiddenDangerLabel: null,
hiddenDangerLabelArray:null,
areaId:null,
economicType:null,
enterpriseScale:null,
isTowns:null,
};
this.resetForm("form");
this.queryParams.status = null;
this.queryParams.enterpriseScale = null;
this.queryParams.economicType = null;
this.queryParams.enterpriseType = null;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCheckTime = [];
this.daterangeRectifyTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.hiddenDangerId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 督办 */
handleIsSupervise(row) {
const hiddenDangerIds = row.hiddenDangerId || this.ids;
this.$modal.confirm('是否确认督办隐患信息?').then(function() {
return superviseEhsHiddenDanger(hiddenDangerIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("督办成功");
}).catch(() => {});
},
/** 协办 */
handleAssist(row) {
this.reset();
this.openAssist = true;
this.assistDeptList = row.assistDept.split(",").map(Number);
this.currAssistHiddenDangerId = row.hiddenDangerId;
},
//
isSuperviseChange(value,row) {
if(this.deptShow==false){
return;
}
console.log(row);
if(row.isSupervise==0){
this.handleIsSupervise(row);
}else{
this.$modal.alert("此隐患已督办,不能撤回督办。");
}
},
//
assistDeptClick(value,row) {
if(row.assistDeptName!="" && row.assistDeptName!=null){
this.$alert(row.assistDeptName, '协办单位', {
confirmButtonText: '确定',
callback: action => {
}
});
}
},
/** 显示督办反馈 */
handleShowAssistResult(row) {
this.$alert(row.superviseResult, '督办反馈', {
confirmButtonText: '确定',
callback: action => {
/*this.$message({
type: 'info',
message: `action: ${ action }`
});*/
}
});
},
tableRowClassName({row, rowIndex}) {
if(row.status==0 ||status==5){
if (row.overTime <0 ) {
return 'warning-row';
} else if (row.overTime > 3 && row.overTime <= 7) {
return 'warning7-row';
} else if (row.overTime > 0 && rowIndex <= 3) {
return 'warning3-row';
}
}
return '';
},
openDialog1(status) {
//this.queryParams.currMonth = 1;
this.queryParams.status = status;
this.getList();
this.open = true;
},
openDialog2(enterpriseScale) {
//this.queryParams.currMonth = 1;
this.queryParams.enterpriseScale = enterpriseScale;
this.getList();
this.open = true;
},
openDialog3(economicType) {
//this.queryParams.currMonth = 1;
this.queryParams.economicType = economicType;
this.getList();
this.open = true;
},
openDialog4(enterpriseType) {
//this.queryParams.currMonth = 1;
this.queryParams.enterpriseType = enterpriseType;
this.getList();
this.open = true;
},
}
};
</script>
<style>
.el-table .warning-row {
background: #f97762;
}
.el-table .warning7-row {
background: #57a6f9;
}
.el-table .warning3-row {
background: #f9c43d;
}
</style>
Loading…
Cancel
Save