| | |
| | | </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="hazardDep"> |
| | | <el-select v-model="analyseUnitForm.hazardDep" value-key="item" class="analyseUnit_input" @change="departmentChange" @clear="departmentClear" clearable filterable> |
| | | <el-form-item label="责任部门" prop="hazardDepId"> |
| | | <el-select v-model="analyseUnitForm.hazardDepId" class="analyseUnit_input" @change="departmentChange" clearable filterable> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | | :value="item" |
| | | :value="item.id" |
| | | :label="item.department" |
| | | ></el-option> |
| | | </el-select> |
| | | </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" clearable filterable> |
| | | <el-form-item label="责任人" prop="hazardLiablePersonId"> |
| | | <el-select v-model="analyseUnitForm.hazardLiablePersonId" class="analyseUnit_input" clearable filterable> |
| | | <el-option |
| | | v-for="item in userList" |
| | | v-for="item in departmentUserList" |
| | | :key="item.id" |
| | | :label="item.realname" |
| | | :value="item" |
| | | :value="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | analyseUnitData: [], |
| | | departmentList:[], |
| | | userList:[], |
| | | departmentUserList:[], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | |
| | | importDialogFormVisible:false, |
| | | analyseUnitVisible:false, |
| | | analyseUnitFormRules:{ |
| | | hazardDep: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardLiablePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }], |
| | | hazardDepId: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], |
| | | hazardLiablePersonId: [{ 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: "", |
| | |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: 1 |
| | | hazardDepId: null |
| | | }, |
| | | listQuery:{ |
| | | pageIndex:1, |
| | |
| | | this.analyseUnitForm = { |
| | | id: null, |
| | | hazardCode: "", |
| | | hazardDep: "", |
| | | hazardLiablePerson: "", |
| | | riskUnitName: "", |
| | | createTime: "", |
| | | updateTime: "", |
| | |
| | | updateBy: "", |
| | | validFlag: null, |
| | | hazardLiablePersonId: null, |
| | | hazardDepId: 1 |
| | | hazardDepId: null |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | | this.analyseUnitForm = value |
| | | this.analyseUnitForm.hazardDepId = value.hazardDepId |
| | | this.departmentChange() |
| | | this.analyseUnitForm = JSON.parse(JSON.stringify(value)) |
| | | } |
| | | }, |
| | | submitAnalyseUnit(){ |
| | |
| | | return jsonData.map(v => filterVal.map(j => v[j])) |
| | | }, |
| | | |
| | | personChange(val){ |
| | | 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 |
| | | departmentChange(){ |
| | | this.analyseUnitForm.hazardLiablePersonId = null |
| | | }, |
| | | departmentClear(){ |
| | | this.analyseUnitForm.hazardDep = null |
| | | this.analyseUnitForm.hazardDepId = null |
| | | this.departmentUserList = this.userList.filter( item => item.department === this.analyseUnitForm.hazardDepId) |
| | | console.log(this.departmentUserList) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getAnalyseUnitData() |