| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <span>单位名称:</span> |
| | | <el-input v-model="listQuery.filter.riskUnitName" style="width:200px"> |
| | | </el-input> |
| | | </div> |
| | | <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> |
| | | <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-plus" @click="showAnalyseUnitForm('','新增')">新增</el-button> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="analyseUnitData" |
| | | :data="inspectionRecordData" |
| | | border |
| | | fit |
| | | 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"> |
| | | </el-table-column> |
| | | <el-table-column label="责任人" prop="hazardLiablePerson" align="center"> |
| | | <el-table-column label="检查频次" prop="intervalSeconds" align="center"> |
| | | </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="endTime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" prop="createTime" align="center"> |
| | | <el-table-column label="异常通知人" prop="noticeUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="最后修改人" prop="updateBy" align="center"> |
| | | <el-table-column label="巡检人" prop="execUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="最后修改时间" prop="updateTime" align="center"> |
| | | <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-button type="text" @click="showAnalyseUnitForm(scope.row,'编辑')">编辑</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(scope.row)">删除</el-button> |
| | | <el-button type="text" @click="showInspectionRecordForm(scope.row,'编辑')">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | /> |
| | | <br> |
| | | </div> |
| | | <el-dialog :title="title" :visible.sync="analyseUnitVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> |
| | | <el-form ref="analyseUnitForm" :rules="analyseUnitFormRules" :model="analyseUnitForm" label-position="right" label-width="165px"> |
| | | <el-dialog :title="title" :visible.sync="inspectionRecordVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> |
| | | <el-form ref="inspectionRecordForm" :model="inspectionRecordForm" label-position="right" label-width="165px"> |
| | | <el-form-item label="责任部门" prop="hazardDep"> |
| | | <el-select v-model="analyseUnitForm.hazardDep" class="analyseUnit_input"> |
| | | <el-select v-model="inspectionRecordForm.hazardDep" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="责任人" prop="hazardLiablePerson"> |
| | | <el-input v-model="analyseUnitForm.hazardLiablePerson" class="analyseUnit_input"></el-input> |
| | | <el-input v-model="inspectionRecordForm.hazardLiablePerson" class="analyseUnit_input"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="安全风险分析对象编码" prop="hazardCode"> |
| | | <el-input v-model="analyseUnitForm.hazardCode" class="analyseUnit_input"></el-input> |
| | | <el-input v-model="inspectionRecordForm.hazardCode" class="analyseUnit_input"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="安全风险分析单元名称" prop="riskUnitName"> |
| | | <el-input v-model="analyseUnitForm.riskUnitName" class="analyseUnit_input"></el-input> |
| | | <el-input v-model="inspectionRecordForm.riskUnitName" class="analyseUnit_input"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div align="right"> |
| | | <el-button @click="unitFormVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitAnalyseUnit()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '@/utils' |
| | | import { addAnalyseUnit, deleteAnalyseUnit, getAnalyseUnitList, updateAnalyseUnit } from '@/api/riskLevelManage' |
| | | import { getInspectionRecord } from '@/api/inspectionTask' |
| | | import {getAllDepartment, getDepartmentList} from "../../../../api/departmentManage"; |
| | | export default { |
| | | name: 'index', |
| | |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | analyseUnitData: [], |
| | | inspectionRecordData: [], |
| | | departmentList:[], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | |
| | | title:'', |
| | | company:'', |
| | | code:'', |
| | | analyseUnitVisible:false, |
| | | analyseUnitFormRules:{ |
| | | hazardDep: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardLiablePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }], |
| | | hazardCode: [{ required: true, message: '安全风险分析对象编码不能为空', trigger: 'blur' }], |
| | | riskUnitName: [{ required: true, message: '安全风险分析单元名称不能为空', trigger: 'blur' }], |
| | | }, |
| | | analyseUnitForm:{ |
| | | id: null, |
| | | hazardCode: "", |
| | | hazardDep: "", |
| | | hazardLiablePerson: "", |
| | | riskUnitName: "", |
| | | createTime: "", |
| | | updateTime: "", |
| | | createBy: "", |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: 1 |
| | | inspectionRecordVisible:false, |
| | | inspectionRecordForm:{ |
| | | |
| | | }, |
| | | listQuery:{ |
| | | pageIndex:1, |
| | | createUid: null, |
| | | endTime: null, |
| | | execUid: null, |
| | | noticeUid: null, |
| | | page: 1, |
| | | pageSize:10, |
| | | filter:{ |
| | | riskUnitName:'', |
| | | } |
| | | startTime: null, |
| | | result:null, |
| | | statusList: null, |
| | | type: null |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getAnalyseUnitData() |
| | | this.getInspectionRecordData() |
| | | this.getDepartment() |
| | | }, |
| | | methods: { |
| | | async getAnalyseUnitData(){ |
| | | async getInspectionRecordData(){ |
| | | this.listLoading = true |
| | | let res = await getAnalyseUnitList(this.listQuery) |
| | | let res = await getInspectionRecord(this.listQuery) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.total |
| | | this.pageSize = res.data.result.size |
| | |
| | | } |
| | | }, |
| | | showAnalyseUnitForm(value,type){ |
| | | this.analyseUnitVisible = true |
| | | this.inspectionRecordVisible = true |
| | | this.$nextTick(() =>{ |
| | | this.$refs["analyseUnitForm"].clearValidate() |
| | | }) |
| | | if(type === '新增'){ |
| | | this.title = '新增' |
| | | this.analyseUnitForm = { |
| | | id: null, |
| | | hazardCode: "", |
| | | hazardDep: "", |
| | | hazardLiablePerson: "", |
| | | riskUnitName: "", |
| | | createTime: "", |
| | | updateTime: "", |
| | | createBy: "", |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: 1 |
| | | this.inspectionRecordData = { |
| | | |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | | this.analyseUnitForm = value |
| | | this.inspectionRecordData = value |
| | | } |
| | | }, |
| | | submitAnalyseUnit(){ |
| | | this.$refs["analyseUnitForm"].validate((valid) =>{ |
| | | if(valid){ |
| | | if(this.title === '新增'){ |
| | | addAnalyseUnit(this.analyseUnitForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.analyseUnitVisible = false |
| | | this.getAnalyseUnitData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | message:'新增成功', |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | }else{ |
| | | updateAnalyseUnit(this.analyseUnitForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.analyseUnitVisible = false |
| | | this.getAnalyseUnitData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | title:'成功', |
| | | message:'编辑成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | deleteById(val){ |
| | | this.$confirm('删除此条信息,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | | cancelButtonText:'取消', |
| | | type:'warning', |
| | | }).then(()=> { |
| | | deleteAnalyseUnit({id:val.id}).then( ()=>{ |
| | | this.getAnalyseUnitData() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'删除成功', |
| | | type:'success', |
| | | duration:2000, |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getAnalyseUnitData() |
| | | this.getInspectionRecordData() |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.listQuery.pageSize = val |
| | | this.getAnalyseUnitData() |
| | | this.getInspectionRecordData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.listQuery.pageIndex = val |
| | | this.getAnalyseUnitData() |
| | | this.listQuery.page = val |
| | | this.getInspectionRecordData() |
| | | }, |
| | | } |
| | | } |