heyang 10 months ago
parent
commit
980c0ffe77

+ 1 - 0
src/api/index.js

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

+ 0 - 94
src/views/courtyardManage/dangerDetail.vue

@@ -69,17 +69,8 @@
 </template>
 
 <script>
-import {
-  checkOptionList,
-  departmentsList,
-  getSubjectDict,
-  optionChartDetails,
-  optionCharts, optionLabCharts
-} from "../../api/http"
 import Header from '@/components/header.vue'
 import {
-  laboratoryBigViewSubHazardList,
-  laboratoryBigViewSubUserCount,
   securityBigViewCheckOptionChartDetails, securityCheckOptionList
 } from "@/api/index";
 export default {
@@ -185,66 +176,6 @@ export default {
         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;
@@ -292,31 +223,6 @@ export default {
         }
       })
     },
-    /*查询*/
-    onSearch() {
-      if(this.dateRange.length>0){
-        this.editForm.beginTimeStr = this.dateRange[0];
-        this.editForm.endTimeStr = this.dateRange[1];
-      }
-      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) {
       let safetydetailOption = {

+ 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('/')
@@ -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
-  },
+