safetyHazardStatistics.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <!--安全隐患统计列表-->
  2. <template>
  3. <div class="page-container safetyHazardStatistics">
  4. <div class="page-form-title-box">
  5. <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true">
  6. <el-form-item label="" prop="deptId" label-width="50px">
  7. <el-select v-model="queryParams.deptId" clearable placeholder="全部">
  8. <el-option
  9. v-for="item in deptSelectList"
  10. :key="item.deptId"
  11. :label="item.deptName"
  12. :value="item.deptId">
  13. </el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item label="" prop="rectifyStatus">
  17. <el-select v-model="queryParams.rectifyStatus" clearable placeholder="全部状态" style="width: 120px">
  18. <el-option
  19. v-for="item in typeList"
  20. :key="item.key"
  21. :label="item.label"
  22. :value="item.key">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="" prop="hdLevel">
  27. <el-select v-model="queryParams.hdLevel" clearable placeholder="全部隐患等级" style="width: 140px">
  28. <el-option
  29. v-for="item in levelList"
  30. :key="item.key"
  31. :label="item.label"
  32. :value="item.key">
  33. </el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="" prop="searchValue" label-width="80px">
  37. <el-input
  38. maxLength="30"
  39. v-model="queryParams.searchValue"
  40. placeholder="计划任务/实验室/房间号"
  41. clearable
  42. style="width: 200px"/>
  43. </el-form-item>
  44. <el-form-item label="" prop="dateRange" label-width="70px">
  45. <el-date-picker
  46. :clearable="false"
  47. v-model="dateRange"
  48. size="small"
  49. style="width: 240px"
  50. value-format="yyyy-MM-dd"
  51. type="daterange"
  52. range-separator="-"
  53. start-placeholder="开始日期"
  54. end-placeholder="结束日期"
  55. ></el-date-picker>
  56. </el-form-item>
  57. <p class="page-inquire-common-style-button" @click="handleQuery" style="margin-right:10px;">查询</p>
  58. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  59. <el-form-item style="float: right;" v-hasPermiRouter="['safety:dataSub:export']">
  60. <export-component :exportConfig="exportConfig"></export-component>
  61. </el-form-item>
  62. </el-form>
  63. </div>
  64. <div class="page-content-box">
  65. <div class="num-data-box">
  66. 共搜索到隐患总数 {{numData.sumTotal}},重大隐患数 {{numData.zdHazardTotal}},一般隐患数 {{numData.ybHazardTotal}},管理问题数 {{numData.glHazardTotal}} ,待整改总数 {{numData.rectifiedTotal}},复核总数 {{numData.resultTotal}},复核通过率 {{numData.rate}}
  67. </div>
  68. <el-table class="table-box" border :data="tableList" ref="table-box"
  69. :row-key="getRowKeys"
  70. @selection-change="handleSelectionChange">
  71. <el-table-column type="selection" width="50" align="center" fixed/>
  72. <el-table-column label="序号" align="center" type="index" width="60" fixed/>
  73. <el-table-column label="计划任务" align="center" prop="title" show-overflow-tooltip width="200" fixed/>
  74. <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="200" fixed/>
  75. <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="180"/>
  76. <el-table-column label="房间号" align="center" prop="subRoom" show-overflow-tooltip width="100"/>
  77. <el-table-column label="楼栋" align="center" prop="buildName" show-overflow-tooltip width="180"/>
  78. <el-table-column label="隐患等级" align="center" prop="hazardLevel" show-overflow-tooltip width="100">
  79. <template slot-scope="scope">
  80. {{scope.row.hazardLevel==1?'重大隐患':(scope.row.hazardLevel==2?'一般隐患':(scope.row.hazardLevel==3?'管理问题':''))}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="不符合项" align="center" prop="hazardCheckPoint" show-overflow-tooltip width="260">
  84. <template slot-scope="scope">
  85. <span>{{scope.row.hazardCheckCode}}</span>
  86. <span v-if="scope.row.checkCategory==1">{{scope.row.hazardCheckPoint}}</span>
  87. <span v-if="scope.row.checkCategory!=1">{{scope.row.hazardCheckName}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="历史出现次数" align="center" prop="sumTotal" show-overflow-tooltip width="120"/>
  91. <el-table-column label="隐患描述" align="center" prop="hazardDescribe" show-overflow-tooltip width="180"/>
  92. <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
  93. <el-table-column label="检查时间" align="center" prop="checkTime2" show-overflow-tooltip width="180"/>
  94. <el-table-column label="状态" align="center" prop="rectifyStatus" show-overflow-tooltip width="100">
  95. <template slot-scope="scope">
  96. {{scope.row.rectifyStatus==1?'复核完毕':(scope.row.rectifyStatus==2?'未整改':(scope.row.rectifyStatus==3?'已整改':(scope.row.rectifyStatus==4?'暂无法整改':'')))}}
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <pagination :page-sizes="[20, 30, 40, 50]"
  101. v-show="total>0"
  102. :total="total"
  103. :page.sync="queryParams.page"
  104. :limit.sync="queryParams.pageSize"
  105. @pagination="getList"
  106. />
  107. </div>
  108. </div>
  109. </template>
  110. <script>
  111. import { dataStatisticsHazardList,dataStatisticsHazardListTop } from "@/api/safetyCheck/index";
  112. // V3
  113. import exportComponent from "@/components/exportComponent/exportComponent.vue";
  114. import { getDeptDropList } from '@/api/commonality/permission'
  115. export default {
  116. name: 'safetyHazardStatistics',
  117. components: {
  118. exportComponent,
  119. },
  120. data(){
  121. return{
  122. //导出
  123. exportConfig:{
  124. api:'/zd-security/DataStatistics/hazardExport/', //导出接口地址
  125. ids:'', //勾选导出,勾选的IDS
  126. fileName:'安全隐患统计', //导出文件的命名
  127. },
  128. deptSelectList:[],
  129. typeList:[{label:"未整改",key:"2"},{label:"已整改",key:"3"},{label:"暂无法整改",key:"4"},{label:"复核完毕",key:"1"}],
  130. levelList:[{label:"一般隐患",key:"2"},{label:"重大隐患",key:"1"},{label:"管理问题",key:"3"}],
  131. dateRange:[],
  132. queryParams:{
  133. page:1,
  134. pageSize:20,
  135. searchValue:null,
  136. deptId:null,
  137. rectifyStatus:null,
  138. hdLevel:null,
  139. },
  140. setChildren:"",
  141. numData:{},
  142. tableList:[],
  143. total:0,
  144. }
  145. },
  146. created(){
  147. },
  148. mounted(){
  149. this.initializationInterface();
  150. this.getList();
  151. },
  152. methods:{
  153. initializationInterface(){
  154. //获取学院列表
  155. getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
  156. this.$set(this, 'deptSelectList', response.data)
  157. })
  158. },
  159. //获取数据列表
  160. getList(){
  161. let obj = JSON.parse(JSON.stringify(this.queryParams))
  162. if(this.dateRange[0]){
  163. obj.beginTime=this.dateRange[0]+'T00:00:00';
  164. obj.endTime=this.dateRange[1]+'T23:59:59';
  165. }else{
  166. obj.beginTime== "";
  167. obj.endTime== "";
  168. }
  169. dataStatisticsHazardList(obj).then(response => {
  170. this.total = response.data.total;
  171. this.tableList = response.data.records;
  172. });
  173. dataStatisticsHazardListTop(obj).then(response => {
  174. this.$set(this,'numData',response.data);
  175. });
  176. },
  177. /** 搜索按钮操作 */
  178. handleQuery() {
  179. this.$set(this.queryParams,'page',1);
  180. this.getList();
  181. },
  182. /** 重置按钮操作 */
  183. resetQuery() {
  184. this.$set(this,'dateRange',[]);
  185. this.$set(this,'queryParams',{
  186. page:1,
  187. pageSize:20,
  188. searchValue:"",
  189. deptId:"",
  190. rectifyStatus:"",
  191. hdLevel:"",
  192. });
  193. this.handleQuery();
  194. },
  195. /*===记录勾选数据===
  196. 需要再el-table 添加 :row-key="getRowKeys"
  197. 需要在selection 添加 :reserve-selection="true"
  198. */
  199. getRowKeys(row) {
  200. return row.id
  201. },
  202. // 多选框选中数据
  203. handleSelectionChange(selection) {
  204. this.exportConfig.ids = selection.map(item => item.id);
  205. },
  206. }
  207. }
  208. </script>
  209. <style scoped lang="scss">
  210. ::v-deep .el-table__body-wrapper{
  211. padding-bottom: 8px;
  212. }
  213. ::v-deep .el-table__fixed{
  214. margin-top:-1px;
  215. margin-left:-1px;
  216. height:calc(100% - 8px)!important;
  217. }
  218. ::v-deep .el-table__fixed-body-wrapper{
  219. height: calc(100% - 48px);
  220. overflow-y: auto;
  221. }
  222. .safetyHazardStatistics{
  223. .form-box{
  224. .form-dropdown-box{
  225. display: flex;
  226. margin:0;
  227. padding:0 10px;
  228. cursor: pointer;
  229. height:40px;
  230. img:nth-child(1){
  231. width:16px;
  232. height:16px;
  233. margin-top:12px;
  234. }
  235. p{
  236. width:47px;
  237. text-align: center;
  238. font-size:14px;
  239. margin:0;
  240. line-height:40px;
  241. }
  242. img:nth-child(3){
  243. width:10px;
  244. height:6px;
  245. margin-top:17px;
  246. }
  247. }
  248. }
  249. .num-data-box{
  250. background: rgba(1,131,250,0.2);
  251. color:#0183FA;
  252. font-size:14px;
  253. line-height:40px;
  254. padding:0 20px;
  255. border-radius:4px;
  256. margin-bottom:20px;
  257. }
  258. }
  259. </style>