zhaobao 2 лет назад
Родитель
Сommit
351adfd297

+ 1 - 1
src/api/goaf/checkRecordApi.js

@@ -7,7 +7,7 @@ import request from '@/utils/request'
  */
 export function getCheckRecordByList(data) {
   return request({
-    url: `/check/record`,
+    url: `/goaf/goafcheckRecord/list`,
     method: 'get',
     params: data
   })

+ 2 - 2
src/settings.js

@@ -37,8 +37,8 @@ module.exports = {
   * 服务API地址
   */
   serverUrl: 'http://113.141.93.143:1688', // 正式环境
-  // devServerUrl: 'http://113.141.93.143:1688', // 开发环境
-  devServerUrl: 'http://192.168.3.5:1688', // 开发环境 qu
+  devServerUrl: 'http://113.141.93.143:1688', // 开发环境
+  // devServerUrl: 'http://192.168.3.5:1688', // 开发环境 qu
   // devServerUrl: 'http://192.168.3.201:8080/', // 开发环境  test
   // mqttUrl: 'ws://1.15.92.205:8083/mqtt', // mqtt地址
   mqttUrl: 'ws://113.141.93.143:8894/mqtt', // mqtt地址

+ 2 - 1
src/views/goaf/alert/activity/Accept.vue

@@ -46,7 +46,7 @@ import VueScroll from 'vuescroll'
 import { getDangerById, updateDanger } from '@/api/goaf/dangerApi'
 import { WorkFlow, ActivityHandleRecord } from '@/components'
 import DangerInfo from '../components/DangerInfo'
-
+import { parseTime } from '@/utils'
 export default {
   name: 'AcceptTask',
   components: { VueScroll, DangerInfo, WorkFlow, ActivityHandleRecord },
@@ -201,6 +201,7 @@ export default {
       }
       this.formData.acceptRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
+      this.formData.acceptTime = parseTime(new Date())
 
       updateDanger(this.formData).then((resp) => {
         const { code, msg } = resp

+ 2 - 1
src/views/goaf/alert/activity/Rectify.vue

@@ -58,7 +58,7 @@ import { getDangerById, updateDanger } from '@/api/goaf/dangerApi'
 import Vuescroll from 'vuescroll'
 import { WorkFlow, ActivityHandleRecord } from '@/components'
 import DangerInfo from '../components/DangerInfo'
-
+import { parseTime } from '@/utils'
 export default {
   name: 'RectifyTask',
   components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
@@ -223,6 +223,7 @@ export default {
       }
       this.formData.rectifyRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
+      this.formData.rectifyTime = parseTime(new Date())
 
       this.formData.acceptAccountId = flow.user.accountIdTo
       this.formData.acceptAccountName = flow.user.accountNameTo

+ 2 - 1
src/views/goaf/alert/activity/Review.vue

@@ -66,7 +66,7 @@ import { updateDanger, getDangerById } from '@/api/goaf/dangerApi'
 import Vuescroll from 'vuescroll'
 import { WorkFlow, ActivityHandleRecord } from '@/components'
 import DangerInfo from '../components/DangerInfo'
-
+import { parseTime } from '@/utils'
 export default {
   name: 'ReviewTask',
   components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
@@ -228,6 +228,7 @@ export default {
         this.formData.status = 3
       }
       this.formData.reviewRemark = flow.data.actionRemark
+      this.formData.reviewTime = parseTime(new Date())
       this.formData.attachList = flow.data.attachList
 
       this.formData.rectifyAccountId = flow.user.accountIdTo

+ 45 - 0
src/views/goaf/alert/checkList.vue

@@ -12,6 +12,7 @@
           <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
             <el-button slot="append" icon="el-icon-search" @click="getData()" />
           </el-input>
+          <el-button style="margin-left: 10px;" type="primary" :disabled="downloadLoading" @click="handleExport">导出Excel</el-button>
         </div>
       </el-col>
     </el-row>
@@ -77,6 +78,7 @@ import SubmitActivity from './activity/Submit'
 import ReviewActivity from './activity/Review'
 import RectifyActivity from './activity/Rectify'
 import AcceptActivity from './activity/Accept'
+import { parseTime } from '@/utils'
 export default {
   name: 'DangerList',
   components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
@@ -101,6 +103,7 @@ export default {
       dataList: [],
       total: 0,
       listLoading: false,
+      downloadLoading: false,
       conditions: {
         page: 1,
         limit: 10,
@@ -186,7 +189,49 @@ export default {
       const { hdangerId } = data
       this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
     },
+    // 导出EXCEL
+    handleExport() {
+      this.downloadLoading = true
+      const tHeader = Object.values(this.getEnums())
+      const filterVal = Object.keys(this.getEnums())
+      const list = JSON.parse(JSON.stringify(this.dataList))
 
+      const data = this.formatJson(filterVal, list)
+      if (list.length < 1) {
+        this.$message.error('没有数据可供导出!')
+        this.downloadLoading = false
+        return
+      }
+      import('@/vendor/Export2Excel').then(excel => {
+        excel.export_json_to_excel({
+          header: tHeader,
+          data,
+          filename: `预警台账${parseTime(new Date())}`,
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+        this.downloadLoading = false
+      })
+    },
+    formatJson(filterVal, jsonData) {
+      const status = ['较低', '一般', '较大', '重大']
+      return jsonData.map(v => filterVal.map(j => {
+        if (j === 'hdangerLevel') {
+          return status[v[j]]
+        } else {
+          return v[j]
+        }
+      }))
+    },
+    getEnums() {
+      return {
+        'hdangerTitle': '预警标题', 'hdangerLevel': '预警等级',
+        'submitAccountName': '提交人', 'submitGroupName': '提交部门', 'hdangerDesc': '预警描述', 'submitTime': '提交时间',
+        'reviewAccountName': '评审人', 'reviewGroupName': '评审部门', 'reviewRemark': '评审描述', 'reviewTime': '评审时间',
+        'rectifyAccountName': '整改人', 'rectifyGroupName': '整改部门', 'rectifyRemark': '整改描述', 'rectifyTime': '这个时间',
+        'acceptAccountName': '验收人', 'acceptGroupName': '验收部门', 'acceptRemark': '验收描述', 'acceptTime': '验收时间'
+      }
+    },
     // Update View
     formSuccess() {
       this.getData()

+ 47 - 2
src/views/goaf/alert/checkList_warning.vue

@@ -1,17 +1,18 @@
 <template>
   <div class="content-container">
     <el-row class="tool-bar">
-      <el-col :span="12" class="left">
+      <el-col :span="6" class="left">
         <div class="content-title">
           {{ title }}
         </div>
       </el-col>
 
-      <el-col :span="12" class="button-group">
+      <el-col :span="18" class="button-group">
         <div class="select-search right">
           <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
             <el-button slot="append" icon="el-icon-search" @click="getData()" />
           </el-input>
+          <el-button style="margin-left: 10px;" type="primary" :disabled="downloadLoading" @click="handleExport">导出Excel</el-button>
         </div>
       </el-col>
     </el-row>
@@ -78,6 +79,7 @@ import SubmitActivity from './activity/Submit'
 import ReviewActivity from './activity/Review'
 import RectifyActivity from './activity/Rectify'
 import AcceptActivity from './activity/Accept'
+import { parseTime } from '@/utils'
 export default {
   name: 'DangerList',
   components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
@@ -102,6 +104,7 @@ export default {
       dataList: [],
       total: 0,
       listLoading: false,
+      downloadLoading: false,
       conditions: {
         page: 1,
         limit: 10,
@@ -188,7 +191,49 @@ export default {
       const { hdangerId } = data
       this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
     },
+    // 导出EXCEL
+    handleExport() {
+      this.downloadLoading = true
+      const tHeader = Object.values(this.getEnums())
+      const filterVal = Object.keys(this.getEnums())
+      const list = JSON.parse(JSON.stringify(this.dataList))
 
+      const data = this.formatJson(filterVal, list)
+      if (list.length < 1) {
+        this.$message.error('没有数据可供导出!')
+        this.downloadLoading = false
+        return
+      }
+      import('@/vendor/Export2Excel').then(excel => {
+        excel.export_json_to_excel({
+          header: tHeader,
+          data,
+          filename: `严重预警整改台账${parseTime(new Date())}`,
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+        this.downloadLoading = false
+      })
+    },
+    formatJson(filterVal, jsonData) {
+      const status = ['较低', '一般', '较大', '重大']
+      return jsonData.map(v => filterVal.map(j => {
+        if (j === 'hdangerLevel') {
+          return status[v[j]]
+        } else {
+          return v[j]
+        }
+      }))
+    },
+    getEnums() {
+      return {
+        'hdangerTitle': '预警标题', 'hdangerLevel': '预警等级',
+        'submitAccountName': '提交人', 'submitGroupName': '提交部门', 'hdangerDesc': '预警描述', 'submitTime': '提交时间',
+        'reviewAccountName': '评审人', 'reviewGroupName': '评审部门', 'reviewRemark': '评审描述', 'reviewTime': '评审时间',
+        'rectifyAccountName': '整改人', 'rectifyGroupName': '整改部门', 'rectifyRemark': '整改描述', 'rectifyTime': '这个时间',
+        'acceptAccountName': '验收人', 'acceptGroupName': '验收部门', 'acceptRemark': '验收描述', 'acceptTime': '验收时间'
+      }
+    },
     // Update View
     formSuccess() {
       this.getData()

+ 13 - 5
src/views/goaf/checkTask/record/index.vue

@@ -58,7 +58,6 @@
 
 <script>
 import { getCheckRecordByPage, getCheckRecordByList } from '@/api/goaf/checkRecordApi'
-import { checkResult } from '@/utils'
 import { mapGetters } from 'vuex'
 import Pagination from '@/components/Pagination'
 import RecordDetail from './detail.vue'
@@ -77,7 +76,7 @@ export default {
         limit: 10
       },
       exportList: [],
-      filename: '',
+      filename: '检查记录',
       autoWidth: true,
       bookType: 'xlsx'
     }
@@ -123,8 +122,8 @@ export default {
     // 导出EXCEL
     exportExcel() {
       import('@/vendor/Export2Excel').then(excel => {
-        const tHeader = ['任务名称', '任务类别', '检查时间', '风险点', '风险单元', '危险因素', '检查内容', '检查结果']
-        const filterVal = ['taskTitle', 'taskCatTitle', 'checkTime', 'riskPointTitle', 'hazardTitle', 'riskTitle', 'measureContent', 'checkResult']
+        const tHeader = ['任务名称', '检查人员', '检查部门', '检查时间', '矿带', '矿体', '中段', '编号', '检查内容', '检查结果']
+        const filterVal = ['taskTitle', 'handleAccountName', 'handleGroupName', 'checkTime', 'goafOrebelt', 'goafOrebody', 'goafOreheight', 'goafName', 'checkContent', 'checkResult']
         const list = this.exportList
         const data = this.formatJson(filterVal, list)
         excel.export_json_to_excel({
@@ -141,7 +140,16 @@ export default {
     formatJson(filterVal, jsonData) {
       return jsonData.map(v => filterVal.map(j => {
         if (j === 'checkResult') {
-          return checkResult(v[j])
+          if (v[j] === 0) {
+            return '通过'
+          }
+          return '不通过'
+        } else if (j === 'checkContent') {
+          if (!v.checkItemNopass) {
+            return `${v.checkItemPass}`
+          }
+          if (!v.checkItemPass)v.checkItemPass = ''
+          return `${v.checkItemNopass};${v.checkItemPass}`
         } else {
           return v[j]
         }

+ 2 - 1
src/views/goaf/danger/activity/Accept.vue

@@ -46,7 +46,7 @@ import VueScroll from 'vuescroll'
 import { getDangerById, updateDanger } from '@/api/goaf/dangerApi'
 import { WorkFlow, ActivityHandleRecord } from '@/components'
 import DangerInfo from '../components/DangerInfo'
-
+import { parseTime } from '@/utils'
 export default {
   name: 'AcceptTask',
   components: { VueScroll, DangerInfo, WorkFlow, ActivityHandleRecord },
@@ -201,6 +201,7 @@ export default {
       }
       this.formData.acceptRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
+      this.formData.acceptTime = parseTime(new Date())
 
       updateDanger(this.formData).then((resp) => {
         const { code, msg } = resp

+ 2 - 1
src/views/goaf/danger/activity/Rectify.vue

@@ -58,7 +58,7 @@ import { getDangerById, updateDanger } from '@/api/goaf/dangerApi'
 import Vuescroll from 'vuescroll'
 import { WorkFlow, ActivityHandleRecord } from '@/components'
 import DangerInfo from '../components/DangerInfo'
-
+import { parseTime } from '@/utils'
 export default {
   name: 'RectifyTask',
   components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
@@ -223,6 +223,7 @@ export default {
       }
       this.formData.rectifyRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
+      this.formData.rectifyTime = parseTime(new Date())
 
       this.formData.acceptAccountId = flow.user.accountIdTo
       this.formData.acceptAccountName = flow.user.accountNameTo

+ 2 - 1
src/views/goaf/danger/activity/Review.vue

@@ -66,7 +66,7 @@ import { updateDanger, getDangerById } from '@/api/goaf/dangerApi'
 import Vuescroll from 'vuescroll'
 import { WorkFlow, ActivityHandleRecord } from '@/components'
 import DangerInfo from '../components/DangerInfo'
-
+import { parseTime } from '@/utils'
 export default {
   name: 'ReviewTask',
   components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
@@ -228,6 +228,7 @@ export default {
         this.formData.status = 3
       }
       this.formData.reviewRemark = flow.data.actionRemark
+      this.formData.reviewTime = parseTime(new Date())
       this.formData.attachList = flow.data.attachList
 
       this.formData.rectifyAccountId = flow.user.accountIdTo