dedsudiyu 2 lat temu
rodzic
commit
484eb2d0b5

+ 2 - 6
src/views/safetyCheck/checkItemLibrary/index.vue

@@ -627,8 +627,6 @@
           for(let i=0;i<list.length;i++){
             ids.push(list[i].id)
           }
-          console.log('list',list);
-          console.log('ids',ids);
           if(ids.length>0) {
             self.$confirm(`确认导出选中数据?`, "提示", {
               confirmButtonText: "确定",
@@ -639,12 +637,10 @@
                 ids :ids.join(',')
               }
               self.download(`/zd-security/checkOption/export/`,obj, '项目检查库.xlsx')
+              this.$refs.multipleTable.clearSelection();
             }).catch(() => {})
           }else {
-            Message({
-              message: "请选择要导出的数据",
-              type: 'error'
-            });
+            this.msgError('请选择要导出的数据')
           }
         }
       },

+ 20 - 23
src/views/safetyCheck/dataStatistics/checkIndexStatistics.vue

@@ -1,3 +1,4 @@
+<!--指标统计列表-->
 <template>
   <div class="checkIndexStatistics">
     <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true">
@@ -111,7 +112,6 @@
         numData:{},
         tableList:[{}],
         total:0,
-        currentDate:'',
         userFlg:false,
         deptId:"",
       }
@@ -214,47 +214,44 @@
         }
         this.handleQuery();
       },
-      /** 当前时间 */
-      getCurrentTime () {
-        const yy = new Date().getFullYear()
-        const mm = new Date().getMonth() + 1
-        const dd = new Date().getDate()
-        const hh = new Date().getHours()
-        const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
-        const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
-        return yy + '-' + mm + '-' + dd
-      },
       /** 导出按钮操作 */
       exportButton(item) {
         let self = this;
-        this.currentDate=this.getCurrentTime()
-
         if(item.command == 1){
           self.$confirm(`确认导出全部数据?`, "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
           }).then(async () => {
-            self.download('/system/user/teacher/export/', {...self.queryParams}, '教职工信息-'+this.currentDate+'.xlsx')
+
+            if(self.userFlg){
+              self.download('/zd-security/collegCheck/collegeItemsExport/', {}, '检查指标统计-.xlsx')
+            }else{
+              self.download('/zd-security/DataStatistics/itemsExport/', {}, '检查指标统计-.xlsx')
+            }
           }).catch(() => {})
         }else if(item.command == 2){
-          if(self.ids.length>0) {
+          let list = self.$refs.multipleTable.selection;
+          let ids = [];
+          for(let i=0;i<list.length;i++){
+            ids.push(list[i].id)
+          }
+          if(ids.length>0) {
             self.$confirm(`确认导出选中数据?`, "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
             }).then(async () => {
-              let ids = self.ids.join(',');
-              let obj = {
-                ids :ids
+              if(self.userFlg){
+                self.download(`/zd-security/collegCheck/collegeItemsExport/?ids=`+ids,{}, '检查指标统计.xlsx')
+                this.$refs.multipleTable.clearSelection();
+              }else{
+                self.download(`/zd-security/DataStatistics/itemsExport/?ids=`+ids,{}, '检查指标统计.xlsx')
+                this.$refs.multipleTable.clearSelection();
               }
-              self.download(`/system/user/teacher/export/`,obj, '教职工信息-'+this.currentDate+'.xlsx')
             }).catch(() => {})
           }else {
-            Message({
-              message: "请选择要导出的数据",
-              type: 'error'
-            });
+            this.msgError('请选择要导出的数据')
           }
         }
       },

+ 13 - 24
src/views/safetyCheck/dataStatistics/laboratoryStatistics.vue

@@ -1,3 +1,4 @@
+<!--实验室统计列表-->
 <template>
   <div class="laboratoryStatistics">
     <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true">
@@ -126,7 +127,6 @@
         numData:{},
         tableList:[],
         total:0,
-        currentDate:'',
       }
     },
     created(){
@@ -190,47 +190,36 @@
         });
         this.handleQuery();
       },
