zhaobao 2 роки тому
батько
коміт
413c01b157

+ 64 - 0
src/api/goaf/dangerApi.js

@@ -0,0 +1,64 @@
+import request from '@/utils/request'
+
+/**
+ * 获取Danger列表
+ * @param data
+ * @returns
+ */
+export function getDangerByList(data) {
+  return request({
+    url: '/goaf/goafhdanger/list',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 获取Danger分页
+ * @param data
+ * @returns
+ */
+export function getDangerByPage(data) {
+  return request({
+    url: '/goaf/goafhdanger/page',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 根据Id获取Danger
+ * @param dangerId
+ * @returns
+ */
+export function getDangerById(dangerId) {
+  return request({
+    url: `/goaf/goafhdanger/${dangerId}`,
+    method: 'GET'
+  })
+}
+
+/**
+ * 删除Danger
+ * @param dangerId
+ * @returns
+ */
+export function deleteDangerById(dangerId) {
+  return request({
+    url: `goaf/goafhdanger/delete/${dangerId}`,
+    method: 'DELETE'
+  })
+}
+
+/**
+ * 处理Danger
+ * @param data
+ * @returns
+ */
+export function handleDanger(data) {
+  return request({
+    url: `/goaf/goafhdanger/add`,
+    method: 'POST',
+    data
+  })
+}

+ 35 - 0
src/api/goaf/dangerStatisApi.js

@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+/**
+ * 获取统计
+ * @returns
+ */
+export function getDangerCounter() {
+  return request({
+    url: '/ent/danger/statis/getCounter',
+    method: 'GET'
+  })
+}
+
+/**
+ * 基于分类统计
+ * @returns
+ */
+export function counterByCat() {
+  return request({
+    url: '/ent/danger/statis/counterByCat',
+    method: 'GET'
+  })
+}
+
+/**
+ * 基于年度月份统计
+ * @param year
+ * @returns
+ */
+export function counterByMonth(year) {
+  return request({
+    url: `/ent/danger/statis/counterByMonth/${year}`,
+    method: 'GET'
+  })
+}

+ 38 - 39
src/router/modules/aqpt.js

@@ -183,45 +183,44 @@ const aqptRouter = [
       }
     ]
   },
-  // {
-  //   path: '/aqpt/danger',
-  //   component: Layout,
-  //   name: 'AqptDanger',
-  //   redirect: '/aqpt/danger/index',
-  //   meta: {
-  //     title: '隐患管理',
-  //     permit: 'aqpt_danger'
-  //   },
-  //   groupId: [5],
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/aqpt/danger/index'),
-  //       name: 'aqpt_danger_index',
-  //       meta: { title: '隐患管理', noCache: true, icon: 'icon-common_riskmanagement', permit: 'aqpt_danger' }
-  //     }
-  //   ]
-  // },
-
-  // {
-  //   path: '/aqpt/report',
-  //   component: Layout,
-  //   name: 'AqptLedger',
-  //   redirect: '/aqpt/report/index',
-  //   meta: {
-  //     title: '台帐清单',
-  //     permit: 'aqpt_report'
-  //   },
-  //   groupId: [3],
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/aqpt/report/index'),
-  //       name: 'aqpt_report_index',
-  //       meta: { title: '台帐中心', noCache: true, icon: 'icon-common_statistical', permit: 'aqpt_report' }
-  //     }
-  //   ]
-  // },
+  {
+    path: '/goaf/danger',
+    component: Layout,
+    name: 'GoafDanger',
+    redirect: '/goaf/danger/index',
+    meta: {
+      title: '采空区隐患管理',
+      permit: 'aqpt_danger'
+    },
+    groupId: [5],
+    children: [
+      {
+        path: 'index',
+        component: () => import('@/views/goaf/danger/index'),
+        name: 'goaf_danger_index',
+        meta: { title: '采空区隐患管理', noCache: true, icon: 'icon-common_riskmanagement', permit: 'aqpt_danger' }
+      }
+    ]
+  },
+  {
+    path: '/aqpt/danger',
+    component: Layout,
+    name: 'GoafDanger',
+    redirect: '/aqpt/danger/index',
+    meta: {
+      title: '隐患管理',
+      permit: 'aqpt_danger'
+    },
+    groupId: [5],
+    children: [
+      {
+        path: 'index',
+        component: () => import('@/views/aqpt/danger/index'),
+        name: 'aqpt_danger_index',
+        meta: { title: '隐患管理', noCache: true, icon: 'icon-common_riskmanagement', permit: 'aqpt_danger' }
+      }
+    ]
+  },
 
   {
     path: '/aqpt/equipment',

+ 2 - 2
src/settings.js

@@ -38,8 +38,8 @@ module.exports = {
   */
   serverUrl: 'http://192.168.1.214:8080/', // 正式环境
   // devServerUrl: 'http://1.15.92.205:8080/', // 开发环境
-  // devServerUrl: 'http://192.168.3.5:8080/', // 开发环境 qu
-  devServerUrl: 'http://192.168.3.201:8080/', // 开发环境  test
+  devServerUrl: 'http://192.168.3.5:8080/', // 开发环境 qu
+  // devServerUrl: 'http://192.168.3.201:8080/', // 开发环境  test
   mqttUrl: 'ws://1.15.92.205:8083/mqtt', // mqtt地址
   /**
   * websocket 地址

+ 259 - 0
src/views/goaf/danger/activity/Accept.vue

@@ -0,0 +1,259 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <VueScroll :ops="ops" style="height: calc(100vh - 400px)">
+            <DangerInfo :view-data="viewData" class="form" />
+            <work-flow ref="WFlow" />
+          </VueScroll>
+          <div class="btn-group">
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+            <el-button @click="dialogVisible = false">取消</el-button>
+          </div>
+        </div>
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" :wf-ins-id="viewData.dangerId" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import VueScroll from 'vuescroll'
+import { getDangerById, handleDanger } from '@/api/goaf/dangerApi'
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import DangerInfo from '../components/DangerInfo'
+
+export default {
+  name: 'AcceptTask',
+  components: { VueScroll, DangerInfo, WorkFlow, ActivityHandleRecord },
+  props: {
+    title: {
+      type: [String],
+      default: '隐患验收'
+    }
+  },
+
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      viewData: {
+        groupId: undefined,
+        groupName: '',
+        dangerId: undefined,
+        dangerSource: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+        status: 0,
+        attachList: []
+      },
+      formData: {
+        formCode: 'accept',
+        dangerId: undefined,
+        acceptRemark: '',
+        status: 0,
+        attachList: []
+      },
+      rules: { }
+    }
+  },
+  methods: {
+    previewList(photos) {
+      if (!photos) return null
+      if (Array.isArray(photos)) {
+        return photos
+      }
+      return [photos.fileUrl]
+    },
+
+    // 显示窗口
+    showModel(dangerId) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(dangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = data
+          this.$refs.WFlow.get(dangerId)
+          this.$refs.ActivityHandleRecord.getData(dangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    resetFormData() {
+      this.formData = {
+        formCode: 'accept',
+        dangerId: undefined,
+        status: 0,
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$nextTick(() => {
+        this.$refs.WFlow.handle({}).then((res) => {
+          if (res === false) {
+            this.$message.error('请检查填写信息')
+            return false
+          }
+          this.handleCommand(res)
+        }).catch((error) => {
+          console.log(error)
+        })
+      })
+    },
+
+    // 处理
+    handleCommand(flow) {
+      this.formData.dangerId = this.viewData.dangerId
+      this.formData.status = flow.status
+      this.formData.acceptRemark = flow.data.actionRemark
+      this.formData.attachList = flow.data.attachList
+      handleDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.dialogVisible = false
+          this.$message.success(msg)
+          this.formSuccess()
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+
+    resetFormField(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.hd-info-component {
+  margin: 15px;
+  position: relative;
+  height: calc(100% - 15px);
+
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+
+    .el-button {
+      width: 100%;
+      margin: 0 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  .el-row {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+
+    .el-button {
+      width: 10%;
+    }
+  }
+}
+
+</style>

+ 289 - 0
src/views/goaf/danger/activity/Rectify.vue

@@ -0,0 +1,289 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+
+          <Vuescroll :ops="ops" style="height: calc(100vh - 300px)">
+            <DangerInfo :view-data="viewData" class="form" />
+            <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="130px">
+              <el-form-item label="原因分析" prop="dangerReason">
+                <el-input v-model="formData.dangerReason" type="textarea" :rows="10" placeholder="请填写原因分析" />
+              </el-form-item>
+              <el-form-item label="整改类型" prop="rectifyCat">
+                <el-select v-model="formData.rectifyCat" style="width: 100%" filterable placeholder="选择整改类型">
+                  <el-option label="自行整改" :value="1" />
+                  <el-option label="外协整改" :value="2" />
+                </el-select>
+              </el-form-item>
+
+              <el-form-item label="整改措施" prop="rectifyMeasure">
+                <el-input v-model="formData.rectifyMeasure" type="textarea" :rows="10" placeholder="请填写整改措施" />
+              </el-form-item>
+            </el-form>
+            <work-flow ref="WFlow" />
+          </Vuescroll>
+          <div class="btn-group">
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+            <el-button @click="dialogVisible = false">取消</el-button>
+          </div>
+        </div>
+
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" :wf-ins-id="viewData.dangerId" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import { getDangerById, handleDanger } from '@/api/goaf/dangerApi'
+import Vuescroll from 'vuescroll'
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import DangerInfo from '../components/DangerInfo'
+
+export default {
+  name: 'RectifyTask',
+  components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
+  props: {
+    title: {
+      type: [String],
+      default: '隐患整改'
+    }
+  },
+
+  data() {
+    return {
+      transferVisible: false,
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      viewData: {
+        groupId: undefined,
+        groupName: '',
+        dangerId: undefined,
+        dangerSource: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+        status: 0,
+        attachList: []
+      },
+      formData: {
+        formCode: 'rectify',
+        dangerId: undefined,
+        status: 0,
+        attachList: []
+      },
+      rules: {
+        dangerReason: [
+          { required: true, message: '请输入隐患发生原因', trigger: 'blur' }
+        ],
+        rectifyMeasure: [
+          { required: true, message: '请输入整改措施', trigger: 'blur' }
+        ]
+      },
+      attachList: []
+    }
+  },
+  methods: {
+    previewList(photos) {
+      if (!photos) return null
+      if (Array.isArray(photos)) {
+        return photos
+      }
+      return [photos.fileUrl]
+    },
+
+    // 显示窗口
+    showModel(dangerId) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(dangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = data
+          this.$refs.WFlow.get(dangerId)
+          this.$refs.ActivityHandleRecord.getData(dangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 重置
+    resetFormData() {
+      this.formData = {
+        formCode: 'rectify',
+        dangerId: undefined,
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        status: 0,
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$nextTick(() => {
+        this.$refs.WFlow.handle({}).then((res) => {
+          if (res === false) {
+            this.$message.error('请检查填写信息')
+            return false
+          }
+          this.handleCommand(res)
+        }).catch((error) => {
+          console.log(error)
+        })
+      })
+    },
+
+    // 处理
+    handleCommand(flow) {
+      this.formData.dangerId = this.viewData.dangerId
+      this.formData.status = flow.status
+      this.formData.rectifyRemark = flow.data.actionRemark
+      this.formData.attachList = flow.data.attachList
+      handleDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.dialogVisible = false
+          this.$message.success(msg)
+          this.formSuccess()
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+
+    resetFormField(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.hd-info-component {
+  margin: 15px;
+  position: relative;
+  height: calc(100% - 15px);
+
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+
+    .el-button {
+      width: 100%;
+      margin: 0 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  .el-row {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+
+    .el-button {
+      width: 10%;
+    }
+  }
+}
+
+</style>

+ 264 - 0
src/views/goaf/danger/activity/Review.vue

@@ -0,0 +1,264 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <Vuescroll :ops="ops" style="height: calc(100vh - 400px)">
+            <DangerInfo :view-data="viewData" class="form" />
+            <work-flow ref="WFlow" />
+          </Vuescroll>
+
+          <div class="btn-group">
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+            <el-button @click="dialogVisible = false">取消</el-button>
+          </div>
+        </div>
+
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" :wf-ins-id="viewData.dangerId" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import { handleDanger, getDangerById } from '@/api/goaf/dangerApi'
+import Vuescroll from 'vuescroll'
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import DangerInfo from '../components/DangerInfo'
+
+export default {
+  name: 'ReviewTask',
+  components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
+  filters: {},
+  props: {
+    title: {
+      type: [String],
+      default: ''
+    }
+  },
+
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      rules: { },
+      viewData: {
+        dangerId: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerSource: undefined,
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+        status: 0,
+        attachList: []
+      },
+      formData: {
+        formCode: 'review',
+        dangerId: undefined,
+        status: 0,
+        attachList: []
+      }
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    previewList(photos) {
+      if (!photos) return null
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item.fileUrl
+        })
+        return list
+      }
+      return [photos.fileUrl]
+    },
+
+    // 显示窗口
+    showModel(dangerId) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(dangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = data
+          this.$refs.WFlow.get(dangerId)
+          this.$refs.ActivityHandleRecord.getData(dangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 重置
+    resetFormData() {
+      this.formData = {
+        formCode: 'review',
+        dangerId: undefined,
+        status: 0,
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$nextTick(() => {
+        this.$refs.WFlow.handle({}).then((res) => {
+          if (res === false) {
+            this.$message.error('请检查填写信息')
+            return false
+          }
+          this.handleCommand(res)
+        }).catch((error) => {
+          console.log(error)
+        })
+      })
+    },
+
+    // 处理
+    handleCommand(flow) {
+      this.formData.dangerId = this.viewData.dangerId
+      this.formData.status = flow.status
+      this.formData.reviewRemark = flow.data.actionRemark
+      this.formData.attachList = flow.data.attachList
+      handleDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.dialogVisible = false
+          this.$message.success(msg)
+          this.$emit('formSuccess')
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+    resetFormField(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.hd-info-component {
+  margin: 15px;
+  position: relative;
+  height: calc(100% - 15px);
+
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+
+    .el-button {
+      width: 100%;
+      margin: 0 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  .el-row {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+
+    .el-button {
+      width: 10%;
+    }
+  }
+}
+
+</style>

+ 329 - 0
src/views/goaf/danger/activity/Submit.vue

@@ -0,0 +1,329 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <vuescroll :ops="ops" style="height: calc(100vh - 300px)">
+            <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="130px">
+              <el-form-item label="隐患标题" prop="hdangerTitle">
+                <el-input v-model="formData.hdangerTitle" />
+              </el-form-item>
+
+              <el-form-item label="隐患编码" prop="dangerCode">
+                <el-input v-model="formData.dangerCode" />
+              </el-form-item>
+
+              <el-form-item label="所在位置" prop="riskPointId">
+                <risk-point-selector v-model="formData.riskPointId" />
+              </el-form-item>
+              <el-form-item label="采空区" prop="goafId">
+                <el-select v-model="formData.goafId" filterable placeholder="采空区名称" style="width: 100%">
+                  <el-option value="" label="请选择采空区" disabled />
+                  <el-option v-for="item in goafs" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+                </el-select>
+              </el-form-item>
+
+              <el-form-item label="隐患类别" prop="dangerCatId">
+                <danger-cat-selector v-model="formData.dangerCatId" />
+              </el-form-item>
+
+              <el-form-item label="隐患来源" prop="dangerSource">
+                <el-select v-model="formData.dangerSource" style="width: 100%" filterable placeholder="请选择隐患来源">
+                  <el-option label="自查" :value="0" />
+                  <el-option label="内部反馈" :value="1" />
+                  <el-option label="上级检查" :value="2" />
+                  <el-option label="政府执法" :value="3" />
+                </el-select>
+              </el-form-item>
+
+              <el-form-item label="隐患等级" prop="hdangerLevel">
+                <el-radio-group v-model="formData.hdangerLevel">
+                  <el-radio :label="1">一般事故隐患</el-radio>
+                  <el-radio :label="2">重大事故隐患</el-radio>
+                </el-radio-group>
+              </el-form-item>
+
+              <el-form-item label="整改截止时间" prop="dangerDeadLine">
+                <el-date-picker
+                  v-model="formData.dangerDeadLine"
+                  type="date"
+                  placeholder="设置截止时间"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  clearable
+                  style="width: 100%"
+                />
+              </el-form-item>
+
+              <el-form-item label="描述" prop="hdangerDesc">
+                <el-input v-model="formData.hdangerDesc" type="textarea" :rows="5" placeholder="隐患描述" />
+              </el-form-item>
+            </el-form>
+            <work-flow ref="WFlow" />
+            <div class="btn-group">
+              <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+              <el-button @click="dialogVisible = false">取消</el-button>
+            </div>
+          </vuescroll>
+        </div>
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" :wf-ins-id="formData.dangerId" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import { DangerCatSelector, RiskPointSelector } from '@/views/aqpt/components'
+import { handleDanger, getDangerById } from '@/api/goaf/dangerApi'
+import { getGoafBaseInfo } from '@/api/goaf/info'
+import Vuescroll from 'vuescroll'
+import { getUserData } from '@/utils/auth'
+export default {
+  name: 'SubmitTask',
+  components: {
+    Vuescroll,
+    DangerCatSelector,
+    RiskPointSelector,
+    WorkFlow,
+    ActivityHandleRecord
+  },
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      formData: {
+        formCode: 'submit',
+        dangerId: undefined,
+        scenePhoto: '',
+        sceneIcon: '',
+        groupId: undefined, // 所属部门
+        riskPointId: undefined, // 风险点:所属区域
+        dangerCode: '', // 隐患编码
+        hdangerTitle: '', // 隐患标题
+        dangerCatId: undefined, // 隐患类别ID
+        hdangerLevel: 1, // 隐患等级
+        hdangerDesc: '', // 描述
+        dangerDeadLine: '', // 截止时间
+        dangerSource: 0, // 隐患来源
+        status: 0, // 状态
+        submitRemark: '',
+        attachList: [],
+        goafId: undefined
+      },
+      goafs: [],
+      rules: {
+        hdangerTitle: [
+          { required: true, message: '请输入隐患标题', trigger: 'blur' }
+        ],
+        dangerCode: [
+          { required: true, message: '请输入隐患编码', trigger: 'blur' }
+        ],
+        groupId: [
+          { required: true, message: '请输入所在部门', trigger: 'blur' }
+        ],
+        riskPointId: [
+          { required: true, message: '请选择所在部位', trigger: 'blur' }
+        ],
+        goafId: [
+          { required: true, message: '请选择采空区', trigger: 'change' }
+        ],
+        hdangerLevel: [
+          { required: true, message: '请输选择隐患等级', trigger: 'blur' }
+        ],
+        dangerDeadLine: [
+          { required: true, message: '截止时间', trigger: 'blur' }
+        ],
+        dangerCatId: [
+          { required: true, message: '请选择隐患类别', trigger: 'blur' }
+        ],
+        accountIdTo: [
+          { required: true, message: '请选择执行人', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  mounted() {
+    const userData = getUserData()
+    this.formData.ocId = userData.ocId
+    getGoafBaseInfo().then((res) => {
+      this.goafs = res.data
+    })
+  },
+  methods: {
+
+    // 启动
+    start() {
+      const wfDefId = 1
+      this.dialogVisible = true
+      this.$nextTick(() => {
+        this.$refs.WFlow.start(wfDefId).then((res) => {
+          if (res > 0) {
+            this.formData.dangerId = res
+          } else {
+            this.$message.error('流程初始化失败')
+          }
+        })
+      })
+    },
+
+    // 显示窗口
+    showModel(dangerId) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(dangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.formData = data
+          this.$refs.WFlow.get(dangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    resetFormData() {
+      this.formData = {
+        formCode: 'submit',
+        dangerId: undefined,
+        scenePhoto: '',
+        sceneIcon: '',
+        groupId: undefined, // 所属部门
+        riskPointId: undefined, // 风险点:所属区域
+        dangerCode: '', // 隐患编码
+        hdangerTitle: '', // 隐患标题
+        dangerCatId: undefined, // 隐患类别ID
+        hdangerLevel: 1, // 隐患等级
+        hdangerDesc: '', // 描述
+        dangerDeadLine: '', // 截止时间
+        dangerSource: 0, // 隐患来源
+        status: 0, // 状态
+        submitRemark: '',
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$refs['ruleForm'].validate((valid) => {
+        if (valid) {
+          this.$nextTick(() => {
+            this.$refs.WFlow.handle({}).then((res) => {
+              this.handleCommand(res)
+            }).catch((error) => {
+              console.log(error)
+            })
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+
+    // 提交
+    handleCommand(flow) {
+      console.log(flow)
+      const attachList = flow.data.attachList
+      this.formData.status = flow.status
+      this.formData.submitRemark = flow.data.actionRemark
+      this.formData.attachList = attachList
+      if (Array.isArray(attachList) && attachList.length > 0) {
+        const attach = attachList[0]
+        console.log(attach)
+        this.formData.scenePhoto = attach.fileUrl
+        this.formData.sceneIcon = attach.fileIcon
+      }
+      handleDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.$emit('formSuccess')
+          this.dialogVisible = false
+          this.$message.success(msg)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+
+    resetForm(formName) {
+      this.$refs[formName].resetFields()
+    }
+
+  }
+}
+</script>
+
+<style lang="scss">
+</style>
+<style lang="scss" scoped>
+.content-container {
+  position: relative;
+  height: calc(100% - 15px);
+  .ruleForm {
+    margin: 0 100px;
+  }
+
+  .btn-group {
+    width: 100%;
+    text-align: center;
+
+    .el-button {
+      margin: 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+}
+
+</style>

+ 171 - 0
src/views/goaf/danger/components/DangerInfo.vue

@@ -0,0 +1,171 @@
+<template>
+  <div class="text-block" :style="styles">
+    <div class="activity-item danger">
+      <div v-if="viewData.dangerCode" class="text-row">
+        <div v-if="viewData.dangerCode" class="text-item">
+          <span class="text-label right">隐患编码:</span>
+          <span> {{ viewData.dangerCode }} </span>
+        </div>
+        <div v-if="viewData.status" class="text-item">
+          <span class="text-label right">隐患状态:</span>
+          <span> {{ viewData.status | dangerStatusFilter }} </span>
+        </div>
+        <div v-if="viewData.dangerTitle" class="text-item">
+          <span class="text-label right">隐患名称:</span>
+          <span> {{ viewData.dangerTitle }} </span>
+        </div>
+        <div v-if="viewData.dangerTitle" class="text-item">
+          <span class="text-label right">隐患类别:</span>
+          <span> {{ viewData.dangerCatTitle }} </span>
+        </div>
+        <div v-if="viewData.dangerLevel" class="text-item">
+          <span class="text-label right">隐患等级:</span>
+          <span> {{ viewData.dangerLevel | dangerLevelFilter }} </span>
+        </div>
+        <div v-if="viewData.riskPointTitle" class="text-item">
+          <span class="text-label right">所在位置:</span>
+          <span> {{ viewData.riskPointTitle }}</span>
+        </div>
+        <div v-if="viewData.dangerDeadLine" class="text-item">
+          <span class="text-label right">整改期限:</span>
+          <span> {{ viewData.dangerDeadLine }}</span>
+        </div>
+        <div v-if="viewData.dangerDesc" class="text-item">
+          <span class="text-label right">描述:</span>
+          <span> {{ viewData.dangerDesc }} </span>
+        </div>
+      </div>
+    </div>
+    <div class="activity-item submit">
+      <div v-if="viewData.submitAccountName" class="text-row">
+        <div v-if="viewData.submitAccountName" class="text-item">
+          <span class="text-label right">提交人员:</span>
+          <span> {{ viewData.submitAccountName }}( {{ viewData.submitPositionName }} ) </span>
+        </div>
+        <div v-if="viewData.submitGroupName" class="text-item">
+          <span class="text-label right">所在部位:</span>
+          <span> {{ viewData.submitGroupName }} </span>
+        </div>
+      </div>
+    </div>
+    <div class="activity-item rectify">
+      <div v-if="viewData.rectifyAccountId" class="text-row">
+        <div v-if="viewData.rectifyAccountId" class="text-item">
+          <span class="text-label right">整改人员:</span>
+          <span> {{ viewData.rectifyAccountName }}</span>
+        </div>
+        <div v-if="viewData.rectifyGroupName" class="text-item">
+          <span class="text-label right">所在部门:</span>
+          <span> {{ viewData.rectifyGroupName }} </span>
+        </div>
+      </div>
+      <div v-if="viewData.rectifyMeasure" class="text-row">
+        <div v-if="viewData.rectifyMeasure" class="text-item">
+          <span class="text-label right">整改措施:</span>
+          <span> {{ viewData.rectifyMeasure }}</span>
+        </div>
+      </div>
+      <div v-if="viewData.rectifyRemark" class="text-row">
+        <div v-if="viewData.rectifyRemark" class="text-item">
+          <span class="text-label right">整改说明:</span>
+          <span> {{ viewData.rectifyRemark }}</span>
+        </div>
+      </div>
+    </div>
+    <div v-if="viewData.attachList&&viewData.attachList.length>0" class="activity-item attach">
+      <div v-for="(attach,index) in viewData.attachList" :key="index" class="attach-item">
+        <el-image
+          style="width: 100px; height: 100px"
+          :src="attach.fileUrl"
+          :preview-src-list="[attach.fileUrl]"
+          fit="fill"
+        />
+        <div class="tag">{{ attach.taskCode |taskCodeFilter }}</div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { dangerLevel, dangerSource, dangerStatus, rectifyCat } from '@/utils'
+export default {
+  name: 'DangerInfo',
+  components: { },
+  filters: {
+    dangerSourceFilter(ival) {
+      return dangerSource(ival)
+    },
+    dangerLevelFilter(ival) {
+      return dangerLevel(ival)
+    },
+    dangerStatusFilter(ival) {
+      return dangerStatus(ival)
+    },
+    rectifyFilter(ival) {
+      return rectifyCat(ival)
+    },
+    taskCodeFilter(code) {
+      const enums = {
+        'submit': '提交',
+        'accept': '验收',
+        'review': '评审',
+        'rectify': '整改'
+      }
+      return enums[code]
+    }
+
+  },
+  props: {
+    viewData: {
+      type: Object,
+      default: undefined
+    },
+    styles: {
+      type: String,
+      default: ''
+    }
+
+  },
+  data() {
+    return {
+
+    }
+  }
+}
+
+</script>
+<style lang="scss" scoped>
+  .text-block{
+    margin-bottom: 20px;
+    &.form{
+      .activity-item{
+        padding-left: 50px;
+      }
+    }
+  }
+.activity-item{
+  margin-top:1px;
+  background-color: #28475c;
+  &.attach{
+    display: flex;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+    align-items: center;
+    padding: 5px 0;
+    .attach-item{
+      position: relative;
+      height: 100px;
+      margin-left: 10px;
+      .tag{
+        width: 100%;
+        position: absolute;
+        bottom: 0;
+        padding: 3px 0;
+        line-height: 1;
+        background-color: rgba(0,0,0,0.6);
+        color: #fff;
+        text-align: center;
+      }
+    }
+  }
+}
+</style>

+ 317 - 0
src/views/goaf/danger/components/DangerList.vue

@@ -0,0 +1,317 @@
+<template>
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="12" class="left">
+        <div class="content-title">
+          {{ title }}
+        </div>
+      </el-col>
+
+      <el-col :span="12" class="button-group">
+        <div class="select-search right">
+          <el-input v-model="conditions.keywords" class="search-input" placeholder="请输入内容">
+            <el-button slot="append" icon="el-icon-search" @click="getData()" />
+          </el-input>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 230px)">
+
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
+
+        <el-table-column prop="scenePhoto" label="照片" header-align="center" align="center" width="60">
+          <template v-slot="{row}">
+            <div class="custom-avatar">
+              <el-image
+                :src="row.sceneIcon"
+                :preview-src-list="previewList(row.scenePhoto)"
+              />
+            </div>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="dangerTitle" label="隐患名称" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.dangerTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="dangerCatTitle" label="类别" header-align="center" align="center" width="100">
+          <template v-slot="{row}">
+            <span>{{ row.dangerCatTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="dangerLevel" label="级别" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="success" effect="plain" color="rgb(38 69 90)">{{ row.dangerLevel | dangerLevelFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="status" label="状态" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="warning" effect="plain" color="rgb(38 69 90)">{{ row.status | dangerStatusFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="curActivityTitle" label="当前关卡" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span v-if="row.status!==0">-</span>
+            <!-- color="rgb(38 69 90)" -->
+            <span v-else><el-tag type="danger" effect="plain" color="rgb(38 69 90)">{{ row.curActivityTitle }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="curAccountName" label="当前处理人" header-align="center" align="center" width="160">
+          <template v-slot="{row}">
+            <span v-if="row.status!==0">-</span>
+            <span v-else><i class="el-icon-user-solid" />{{ row.curAccountName }}( {{ row.curPositionName }} )</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="expectedEndTime" label="整改期限" header-align="center" align="center" width="165">
+          <template v-slot="{row}">
+            <span><i class="el-icon-timer" />{{ row.dangerDeadLine }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" header-align="center" align="center" width="180">
+          <template v-slot="{row}">
+            <el-button v-if="row.status === 0 && row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button>
+            <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-container">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
+    <danger-details ref="DangerDetails" title="隐患详情" />
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
+import SubmitActivity from '../activity/Submit'
+import ReviewActivity from '../activity/Review'
+import RectifyActivity from '../activity/Rectify'
+import AcceptActivity from '../activity/Accept'
+import DangerDetails from './Details'
+import { dangerLevel, dangerStatus } from '@/utils'
+import { mapGetters } from 'vuex'
+
+export default {
+  name: 'DangerList',
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
+  filters: {
+    dangerLevelFilter(val) {
+      return dangerLevel(val)
+    },
+    dangerStatusFilter(val) {
+      return dangerStatus(val)
+    },
+    dangerDeadlineFilter(val) {
+
+    }
+  },
+  data() {
+    return {
+      title: '',
+      dataList: [],
+      total: 0,
+      listLoading: false,
+      conditions: {
+        page: 1,
+        limit: 10,
+        keywords: '',
+        status: undefined,
+        day: undefined,
+        submitAccountId: undefined,
+        handleAccountId: undefined,
+        curAccountId: undefined,
+        startDate: undefined,
+        endDate: undefined,
+        groupId: undefined
+      },
+      action: ''
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  mounted() {
+    // this.getData()
+  },
+  methods: {
+
+    // 重置查询条件
+    resetConditions() {
+      this.conditions.keywords = ''
+      this.conditions.status = undefined
+      this.conditions.submitAccountId = undefined
+      this.conditions.handleAccountId = undefined
+      this.conditions.curAccountId = undefined
+      this.conditions.groupId = undefined
+    },
+
+    // 加载数据
+    loadData(action) {
+      this.action = action
+      const groupId = this.userData.groupId
+      const userId = this.userData.userId
+
+      switch (action) {
+        case 'MyCreated':
+          this.title = '我提交的隐患'
+          this.resetConditions()
+          this.conditions.submitAccountId = userId
+          break
+
+        case 'MyHandling':
+          this.title = '我的待处理隐患'
+          this.resetConditions()
+          this.conditions.status = 0
+          this.conditions.curAccountId = userId
+          break
+
+        case 'MyHandled':
+          this.title = '我处理完的隐患'
+          this.resetConditions()
+          this.conditions.handleAccountId = userId
+          break
+
+        case 'MyCanceled':
+          this.title = '我撤消的隐患'
+          this.resetConditions()
+          this.conditions.submitAccountId = userId
+          this.conditions.status = -1
+          break
+
+        case 'GroupHandling':
+          this.title = '部门待处理的隐患'
+          this.resetConditions()
+          this.conditions.curGroupId = groupId
+          this.conditions.status = 0
+          break
+
+        case 'GroupSubmit':
+          this.title = '部门提交的隐患'
+          this.resetConditions()
+          this.conditions.submitGroupId = groupId
+          break
+
+        case 'GroupReview':
+          this.title = '部门参与评审的隐患'
+          this.resetConditions()
+          this.conditions.reviewGroupId = groupId
+          break
+
+        case 'GroupRectify':
+          this.title = '部门整改的隐患'
+          this.resetConditions()
+          this.conditions.rectifyGroupId = groupId
+          break
+
+        case 'GroupAccept':
+          this.title = '部门参与验收的隐患'
+          this.resetConditions()
+          this.conditions.acceptGroupId = groupId
+          break
+      }
+
+      this.getData()
+    },
+
+    // Fetch Data
+    getData() {
+      this.listLoading = true
+      const conditions = {
+        page: 1,
+        limit: 10
+      }
+      getDangerByPage(conditions).then((resp) => {
+        const { code, data, total, msg } = resp
+        this.listLoading = false
+        if (code === 0) {
+          this.total = total
+          this.dataList = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 流程处理
+    handleDanger(data) {
+      const { curActivityCode, dangerId } = data
+      this.$refs[curActivityCode].showModel(dangerId)
+    },
+
+    // Delete Handler
+    handleDelete(data) {
+      const { dangerId, dangerTitle } = data
+      this.$confirm(`此操作将删除该数据${dangerTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteDangerById(dangerId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.$message.success(msg)
+            this.getData()
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+
+    // Show Details
+    handleDetail(data) {
+      const { dangerId } = data
+      this.$refs['DangerDetails'].showView(dangerId)
+    },
+
+    // Update View
+    formSuccess() {
+      this.getData()
+      this.$emit('actionUpdate')
+    },
+
+    // Preview Photo
+    previewList(photos) {
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item
+        })
+        return list
+      }
+      return [photos]
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.content-container {
+  margin: 10px 10px 10px 0;
+  height: calc(100vh - 95px);
+}
+</style>

+ 338 - 0
src/views/goaf/danger/components/Details.vue

@@ -0,0 +1,338 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    size="65%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <Vuescroll :ops="ops" style="height: calc(100vh - 260px)">
+            <div class="handle-contanier" style="padding-bottom:3px">
+              <el-button type="primary" size="mini" @click="getPdf()">导出PDF</el-button>
+            </div>
+            <DangerInfo id="pdfDom" :view-data="viewData" />
+          </Vuescroll>
+        </div>
+      </el-row>
+      <div v-show="tabType==='history'">
+        <ActivityHandleRecord ref="ActivityHandleRecord" :wf-ins-id="viewData.dangerId" />
+      </div>
+      <div class="btn-group">
+        <el-button class="cancel-btn" @click="dialogVisible = false">关闭</el-button>
+      </div>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import Vuescroll from 'vuescroll'
+import { getDangerById } from '@/api/goaf/dangerApi'
+import DangerInfo from '../components/DangerInfo'
+import { ActivityHandleRecord } from '@/components'
+
+export default {
+  name: 'DangerDetails',
+  components: { Vuescroll, DangerInfo, ActivityHandleRecord },
+  filters: {},
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      previewVisible: false,
+      previewsrc: '',
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      viewData: {
+        groupId: undefined,
+        groupName: '',
+        dangerId: undefined,
+        dangerSource: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+
+        status: 0,
+
+        wfDefId: 1,
+        wfInsId: undefined,
+        wfInsTitle: '',
+
+        curActivityInsId: undefined,
+        curActivityInsTitle: '',
+
+        curGroupId: undefined,
+        curGroupName: '',
+        curPositionId: undefined,
+        curPositionName: '',
+        curAccountId: undefined,
+        curAccountName: '',
+
+        attachList: []
+      },
+      rules: {}
+    }
+  },
+  computed: {},
+  mounted() {},
+  methods: {
+
+    // Fetch Data
+    getData(dangerId) {
+      getDangerById(dangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = data
+          this.$refs.ActivityHandleRecord.getData(dangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // Show View Info
+    showView(dangerId) {
+      this.eventList = []
+      this.dialogVisible = true
+      this.getData(dangerId)
+    },
+
+    previewPic(targetSrc) {
+      if (!targetSrc) {
+        this.$message({
+          type: 'info',
+          message: '未获取到图片地址!'
+        })
+        return
+      }
+      this.previewVisible = true
+      this.previewsrc = targetSrc
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+</style>
+<style lang="scss" scoped>
+.content-container {
+  position: relative;
+  height: calc(100% - 30px);
+
+  &{
+    padding: 10px;
+    font-size: 12px;
+    font-weight: 400;
+    color: #FFFFFF;
+  }
+  .el-timeline {
+    width: 360px;
+    margin: 15px auto 0;
+    padding: 0 0 0 90px;
+  }
+  .record-item {
+    position: relative;
+    top:0;
+    .time {
+      font-size: 12px;
+      font-weight: 400;
+      color: #A9BDC9;
+      position: absolute;
+      margin-top:25px;
+      left: -165px;
+      top: 17px;
+    }
+    .title {
+      margin-top:85px;
+      font-size: 12px;
+      font-weight: 400;
+      color: #A9BDC9;
+      margin:0px;
+    }
+    .desc {
+      font-size: 11px;
+      font-weight: 400;
+      color: #FFFFFF;
+      line-height: 2em;
+      margin: 0;
+    }
+  }
+  .hd-details {
+    color: #FFFFFF;
+  }
+  p {
+    color: #FFFFFF;
+    font-size: 12px;
+    margin: 0;
+    padding: 0;
+    line-height: 1.8;
+    &.desc{
+      font-size: 14px;
+    }
+    &.row{
+      span{
+        width: 33.3%;
+        display: inline-block;
+        text-align: left;
+      }
+    }
+  }
+  .cut-off-line{
+    height: 2px;
+    background: linear-gradient(90deg, #233E4F 0%, #233E4F 100%);
+    margin: 38px auto;
+  }
+  .demo-image__placeholder{
+    display: flex;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+    .block{
+      margin-right: 10px;
+      cursor: pointer;
+      .el-image{
+        display: block;
+      }
+      .el-card{
+        border: 0;
+      }
+      .card-box{
+        position: relative;
+        .desc{
+          width: 100%;
+          height: 24px;
+          line-height: 24px;
+          position: absolute;
+          top: 22px;
+          background-color: rgba(25, 49, 82);
+          color: #fff;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+          text-align: center;
+          transform: rotate(45deg);
+          right: -28px;
+          font-size: 14px;
+          letter-spacing: 2px;
+          &.submit{
+            background-color: #1890FF;
+          }
+          &.accept{
+            background-color: #346B98;
+          }
+          &.rectify{
+            background-color: #F97647;
+          }
+        }
+      }
+    }
+  }
+  .history{
+    margin-top: 20px;
+  }
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    text-align: center;
+    .el-button {
+      margin: 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+}
+.custom-dialog{
+  &{
+    position:fixed;
+    left: 0;
+    right:0;
+    top: 0;
+    bottom: 0;
+    background-color:rgba(0,0,0,0.75);
+  }
+  img{
+    display: block;
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%)
+  }
+}
+</style>

+ 273 - 0
src/views/goaf/danger/components/LeftCounter.vue

@@ -0,0 +1,273 @@
+<template>
+  <div class="content-container">
+    <el-row class="content-title">
+      <span>{{ title }}</span>
+    </el-row>
+
+    <el-row class="btn-group">
+      <el-button class="send-menu" @click="handleSubmitTask">登记隐患</el-button>
+    </el-row>
+
+    <el-row class="list-group">
+      <div>
+        <div :class="curSel === 'MyCreated' ? 'list-item active' : 'list-item'" @click="selectItem('MyCreated')">
+          <el-col :span="18">
+            <p class="title">我提交的</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.myCreatedCount }}</p>
+          </el-col>
+        </div>
+
+        <div :class="curSel === 'MyCanceled' ? 'list-item active' : 'list-item'" @click="selectItem('MyCanceled')">
+          <el-col :span="18">
+            <p class="title">我撤消的</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.myCanceledCount }}</p>
+          </el-col>
+        </div>
+      </div>
+
+      <div>
+        <el-row class="sub-title-bar">
+          <p class="sub-title">我参与的</p>
+        </el-row>
+
+        <div :class="curSel === 'MyHandling' ? 'list-item active' : 'list-item'" @click="selectItem('MyHandling')">
+          <el-col :span="18">
+            <p class="title">待处理</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.myHandlingCount }}</p>
+          </el-col>
+        </div>
+
+        <div :class="curSel === 'MyHandled' ? 'list-item active' : 'list-item'" @click="selectItem('MyHandled')">
+          <el-col :span="18">
+            <p class="title">已处理</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.myHandledCount }}</p>
+          </el-col>
+        </div>
+
+      </div>
+
+      <div>
+        <el-row class="sub-title-bar">
+          <p class="sub-title">部门的</p>
+        </el-row>
+
+        <div :class="curSel === 'GroupHandling' ? 'list-item active' : 'list-item'" @click="selectItem('GroupHandling')">
+          <el-col :span="18">
+            <p class="title">待处理</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.groupHandlingCount }}</p>
+          </el-col>
+        </div>
+
+        <div :class="curSel === 'GroupSubmit' ? 'list-item active' : 'list-item'" @click="selectItem('GroupSubmit')">
+          <el-col :span="18">
+            <p class="title">提交</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.groupSubmitCount }}</p>
+          </el-col>
+        </div>
+
+        <div :class="curSel === 'GroupReview' ? 'list-item active' : 'list-item'" @click="selectItem('GroupReview')">
+          <el-col :span="18">
+            <p class="title">评审</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.groupReviewCount }}</p>
+          </el-col>
+        </div>
+
+        <div :class="curSel === 'GroupRectify' ? 'list-item active' : 'list-item'" @click="selectItem('GroupRectify')">
+          <el-col :span="18">
+            <p class="title">整改</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.groupRectifyCount }}</p>
+          </el-col>
+        </div>
+
+        <div :class="curSel === 'GroupAccept' ? 'list-item active' : 'list-item'" @click="selectItem('GroupAccept')">
+          <el-col :span="18">
+            <p class="title">验收</p>
+          </el-col>
+          <el-col :span="6">
+            <p class="count">{{ dangerCounter.groupAcceptCount }}</p>
+          </el-col>
+        </div>
+
+      </div>
+    </el-row>
+    <submit-task ref="SubmitTask" title="隐患登记" @formSuccess="selectItem(curSel)" />
+  </div>
+</template>
+<script>
+
+import SubmitTask from '../activity/Submit'
+import { getDangerCounter } from '@/api/goaf/dangerStatisApi'
+
+export default {
+  components: {
+    SubmitTask
+  },
+  props: {
+    value: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      title: '隐患管理',
+      dangerCounter: {
+        myCreatedCount: 0,
+        myHandlingCount: 0,
+        myHandledCount: 0,
+        myCanceledCount: 0,
+        groupHandlingCount: 0,
+        groupSubmitCount: 0,
+        groupReviewCount: 0,
+        groupRectifyCount: 0,
+        groupAcceptCount: 0
+      },
+      curSel: 'MyHandling'
+    }
+  },
+
+  mounted() {
+    this.loadData()
+    this.selectItem(this.curSel)
+  },
+  methods: {
+    // 加载数据
+    loadData() {
+      this.getData()
+    },
+
+    // 添加
+    handleSubmitTask() {
+      this.$refs['SubmitTask'].start()
+    },
+
+    // 初始化
+    getData() {
+      getDangerCounter().then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.dangerCounter = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // “选择” 处理
+    selectItem(val) {
+      this.curSel = val
+      this.$emit('selectItem', val)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.content-container {
+  margin: 10px;
+  padding: 10px;
+  height: calc(100vh - 95px);
+
+  .title-bar {
+    height: 40px;
+    line-height: 40px;
+    text-indent: 15px;
+    background: #113849;
+
+    .content-title {
+      font-size: 16px;
+      color: #FFF;
+      margin: 0;
+      font-weight: bold;
+    }
+  }
+
+  .sub-title-bar {
+    height: 40px;
+    line-height: 40px;
+    text-indent: 15px;
+    background: #113849;
+    margin-top: 10px;
+    margin-bottom: 5px;
+
+    .sub-title {
+      font-size: 16px;
+      color: #FFF;
+      margin: 0;
+    }
+  }
+
+  .btn-group {
+    margin-top: 20px;
+
+    .send-menu {
+      width: 90%;
+      background: #3D5F76;
+      color: #FFF;
+      border-color: #3D5F76;
+
+      &:hover {
+        background: #283c4c;
+        color: #FFF;
+        border-color: #283c4c;
+      }
+    }
+  }
+
+  .list-group {
+    background: #193142;
+
+    p {
+      margin: 0;
+      padding: 0;
+    }
+
+    .count {
+      text-align: right;
+    }
+
+    .list-item {
+      height: 40px;
+      line-height: 40px;
+      color: #FFF;
+      padding: 0 30px;
+      font-size: 14px;
+
+      &.active {
+        color: #08A6DC;
+        position: relative;
+
+        &::after {
+          position: absolute;
+          content: "";
+          width: 0;
+          height: 0;
+          top: calc(50% - 3.5px);
+          right: -3px;
+          border-left: 7px solid transparent;
+          border-right: 7px solid transparent;
+          border-bottom: 7px solid #08A6DC;
+          transform: rotate(270deg);
+        }
+      }
+    }
+  }
+}
+</style>

+ 47 - 0
src/views/goaf/danger/index.vue

@@ -0,0 +1,47 @@
+<template>
+  <div class="page-container">
+    <el-row class="counter-wrap">
+      <el-col :span="4" class="left-counter-wrap">
+        <left-counter ref="LeftCounter" @selectItem="selectItem" />
+      </el-col>
+      <el-col :span="20" class="right-counter-wrap">
+        <danger-list ref="DangerList" @actionUpdate="actionUpdate" />
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import LeftCounter from './components/LeftCounter'
+import DangerList from './components/DangerList'
+
+export default {
+  name: 'DangerIndex',
+  components: {
+    LeftCounter,
+    DangerList
+  },
+  data() {
+    return {
+      viewCode: 'MyHandling'
+    }
+  },
+  mounted() {
+  },
+  methods: {
+
+    // Action Update
+    actionUpdate() {
+      this.$refs['LeftCounter'].loadData()
+    },
+
+    // Select Code
+    selectItem(action) {
+      this.$refs['DangerList'].loadData(action)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>