| | |
| | | data:data |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function getInspectionRecord(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/safecheck/task/get/list', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/riskSource/find/list', |
| | | method: 'get', |
| | | method: 'post', |
| | | data:data |
| | | }) |
| | | } |
| | |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/riskAnaUnit/mod', |
| | | url: process.env.BASE_API + '/riskSource/update/one', |
| | | method: 'post', |
| | | data:data |
| | | }) |
| | |
| | | import Element from 'element-ui' |
| | | import 'element-ui/lib/theme-chalk/index.css' |
| | | |
| | | import echarts from 'echarts' |
| | | Vue.prototype.$echarts = echarts |
| | | |
| | | import '@/styles/index.scss' // global css |
| | | |
| | | import App from './App' |
| | |
| | | <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() |
| | | }, |
| | | } |
| | | } |
| | |
| | | <template> |
| | | |
| | | <div id="inspectionPerson" style="width:90%;height:360px;margin: 0 auto;"> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data(){ |
| | | return{ |
| | | barData:[], |
| | | myChart:'', |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.drawLine() |
| | | }, |
| | | methods:{ |
| | | async drawLine(){ |
| | | this.myChart = this.$echarts.init(document.getElementById('inspectionPerson')) |
| | | this.myChart.setOption({ |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | left: 'center', |
| | | top: '84%', |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [120, 200, 150, 80, 70, 110, 130], |
| | | type: 'bar', |
| | | showBackground: true, |
| | | backgroundStyle: { |
| | | color: '#5470c6' |
| | | } |
| | | }] |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style scoped lang="scss"> |
| | | </style> |
| | |
| | | <template> |
| | | |
| | | <div id="toadyLine" style="width:90%;height:360px;margin: 0 auto;"> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: 'index', |
| | | data(){ |
| | | return{ |
| | | numData:[], |
| | | timeData:[], |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.drawTodayLine() |
| | | }, |
| | | methods:{ |
| | | async drawTodayLine(){ |
| | | this.timeData = [1,2,3,4,] |
| | | this.numData = [2,5,7,9] |
| | | let myChart = this.$echarts.init(document.getElementById('toadyLine')) |
| | | myChart.setOption({ |
| | | xAxis: { |
| | | type: 'category', |
| | | data: this.timeData |
| | | }, |
| | | grid: { |
| | | left: '10%', |
| | | right: '10%', |
| | | bottom: '5%', |
| | | top:'5%', |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: this.numData, |
| | | type: 'line', |
| | | itemStyle:{ |
| | | normal:{ |
| | | color:'#0180ff', |
| | | areaStyle: { |
| | | type:'default', |
| | | color: new this.$echarts.graphic.LinearGradient(0,0,0,2,[ |
| | | {offset:0,color:'#0180ff'}, |
| | | {offset:0.5,color:'#d7f4f8'}, |
| | | {offset:1,color:'#fff'}, |
| | | ]) |
| | | }, |
| | | lineStyle:{ |
| | | width:3, |
| | | type:'solid', |
| | | color:'#0180ff' |
| | | }, |
| | | emphasis:{ |
| | | color:'#0180ff', |
| | | lineStyle:{ |
| | | width:2, |
| | | type:'dotted', |
| | | color:'0180ff' |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | symbolSize:6, |
| | | }] |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | |
| | | <div id="todayUnusual" style="width:90%;height:380px;margin: 0 auto;"> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: 'index', |
| | | data(){ |
| | | return{ |
| | | numData:[], |
| | | timeData:[], |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.drawTodayLine() |
| | | }, |
| | | methods:{ |
| | | async drawTodayLine(){ |
| | | this.myChart = this.$echarts.init(document.getElementById('todayUnusual')) |
| | | this.myChart.setOption({ |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | top: '5%', |
| | | left: 'center' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 2 |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: true, |
| | | fontSize: '40', |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | color:['#5470c6', '#91cc75', '#fac858','#ee6666','#73c0de','#3ba272','#fc8452','#9a60b4'], |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: [ |
| | | { value: 1048, name: '今日完成' }, |
| | | { value: 735, name: '今日异常' }, |
| | | ] |
| | | } |
| | | ] |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | noticeUid: "", |
| | | startTime: "", |
| | | status:"", |
| | | type: "" |
| | | type: "", |
| | | page: 10, |
| | | pageSize: 1, |
| | | |
| | | }, |
| | | } |
| | | }, |
| | |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <span>单位名称:</span> |
| | | <el-input v-model="listQuery.name" style="width:200px"> |
| | | <span>巡检开始时间:</span> |
| | | <el-date-picker v-model="listQuery.startTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="开始时间"></el-date-picker> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>巡检结束时间:</span> |
| | | <el-date-picker v-model="listQuery.endTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="结束时间"></el-date-picker> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>风险源名称:</span> |
| | | <el-input v-model="listQuery.name" class="analyseUnit_input"> |
| | | </el-input> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>风险类型:</span> |
| | | <el-select v-model="listQuery.type"> |
| | | <el-option |
| | | v-for="item in typeList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>风险等级:</span> |
| | | <el-select v-model="listQuery.level"> |
| | | <el-option |
| | | v-for="item in levelList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>状态:</span> |
| | | <el-select v-model="listQuery.status"> |
| | | <el-option |
| | | v-for="item in statusList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>所属部门名称:</span> |
| | | <el-select v-model="listQuery.depId"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>区域位置:</span> |
| | | <el-input v-model="listQuery.location" class="analyseUnit_input"> |
| | | </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="showRiskSourceForm('','新增')">新增</el-button> |
| | | </div> |
| | |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="analyseUnitData" |
| | | :data="riskSourceData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | |
| | | <el-table-column label="风险源名称" prop="name" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="点位类型" prop="type" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.type | parseType}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="风险等级" prop="level" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.level | parseLevel}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="可能导致的主要事故类型" prop="accidentDesc" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="区域位置" prop="location" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="所属单位" prop="depId" align="center"> |
| | | <el-table-column label="所属单位" prop="depName" 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 label="最后修改人" prop="editUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="最后修改时间" prop="updateTime" align="center"> |
| | | <el-table-column label="最后修改时间" prop="editTime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="status" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in statusList"> |
| | | <div v-show="item.id === scope.row.status"> |
| | | <el-tag :type="scope.row.status === 1 ? 'success' : (scope.row.status === 2 ? 'warning' : 'danger')">{{item.name}}</el-tag> |
| | | </div> |
| | | </div> |
| | | </template>> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-option |
| | | v-for="item in typeList" |
| | | :key="item.id" |
| | | :value="item.name" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | |
| | | <el-option |
| | | v-for="item in levelList" |
| | | :key="item.id" |
| | | :value="item.name" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | |
| | | <el-input v-model="riskSourceForm.location" class="analyseUnit_input"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属部门" prop="depId"> |
| | | <el-input v-model="riskSourceForm.depId" class="analyseUnit_input"></el-input> |
| | | <el-select v-model="riskSourceForm.depId" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.department" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div align="right"> |
| | | <el-button @click="riskSourceVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="showRiskSourceForm()">确认</el-button> |
| | | <el-button type="primary" @click="submitRiskSourceForm()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | parseType(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | return "设备、设施" |
| | | }else{ |
| | | return "作业活动" |
| | | } |
| | | }, |
| | | parseLevel(level){ |
| | | switch(level){ |
| | | case 1 : return '低风险';break; |
| | | case 2 : return '一般风险';break; |
| | | case 3 : return '较大风险';break; |
| | | case 4 : return '重大风险';break; |
| | | default : break; |
| | | |
| | | } |
| | | }, |
| | | parseStatus(status){ |
| | | if(status === 1) { |
| | | return '有效' |
| | | }else if(status === 2){ |
| | | return '无效' |
| | | }else{ |
| | | return '删除' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | tableKey: 0, |
| | | riskSourceData: [], |
| | | departmentList:[], |
| | | typeList:[{id:1,name:'typeList'},{id:2,name:'作业活动'}], |
| | | typeList:[{id:1,name:'设备、设施'},{id:2,name:'作业活动'}], |
| | | levelList:[{id:1,name:'低风险'},{id:2,name:'一般风险'},{id:3,name:'较大风险'},{id:4,name:'重大风险'}], |
| | | statusList:[{id:1,name:'有效'},{id:2,name:'无效'},{id:3,name:'删除'},], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | |
| | | code:'', |
| | | riskSourceVisible:false, |
| | | riskSourceFormRules:{ |
| | | hazardDep: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardLiablePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }], |
| | | hazardCode: [{ required: true, message: '安全风险分析对象编码不能为空', trigger: 'blur' }], |
| | | riskUnitName: [{ required: true, message: '安全风险分析单元名称不能为空', trigger: 'blur' }], |
| | | name: [{ required: true, message: '风险名称不能为空', trigger: 'blur' }], |
| | | }, |
| | | riskSourceForm:{ |
| | | accidentDesc: "", |
| | | createTime: "", |
| | | createUid: null, |
| | | createUname: "", |
| | | depId: null, |
| | | depName: "", |
| | | editTime: "", |
| | | editUid: null, |
| | | editUname: "", |
| | | id: null, |
| | | level: null, |
| | | location: "", |
| | | name: "", |
| | | status: null, |
| | | type: null |
| | | }, |
| | | listQuery:{ |
| | | startTime:'', |
| | | endTime:'', |
| | | type:'', |
| | | status:'', |
| | | level:'', |
| | | depId:'', |
| | | depName:'', |
| | | location:'', |
| | | pageIndex:1, |
| | | pageSize:10, |
| | | name:'', |
| | |
| | | this.listLoading = true |
| | | let res = await getRiskSourceList(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.riskSourceData = res.data.result.records |
| | | this.recordTotal =JSON.parse(res.data.message).totalCount |
| | | this.pageSize = JSON.parse(res.data.message).pageSize |
| | | this.pageTotal = computePageCount(this.recordTotal, this.pageSize) |
| | | this.currentPage = JSON.parse(res.data.message).pageIndex |
| | | this.riskSourceData = res.data.result |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | |
| | | this.title = '新增' |
| | | this.riskSourceForm = { |
| | | accidentDesc: "", |
| | | createTime: "", |
| | | createUid: null, |
| | | createUname: "", |
| | | depId: null, |
| | | depName: "", |
| | | editTime: "", |
| | | editUid: null, |
| | | editUname: "", |
| | | id: null, |
| | | level: null, |
| | | location: "", |
| | | name: "", |
| | | status: null, |
| | | type: null |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | | this.riskSourceForm = value |
| | | this.title = '编辑' |
| | | for( let key in this.riskSourceForm){ |
| | | this.riskSourceForm[key] = JSON.parse(JSON.stringify(value))[key] |
| | | } |
| | | } |
| | | }, |
| | | submitAnalyseUnit(){ |
| | | submitRiskSourceForm(){ |
| | | this.$refs["riskSourceForm"].validate((valid) =>{ |
| | | if(valid){ |
| | | if(this.title === '新增'){ |
| | | addAnalyseUnit(this.riskSourceForm).then((res)=>{ |
| | | addRiskSource(this.riskSourceForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.riskSourceVisible = false |
| | | this.getRiskSourceData() |
| | |
| | | } |
| | | }) |
| | | }else{ |
| | | updateAnalyseUnit(this.riskSourceForm).then((res)=>{ |
| | | updateRiskSource(this.riskSourceForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.riskSourceVisible = false |
| | | this.getRiskSourceData() |
| | |
| | | padding-bottom: 10px; |
| | | } |
| | | .analyseUnit_input{ |
| | | width:320px; |
| | | width:200px; |
| | | } |
| | | </style> |