| | |
| | | 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, |
| | |
| | | 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() |