zhaobao 2 năm trước cách đây
mục cha
commit
a7e13227b0

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

@@ -41,3 +41,12 @@ export function deleteCheckTaskById(taskId) {
     method: 'DELETE'
   })
 }
+
+// 提交任务
+export function handleCheckTask(data) {
+  return request({
+    url: '/goaf/goaftask/completed',
+    method: 'POST',
+    data
+  })
+}

+ 11 - 10
src/views/goaf/checkTask/manage/CheckTaskList.vue

@@ -50,12 +50,13 @@
           </template>
         </el-table-column>
 
-        <!-- <el-table-column label="操作" header-align="center" align="center" width="280">
+        <el-table-column label="操作" header-align="center" align="center" width="280">
           <template v-slot="{row}">
-            <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>
+            <el-button v-if="row.status!==1" size="mini" type="text" style="color:#1B81FF" @click="handleTask(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-column>
       </el-table>
 
       <div class="pagination-wrap">
@@ -64,7 +65,7 @@
     </el-row>
     <task-event ref="TaskEvent" title="任务动态" />
     <task-details ref="TaskDetails" title="任务详情" />
-    <handling-view ref="HandlingView" title="处理任务" @formSuccess="getData" />
+    <handling-view ref="HandlingView" title="处理任务" @success="getData" />
     <check-task ref="checkTask" @formSuccess="getData" />
   </div>
 </template>
@@ -72,7 +73,9 @@
 <script>
 import CheckTask from './CheckTask.vue'
 import TaskEvent from './TaskEvent.vue'
-import HandlingView from './check/Handle.vue'
+// import HandlingView from './check/Handle.vue'
+import HandlingView from './ChecklistItem.vue'
+
 import TaskDetails from './Details.vue'
 import { getCheckTaskByPage, deleteCheckTaskById } from '@/api/goaf/task'
 import { mapGetters } from 'vuex'
@@ -174,14 +177,12 @@ export default {
     },
     // 任务动态
     handleTaskEvent(data) {
-      const taskId = data.taskId
-      this.$refs['TaskEvent'].showTaskEvent(taskId)
+      this.$refs['TaskEvent'].showTaskEvent(data)
     },
 
     // 处理
     handleTask(data) {
-      const { taskId } = data
-      this.$refs['HandlingView'].showView(taskId)
+      this.$refs['HandlingView'].showView(data)
     },
 
     // 添加

+ 165 - 0
src/views/goaf/checkTask/manage/ChecklistItem.vue

