dedsudiyu 10 hónapja
szülő
commit
3f8b3b97dd

+ 1 - 0
src/api/index.js

@@ -223,3 +223,4 @@ export function examViolationSiteGetListByType(query) {
 }
 
 
+

+ 26 - 160
src/views/courtyardManage/dangerDetail.vue

@@ -8,12 +8,12 @@
       </div>
       <div class="main_t_b" id="danger_chart"></div>
     </div>
-    <div class="main_btn">
+<!--    <div class="main_btn">
       <i :key="index"  :class='currentIndex==index?"active":""'  v-for="(item,index) in btnList" @click="btnFun(index)">{{item}}</i>
-    </div>
+    </div>-->
     <div class="main_b">
       <!--查询条件-->
-      <el-form :model="editForm" ref="queryParams" class="form-box" :inline="true" style="margin:20px;">
+      <el-form :model="queryParams" ref="queryParams" class="form-box" :inline="true" style="margin:20px;">
         <el-form-item label="实验室" prop="dangerId" label-width="98px">
           <el-input
               maxLength="30"
@@ -69,18 +69,9 @@
 </template>
 
 <script>
-import {
-  checkOptionList,
-  departmentsList,
-  getSubjectDict,
-  optionChartDetails,
-  optionCharts, optionLabCharts
-} from "../../api/http"
 import Header from '@/components/header.vue'
 import {
-  laboratoryBigViewSubHazardList,
-  laboratoryBigViewSubUserCount,
-  securityBigViewCheckOptionChartDetails, securityCheckOptionList
+  securityBigViewCheckOptionChartDetails, securityBigViewCheckOptionCharts, securityCheckOptionList
 } from "@/api/index";
 export default {
   components: {
@@ -113,6 +104,8 @@ export default {
         pageSize:10,
         id:'',
         searchValue:'',
+        startDate:'',
+        endDate:'',
       },
       dataList:[],
       total:0,
@@ -121,11 +114,7 @@ export default {
   mounted() {
     this.getList();
     this.securityCheckOptionList();
-    // this.checkOptionList()
-    // this.departmentsList()
-    // this.getSubjectDict()
-    // this.getAjaxData()
-    // this.getAjaxList()
+    this.securityBigViewCheckOptionCharts();
   },
   methods: {
     getList(){
@@ -156,6 +145,8 @@ export default {
         pageSize:10,
         id:'',
         searchValue:'',
+        startDate:'',
+        endDate:'',
       });
       this.getList();
     },
@@ -164,158 +155,34 @@ export default {
         this.$set(this,'dangerList',response.data);
       });
     },
-
-    btnFun(index){
-      this.currentIndex = index
-      console.log(this.currentIndex)
-      if(this.currentIndex==0){
-        this.getAjaxData()
-      }else{
-        this.getLabAjaxData()
-      }
-    },
-    back(){
-        this.$router.push('/home')
-    },
-    tableRowClassName({ rowIndex}) {
-      if (rowIndex%2 === 0) {
-        return 'success-row';
-      } else{
-
-        return 'warning-row';
-      }
-    },
-    indexMethod(index) {
-      return (this.editForm.pageNum - 1) * this.editForm.pageSize + index + 1;
-    },
-    //隐患类型
-    checkOptionList:function () {
-      let _this=this;
-      checkOptionList({}).then((res) =>{
-        if(res.code==200){
-          let data=res.data;
-          _this.dangerList=data
-        }
-      })
-    },
-    //查询院系
-    departmentsList:function () {
-      let _this=this;
-      departmentsList().then((res) =>{
-        if(res.code==200){
-          let data=res.data;
-          _this.subjectOptions=data
-        }
-      })
-    },
-    //查询实验室
-    getSubjectDict:function () {
-      let _this=this;
-      getSubjectDict().then((res) =>{
-        if(res.code==200){
-          let data=res.data;
-          _this.labList=data
-
-        }
-      })
-    },
-    //请求列表
-    getAjaxList:function (){
-      let _this=this;
-      //列表
-      let obj={
-        'type':localStorage.getItem('deptLevel'),
-        'optionId':this.editForm.optionId,
-        'subId':this.editForm.subId,
-        'pageNum':this.editForm.pageNum,
-        'pageSize':this.editForm.pageSize,
-        'startTime':this.editForm.beginTimeStr,
-        'endTime':this.editForm.endTimeStr,
-      }
-      optionChartDetails(obj).then((res) =>{
-        if(res.code==200){
-          let data = res.rows;
-          if(data && data.length>0){
-            _this.tableData = data;
-            _this.totalNum = parseInt(res.total);
-          }else{
-            _this.tableData = [];
-            _this.totalNum = 0;
-          }
-        }
-      })
-    },
-    //查询图表
-    getAjaxData: function () {
-      let _this=this;
-
-      //人员违规统计图表
-      let obj={
-        'type':localStorage.getItem('deptLevel'),
-        'subId':this.editForm.subId,
-        'optionId':this.editForm.optionId,
-        'startTime':this.editForm.beginTimeStr,
-        'endTime':this.editForm.endTimeStr,
-      }
-      optionCharts(obj).then((res) =>{
-        if(res.code==200){
+    securityBigViewCheckOptionCharts(){
+      let self=this;
+      securityBigViewCheckOptionCharts({}).then(response => {
+        //this.$set(this,'dangerList',response.data);
+        if(response.code==200){
           let dataX=[];
           let dataCount=[];
-          let data=res.data.list;
+          let data=response.data.list;
           for (var i = 0; i < data.length; i++) {
             dataX.push( data[i].optionName)
             dataCount.push(data[i].count)
           }
-          _this.safetyDetailFun(dataX,dataCount,false)
+          self.safetyDetailFun(dataX,dataCount,false)
 
         }
-      })
+      });
     },
-    getLabAjaxData: function () {
-      let _this=this;
-      //人员违规统计图表
-      let obj={
-        'pageNum':1,
-        'pageSize':50,
-      }
-      optionLabCharts(obj).then((res) =>{
-        if(res.code==200){
-          let dataX=[];
-          let dataCount=[];
-          let data=res.data;
-          for (var i = 0; i < data.length; i++) {
-            dataX.push( data[i].subName)
-            dataCount.push(data[i].count)
-          }
-          _this.safetyDetailFun(dataX,dataCount,true)
 
-        }
-      })
+    back(){
+      this.$router.push('/')
     },
-    /*查询*/
-    onSearch() {
-      if(this.dateRange.length>0){
-        this.editForm.beginTimeStr = this.dateRange[0];
-        this.editForm.endTimeStr = this.dateRange[1];
+    tableRowClassName({ rowIndex}) {
+      if (rowIndex%2 === 0) {
+        return 'success-row';
+      } else{
+
+        return 'warning-row';
       }
-      this.editForm.pageNum =1;
-      this.currentIndex=0;
-      this.getAjaxList();
-      this.getAjaxData();
-    },
-    /*重置*/
-    resetForm() {
-      this.editForm.schoolDeptId = "";
-      this.editForm.optionId = "";
-      this.editForm.subId = "";
-      this.editForm.beginTimeStr = "";
-      this.editForm.endTimeStr = "";
-      this.dateRange = [];
-      this.onSearch();
-    },
-    handleCurrentChange(val) {
-      this.editForm.pageNum = val;
-      this.getAjaxList();
     },
     /*安全隐患详情图表*/
     safetyDetailFun:function (dataX,dataCount,SlideType) {
@@ -462,8 +329,7 @@ export default {
 
             },
             type:'bar',
-            barWidth: '60%',
-            barMaxWidth: '10%',
+            barWidth: '30px',
             data:dataCount
           }
         ]

+ 28 - 122
src/views/courtyardManage/illegalDetail.vue

@@ -43,8 +43,8 @@
                     ></el-date-picker>
                 </el-form-item>
                 <el-form-item label-width="0">
-                    <el-button type="primary" @click.native.prevent="onSearch" native-type="submit">查询</el-button>
-                    <el-button @click="resetForm('searchForm')">重置</el-button>
+                  <el-button type="primary" @click.native.prevent="handleQuery" native-type="submit">查询</el-button>
+                  <el-button @click="resetQuery">重置</el-button>
                 </el-form-item>
             </el-form>
             <!--列表-->
@@ -77,7 +77,7 @@ import {
 import Header from '@/components/header.vue'
 import {
   examBigViewDetailColumnar,
-  examBigViewDetailSubList,
+  examBigViewDetailSubList, examViolationSiteGetListByType,
   laboratoryBigViewSubHazardBarChartCount,
   securityBigViewCheckOptionChartDetails
 } from "@/api";
@@ -113,6 +113,8 @@ export default {
         page:1,
         pageSize:10,
         searchValue:'',
+        beginTimeStr:'',
+        endTimeStr:'',
       },
       dataList:[],
       total:0,
@@ -121,8 +123,7 @@ export default {
   mounted() {
     this.getList();
     this.examBigViewDetailColumnar();
-    //this.getAjaxData()
-    //this.getAjaxList()
+    this.examViolationSiteGetListByType();
 
 
   },
@@ -143,6 +144,7 @@ export default {
         this.$set(this,'total',response.data.total);
       });
     },
+    //柱状图
     examBigViewDetailColumnar(){
       let self=this;
       examBigViewDetailColumnar({}).then(response => {
@@ -155,6 +157,26 @@ export default {
         self.illegalDetailFun(illegalDetailData,dataNum)
       });
     },
+    //违规原因
+    examViolationSiteGetListByType(){
+      examViolationSiteGetListByType().then(response => {
+        this.causeList=response.data
+      });
+    },
+    //查询按钮
+    handleQuery(){
+      this.$set(this.queryParams,'page',1);
+      this.getList();
+    },
+    //重置按钮
+    resetQuery(){
+      this.$set(this,'queryParams',{
+        page:1,
+        pageSize:10,
+        searchValue:'',
+      });
+      this.getList();
+    },
 
     back(){
       this.$router.push('/home')
@@ -167,118 +189,6 @@ export default {
         return 'warning-row';
       }
     },
-    getAjaxData: function () {
-      let _this=this;
-      //人员违规统计图表
-
-      let obj={
-        'deptLevel':localStorage.getItem('deptLevel'),
-        'subjectId':this.editForm.subId,
-        'violationType':this.editForm.violationType,
-        'beginTimeStr':this.editForm.beginTimeStr,
-        'endTimeStr':this.editForm.endTimeStr,
-      }
-      detailColumnar(obj).then((res) =>{
-        if(res.code==200){
-          var illegalDetailData=[];
-          let data=res.data;
-          let dataLength=0;
-          let dataNum=[];
-
-          if(data.length<=1){
-            illegalDetailData=[
-              ['product', '离开未打卡', '未佩戴护目镜', '未佩戴实验手套', '非法闯入', '未穿着实验服','实验室清洁'],
-              ['第一季度', 0, 0, 0,0,0,0],
-              ['第二季度', 0, 0, 0,0,0,0],
-              ['第三季度', 0, 0, 0,0,0,0],
-              ['第四季度', 0, 0, 0,0,0,0],
-
-            ]
-            dataNum= [
-              { type: 'bar', itemStyle: { normal: { barBorderRadius: 8}} ,"label": {"normal": {"show": true,"position": "top",fontSize: 14,color: '#fff',}},},
-              { type: 'bar' , itemStyle: { normal: { barBorderRadius: 8}}},
-              { type: 'bar', itemStyle: { normal: { barBorderRadius: 8}} },
-              { type: 'bar' , itemStyle: { normal: { barBorderRadius: 8}}},
-              { type: 'bar', itemStyle: { normal: { barBorderRadius: 8}} },
-              { type: 'bar' , itemStyle: { normal: { barBorderRadius: 8}}}
-            ]
-
-          }else{
-            illegalDetailData=data
-            illegalDetailData[0].unshift('product')
-            dataLength=illegalDetailData[0].length-1
-            for(var i=0;i<dataLength;i++){
-              dataNum.push({ type: 'bar',barMaxWidth: "20", itemStyle: { normal: { barBorderRadius: 8}},"label": {"normal": {"show": true,"position": "top",fontSize: 14,color: '#fff',}}, },)
-            }
-          }
-          _this.illegalDetailFun(illegalDetailData,dataNum)
-
-        }
-      })
-
-      //查询院系
-      departmentsList().then((res) =>{
-        if(res.code==200){
-          let data=res.data;
-          _this.subjectOptions=data
-        }
-      })
-      //查询实验室
-      getSubjectDict().then((res) =>{
-        if(res.code==200){
-          let data=res.data;
-          _this.labList=data
-
-        }
-      })
-      //查询违规原因
-      getDictViolation().then((res) =>{
-        if(res.code==200){
-          let data=res.data;
-          _this.causeList=data
-
-        }
-      })
-    },
-    /*查询*/
-    onSearch() {
-
-      if(this.dateRange.length>0){
-        this.editForm.beginTimeStr = this.dateRange[0];
-        this.editForm.endTimeStr = this.dateRange[1];
-      }
-      this.getAjaxList();
-      this.getAjaxData();
-    },
-    /*重置*/
-    resetForm() {
-
-      this.editForm.subId = "";
-      this.editForm.violationType = "";
-      this.editForm.beginTimeStr=this.getdate()+'-1'
-      this.editForm.endTimeStr=this.getdate()+'-'+this.endDay
-      this.dateRange = [];
-      this.onSearch();
-    },
-    handleCurrentChange(val) {
-      this.param.pageNum = val;
-      // this.getAjaxList();
-    },
-    getdate() {
-      var date = new Date();
-      var year = date.getFullYear();
-      var month = date.getMonth() + 1;
-      var strDate = date.getDate();
-
-      if (month >= 1 && month <= 9) {
-        month = "0" + month;
-      }
-      if (strDate >= 0 && strDate <= 9) {
-        strDate = "0" + strDate;
-      }
-      var currentdate = year + "-" + month;
-      return currentdate;
-    },
     /*安全隐患详情图表*/
      illegalDetailFun:function(illegalDetailData,dataNum) {
       let illegalOption = {
@@ -383,11 +293,7 @@ export default {
       illegal_chart.setOption(illegalOption);
     }
   },
-  beforeMount(){
-    let _this=this
-    _this.editForm.beginTimeStr=_this.getdate()+'-1'
-    _this.editForm.endTimeStr=_this.getdate()+'-'+_this.endDay
-  },
+