-      /** 当前时间 */
-      getCurrentTime () {
-        const yy = new Date().getFullYear()
-        const mm = new Date().getMonth() + 1
-        const dd = new Date().getDate()
-        const hh = new Date().getHours()
-        const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
-        const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
-        return yy + '-' + mm + '-' + dd
-      },
       /** 导出按钮操作 */
       exportButton(item) {
         let self = this;
-        this.currentDate=this.getCurrentTime()
-
         if(item.command == 1){
           self.$confirm(`确认导出全部数据?`, "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
           }).then(async () => {
-            self.download('/system/user/teacher/export/', {...self.queryParams}, '教职工信息-'+this.currentDate+'.xlsx')
+            self.download('/zd-security/DataStatistics/subExport/', {}, '实验室统计-.xlsx')
           }).catch(() => {})
         }else if(item.command == 2){
-          if(self.ids.length>0) {
+          let list = self.$refs.multipleTable.selection;
+          let ids = [];
+          for(let i=0;i<list.length;i++){
+            ids.push(list[i].id)
+          }
+          console.log('list',list);
+          console.log('ids',ids);
+          if(ids.length>0) {
             self.$confirm(`确认导出选中数据?`, "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
             }).then(async () => {
-              let ids = self.ids.join(',');
-              let obj = {
-                ids :ids
-              }
-              self.download(`/system/user/teacher/export/`,obj, '教职工信息-'+this.currentDate+'.xlsx')
+              self.download(`/zd-security/DataStatistics/subExport/?ids=`+ids,{}, '实验室统计.xlsx')
+              this.$refs.multipleTable.clearSelection();
             }).catch(() => {})
           }else {
-            Message({
-              message: "请选择要导出的数据",
-              type: 'error'
-            });
+            this.msgError('请选择要导出的数据')
           }
         }
       },

+ 16 - 25
src/views/safetyCheck/dataStatistics/safetyHazardStatistics.vue

@@ -1,3 +1,4 @@
+<!--安全隐患统计列表-->
 <template>
   <div class="safetyHazardStatistics">
     <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true">
@@ -88,7 +89,11 @@
           {{scope.row.hazardLevel==1?'重大隐患':(scope.row.hazardLevel==2?'一般隐患':(scope.row.hazardLevel==3?'管理问题':''))}}
         </template>
       </el-table-column>
-      <el-table-column label="不符合项" align="center" prop="hazardCheckPoint" show-overflow-tooltip width="260"/>
+      <el-table-column label="不符合项" align="center" prop="hazardCheckPoint" show-overflow-tooltip width="260">
+        <template slot-scope="scope">
+          {{scope.row.hazardCheckCode}} {{scope.row.hazardCheckPoint}}
+        </template>
+      </el-table-column>
       <el-table-column label="历史出现次数" align="center" prop="sumTotal" show-overflow-tooltip width="120"/>
       <el-table-column label="隐患描述" align="center" prop="hazardDescribe" show-overflow-tooltip width="180"/>
       <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
@@ -132,7 +137,6 @@
         numData:{},
         tableList:[],
         total:0,
-        currentDate:'',
       }
     },
     created(){
@@ -188,47 +192,34 @@
         });
         this.handleQuery();
       },
-      /** 当前时间 */
-      getCurrentTime () {
-        const yy = new Date().getFullYear()
-        const mm = new Date().getMonth() + 1
-        const dd = new Date().getDate()
-        const hh = new Date().getHours()
-        const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
-        const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
-        return yy + '-' + mm + '-' + dd
-      },
       /** 导出按钮操作 */
       exportButton(item) {
         let self = this;
-        this.currentDate=this.getCurrentTime()
-
         if(item.command == 1){
           self.$confirm(`确认导出全部数据?`, "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
           }).then(async () => {
-            self.download('/system/user/teacher/export/', {...self.queryParams}, '教职工信息-'+this.currentDate+'.xlsx')
+            self.download('/zd-security/DataStatistics/hazardExport/', {}, '安全隐患统计.xlsx')
           }).catch(() => {})
         }else if(item.command == 2){
-          if(self.ids.length>0) {
+          let list = self.$refs.multipleTable.selection;
+          let ids = [];
+          for(let i=0;i<list.length;i++){
+            ids.push(list[i].id)
+          }
+          if(ids.length>0) {
             self.$confirm(`确认导出选中数据?`, "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
             }).then(async () => {
-              let ids = self.ids.join(',');
-              let obj = {
-                ids :ids
-              }
-              self.download(`/system/user/teacher/export/`,obj, '教职工信息-'+this.currentDate+'.xlsx')
+              self.download(`/zd-security/DataStatistics/hazardExport/?ids=`+ids,{}, '安全隐患统计.xlsx')
+              this.$refs.multipleTable.clearSelection();
             }).catch(() => {})
           }else {
-            Message({
-              message: "请选择要导出的数据",
-              type: 'error'
-            });
+            this.msgError('请选择要导出的数据')
           }
         }
       },