| | |
| | | <div class="basic_search"> |
| | | <span>巡检任务类型:</span> |
| | | <el-select v-model="listQuery.type"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | <el-option |
| | | v-for="item in typeList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | <span>巡检任务状态:</span> |
| | | <el-select v-model="listQuery.status"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | v-for="item in statusList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>巡检任务创建人员:</span> |
| | | <el-select v-model="listQuery.createUid"> |
| | | <el-select v-model="listQuery.createUid" filterable clearable> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | v-for="item in userList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | :value="item.id" |
| | | :label="item.realname" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>异常通知人员:</span> |
| | | <el-select v-model="listQuery.noticeUid"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | <el-select v-model="listQuery.noticeUid" filterable clearable> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | :value="item.id" |
| | | :label="item.realname" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>执行巡检人员:</span> |
| | | <el-select v-model="listQuery.execUid"> |
| | | <el-select v-model="listQuery.execUid" filterable clearable> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | v-for="item in userList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | :value="item.id" |
| | | :label="item.realname" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | <br> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :current-page="listQuery.page" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :page-size="listQuery.pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | /> |
| | | <br> |
| | | </div> |
| | | |
| | |
| | | userList:[], |
| | | noticeUidList:[], |
| | | execUidList:[], |
| | | statusList:[{name:'任务开启',id:1},{id:2,name:'任务关闭'}], |
| | | 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天'}], |
| | |
| | | execDepartment:'', |
| | | inspectionTaskVisible:false, |
| | | inspectionTaskFormRules:{ |
| | | hazardDep: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardLiablePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }], |
| | | hazardCode: [{ required: true, message: '安全风险分析对象编码不能为空', trigger: 'blur' }], |
| | | riskUnitName: [{ required: true, message: '安全风险分析单元名称不能为空', trigger: 'blur' }], |
| | | title: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }], |
| | | type: [{ required: true, message: '检查类型不能为空', trigger: 'change' }], |
| | | intervalSeconds: [{ required: true, message: '检查频次不能为空', trigger: 'change' }], |
| | | noticeSeconds: [{ required: true, message: '提前通知时间不能为空', trigger: 'change' }], |
| | | startTime: [{ required: true, message: '周期开始时间不能为空', trigger: 'change' }], |
| | | effectSeconds: [{ required: true, message: '任务有效时间不能为空', trigger: 'change' }], |
| | | noticeUid: [{ required: true, message: '异常通知人员不能为空', trigger: 'change' }], |
| | | execUid: [{ required: true, message: '执行巡检人员不能为空', trigger: 'change' }], |
| | | }, |
| | | inspectionTaskForm:{ |
| | | type:null, |
| | |
| | | startTime: "", |
| | | status:"", |
| | | type: "", |
| | | page: 10, |
| | | pageSize: 1, |
| | | page: 1, |
| | | pageSize: 10, |
| | | |
| | | }, |
| | | } |
| | |
| | | this.listLoading = true |
| | | let res = await getInspectionTask(this.listQuery) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.total |
| | | this.pageSize = res.data.result.size |
| | | this.pageTotal = computePageCount(res.data.result.total, res.data.result.size) |
| | | this.currentPage = res.data.result.current |
| | | this.recordTotal = JSON.parse(res.data.message).total |
| | | this.inspectionTaskData = res.data.result |
| | | }else if(res.data.code === '300'){ |
| | | this.inspectionTaskData = [] |
| | |
| | | this.noticeDepartment = this.handleDepartment(JSON.parse(JSON.stringify(value)).noticeUid) |
| | | this.changeNotice() |
| | | this.execDepartment = this.handleDepartment(JSON.parse(JSON.stringify(value)).execUid) |
| | | this.changeExec() |
| | | this.changeExec() |
| | | this.inspectionTaskForm = JSON.parse(JSON.stringify(value)) |
| | | // this.inspectionTaskForm.execUid = value.execUname |
| | | // this.inspectionTaskForm.noticeUid = value.noticeUname |
| | |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'任务持续时间不能大于检查频次' |
| | | }) |
| | | }else if(this.justifyTime(this.inspectionTaskForm.startTime,this.inspectionTaskForm.noticeSeconds)){ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'周期开始时间减去当前时间和提前通知时间要大于等于半小时' |
| | | }) |
| | | }else{ |
| | | if(this.title === '新建巡检计划设定'){ |
| | |
| | | }) |
| | | |
| | | }, |
| | | justifyTime(time,interval) { |
| | | debugger |
| | | let timeStr = new Date(time.replace(/-/g,'/')) |
| | | let date = parseInt(timeStr.getTime()/1000) |
| | | let newTimeStr = new Date() |
| | | let newDate = parseInt(newTimeStr.getTime()/1000) |
| | | if(date - newDate - interval - 1800 >= 0){ |
| | | return false |
| | | }else{ |
| | | return true |
| | | } |
| | | }, |
| | | deleteById(val){ |
| | | this.$confirm('删除此条信息,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | |
| | | }) |
| | | }, |
| | | receiveToForm(value) { |
| | | this.inspectionTaskForm.riskControlMeasureIdList = [] |
| | | this.inspectionTaskForm.riskControlMeasureIdList = value.map( item => { |
| | | return item.id |
| | | }) |
| | | // this.inspectionTaskForm.riskControlMeasureIdList = [] |
| | | // this.inspectionTaskForm.riskControlMeasureIdList = value.map( item => { |
| | | // return item.id |
| | | // }) |
| | | this.inspectionTaskForm.riskControlMeasureIdList.push({id:value.id}) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getInspectionTaskData() |
| | |
| | | this.getInspectionTaskData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.listQuery.pageIndex = val |
| | | this.listQuery.page = val |
| | | this.getInspectionTaskData() |
| | | }, |
| | | } |