zhaobao 2 år sedan
förälder
incheckning
272f775e47

+ 79 - 0
src/api/goaf/checkDefApi.js

@@ -0,0 +1,79 @@
+import request from '@/utils/request'
+
+/**
+ * 分页获取任务定义
+ * @param data
+ * @returns
+ */
+export function getCheckDefByPage(data) {
+  return request({
+    url: '/goaf/goafcheckdef/page',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 获取任务定义列表
+ * @param data
+ * @returns
+ */
+export function getCheckDefByList(data) {
+  return request({
+    url: '/goaf/goafcheckdef/list',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 根据Id获取任务定义
+ * @param riskPointId
+ * @param checkDefId
+ * @returns
+ */
+export function getCheckDefById(checkDefId) {
+  return request({
+    url: `/goaf/goafcheckdef/${checkDefId}`,
+    method: 'GET'
+  })
+}
+
+/**
+ * 添加任务定义
+ * @param data
+ * @returns
+ */
+export function createCheckDef(data) {
+  return request({
+    url: `/goaf/goafcheckdef/add`,
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 更新任务定义
+ * @param data
+ * @returns
+ */
+export function updateCheckDef(data) {
+  return request({
+    url: `/goaf/goafcheckdef/update`,
+    method: 'PUT',
+    data
+  })
+}
+
+/**
+ * 删除任务定义
+ * @param checkDefId
+ * @returns
+ */
+export function deleteCheckDefById(id) {
+  return request({
+    url: `/goaf/goafcheckdef/delete/${id}`,
+    method: 'DELETE'
+  })
+}
+

+ 50 - 0
src/api/goaf/checkRecordApi.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request'
+
+/**
+ * 列表查询检查记录
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function getCheckRecordByList(data) {
+  return request({
+    url: `/check/record`,
+    method: 'get',
+    params: data
+  })
+}
+
+/**
+ * 分页查询检查记录
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function getCheckRecordByPage(data) {
+  return request({
+    url: '/goaf/goafcheckRecord/page',
+    method: 'GET',
+    params: data
+  })
+}
+/**
+ * 根据检查记录id获取检查记录的详细信息
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function getCheckRecordById(id) {
+  return request({
+    url: `/goaf/goafcheckRecord/${id}`,
+    method: 'GET'
+  })
+}
+/**
+ * 增加检查记录 hh
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function createCheckRecord(data) {
+  return request({
+    url: '/goaf/goafChecklist/add',
+    method: 'POST',
+    data
+  })
+}

+ 0 - 49
src/api/goaf/task.js

@@ -1,54 +1,5 @@
 
 import request from '@/utils/request'
-
-// 获取所有任务定义
-export function getCheckDefByList(params) {
-  return request({
-    url: '/goaf/goafcheckdef/list',
-    params
-  })
-}
-// 分页获取所有任务定义
-export function getCheckDefByPage(params) {
-  return request({
-    url: '/goaf/goafcheckdef/page',
-    params
-  })
-}
-
-// 获取指定的任务定义
-export function getGoafcheckdefById(goafGoafcheckdefId) {
-  return request({
-    url: `/goaf/goafcheckdef/${goafGoafcheckdefId}`
-  })
-}
-// 增加任务定义
-export function createGoafcheckdef(data) {
-  return request({
-    url: '/goaf/goafcheckdef/add',
-    method: 'POST',
-    data
-  })
-}
-// 更新
-export function updateGoafcheckdef(data) {
-  return request({
-    url: '/goaf/goafcheckdef/update',
-    method: 'PUT',
-    data
-  })
-}
-
-// 删除
-export function deleteCheckDefById(goafId) {
-  return request({
-    url: `/goaf/goafcheckdef/delete/${goafId}`,
-    method: 'DELETE'
-  })
-}
-
-/** 任务 */
-
 // 获取任务列表
 export function goaftaskList(params) {
   return request({

+ 6 - 0
src/router/modules/aqpt.js

@@ -174,6 +174,12 @@ const aqptRouter = [
         component: () => import('@/views/goaf/checkTask/manage/index'),
         name: 'aqpt_check_manage',
         meta: { title: '任务', noCache: true, permit: 'aqpt_check_task' }
+      },
+      {
+        path: 'record',
+        component: () => import('@/views/goaf/checkTask/record/index'),
+        name: 'aqpt_check_record',
+        meta: { title: '检查记录', noCache: true, permit: 'aqpt_check_record' }
       }
     ]
   },

+ 92 - 19
src/views/goaf/checkTask/plan/components/CheckDef.vue

@@ -8,16 +8,13 @@
     :visible.sync="dialogVisible"
   >
     <div class="content-container">
-      <el-form ref="ruleForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
+      <el-form ref="ruleForm" :model="formData" :rules="rules" label-position="right" label-width="120px">
         <el-form-item label="检查名称" prop="checkTitle">
           <el-input v-model="formData.checkTitle" />
         </el-form-item>
-
-        <el-form-item label="检查类别" prop="checkCatId">
-          <check-cat-selector v-model="formData.checkCatId" />
-        </el-form-item>
         <el-form-item label="组织部门">
           <el-cascader
+            v-model="formData.groupId"
             :options="groupData"
             :props="{ checkStrictly: true ,emitPath:false}"
             style="min-width:260px"
@@ -36,10 +33,33 @@
             <el-option v-for="item in userList" :key="item.accountId" :value="item.accountId" :label="item.accountName" />
           </el-select>
         </el-form-item>
-        <el-form-item label="检查清单" prop="checklistId">
-          <checklist-selector v-model="formData.checklistId" />
+        <el-form-item label="检查表" prop="checklistId">
+          <el-select v-model="formData.checklistId" style="width: 100%" filterable placeholder="检查表">
+            <el-option
+              v-for="item in checklist"
+              :key="item.checklistId"
+              :label="item.checklistTitle"
+              :value="item.checklistId"
+              @change="changeCheckList(item.checklistTitle)"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="采空区" prop="goafId">
+          <el-select v-model="formData.goafId" style="width: 100%" filterable placeholder="采空区">
+            <el-option
+              v-for="item in goafList"
+              :key="item.goafId"
+              :label="formatGoafName(item)"
+              :value="item.goafId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="检查任务类型" prop="checkTypeId">
+          <el-select v-model="formData.checkTypeId" style="width:260px" filterable clearable>
+            <el-option :value="0" label="常规任务" />
+            <el-option :value="1" label="临时任务" />
+          </el-select>
         </el-form-item>
-
         <el-form-item label="开始时间" prop="startDate">
           <el-date-picker
             v-model="formData.defStartDate"
@@ -56,9 +76,30 @@
             style="width: 100%"
           />
         </el-form-item>
-        <el-form-item label="频率" prop="timeSpan">
+        <el-form-item label="调度任务" prop="timeSpan">
           <JobSelector v-model="formData.jobId" :job-class-id="jobClassId" />
         </el-form-item>
+        <el-form-item label="检查频率">
+          <el-row>
+            <el-col :span="8"><el-input v-model="formData.checkCount" type="number" /></el-col>
+            <el-col :span="4" style="color:#fff;padding-left: 5px;">次数/每</el-col>
+            <el-col :span="8">
+              <el-select v-model="formData.checkCycleUnit" filterable clearable>
+                <el-option :value="0" label="非周期" />
+                <el-option :value="1" label="日" />
+                <el-option :value="2" label="周" />
+                <el-option :value="3" label="月" />
+                <el-option :value="4" label="年" />
+              </el-select>
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <el-form-item label="任务定义状态" prop="status">
+          <el-select v-model="formData.status" style="width:260px" filterable clearable>
+            <el-option :value="0" label="已停止" />
+            <el-option :value="1" label="执行中" />
+          </el-select>
+        </el-form-item>
         <el-form-item label="说明" prop="checkDesc">
           <el-input v-model="formData.checkDesc" type="textarea" :rows="4" />
         </el-form-item>
@@ -73,21 +114,25 @@
 
 <script>
 import { ACTION_ADD, ACTION_UPDATE } from '@/utils/actionType'
-import { createCheckDef, updateCheckDef } from '@/api/aqpt/checkDefApi'
+import { createCheckDef, updateCheckDef } from '@/api/goaf/checkDefApi'
 import { mapGetters } from 'vuex'
-import { ChecklistSelector, JobSelector } from '@/components'
-import CheckCatSelector from '@/views/aqpt/components/CheckCatSelector/index.vue'
+import { JobSelector } from '@/components'
 import { toTree } from '@/utils/build-tree'
 import { getGroupByList } from '@/api/system/groupApi'
 import { getUserByPage } from '@/api/system/userApi'
+import { getChecklist } from '@/api/goaf/check'
+import { getGoafBaseInfo } from '@/api/goaf/info'
+import { NumConvertLM } from '@/utils'
 export default {
   name: 'CheckDef',
-  components: { ChecklistSelector, JobSelector, CheckCatSelector },
+  components: { JobSelector },
   data() {
     return {
       title: '',
       dialogVisible: false,
       jobClassId: 2, // 分发JOB ID
+      checklist: [],
+      goafList: [],
       formData: {
         'checkDefId': undefined,
         'ocId': undefined,
@@ -100,13 +145,14 @@ export default {
         'accountName': '',
         'positionName': '',
         'groupName': '',
-        'checklistId': 639,
+        'checklistId': ' ',
         'defStartDate': '',
         'defEndDate': '',
         'checkCount': 0,
         'checkCycleUnit': 0,
         'jobId': undefined,
-        'checkDesc': ''
+        'checkDesc': '',
+        'status': 0
       },
       viewData: {},
       rules: {
@@ -122,11 +168,20 @@ export default {
         checklistId: [
           { required: true, message: '请选择检查清单', trigger: 'blur' }
         ],
+        goafId: [
+          { required: true, message: '请选择采空区', trigger: 'blur' }
+        ],
+        checkTypeId: [
+          { required: true, message: '请选择检查任务类型', trigger: 'blur' }
+        ],
         checkCatId: [
           { required: true, message: '请选择检查类别', trigger: 'blur' }
         ],
         jobId: [
           { required: true, message: '请选择频率周期', trigger: 'blur' }
+        ],
+        status: [
+          { required: true, message: '请选择检查任务定义状态', trigger: 'blur' }
         ]
       },
       userSelObj: {},
@@ -157,8 +212,21 @@ export default {
         this.groupData = temp
       }
     })
+    getChecklist().then((res) => {
+      this.checklist = res.data
+    })
+    getGoafBaseInfo().then((res) => {
+      this.goafList = res.data
+    })
   },
   methods: {
+    formatGoafName(item, type) {
+      if (type === 1) {
+        return `${NumConvertLM(item.goafOrebelt)} / ${item.goafOrebody} / ${item.goafOreheight} / ${item.goafName}`
+      } else {
+        return item.goafName
+      }
+    },
     handleChange(groupId) {
       getUserByPage({
         page: 1,
@@ -182,13 +250,12 @@ export default {
       this.formData.positionName = user.positionName
     },
     // 新增窗口
-    showAddModel(riskPointId, riskPointTitle) {
+    showAddModel() {
       this.resetFormData()
       this.title = '新增任务计划'
       this.actionType = ACTION_ADD
       this.dialogVisible = true
       this.formData.groupId = this.userData.groupId
-      this.formData.riskPointId = riskPointId
     },
 
     // 编辑窗口
@@ -197,6 +264,8 @@ export default {
       this.title = '编辑任务计划'
       this.actionType = ACTION_UPDATE
       this.dialogVisible = true
+      this.formData = data
+      console.log(data)
       this.formData.accountId = parseFloat(data.accountId)
     },
 
@@ -214,13 +283,14 @@ export default {
         'accountName': '',
         'positionName': '',
         'groupName': '',
-        'checklistId': 639,
+        'checklistId': '',
         'defStartDate': '',
         'defEndDate': '',
         'checkCount': 0,
         'checkCycleUnit': 0,
         'jobId': undefined,
-        'checkDesc': ''
+        'checkDesc': '',
+        'status': 0
       }
     },
 
@@ -274,6 +344,9 @@ export default {
     },
     resetFormField(formName) {
       this.$refs[formName].resetFields()
+    },
+    changeCheckList(checklistTitle) {
+      this.formData.goafChecklistTitle = checklistTitle
     }
   }
 }

+ 4 - 3
src/views/goaf/checkTask/plan/components/CheckDefList.vue

@@ -67,6 +67,7 @@
                 inactive-color="#C0CCDA"
                 :active-value="1"
                 :inactive-value="0"
+                disabled
                 @change="(status)=>handlerChangeStatus(status, row)"
               />
             </div>
@@ -92,7 +93,7 @@
 
 <script>
 import CheckDef from './CheckDef'
-import { deleteCheckDefById, getCheckDefByPage, updateGoafcheckdef } from '@/api/goaf/task'
+import { deleteCheckDefById, getCheckDefByPage, updateCheckDef } from '@/api/goaf/checkDefApi'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 
 export default {
@@ -137,7 +138,7 @@ export default {
 
     // 编辑
     handleUpdate(data) {
-      this.$refs['EditCheckDef'].showEditModel(data)
+      this.$refs['EditCheckDef'].showEditModel(JSON.parse(JSON.stringify(data)))
     },
 
     // 删除
@@ -166,7 +167,7 @@ export default {
 
     // Change Status
     handlerChangeStatus(status, data) {
-      updateGoafcheckdef({ ...data, status }).then((resp) => {
+      updateCheckDef({ ...data, status }).then((resp) => {
         const { code, msg } = resp
         if (code === 0) {
           this.getData()

+ 0 - 270
src/views/goaf/checkTask/record/LeftCounter.vue

@@ -1,270 +0,0 @@
-<template>
-  <div class="content-container">
-    <div class="list-group">
-      <el-row class="title-bar">
-        <p class="page-title">巡检记录</p>
-      </el-row>
-      <el-row class="sub-title-bar">
-        <p class="page-title">我的</p>
-      </el-row>
-      <div class="list-item" :class="curSel === 'MyTotal' ? 'active' : ''" @click="selectItem('MyTotal')">
-        <el-col :span="18">
-          <p class="title">总数:</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myTotal }}</p>
-        </el-col>
-      </div>
-
-      <div class="list-item" :class="curSel === 'MyPassed' ? 'active' : ''" @click="selectItem('MyPassed')">
-        <el-col :span="18">
-          <p class="title">正常通过</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myPassed }}</p>
-        </el-col>
-      </div>
-
-      <div class="list-item" :class="curSel === 'MyFailed' ? 'active' : ''" @click="selectItem('MyFailed')">
-        <el-col :span="18">
-          <p class="title">未通过</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myFailed }}</p>
-        </el-col>
-      </div>
-
-      <div class="list-item" :class="curSel === 'MyToday' ? 'active' : ''" @click="selectItem('MyToday')">
-        <el-col :span="18">
-          <p class="title">今天</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myToday }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'MyThisWeek' ? 'active' : ''" @click="selectItem('MyThisWeek')">
-        <el-col :span="18">
-          <p class="title">本周</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myThisWeek }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'MyThisMonth' ? 'active' : ''" @click="selectItem('MyThisMonth')">
-        <el-col :span="18">
-          <p class="title">本月</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myThisMonth }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'MyThisYear' ? 'active' : ''" @click="selectItem('MyThisYear')">
-        <el-col :span="18">
-          <p class="title">本年度</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.myThisYear }}</p>
-        </el-col>
-      </div>
-
-      <el-row class="sub-title-bar">
-        <p class="page-title">所有的</p>
-      </el-row>
-      <div class="list-item" :class="curSel === 'GroupTotal' ? 'active' : ''" @click="selectItem('GroupTotal')">
-        <el-col :span="18">
-          <p class="title">总记录数目:</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupTotal }}</p>
-        </el-col>
-      </div>
-
-      <div class="list-item" :class="curSel === 'GroupPassed' ? 'active' : ''" @click="selectItem('GroupPassed')">
-        <el-col :span="18">
-          <p class="title">正常通过</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupPassed }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'GroupFailed' ? 'active' : ''" @click="selectItem('GroupFailed')">
-        <el-col :span="18">
-          <p class="title">未通过</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupFailed }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'GroupTody' ? 'active' : ''" @click="selectItem('GroupTody')">
-        <el-col :span="18">
-          <p class="title">今天</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupToday }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'GroupThisWeek' ? 'active' : ''" @click="selectItem('GroupThisWeek')">
-        <el-col :span="18">
-          <p class="title">本周</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupThisWeek }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'GroupThisMonth' ? 'active' : ''" @click="selectItem('GroupThisMonth')">
-        <el-col :span="18">
-          <p class="title">本月</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupThisMonth }}</p>
-        </el-col>
-      </div>
-      <div class="list-item" :class="curSel === 'GroupThisYear' ? 'active' : ''" @click="selectItem('GroupThisYear')">
-        <el-col :span="18">
-          <p class="title">本年度</p>
-        </el-col>
-        <el-col :span="6">
-          <p class="count">{{ checkRecordCounter.groupThisYear }}</p>
-        </el-col>
-      </div>
-    </div>
-  </div>
-</template>
-<script>
-
-import { getCheckRecordCounter } from '@/api/aqpt/checkRecordStatisApi'
-export default {
-  components: {
-  },
-  data() {
-    return {
-      checkRecordCounter: {
-        myTotal: 0,
-        myPassed: 0,
-        myFailed: 0,
-        myToday: 0,
-        myThisWeek: 0,
-        myThisMonth: 0,
-        myThisYear: 0,
-        groupTotal: 0,
-        groupPassed: 0,
-        groupFailed: 0,
-        groupToday: 0,
-        groupThisWeek: 0,
-        groupThisMonth: 0,
-        groupThisYear: 0
-      },
-      curSel: 'MyTotal'
-    }
-  },
-  mounted() {
-    this.getData()
-  },
-  methods: {
-    // 初始化数据
-    getData() {
-      getCheckRecordCounter().then((resp) => {
-        const { code, data, msg } = resp
-        if (code === 0) {
-          this.checkRecordCounter = data
-        } else {
-          this.$message.error(msg)
-        }
-      }).catch((error) => {
-        console.log(error)
-      })
-    },
-
-    // 发送命令
-    selectItem(action) {
-      this.curSel = action
-      this.$emit('selectItem', action)
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-.content-container {
-  margin: 0 0 15px 15px;
-  height: calc(100vh - 100px);
-
-  .title-bar {
-    height: 40px;
-    line-height: 40px;
-    text-indent: 15px;
-    background: #113849;
-    margin-bottom: 15px;
-
-    .page-title {
-      font-size: 18px;
-      font-weight: bold;
-      color: #FFF;
-      margin: 0;
-    }
-  }
-
-  .btn-group {
-    width: 100%;
-    margin-bottom: 15px;
-
-    .send-menu {
-      width: 100%;
-      background: #3D5F76;
-      color: #FFF;
-      border-color: #3D5F76;
-
-      &:hover {
-        background: #283c4c;
-        color: #FFF;
-        border-color: #283c4c;
-      }
-    }
-  }
-
-  .list-group {
-    height: calc(100vh - 85px);
-    background: #193142;
-
-    .sub-title-bar {
-      font-size: 16px;
-      color: #FFF;
-      margin: 0;
-    }
-
-    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>

+ 0 - 388
src/views/goaf/checkTask/record/RecordList.vue

@@ -1,388 +0,0 @@
-<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="right">
-        <el-input v-model="conditions.keywords" class="search-input m-right-15" placeholder="请输入内容">
-          <el-button slot="append" icon="el-icon-search" @click="getData()" />
-        </el-input>
-        <el-button type="primary" @click="handleExport">导出Excel</el-button>
-      </el-col>
-    </el-row>
-    <el-row class="m-top-15">
-      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 240px)">
-        <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
-
-        <el-table-column prop="riskPointTitle" label="风险点" header-align="center" align="center" width="120">
-          <template v-slot="{row}">
-            <span>{{ row.riskPointTitle }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="accountName" label="检查人员" header-align="center" align="center" width="100">
-          <template v-slot="{row}">
-            <el-popover trigger="hover" placement="top">
-              <p>部门: {{ row.groupName }}</p>
-              <p>岗位: {{ row.positionName }}</p>
-              <div slot="reference" class="name-wrapper">
-                <i class="el-icon-user" /> {{ row.accountName }}
-              </div>
-            </el-popover>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="checkTime" label="检查时间" header-align="center" align="center" width="160">
-          <template v-slot="{row}">
-            <span><i class="el-icon-time" /> {{ row.checkTime }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="taskTitle" label="任务名称" header-align="center" align="center" width="150">
-          <template v-slot="{row}">
-            <span>{{ row.taskTitle }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="taskCatTitle" label="任务类型" header-align="center" align="center" width="100">
-          <template v-slot="{row}">
-            <span>{{ row.taskCatTitle }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="hazardTitle" label="风险单元" header-align="center" align="center" width="120">
-          <template v-slot="{row}">
-            <span>{{ row.hazardTitle }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="riskTitle" label="场所/环节/部位" header-align="center" align="center" width="120">
-          <template v-slot="{row}">
-            <span>{{ row.riskTitle }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="measureContent" label="检查内容" header-align="left" align="left">
-          <template v-slot="{row}">
-            <span>{{ row.measureContent }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="checkResult" label="检查结果" header-align="center" align="center" width="90">
-          <template v-slot="{row}">
-            <span v-if="row.checkResult===0" style="color: #20f704">未检查</span>
-            <span v-if="row.checkResult===1" style="color: #20f704">通过</span>
-            <span v-if="row.checkResult===-1" style="color: #fc5c04">不通过</span>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <div class="pagination-wrap">
-        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
-      </div>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { getCheckRecordByPage, getCheckRecordByList } from '@/api/aqpt/checkRecordApi'
-import { formatDate, getWeekStartDate, getWeekEndDate, getMonthStartDate, getMonthEndDate, getYearStartDate, getYearEndDate, checkResult } from '@/utils'
-import Pagination from '@/components/Pagination'
-import { mapGetters } from 'vuex'
-
-export default {
-  name: 'RecordList',
-  components: { Pagination },
-  data() {
-    return {
-      dataList: [],
-      total: 0,
-      listLoading: false,
-      downloadLoading: false,
-      title: '',
-      action: 'MyTotal',
-      conditions: {
-        page: 1,
-        limit: 10,
-        keywords: '',
-        day: undefined,
-        accountId: undefined,
-        startDate: undefined,
-        endDate: undefined,
-        groupId: undefined,
-        checkResult: 0
-      },
-      exportList: [],
-      filename: '',
-      autoWidth: true,
-      bookType: 'xlsx'
-    }
-  },
-  computed: {
-    ...mapGetters([
-      'userData'
-    ])
-  },
-  mounted() {
-    this.accountId = this.userData.userId
-    this.loadData('MyTotal')
-  },
-  methods: {
-
-    // 重置查询条件
-    resetConditionsData() {
-      this.conditions.accountId = undefined
-      this.conditions.groupId = undefined
-      this.conditions.day = undefined
-      this.conditions.startDate = undefined
-      this.conditions.endDate = undefined
-      this.conditions.checkResult = undefined
-    },
-
-    // 加载数据
-    loadData(action) {
-      this.action = action
-      const groupId = this.userData.groupId
-      const userId = this.userData.userId
-
-      switch (action) {
-        case 'MyTotal':
-          this.title = '我检查的所有记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          break
-        case 'MyPassed':
-          this.title = '我检查通过的记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          this.conditions.checkResult = 1
-          break
-        case 'MyFailed':
-          this.title = '我检查未通过的记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          this.conditions.checkResult = -1
-          break
-        case 'MyToday':
-          this.title = '我今天的记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          this.conditions.day = formatDate(new Date())
-          break
-        case 'MyThisWeek':
-          this.title = '我本周的记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          this.conditions.startDate = getWeekStartDate()
-          this.conditions.endDate = getWeekEndDate()
-          break
-        case 'MyThisMonth':
-          this.title = '我本月的记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          this.conditions.startDate = getMonthStartDate()
-          this.conditions.endDate = getMonthEndDate()
-          break
-        case 'MyThisYear':
-          this.title = '我本年度的记录'
-          this.resetConditionsData()
-          this.conditions.accountId = userId
-          this.conditions.startDate = getYearStartDate()
-          this.conditions.endDate = getYearEndDate()
-          break
-
-        case 'GroupTotal':
-          this.title = '部门记录'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          break
-        case 'GroupPassed':
-          this.title = '部门检查通过的'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          this.conditions.checkResult = 1
-          break
-        case 'GroupFailed':
-          this.title = '部门检查未通过的'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          this.conditions.checkResult = -1
-          break
-        case 'GroupToday':
-          this.title = '部门今天的'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          this.conditions.day = formatDate(new Date())
-          break
-        case 'GroupThisWeek':
-          this.title = '部门本周的'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          this.conditions.startDate = getWeekStartDate()
-          this.conditions.endDate = getWeekEndDate()
-          break
-        case 'GroupThisMonth':
-          this.title = '部门本月的'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          this.conditions.startDate = getMonthStartDate()
-          this.conditions.endDate = getMonthEndDate()
-          break
-        case 'GroupThisYear':
-          this.title = '部门本年度的'
-          this.resetConditionsData()
-          this.conditions.groupId = groupId
-          this.conditions.startDate = getYearStartDate()
-          this.conditions.endDate = getYearEndDate()
-          break
-      }
-      this.getData()
-    },
-    // 加载数据
-    getData() {
-      this.listLoading = true
-      getCheckRecordByPage(this.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)
-      })
-    },
-
-    handleExport() {
-      this.downloadLoading = true
-      getCheckRecordByList(this.conditions).then((resp) => {
-        const { code, data, msg } = resp
-        if (code === 0) {
-          this.exportList = data
-          this.exportExcel()
-        } else {
-          this.$message.error(msg)
-        }
-      }).catch((error) => {
-        console.log(error)
-      })
-    },
-
-    // 导出EXCEL
-    exportExcel() {
-      import('@/vendor/Export2Excel').then(excel => {
-        const tHeader = ['任务名称', '任务类别', '检查时间', '风险点', '风险单元', '危险因素', '检查内容', '检查结果']
-        const filterVal = ['taskTitle', 'taskCatTitle', 'checkTime', 'riskPointTitle', 'hazardTitle', 'riskTitle', 'measureContent', 'checkResult']
-        const list = this.exportList
-        const data = this.formatJson(filterVal, list)
-        excel.export_json_to_excel({
-          header: tHeader,
-          data,
-          filename: this.filename,
-          autoWidth: this.autoWidth,
-          bookType: this.bookType
-        })
-        this.downloadLoading = false
-      })
-    },
-
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v => filterVal.map(j => {
-        if (j === 'checkResult') {
-          return checkResult(v[j])
-        } else {
-          return v[j]
-        }
-      }))
-    }
-  }
-}
-</script>
-<style lang="scss">
-</style>
-<style lang="scss" scoped>
-.content-container {
-  background: #193142FF;
-  margin-left: 15px;
-  padding: 15px;
-  height: calc(100vh - 100px);
-
-  .page-title {
-    font-size: 16px;
-    font-weight: normal;
-    color: #FFFFFF;
-  }
-
-  .tool-bar {
-    .left {
-      float: left;
-    }
-
-    .right {
-      float: right;
-      text-align: right;
-    }
-
-    .title {
-      line-height: 36px;
-      font-size: 26px;
-    }
-
-    .search-input {
-      width: 300px;
-    }
-  }
-
-  .el-dropdown {
-    margin: 0 10px;
-  }
-}
-
-.custom-switch-tag {
-  width: 76px;
-  height: 26px;
-  background: #5EB777;
-  border-radius: 13px;
-  position: relative;
-  font-size: 12px;
-  line-height: 26px;
-  text-align: left;
-  text-indent: 10px;
-  cursor: default;
-
-  &::after {
-    display: block;
-    content: "";
-    width: 14px;
-    height: 14px;
-    background: #FFFFFF;
-    border-radius: 50%;
-    right: 5px;
-    top: 6px;
-    position: absolute;
-  }
-
-  &.wait {
-    background: none;
-    border: 1px solid #3B5D73;
-    color: #3B5D73;
-    text-align: right;
-    box-sizing: border-box;
-    text-indent: 0;
-    padding-right: 10px;
-    line-height: 24px;
-
-    &::after {
-      top: 5px;
-      background: #3B5D73;
-      left: 5px;
-      right: inherit;
-    }
-  }
-}
-</style>

+ 253 - 18
src/views/goaf/checkTask/record/index.vue

@@ -1,39 +1,274 @@
 <template>
-  <div class="page-container">
-    <el-row class="counter-wrap">
-      <el-col :span="4" class="left-counter-wrap">
-        <record-counter ref="LeftCounter" @selectItem="selectItem" />
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="12" class="left">
+        <div class="content-title">
+          检查记录
+        </div>
       </el-col>
-      <el-col :span="20" class="right-counter-wrap">
-        <record-list ref="RecordList" />
+      <el-col :span="12" class="right">
+        <el-input v-model="conditions.keywords" class="search-input m-right-15" placeholder="请输入内容">
+          <el-button slot="append" icon="el-icon-search" @click="getData()" />
+        </el-input>
+        <el-button type="primary" @click="handleExport">导出Excel</el-button>
       </el-col>
     </el-row>
+    <el-row class="m-top-15">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 240px)">
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
+
+        <el-table-column prop="riskPointTitle" label="风险点" header-align="center" align="center" width="120">
+          <template v-slot="{row}">
+            <span>{{ row.riskPointTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="accountName" label="检查人员" header-align="center" align="center" width="100">
+          <template v-slot="{row}">
+            <el-popover trigger="hover" placement="top">
+              <p>部门: {{ row.groupName }}</p>
+              <p>岗位: {{ row.positionName }}</p>
+              <div slot="reference" class="name-wrapper">
+                <i class="el-icon-user" /> {{ row.accountName }}
+              </div>
+            </el-popover>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="checkTime" label="检查时间" header-align="center" align="center" width="160">
+          <template v-slot="{row}">
+            <span><i class="el-icon-time" /> {{ row.checkTime }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="taskTitle" label="任务名称" header-align="center" align="center" width="150">
+          <template v-slot="{row}">
+            <span>{{ row.taskTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="taskCatTitle" label="任务类型" header-align="center" align="center" width="100">
+          <template v-slot="{row}">
+            <span>{{ row.taskCatTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="hazardTitle" label="风险单元" header-align="center" align="center" width="120">
+          <template v-slot="{row}">
+            <span>{{ row.hazardTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="riskTitle" label="场所/环节/部位" header-align="center" align="center" width="120">
+          <template v-slot="{row}">
+            <span>{{ row.riskTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="measureContent" label="检查内容" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.measureContent }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="checkResult" label="检查结果" header-align="center" align="center" width="90">
+          <template v-slot="{row}">
+            <span v-if="row.checkResult===0" style="color: #20f704">未检查</span>
+            <span v-if="row.checkResult===1" style="color: #20f704">通过</span>
+            <span v-if="row.checkResult===-1" style="color: #fc5c04">不通过</span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-wrap">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
   </div>
 </template>
 
 <script>
-import RecordCounter from './LeftCounter.vue'
-import RecordList from './RecordList.vue'
+import { getCheckRecordByPage, getCheckRecordByList } from '@/api/goaf/checkRecordApi'
+import { checkResult } from '@/utils'
+import Pagination from '@/components/Pagination'
+import { mapGetters } from 'vuex'
 
 export default {
-  name: 'CheckRecord',
-  components: {
-    RecordCounter,
-    RecordList
-  },
+  name: 'RecordList',
+  components: { Pagination },
   data() {
-    return {}
+    return {
+      dataList: [],
+      total: 0,
+      listLoading: false,
+      downloadLoading: false,
+      action: 'MyTotal',
+      conditions: {
+        page: 1,
+        limit: 10
+      },
+      exportList: [],
+      filename: '',
+      autoWidth: true,
+      bookType: 'xlsx'
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
   },
   mounted() {
+    this.accountId = this.userData.userId
+    this.loadData('MyTotal')
   },
   methods: {
-    // 用户选择
-    selectItem(action) {
-      this.$refs['RecordList'].loadData(action)
+
+    // 重置查询条件
+    resetConditionsData() {
+      this.conditions = {
+        page: 1,
+        limit: 10
+      }
+    },
+
+    // 加载数据
+    loadData(action) {
+      // this.action = action
+      // const groupId = this.userData.groupId
+      // const userId = this.userData.userId
+      this.getData()
+    },
+    // 加载数据
+    getData() {
+      this.listLoading = true
+      getCheckRecordByPage(this.conditions).then((resp) => {
+        const { data, total } = resp
+        this.listLoading = false
+        this.total = total
+        this.dataList = data
+      })
+    },
+
+    handleExport() {
+      this.downloadLoading = true
+      getCheckRecordByList(this.conditions).then((resp) => {
+        const { data } = resp
+        this.exportList = data
+        this.exportExcel()
+      })
+    },
+
+    // 导出EXCEL
+    exportExcel() {
+      import('@/vendor/Export2Excel').then(excel => {
+        const tHeader = ['任务名称', '任务类别', '检查时间', '风险点', '风险单元', '危险因素', '检查内容', '检查结果']
+        const filterVal = ['taskTitle', 'taskCatTitle', 'checkTime', 'riskPointTitle', 'hazardTitle', 'riskTitle', 'measureContent', 'checkResult']
+        const list = this.exportList
+        const data = this.formatJson(filterVal, list)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data,
+          filename: this.filename,
+          autoWidth: this.autoWidth,
+          bookType: this.bookType
+        })
+        this.downloadLoading = false
+      })
+    },
+
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v => filterVal.map(j => {
+        if (j === 'checkResult') {
+          return checkResult(v[j])
+        } else {
+          return v[j]
+        }
+      }))
     }
   }
 }
 </script>
-
+<style lang="scss">
+</style>
 <style lang="scss" scoped>
+.content-container {
+  background: #193142FF;
+  margin-left: 15px;
+  padding: 15px;
+  height: calc(100vh - 100px);
+
+  .page-title {
+    font-size: 16px;
+    font-weight: normal;
+    color: #FFFFFF;
+  }
+
+  .tool-bar {
+    .left {
+      float: left;
+    }
+
+    .right {
+      float: right;
+      text-align: right;
+    }
+
+    .title {
+      line-height: 36px;
+      font-size: 26px;
+    }
+
+    .search-input {
+      width: 300px;
+    }
+  }
+
+  .el-dropdown {
+    margin: 0 10px;
+  }
+}
+
+.custom-switch-tag {
+  width: 76px;
+  height: 26px;
+  background: #5EB777;
+  border-radius: 13px;
+  position: relative;
+  font-size: 12px;
+  line-height: 26px;
+  text-align: left;
+  text-indent: 10px;
+  cursor: default;
+
+  &::after {
+    display: block;
+    content: "";
+    width: 14px;
+    height: 14px;
+    background: #FFFFFF;
+    border-radius: 50%;
+    right: 5px;
+    top: 6px;
+    position: absolute;
+  }
+
+  &.wait {
+    background: none;
+    border: 1px solid #3B5D73;
+    color: #3B5D73;
+    text-align: right;
+    box-sizing: border-box;
+    text-indent: 0;
+    padding-right: 10px;
+    line-height: 24px;
+
+    &::after {
+      top: 5px;
+      background: #3B5D73;
+      left: 5px;
+      right: inherit;
+    }
+  }
+}
 </style>

+ 0 - 14
src/views/goaf/checklist/index.vue

@@ -29,20 +29,6 @@
           </template>
         </el-table-column>
 
-        <!-- <el-table-column prop="issuedAt" label="变更人" header-align="center" align="center" width="200">
-          <template v-slot="{row}">
-            <i class="el-icon-user" />
-            <span> {{ row.issuedAccountName }}</span>
-          </template>
-        </el-table-column> -->
-
-        <!-- <el-table-column prop="issuedAt" label="变更时间" header-align="center" align="center" width="200">
-          <template v-slot="{row}">
-            <i class="el-icon-time" />
-            <span> {{ row.issuedAt | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
-          </template>
-        </el-table-column> -->
-
         <el-table-column label="操作" header-align="center" align="center" width="180">
           <template v-slot="{row}">
             <el-button size="mini" icon="el-icon-view" type="primary" @click="handleUpdate(row)">编辑</el-button>

+ 29 - 4
src/views/goaf/info/components/Goaf.vue

@@ -86,6 +86,17 @@
             <el-option :value="1" label="否" />
           </el-select>
         </el-form-item>
+        <el-form-item label="检查表" prop="checklistId">
+          <el-select v-model="formData.checklistId" style="width: 100%" filterable placeholder="检查表">
+            <el-option
+              v-for="item in checklist"
+              :key="item.checklistId"
+              :label="item.checklistTitle"
+              :value="item.checklistId"
+              @change="changeCheckList(item.checklistTitle)"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="备注" prop="goafInfoRemak" required>
           <el-input v-model="formData.goafInfoRemak" type="textarea" rows="5" />
         </el-form-item>
@@ -100,6 +111,7 @@
 
 <script>
 import { createGoaf, updateGoaf } from '@/api/goaf/info'
+import { getChecklist } from '@/api/goaf/check'
 
 export default {
   data() {
@@ -112,6 +124,7 @@ export default {
           onlyShowBarOnScroll: false
         }
       },
+      checklist: [],
       dialogVisible: false,
       formData: {
         'goafId': '',
@@ -136,7 +149,9 @@ export default {
         'goafRemainVolume': 0,
         'goafFillMethod': 0,
         'goafIsFill': 0,
-        'goafInfoRemak': ''
+        'goafInfoRemak': '',
+        'checklistId': '',
+        'goafChecklistTitle': ''
       },
       rules: {
         goafName: [{ required: true, message: '采空区名称不能为空', trigger: 'blur' }],
@@ -145,7 +160,8 @@ export default {
         goafRockStability: [{ required: true, message: '围岩稳定性不能为空', trigger: 'blur' }],
         goafFormationTime: [{ required: true, message: '形成时间不能为空', trigger: 'change' }],
         goafIsFill: [{ required: true, message: '形成时间不能为空', trigger: 'change' }],
-        goafInfoRemak: [{ required: true, message: '备注不能为空', trigger: 'blur' }]
+        goafInfoRemak: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
+        checklistId: [{ required: true, message: '请选择检查表', trigger: 'blur' }]
       },
       ctrlLevelList: [],
       positionList: [],
@@ -153,8 +169,12 @@ export default {
       actionType: ''
     }
   },
+  created() {
+    getChecklist().then((res) => {
+      this.checklist = res.data
+    })
+  },
   methods: {
-
     // Show Add Dialog
     showAddModel(hazardId, hazardTitle) {
       this.resetFormData()
@@ -194,7 +214,9 @@ export default {
         'goafRemainVolume': 0,
         'goafFillMethod': 0,
         'goafIsFill': 0,
-        'goafInfoRemak': ''
+        'goafInfoRemak': '',
+        'checklistId': '',
+        'goafChecklistTitle': ''
       }
     },
 
@@ -240,6 +262,9 @@ export default {
     },
     resetFormField(formName) {
       this.$refs[formName].resetFields()
+    },
+    changeCheckList(checklistTitle) {
+      this.formData.goafChecklistTitle = checklistTitle
     }
   }
 }

+ 41 - 2
src/views/goaf/qrcode/components/GoafInfo.vue

@@ -35,11 +35,20 @@
             <span>{{ row.goafInfoRemak||'--' }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="操作" header-align="center" align="center" width="180">
+          <template v-slot="{row}">
+            <el-button size="mini" type="text" style="color:#1B81FF" @click="showDetail(row)">详情</el-button>
+            <el-button size="mini" type="text" style="color:#1B81FF" @click="handleUpdate(row)">修改</el-button>
+            <el-button size="mini" type="text" style="color:#E44E2D" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
       </el-table>
       <div class="pagination-container" style="float:right;margin-right:40px;">
         <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
       </div>
     </el-row>
+    <goaf ref="goaf" @formSuccess="getData" />
+    <detail ref="detail" />
     <QrCode ref="qrcode" />
     <div id="qrcode" ref="qrcodeModal" style="position:fixed;top:-9999px;" />
   </div>
@@ -50,13 +59,15 @@ import html2canvas from 'html2canvas'
 import JSZip from 'jszip'
 import saveAs from 'file-saver'
 import QRCode from 'qrcodejs2'
-import { getGoafBaseInfoByPage } from '@/api/goaf/info'
+import { getGoafBaseInfoByPage, delGoaf } from '@/api/goaf/info'
 import { Pagination } from '@/components'
 import { NumConvertLM } from '@/utils'
 import { QrCode } from '@/components'
+import Goaf from '@/views/goaf/info/components/Goaf'
+import Detail from '@/views/goaf/info/components/detail'
 var zip = new JSZip()
 export default {
-  components: { Pagination, QrCode },
+  components: { Pagination, QrCode, Goaf, Detail },
   data() {
     return {
       dataList: [],
@@ -163,6 +174,34 @@ export default {
           reject(e)
         })
       })
+    },
+    showDetail(data) {
+      this.$refs['detail'].showDetailModel(JSON.parse(JSON.stringify(data)))
+    },
+    // "Edit Risk" Model
+    handleUpdate(data) {
+      this.$refs['goaf'].showEditModel(JSON.parse(JSON.stringify(data)))
+    },
+    // Delete Action
+    handleDelete(data) {
+      const { goafId, goafName } = data
+      this.$confirm(`此操作将删除该数据${goafName}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delGoaf(goafId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.getData()
+            this.$message.success(msg)
+          } else {
+            this.$message.error(msg)
+          }
+        })
+      }).catch(() => {
+        this.$message.info('已取消删除')
+      })
     }
   }
 }

+ 2 - 2
src/views/goaf/sensor/index.vue

@@ -100,13 +100,13 @@ export default {
 
     // Delete Action
     handleDelete(data) {
-      const { hazardId, riskId, riskSource } = data
+      const { typeId, riskSource } = data
       this.$confirm(`此操作将删除该数据${riskSource}, 是否继续?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        delSensor(hazardId, riskId).then((resp) => {
+        delSensor(typeId).then((resp) => {
           const { code, msg } = resp
           if (code === 0) {
             this.getData()