| | |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="任务名称" prop="hazardCode" align="center"> |
| | | <el-table-column label="任务名称" prop="title" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="检查类型" prop="hazardDep" align="center"> |
| | | <el-table-column label="检查类型" prop="type" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in typeList"> |
| | | <div v-show="item.id === scope.row.type"> |
| | | {{ item.name }} |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="检查频次" prop="hazardLiablePerson" align="center"> |
| | | <el-table-column label="检查频次(小时)" prop="intervalSeconds" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.intervalSeconds | parseHours}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="任务开始时间" prop="riskUnitName" align="center"> |
| | | <el-table-column label="任务开始时间" prop="startTime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="任务结束时间" prop="createBy" align="center"> |
| | | <el-table-column label="异常通知人" prop="noticeUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="异常通知人" prop="createTime" align="center"> |
| | | <el-table-column label="巡检人" prop="execUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="巡检人" prop="updateBy" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="创建人" prop="createBy" align="center"> |
| | | <el-table-column label="创建人" prop="createUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" prop="createTime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="最后修改人" prop="updateBy" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="最后修改时间" prop="updateTime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-form ref="inspectionTaskForm" :rules="inspectionTaskFormRules" :model="inspectionTaskForm" label-position="right" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="任务名称" prop="hazardDep"> |
| | | <el-select v-model="inspectionTaskForm.hazardDep" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | ></el-option> |
| | | </el-select> |
| | | <el-form-item label="任务名称" prop="title"> |
| | | <el-input v-model="inspectionTaskForm.title" class="analyseUnit_input"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <el-option |
| | | v-for="item in typeList" |
| | | :key="item.id" |
| | | :value="item.name" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检查频次" prop="intervalSeconds"> |
| | | <el-input v-model="inspectionTaskForm.intervalSeconds" class="analyseUnit_input"></el-input> |
| | | <el-select v-model="inspectionTaskForm.intervalSeconds" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in intervalSecondsList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="提前通知时间" prop="noticeSeconds"> |
| | | <el-input v-model="inspectionTaskForm.noticeSeconds" class="analyseUnit_input"></el-input> |
| | | <el-select v-model="inspectionTaskForm.noticeSeconds" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in noticeSecondsList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="任务有效时间" prop="effectSeconds"> |
| | | <el-input v-model="inspectionTaskForm.effectSeconds" class="analyseUnit_input"></el-input> |
| | | <el-select v-model="inspectionTaskForm.effectSeconds" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in effectSecondsList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-option |
| | | v-for="item in noticeUidList" |
| | | :key="item.id" |
| | | :value="item.realname" |
| | | :value="item.id" |
| | | :label="item.realname" |
| | | ></el-option> |
| | | </el-select> |
| | |
| | | <el-option |
| | | v-for="item in execUidList" |
| | | :key="item.id" |
| | | :value="item.realname" |
| | | :value="item.id" |
| | | :label="item.realname" |
| | | ></el-option> |
| | | </el-select> |
| | |
| | | <div class="inspectionTask_point"> |
| | | <el-tabs class="active" v-model="activeName"> |
| | | <el-tab-pane label="巡检点信息" name="inspectionPoint"> |
| | | <inspection-point ref="inspectionPoint"></inspection-point> |
| | | <inspection-point @giveToForm="receiveToForm" ref="inspectionPoint"></inspection-point> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import Cookies from "js-cookie"; |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '@/utils' |
| | | import inspectionPoint from './components/inpectionPoint' |
| | | import { addAnalyseUnit, deleteAnalyseUnit, getAnalyseUnitList, updateAnalyseUnit } from '@/api/riskLevelManage' |
| | | import { getInspectionTask } from "../../../../api/inspectionTask"; |
| | | import { getInspectionTask , addInspectionTask, updateInspectionTask} from "../../../../api/inspectionTask"; |
| | | import {getAllDepartment, getDepartmentList} from "../../../../api/departmentManage"; |
| | | import {safetyInspectionItemName} from "../../../../api/safetySelfInspection"; |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | parseHours(seconds){ |
| | | let arg1 = parseFloat(seconds) |
| | | let arg2 = parseFloat(3600) |
| | | let t1 = 0 |
| | | let t2 = 0 |
| | | let r1 |
| | | let r2 |
| | | try { |
| | | t1 = arg1.toString().split(".")[1].length; |
| | | }catch (e){ |
| | | |
| | | } |
| | | try { |
| | | t2 = arg2.toString().split(".")[1].length; |
| | | }catch (e){ |
| | | } |
| | | r1 = Number(arg1.toString().replace(".","")) |
| | | r2 = Number(arg2.toString().replace(".","")) |
| | | return r1/r2*Math.pow(10,t2-t1) |
| | | }, |
| | | }, |
| | | computed: { |
| | |
| | | userList:[], |
| | | noticeUidList:[], |
| | | execUidList:[], |
| | | intervalSecondsList:[{id:7200,name:'2小时'},{id:21600,name:'6小时'},{id:43200,name:'12小时'},{id:86400,name:'1天'},{id:17280,name:'2天'}], |
| | | noticeSecondsList:[{id:600,name:'10分'},{id:3600,name:'1小时'},{id:7200,name:'2小时'},{id:21600,name:'6小时'},{id:43200,name:'12小时'},{id:86400,name:'1天'}], |
| | | effectSecondsList:[{id:1800,name:'30分'},{id:3600,name:'1小时'},{id:7200,name:'2小时'},{id:21600,name:'6小时'},{id:43200,name:'12小时'},{id:86400,name:'1天'}], |
| | | typeList:[{id:1,name:'日常检查'},{id:2,name:'周期检查'}], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | |
| | | riskUnitName: [{ required: true, message: '安全风险分析单元名称不能为空', trigger: 'blur' }], |
| | | }, |
| | | inspectionTaskForm:{ |
| | | createUid: 0, |
| | | effectSeconds: 0, |
| | | execUid: 0, |
| | | intervalSeconds: 0, |
| | | noticeSeconds: 0, |
| | | noticeUid: 0, |
| | | type:null, |
| | | createUid: null, |
| | | effectSeconds: null, |
| | | execUid: null, |
| | | intervalSeconds: null, |
| | | noticeSeconds: null, |
| | | noticeUid: null, |
| | | title:'', |
| | | riskControlMeasureIdList: [ |
| | | ], |
| | | startTime: "", |
| | | type: 0 |
| | | }, |
| | | listQuery:{ |
| | | createUid: "", |
| | |
| | | this.pageSize = res.data.result.size |
| | | this.pageTotal = computePageCount(res.data.result.total, res.data.result.size) |
| | | this.currentPage = res.data.result.current |
| | | this.inspectionTaskData = res.data.result.records |
| | | this.inspectionTaskData = res.data.result |
| | | }else if(res.data.code === '300'){ |
| | | this.inspectionTaskData = [] |
| | | } |
| | |
| | | } |
| | | }, |
| | | showAnalyseUnitForm(value,type){ |
| | | debugger |
| | | this.inspectionTaskVisible = true |
| | | this.$nextTick(() =>{ |
| | | this.$refs["inspectionTaskForm"].clearValidate() |
| | |
| | | if(type === '新增'){ |
| | | this.title = '新建巡检计划设定' |
| | | this.inspectionTaskForm = { |
| | | id: null, |
| | | hazardCode: "", |
| | | hazardDep: "", |
| | | hazardLiablePerson: "", |
| | | riskUnitName: "", |
| | | createTime: "", |
| | | updateTime: "", |
| | | createBy: "", |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: 1 |
| | | type:null, |
| | | createUid: parseInt(Cookies.get('userId')), |
| | | effectSeconds: null, |
| | | execUid: null, |
| | | intervalSeconds: null, |
| | | noticeSeconds: null, |
| | | noticeUid: null, |
| | | title:'', |
| | | riskControlMeasureIdList: [ |
| | | ], |
| | | startTime: "", |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | | this.inspectionTaskForm = value |
| | | setTimeout(() => { |
| | | this.$refs.inspectionPoint.inspectionPointData = [] |
| | | }); |
| | | }else{ |
| | | this.title = '编辑巡检计划设定' |
| | | this.inspectionTaskForm = JSON.parse(JSON.stringify(value)) |
| | | setTimeout(() => { |
| | | this.$refs.inspectionPoint.inspectionPointData = this.inspectionTaskForm.checkContents |
| | | }); |
| | | } |
| | | }, |
| | | submitAnalyseUnit(){ |
| | | this.$refs["inspectionTaskForm"].validate((valid) =>{ |
| | | if(valid){ |
| | | if(this.title === '新增'){ |
| | | addAnalyseUnit(this.inspectionTaskForm).then((res)=>{ |
| | | if(this.title === '新建巡检计划设定'){ |
| | | addInspectionTask(this.inspectionTaskForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.inspectionTaskVisible = false |
| | | this.getInspectionTaskData() |
| | |
| | | } |
| | | }) |
| | | }else{ |
| | | updateAnalyseUnit(this.inspectionTaskForm).then((res)=>{ |
| | | updateInspectionTask(this.inspectionTaskForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.inspectionTaskVisible = false |
| | | this.getInspectionTaskData() |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | receiveToForm(value) { |
| | | debugger |
| | | this.inspectionTaskForm.riskControlMeasureIdList = [] |
| | | this.inspectionTaskForm.riskControlMeasureIdList = value.map( item => { |
| | | return item.id |
| | | }) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getInspectionTaskData() |
| | | }, |