| | |
| | | // BASE_API: '"http://222.92.213.21:8006/zhongtai"', |
| | | // IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"', |
| | | |
| | | BASE_API: '"http://112.86.23.127:8006"', |
| | | IMG_API: '"http://112.86.23.127:8006/upload/"', |
| | | BASE_API: '"http://112.86.23.91:8006"', |
| | | IMG_API: '"http://112.86.23.91:8006/upload/"', |
| | | |
| | | // BASE_API: '"http://222.92.213.21:8006/zhongtai_demo"', |
| | | // IMG_API: '"http://222.92.213.21:8006/zhongtai_demo/upload/"', |
| | |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/riskAnaUnit/mod', |
| | | url: process.env.BASE_API + '/safecheck/work/update', |
| | | method: 'post', |
| | | data:data |
| | | }) |
| | |
| | | data |
| | | }); |
| | | } |
| | | |
| | | |
| | | export function addInspectionControlAction(data) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/safecheck/work/content/add?workId=' + data.workId + '&measureId=' + data.measureId, |
| | | method: 'post', |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function deleteInspectionControlAction(data) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/safecheck/work/content/del?workId=' + data.workId + '&measureId=' + data.measureId, |
| | | method: 'post', |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function getInspectionControlAction(id) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/safecheck/work/get/id?workId=' + id, |
| | | method: 'post', |
| | | }); |
| | | } |
| | |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="安全风险事件名称" prop="riskEventId" align="center"> |
| | | <el-table-column label="序号" type="index" width="150" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="管控方式" prop="dataSrc" align="center"> |
| | | <el-table-column label="管控方式描述" prop="content" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="管控方式描述" prop="riskMeasureDesc" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="管控措施分类1" prop="classify1" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="管控措施分类2" prop="classify2" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="管控措施分类3" prop="classify3" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="隐患排查内容" prop="troubleshootContent" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="检查类型" prop="hazardLiablePerson" align="center"> |
| | | <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" style="color:red;" @click="deleteById(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <el-dialog :visible.sync="controlActionVisible" append-to-body :close-on-click-modal="false" width="80%"> |
| | | <control-action ref="controlAction" @giveRiskControlId="receiveRiskControlId"></control-action> |
| | | <control-action ref="controlAction" @closeDialog="closeDialog" @giveRiskControlId="receiveRiskControlId"></control-action> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import controlAction from '../../../riskLevelManage/controlAction/index' |
| | | import { addInspectionControlAction, deleteInspectionControlAction ,getInspectionControlAction } from '../../../../../api/inspectionTask' |
| | | export default { |
| | | props:['title','inspectionTaskForm'], |
| | | name: "inpectionPoint", |
| | | data(){ |
| | | return{ |
| | | tableKey:'', |
| | | listLoading:false, |
| | | ifShowControl:true, |
| | | controlActionVisible:false, |
| | | riskControlMeasureVisible:false, |
| | | riskControlMeasureForm:[], |
| | | inspectionPointData:[], |
| | | controlActionForm:{ |
| | | workId:'', |
| | | measureId:'', |
| | | } |
| | | } |
| | | }, |
| | | components:{ |
| | |
| | | this.$refs.controlAction.ifShowButton() |
| | | }) |
| | | }, |
| | | receiveRiskControlId(value) { |
| | | showMeasureDetail(val){ |
| | | this.controlActionVisible = true |
| | | setTimeout( () => { |
| | | this.$refs.controlAction.showMeasureDetail(val) |
| | | }) |
| | | |
| | | }, |
| | | closeDialog(){ |
| | | this.controlActionVisible = false |
| | | }, |
| | | async receiveRiskControlId(value) { |
| | | this.controlActionVisible = false |
| | | this.inspectionPointData = JSON.parse(JSON.stringify(value)) |
| | | this.$emit('giveToForm',this.inspectionPointData) |
| | | if(this.title === '新建巡检计划设定'){ |
| | | if(value){ |
| | | // this.inspectionPointData = JSON.parse(JSON.stringify(value.map( item => { |
| | | // return { |
| | | // id:item.id, |
| | | // content:item.riskMeasureDesc |
| | | // } |
| | | // }))) |
| | | this.inspectionPointData.push({id:value.id,content:value.riskMeasureDesc}) |
| | | this.$emit('giveToForm',this.inspectionPointData) |
| | | } |
| | | }else{ |
| | | this.controlActionForm.workId = JSON.stringify(this.inspectionTaskForm.workId) |
| | | this.controlActionForm.measureId =JSON.stringify(value.id) |
| | | let res = await addInspectionControlAction(this.controlActionForm) |
| | | if(res.data.code === '200'){ |
| | | this.getControlActionList() |
| | | this.$message({ |
| | | type:'success', |
| | | duretion:2000, |
| | | message:'新增管控措施成功', |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | deleteById(value){ |
| | | this.$confirm('删除此条措施,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | | cancelButtonText:'取消', |
| | | type:'warning', |
| | | }).then(()=> { |
| | | deleteInspectionControlAction({workId:value.workId,measureId:value.measureId}).then( (res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.getControlActionList() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'删除成功', |
| | | type:'success', |
| | | duration:2000, |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }) |
| | | }, |
| | | async getControlActionList(){ |
| | | let res = await getInspectionControlAction(this.inspectionTaskForm.workId) |
| | | this.inspectionPointData = res.data.result.checkContents |
| | | } |
| | | } |
| | | } |
| | |
| | | /deep/.filter-container{ |
| | | padding-left: 0px !important; |
| | | } |
| | | .analyseUnit_input{ |
| | | width:200px; |
| | | } |
| | | </style> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="巡检任务类型" prop="type"> |
| | | <el-select v-model="inspectionTaskForm.type" class="analyseUnit_input"> |
| | | <el-select v-model="inspectionTaskForm.type" class="analyseUnit_input" :disabled="ifShow"> |
| | | <el-option |
| | | v-for="item in typeList" |
| | | :key="item.id" |
| | |
| | | <div class="inspectionTask_point"> |
| | | <el-tabs class="active" v-model="activeName"> |
| | | <el-tab-pane label="巡检点信息" name="inspectionPoint"> |
| | | <inspection-point @giveToForm="receiveToForm" ref="inspectionPoint"></inspection-point> |
| | | <inspection-point @giveToForm="receiveToForm" ref="inspectionPoint" :title="title" :inspectionTaskForm="inspectionTaskForm"></inspection-point> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | ifShow:true, |
| | | activeName:'inspectionPoint', |
| | | inspectionTaskData: [], |
| | | departmentList:[], |
| | |
| | | } |
| | | }, |
| | | showAnalyseUnitForm(value,type){ |
| | | debugger |
| | | this.inspectionTaskVisible = true |
| | | this.$nextTick(() =>{ |
| | | this.$refs["inspectionTaskForm"].clearValidate() |
| | | }) |
| | | if(type === '新增'){ |
| | | this.ifShow = false |
| | | this.title = '新建巡检计划设定' |
| | | this.noticeDepartment = '' |
| | | this.execDepartment = '' |
| | | this.inspectionTaskForm = { |
| | | type:null, |
| | | createUid: parseInt(Cookies.get('userId')), |
| | |
| | | setTimeout(() => { |
| | | this.$refs.inspectionPoint.inspectionPointData = [] |
| | | }); |
| | | }else{ |
| | | }else{ |
| | | this.ifShow = true |
| | | this.title = '编辑巡检计划设定' |
| | | 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.inspectionTaskForm = JSON.parse(JSON.stringify(value)) |
| | | // this.inspectionTaskForm.execUid = value.execUname |
| | | // this.inspectionTaskForm.noticeUid = value.noticeUname |
| | | setTimeout(() => { |
| | | this.$refs.inspectionPoint.inspectionPointData = this.inspectionTaskForm.checkContents |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | handleDepartment(value){ |
| | | let department = '' |
| | | for(let i in this.userList){ |
| | | if(this.userList[i].id === value){ |
| | | department = this.userList[i].department |
| | | } |
| | | } |
| | | department = this.departmentList.find(item => item.department === department) |
| | | return department.department |
| | | }, |
| | | submitAnalyseUnit(){ |
| | | this.$refs["inspectionTaskForm"].validate((valid) =>{ |
| | | if(valid){ |
| | | if(this.title === '新建巡检计划设定'){ |
| | | addInspectionTask(this.inspectionTaskForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.inspectionTaskVisible = false |
| | | this.getInspectionTaskData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | message:'新增成功', |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | if(this.inspectionTaskForm.noticeSeconds >= this.inspectionTaskForm.intervalSeconds){ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'提前通知时间不能大于检查频次' |
| | | }) |
| | | }else if(this.inspectionTaskForm.intervalSeconds <= this.inspectionTaskForm.effectSeconds){ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'任务持续时间不能大于检查频次' |
| | | }) |
| | | }else{ |
| | | updateInspectionTask(this.inspectionTaskForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.inspectionTaskVisible = false |
| | | this.getInspectionTaskData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | title:'成功', |
| | | message:'编辑成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | if(this.title === '新建巡检计划设定'){ |
| | | addInspectionTask(this.inspectionTaskForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.inspectionTaskVisible = false |
| | | this.getInspectionTaskData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | message:'新增成功', |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | }else{ |
| | | updateInspectionTask({ |
| | | effectSeconds: this.inspectionTaskForm.effectSeconds, |
| | | execUid: this.inspectionTaskForm.execUid, |
| | | intervalSeconds: this.inspectionTaskForm.intervalSeconds, |
| | | noticeSeconds: this.inspectionTaskForm.noticeSeconds, |
| | | noticeUid: this.inspectionTaskForm.noticeUid, |
| | | startTime: this.inspectionTaskForm.startTime, |
| | | status: this.inspectionTaskForm.status, |
| | | workId: this.inspectionTaskForm.workId |
| | | }).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.inspectionTaskVisible = false |
| | | this.getInspectionTaskData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | title:'成功', |
| | | message:'编辑成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | |
| | | }) |
| | | }, |
| | | receiveToForm(value) { |
| | | debugger |
| | | this.inspectionTaskForm.riskControlMeasureIdList = [] |
| | | this.inspectionTaskForm.riskControlMeasureIdList = value.map( item => { |
| | | return item.id |
| | |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <!-- <el-table-column type="selection" width="55"></el-table-column> --> |
| | | <el-table-column label="安全风险事件名称" prop="riskEventId" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="管控方式" prop="dataSrc" align="center"> |
| | |
| | | /> |
| | | <br> |
| | | </div> |
| | | <el-dialog :title="title" :visible.sync="riskControlMeasureVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> |
| | | <el-dialog :title="title" :visible.sync="riskControlMeasureVisible" append-to-body :close-on-click-modal="false" width="600px"> |
| | | <el-form ref="riskControlMeasureForm" :rules="riskControlMeasureFormRules" :model="riskControlMeasureForm" label-position="right" label-width="160px"> |
| | | <el-form-item label="安全风险事件名称" prop="riskEventId"> |
| | | <el-select v-model="riskControlMeasureForm.riskEventId" class="analyseUnit_input"> |
| | |
| | | this.riskControlMeasureIdList = val |
| | | }, |
| | | |
| | | giveValue(){ |
| | | this.$emit('giveRiskControlId',this.riskControlMeasureIdList) |
| | | giveValue(value){ |
| | | // this.$emit('giveRiskControlId',this.riskControlMeasureIdList) |
| | | this.$emit('giveRiskControlId',value) |
| | | }, |
| | | showMeasureDetail(value){ |
| | | this.riskControlMeasureVisible = true |
| | | this.getRiskControlMeasureData().then( ()=>{ |
| | | let riskControlMeasureForm = this.riskControlMeasureData.find(item => item.id === value.measureId) |
| | | this.riskControlMeasureForm = riskControlMeasureForm |
| | | this.$emit('closeDialog') |
| | | }) |
| | | |
| | | |
| | | } |
| | | } |
| | | } |