@@ -0,0 +1,165 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="60%"
+    :visible.sync="dialogVisible"
+  >
+    <div class="content-container">
+      <el-card>
+        <div slot="header" class="clearfix">
+          <span>巡检任务</span>
+        </div>
+        <vuescroll :ops="ops">
+          <el-table ref="multipleTable" border :data="dataList" height="60vh" @selection-change="selectionChange">
+            <el-table-column
+              type="selection"
+              width="55"
+            />
+            <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
+            <el-table-column prop="checklistItemContent" label="检查项">
+              <template v-slot="{row}">
+                <span><i class="el-icon-tickets" /> {{ row.checklistItemContent }}</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>
+                <el-button v-if="row.isFixed !== 1" size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(row)">删除</el-button>
+              </template>
+            </el-table-column> -->
+          </el-table>
+          <div class="btn-group">
+            <el-button type="primary" @click="handleSubmit">提交</el-button>
+            <el-button class="cancel-btn" @click="dialogVisible = false">取消</el-button>
+          </div>
+        </vuescroll>
+      </el-card>
+      <submit-activity ref="submit" title="登记隐患" />
+    </div>
+  </el-drawer>
+</template>
+<script>
+import SubmitActivity from '@/views/goaf/danger/activity/Submit'
+import { getChecklistItemById } from '@/api/goaf/check'
+import { handleCheckTask } from '@/api/goaf/task'
+import { mapGetters } from 'vuex'
+import Vuescroll from 'vuescroll'
+export default {
+  name: 'ChecklistEdit',
+  components: {
+    Vuescroll,
+    SubmitActivity
+  },
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      viewData: {
+        'checklistId': undefined,
+        'ocId': '',
+        'checklistTitle': '',
+        'checklistDesc': '',
+        'checklistItemId': undefined,
+        'checklistItemContent': ''
+      },
+      dataList: [],
+      selection: []
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  methods: {
+    showView(data) {
+      this.dialogVisible = true
+      this.viewData = JSON.parse(JSON.stringify(data))
+      getChecklistItemById(data.checklistId).then((res) => {
+        this.dataList = res.data
+        this.$nextTick(() => {
+          this.dataList.forEach(item => {
+            this.$refs.multipleTable.toggleRowSelection(item)
+          })
+        })
+      })
+    },
+    selectionChange(selection) {
+      this.selection = selection
+    },
+    handleSubmit() {
+      const allselect = this.dataList.length === this.selection.length
+      let checkItemNopass = ''
+      let checkItemPass = ''
+      const selectionItemIds = []
+      this.selection.forEach((item) => {
+        checkItemPass += item.checklistItemContent + ','
+        selectionItemIds.push(item.checklistItemId)
+      })
+      this.dataList.forEach(item => {
+        if (selectionItemIds.indexOf(item.checklistItemId) < 0) {
+          checkItemNopass += item.checklistItemContent + '不通过,'
+        }
+      })
+      checkItemPass = checkItemPass.substring(0, checkItemPass.length - 1)
+      checkItemNopass = checkItemNopass.substring(0, checkItemNopass.length - 1)
+      handleCheckTask({
+        ...this.viewData,
+        'handleAccountId': this.userData.userId,
+        'handleAccountName': this.userData.userName,
+        'handlePositionId': this.userData.positionId,
+        'handlePositionName': this.userData.positionName,
+        'handleGroupId': this.userData.groupId,
+        'handleGroupName': this.userData.groupName,
+        'status': 1,
+        'checkResult': allselect ? 0 : 1,
+        checkItemPass,
+        checkItemNopass
+      }).then(() => {
+        this.dialogVisible = false
+        this.$emit('success')
+        if (!allselect) {
+          this.$nextTick(() => {
+            this.$refs['submit'].start({
+              ...this.viewData,
+              checkItemNopass
+            })
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped>  .btn-group {
+    margin-top: 20px;
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+      margin-left: 20px;
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  </style>
+

+ 11 - 41
src/views/goaf/checkTask/record/index.vue

@@ -17,65 +17,35 @@
       <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">
+        <el-table-column prop="riskPointTitle" label="任务名称" header-align="center" align="center" min-width="120">
           <template v-slot="{row}">
-            <span>{{ row.riskPointTitle }}</span>
+            <span>{{ row.taskTitle }}</span>
           </template>
         </el-table-column>
 
-        <el-table-column prop="accountName" label="检查人员" header-align="center" align="center" width="100">
+        <el-table-column prop="accountName" label="检查人员" header-align="center" align="center" min-width="100">
           <template v-slot="{row}">
             <el-popover trigger="hover" placement="top">
-              <p>部门: {{ row.groupName }}</p>
-              <p>岗位: {{ row.positionName }}</p>
+              <p>部门: {{ row.handleGroupName }}</p>
+              <p>岗位: {{ row.handlePositionName }}</p>
               <div slot="reference" class="name-wrapper">
-                <i class="el-icon-user" /> {{ row.accountName }}
+                <i class="el-icon-user" /> {{ row.handleAccountName }}
               </div>
             </el-popover>
           </template>
         </el-table-column>
 
-        <el-table-column prop="checkTime" label="检查时间" header-align="center" align="center" width="160">
+        <el-table-column prop="checkTime" label="检查时间" header-align="center" align="center" min-width="200">
           <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">
+        <el-table-column prop="status" label="检查结果" header-align="center" align="center" min-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>
+            <span v-if="row.status===-1" style="color: #20f704">未检查</span>
+            <span v-if="row.status===0" style="color: #20f704">通过</span>
+            <span v-if="row.status===1" style="color: #fc5c04">不通过</span>
           </template>
         </el-table-column>
       </el-table>

+ 9 - 3
src/views/goaf/checklist/components/checkListBind.vue

@@ -3,7 +3,6 @@
     title="提示"
     :visible.sync="dialogVisible"
     width="30%"
-    :before-close="handleClose"
   >
     <el-form ref="ruleForm" :model="formData" :rules="rules" label-position="top" class="goaf-form">
       <el-form-item label="检查表" prop="goafChecklistId">
@@ -60,7 +59,8 @@ export default {
         'goafIsFill': 0,
         'goafInfoRemak': '',
         'goafChecklistId': '',
-        'goafChecklistTitle': ''
+        'goafChecklistTitle': '',
+        'goafChecklistIsbind': 1
       }
     }
   },
@@ -75,15 +75,21 @@ export default {
     },
     showEditModel(data) {
       this.formData = data
+      this.dialogVisible = true
+      this.formData.goafChecklistIsbind = 1
+      this.formData.goafChecklistTitle = ''
+      this.formData.goafChecklistId = ''
     },
     submitForm() {
       this.$refs['ruleForm'].validate((valid) => {
         if (valid) {
+          const goafChecklist = this.checklist.filter(item => this.formData.goafChecklistId === item.checklistId)[0]
+          this.formData.goafChecklistTitle = goafChecklist.checklistTitle
           updateGoaf(this.formData).then((resp) => {
             const { msg } = resp
             this.dialogVisible = false
             this.$message.success(msg)
-            this.formSuccess()
+            this.$emit('formSuccess')
           })
         } else {
           this.$message.error('error submit!!')

+ 7 - 6
src/views/goaf/checklist/config.vue

@@ -25,10 +25,10 @@
         <el-table-column prop="goafOrebody" label="矿体" />
         <el-table-column prop="goafOreheight" label="中段" />
         <el-table-column prop="goafName" label="采空区名称" />
-        <el-table-column prop="positionName" label="检查表" header-align="center" align="center" width="70">
+        <el-table-column prop="positionName" label="检查表" header-align="center" align="center">
           <template v-slot="{row}">
             <!-- <span v-if="!isNull(row.goafChecklistId)" class="icon iconfont icon-erweima" style="color:#fff" @click="showQrcode(row)" /> -->
-            <span v-if="!isNull(row.goafChecklistId)">{{ row.goafChecklistTitle }}</span>
+            <span v-if="row.goafChecklistIsbind===1">{{ row.goafChecklistTitle }}</span>
             <span v-else>未绑定</span>
           </template>
         </el-table-column>
@@ -40,8 +40,8 @@
         <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 v-if="isNull(row.goafChecklistId)" size="mini" type="text" style="color:#1B81FF" @click="handleUpdate(row)">绑定</el-button>
-            <el-button v-if="!isNull(row.goafChecklistId)" size="mini" type="text" style="color:#E44E2D" @click="handleDelete(row)">解绑</el-button>
+            <el-button v-if="row.goafChecklistIsbind===0" size="mini" type="text" style="color:#1B81FF" @click="handleUpdate(row)">绑定</el-button>
+            <el-button v-else size="mini" type="text" style="color:#E44E2D" @click="handleDelete(row)">解绑</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -65,8 +65,8 @@ import { getGoafBaseInfoByPage, updateGoaf } from '@/api/goaf/info'
 import { Pagination } from '@/components'
 import { NumConvertLM } from '@/utils'
 import { QrCode } from '@/components'
-import checkListBind from '@/views/goaf/info/components/Goaf'
-// import checkListBind from './components/checkListBind.vue'
+// import checkListBind from '@/views/goaf/info/components/Goaf'
+import checkListBind from './components/checkListBind.vue'
 import Detail from '@/views/goaf/info/components/detail'
 var zip = new JSZip()
 export default {
@@ -194,6 +194,7 @@ export default {
       const formData = JSON.parse(JSON.stringify(data))
       formData.goafChecklistId = ''
       formData.goafChecklistTitle = ''
+      formData.goafChecklistIsbind = 0
       this.$confirm(`此操作将解绑该数据${goafName}, 是否继续?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',

+ 7 - 1
src/views/goaf/danger/activity/Submit.vue

@@ -166,7 +166,7 @@ export default {
   methods: {
 
     // 启动
-    start() {
+    start(params) {
       const wfDefId = 1
       this.dialogVisible = true
       const userData = JSON.parse(JSON.stringify(this.userData))
@@ -187,6 +187,12 @@ export default {
           }
         })
       })
+      if (params) {
+        this.formData.checklistId = params.checklistId
+        this.formData.goafId = params.goafId
+        this.formData.hdangerDesc = params.checkItemNopass
+        this.formData.hdangerTitle = params.checkItemNopass
+      }
     },
 
     // 显示窗口

+ 6 - 2
src/views/goaf/info/components/Goaf.vue

@@ -148,7 +148,8 @@ export default {
         'goafIsFill': 0,
         'goafInfoRemak': '',
         'goafChecklistId': '',
-        'goafChecklistTitle': ''
+        'goafChecklistTitle': '',
+        'goafChecklistIsbind': 1
       },
       rules: {
         goafName: [{ required: true, message: '采空区名称不能为空', trigger: 'blur' }],
@@ -213,7 +214,8 @@ export default {
         'goafIsFill': 0,
         'goafInfoRemak': '',
         'goafChecklistId': '',
-        'goafChecklistTitle': ''
+        'goafChecklistTitle': '',
+        'goafChecklistIsbind': 1
       }
     },
 
@@ -221,6 +223,8 @@ export default {
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
+          const goafChecklist = this.checklist.filter(item => this.formData.goafChecklistId === item.checklistId)[0]
+          this.formData.goafChecklistTitle = goafChecklist.checklistTitle
           switch (this.actionType) {
             case 'ADD':
               createGoaf(this.formData).then((resp) => {