From 27d6c869e1fac29b6e267f1ccfb1373658bbdffa Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: Thu, 19 May 2022 17:42:28 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/ztqt
---
src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue | 112 +++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 91 insertions(+), 21 deletions(-)
diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue
index 4c61f8c..80ae467 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue
@@ -22,7 +22,7 @@
</div>
<div class="basic_search">
<span>任务单元状态列表:</span>
- <el-select v-model="listQuery.statusList">
+ <el-select v-model="listQuery.statusList" filterable clearable multiple>
<el-option
v-for="item in statusListList"
:key="item.id"
@@ -91,15 +91,19 @@
</el-table-column>
<el-table-column label="隐患排查内容" prop="content" align="center">
</el-table-column>
- <el-table-column label="巡检内容" prop="info" align="center">
+ <el-table-column label="上报说明" prop="info" align="center">
</el-table-column>
- <el-table-column label="巡检照片" prop="img" align="center">
+ <el-table-column label="上报照片" prop="img" align="center">
</el-table-column>
<el-table-column label="状态" prop="status" align="center">
+ <template slot-scope="scope">
+ {{ scope.row.status | parseUnitStatus}}
+ </template>
</el-table-column>
<el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
<template slot-scope="scope">
- <el-button type="text" @click="showMeasureDetail(scope.row)">详情</el-button>
+ <el-button type="text" @click="showInspectionRecordDetailForm(scope.row,'上报')" v-show="scope.row.status === 1">上报</el-button>
+ <el-button type="text" @click="showInspectionRecordDetailForm(scope.row,'查看')">查看</el-button>
</template>
</el-table-column>
</el-table>
@@ -112,18 +116,23 @@
{{ scope.row.type | parseType}}
</template>
</el-table-column>
- <el-table-column label="异常通知人" prop="noticeUname" align="center">
- </el-table-column>
<el-table-column label="巡检人" prop="execUname" align="center">
+ </el-table-column>
+ <el-table-column label="巡检开始时间" prop="expTime" align="center">
+ </el-table-column>
+ <el-table-column label="巡检结束时间" prop="endTime" align="center">
+ </el-table-column>
+ <el-table-column label="巡检提交时间" prop="execTime" align="center">
</el-table-column>
<el-table-column label="任务状态" prop="status" align="center">
<template slot-scope="scope">
- {{ scope.row.status | parseStatus}}
+ {{ scope.row.status | parseStatusList}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
<template slot-scope="scope">
- <el-button type="text" @click="showInspectionRecordForm(scope.row,'编辑')">查看</el-button>
+ <el-button type="text" @click="submitInspectionRecordForm(scope.row,'上报')">提交</el-button>
+ <el-button type="text" @click="showInspectionRecordForm(scope.row,'查看')">查看</el-button>
</template>
</el-table-column>
</el-table>
@@ -168,15 +177,21 @@
<el-button @click="unitFormVisible = false">取消</el-button>
</div>
</el-dialog>
+ <detail ref="detail"></detail>
</div>
</template>
<script>
+ import Cookies from "js-cookie";
+ import detail from './components/detail.vue'
import { mapGetters } from 'vuex'
import { computePageCount } from '@/utils'
import { getInspectionRecord } from '@/api/inspectionTask'
import {getAllDepartment, getDepartmentList} from "../../../../api/departmentManage";
+ import {safetyInspectionItemName} from "../../../../api/safetySelfInspection";
+ import {submitTask} from "../../../../api/inspectionTask";
export default {
+ components: { detail },
name: 'index',
filters: {
parseType(type){
@@ -193,6 +208,26 @@
return "任务关闭"
}
},
+ parseUnitStatus(value) {
+ if(value === 1){
+ return "待巡检"
+ }else if(value === 2) {
+ return "已完成"
+ }
+ },
+ parseStatusList(status) {
+ if(status === 1){
+ return "待巡检"
+ }else if(status === 2) {
+ return "巡检中"
+ }else if(status === 3) {
+ return "已完成"
+ }else if(status === 4) {
+ return "超时未巡检"
+ }else{
+ return "已取消"
+ }
+ }
},
computed: {
...mapGetters([
@@ -217,14 +252,13 @@
code:'',
inspectionRecordVisible:false,
inspectionRecordForm:{
-
+
},
listQuery:{
createUid: null,
endTime: null,
execUid: null,
execUname: null,
- noticeUid: null,
page: 1,
pageSize: 10,
result: null,
@@ -234,9 +268,13 @@
},
}
},
+ components: {
+ detail
+ },
created() {
this.getInspectionRecordData()
this.getDepartment()
+ this.getUser()
},
methods: {
async getInspectionRecordData(){
@@ -264,19 +302,51 @@
})
}
},
- showAnalyseUnitForm(value,type){
- this.inspectionRecordVisible = true
- this.$nextTick(() =>{
- this.$refs["analyseUnitForm"].clearValidate()
- })
- if(type === '新增'){
- this.title = '新增'
- this.inspectionRecordData = {
-
+ async getUser(){
+ let res = await safetyInspectionItemName()
+ if(res.data.code === '200'){
+ this.userList = res.data.result
+ }else{
+ this.$message({
+ message:res.data.message,
+ type:'warning'
+ })
+ }
+ },
+ showInspectionRecordForm(value){
+ this.$refs.detail.showInspectionRecordForm(value)
+ },
+ showInspectionRecordDetailForm(value,type) {
+ this.$refs.detail.showInspectionRecordDetailForm(value,type,this.userList)
+ },
+ async submitInspectionRecordForm(value){
+ if(value.unitList.find(item => item.status === 1) === undefined){
+ let data = {
+
+ }
+ let res = await submitTask({
+ execUid:Cookies.get('userId'),
+ info:"",
+ taskId: value.id
+ })
+ if(res.data.code === '200'){
+ this.$message({
+ type:'success',
+ message:'提交成功',
+ duration:2000,
+ title:'成功'
+ })
+ }else{
+ this.$message({
+ type:'warning',
+ message:res.data.message
+ })
}
}else{
- this.title = '修改'
- this.inspectionRecordData = value
+ this.$message({
+ type:'warning',
+ message:'请先上报所有巡检单元'
+ })
}
},
refreshHandle(){
--
Gitblit v1.9.2