| | |
| | | </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-form-item label="责任部门" prop="hazardDepId"> |
| | | <el-select v-model="analyseUnitForm.hazardDepId" class="analyseUnit_input" > |
| | | <el-form-item label="责任部门" prop="hazardDep"> |
| | | <el-row> |
| | | <el-col :span="21"> |
| | | <el-select v-model="analyseUnitForm.hazardDep" value-key="item" class="analyseUnit_input" @change="departmentChange" @clear="departmentClear"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :value="item" |
| | | :label="item.department" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <img src="../../../../assets/map.png" class="image" @click="showDepartmentChart"></img> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="责任人" prop="hazardLiablePerson"> |
| | | <el-select v-model="analyseUnitForm.hazardLiablePerson" value-key="item" class="analyseUnit_input"@change="personChange" @clear="personClear" > |
| | |
| | | <el-button type="primary" @click="submitAnalyseUnit()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <department-chart ref="chart"></department-chart> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import departmentChart from "./components/departmentChart"; |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '@/utils' |
| | | import { addAnalyseUnit, deleteAnalyseUnit, getAnalyseUnitList, updateAnalyseUnit } from '@/api/riskLevelManage' |
| | | import {getAllDepartment, getDepartmentList} from "../../../../api/departmentManage"; |
| | | import {safetyInspectionItemName} from "../../../../api/safetySelfInspection"; |
| | | import {getDepartmentChart} from "../../../../api/riskLevelManage"; |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | components :{ |
| | | departmentChart |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | code:'', |
| | | analyseUnitVisible:false, |
| | | analyseUnitFormRules:{ |
| | | hazardDepId: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardDep: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardLiablePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }], |
| | | hazardCode: [{ required: true, message: '安全风险分析对象编码不能为空', trigger: 'blur' }], |
| | | riskUnitName: [{ required: true, message: '安全风险分析单元名称不能为空', trigger: 'blur' }], |
| | |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: null |
| | | hazardDepId: 1 |
| | | }, |
| | | listQuery:{ |
| | | pageIndex:1, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | showDepartmentChart() { |
| | | this.$refs.chart.show() |
| | | }, |
| | | showAnalyseUnitForm(value,type){ |
| | | this.analyseUnitVisible = true |
| | | this.$nextTick(() =>{ |
| | |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: null |
| | | hazardDepId: 1 |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | |
| | | this.analyseUnitForm.hazardLiablePerson = val.realname |
| | | this.analyseUnitForm.hazardLiablePersonId = val.id |
| | | }, |
| | | |
| | | departmentChange(val){ |
| | | this.analyseUnitForm.hazardDep = val.department |
| | | this.analyseUnitForm.hazardDepId = val.id |
| | | }, |
| | | personClear(){ |
| | | this.analyseUnitForm.hazardLiablePerson = null |
| | | this.analyseUnitForm.hazardLiablePersonId = null |
| | | }, |
| | | |
| | | departmentClear(){ |
| | | this.analyseUnitForm.hazardDep = null |
| | | this.analyseUnitForm.hazardDepId = null |
| | | }, |
| | | refreshHandle(){ |
| | | this.getAnalyseUnitData() |
| | | }, |
| | |
| | | .analyseUnit_input{ |
| | | width:320px; |
| | | } |
| | | .image{ |
| | | width:70%; |
| | | height:70%; |
| | | } |
| | | </style> |