|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="checkIndexStatistics">
|
|
|
<el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true">
|
|
|
- <el-form-item label="" prop="deptId" label-width="50px">
|
|
|
+ <el-form-item label="" prop="deptId" label-width="50px" v-if="!userFlg">
|
|
|
<el-select v-model="queryParams.deptId" clearable placeholder="全部">
|
|
|
<el-option
|
|
|
v-for="item in deptSelectList"
|
|
@@ -11,6 +11,17 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="" prop="subId" label-width="50px" v-if="userFlg">
|
|
|
+ <el-select placeholder="请输入关键词" filterable remote reserve-keyword
|
|
|
+ v-model="queryParams.subId" :remote-method="getSubList">
|
|
|
+ <el-option
|
|
|
+ v-for="item in subSelectList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="" prop="searchValue" label-width="80px">
|
|
|
<el-input
|
|
|
maxLength="30"
|
|
@@ -59,7 +70,8 @@
|
|
|
<el-table-column type="selection" width="50" align="center"/>
|
|
|
<el-table-column label="序号" align="center" type="index" width="60" />
|
|
|
<el-table-column label="计划任务" align="center" prop="title" show-overflow-tooltip/>
|
|
|
- <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="230"/>
|
|
|
+ <el-table-column v-if="!userFlg" label="学院" align="center" prop="collegeName" show-overflow-tooltip width="230"/>
|
|
|
+ <el-table-column v-if="userFlg" label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="230"/>
|
|
|
<el-table-column label="隐患总数" align="center" prop="sumTotal" show-overflow-tooltip width="120"/>
|
|
|
<el-table-column label="一级指标隐患数" align="center" prop="itemsTotal1" show-overflow-tooltip width="130"/>
|
|
|
<el-table-column label="一级指标占比" align="center" prop="percent" show-overflow-tooltip width="130"/>
|
|
@@ -80,7 +92,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { listDepartments } from "@/api/system/dept";
|
|
|
- import { dataStatisticsItemsList,dataStatisticsItemsListTop } from "@/api/safetyCheck/index";
|
|
|
+ import { dataStatisticsItemsList,dataStatisticsItemsListTop,isSCollege,getloginUser,
|
|
|
+ hiddenDataItemsSubList,hiddenDataItemsSubListTop,listSubAdmin } from "@/api/safetyCheck/index";
|
|
|
export default {
|
|
|
name: 'checkIndexStatistics',
|
|
|
props:{
|
|
@@ -89,59 +102,94 @@
|
|
|
data(){
|
|
|
return{
|
|
|
deptSelectList:[],
|
|
|
+ subSelectList:[],
|
|
|
classTypeList:[],
|
|
|
classifiedList:[],
|
|
|
dateRange:[],
|
|
|
- queryParams:{
|
|
|
- pageNum:1,
|
|
|
- pageSize:20,
|
|
|
- searchValue:"",
|
|
|
- deptId:""
|
|
|
- },
|
|
|
+ queryParams:{},
|
|
|
setChildren:"",
|
|
|
numData:{},
|
|
|
tableList:[{}],
|
|
|
total:0,
|
|
|
currentDate:'',
|
|
|
- jumpType:false,
|
|
|
+ userFlg:false,
|
|
|
+ deptId:"",
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.$set(this,'jumpType',this.propsData.jumpType);
|
|
|
this.initializationInterface();
|
|
|
this.getList();
|
|
|
},
|
|
|
methods:{
|
|
|
initializationInterface(){
|
|
|
+ this.$set(this,'queryParams',{
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:20,
|
|
|
+ searchValue:"",
|
|
|
+ });
|
|
|
//获取学院列表
|
|
|
listDepartments().then(response => {
|
|
|
this.deptSelectList = response.data;
|
|
|
});
|
|
|
+ getloginUser().then(response => {
|
|
|
+ this.$set(this,'deptId',response.data.deptId)
|
|
|
+ this.getSubList('');
|
|
|
+ });
|
|
|
+ isSCollege().then(response => {
|
|
|
+ this.$set(this,'userFlg',response.data.userFlg);
|
|
|
+ if(this.userFlg){
|
|
|
+ this.$set(this.queryParams,'subId','')
|
|
|
+ }else{
|
|
|
+ this.$set(this.queryParams,'deptId','')
|
|
|
+ }
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //实验室搜索
|
|
|
+ getSubList(val){
|
|
|
+ console.log('val',val)
|
|
|
+ listSubAdmin({deptId:this.deptId,name:val}).then(response => {
|
|
|
+ this.subSelectList = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
//获取数据列表
|
|
|
getList(){
|
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
+ let objTop = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
if(this.dateRange[0]){
|
|
|
obj.beginTime = this.dateRange[0];
|
|
|
+ objTop.beginTime = this.dateRange[0];
|
|
|
}else{
|
|
|
obj.beginTime = "";
|
|
|
+ objTop.beginTime = "";
|
|
|
}
|
|
|
if(this.dateRange[1]){
|
|
|
obj.endTime = this.dateRange[1];
|
|
|
+ objTop.endTime = this.dateRange[1];
|
|
|
}else{
|
|
|
obj.endTime = "";
|
|
|
+ objTop.endTime = "";
|
|
|
}
|
|
|
- if(this.jumpType){
|
|
|
- //已跳转
|
|
|
+ delete objTop.pageNum
|
|
|
+ delete objTop.pageSize
|
|
|
+ if(this.userFlg){
|
|
|
+ //院级
|
|
|
+ hiddenDataItemsSubList(obj).then(response => {
|
|
|
+ this.total = response.total;
|
|
|
+ this.tableList = response.rows;
|
|
|
+ });
|
|
|
+ hiddenDataItemsSubListTop(objTop).then(response => {
|
|
|
+ this.$set(this,'numData',response.data);
|
|
|
+ });
|
|
|
}else{
|
|
|
- //未跳转
|
|
|
+ //校级
|
|
|
dataStatisticsItemsList(obj).then(response => {
|
|
|
this.total = response.total;
|
|
|
this.tableList = response.rows;
|
|
|
});
|
|
|
- dataStatisticsItemsListTop(obj).then(response => {
|
|
|
+ dataStatisticsItemsListTop(objTop).then(response => {
|
|
|
this.$set(this,'numData',response.data);
|
|
|
});
|
|
|
}
|
|
@@ -158,8 +206,12 @@
|
|
|
pageNum:1,
|
|
|
pageSize:20,
|
|
|
searchValue:"",
|
|
|
- deptId:""
|
|
|
});
|
|
|
+ if(this.userFlg){
|
|
|
+ this.$set(this.queryParams,'subId','')
|
|
|
+ }else{
|
|
|
+ this.$set(this.queryParams,'deptId','')
|
|
|
+ }
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
/** 当前时间 */
|