| | |
| | | <!-- </div>--> |
| | | <div class="basic_search"> |
| | | <span>生产装置名称:</span> |
| | | <el-input v-model="listQuery.name" class="analyseUnit_input"> |
| | | <el-input v-model="listQuery.produceDeviceName" class="analyseUnit_box"> |
| | | </el-input> |
| | | </div> |
| | | <div class="basic_search"> |
| | |
| | | ></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.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" |
| | | :value="item.id" |
| | | :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> |
| | | <!-- <div class="basic_search">--> |
| | | <!-- <span>区域位置:</span>--> |
| | | <!-- <el-input v-model="listQuery.location" class="analyseUnit_box">--> |
| | | <!-- </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> |
| | |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="生产装置名称" prop="name" align="center"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="depName" label="所属部门" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="风险等级" prop="level" align="center"> |
| | | <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.level | parseLevel}} |
| | | <el-tag :type="scope.row.riskLevel === 1 ? 'success' : scope.row.riskLevel === 2 ? 'info' : scope.row.riskLevel === 3 ? 'warning' : 'danger'"> |
| | | {{ parseNumber(scope.row.riskLevel, '风险等级') }} |
| | | </el-tag> |
| | | </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="depName" align="center"> |
| | | </el-table-column> |
| | | <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="editUname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="最后修改时间" prop="editTime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="status" align="center"> |
| | | <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="status" label="状态" show-overflow-tooltip> |
| | | <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-tag :type="scope.row.status === 1 ? 'primary' : 'warning'"> |
| | | {{ parseNumber(scope.row.status, '状态') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></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="showRiskSourceForm(scope.row,'编辑')">编辑</el-button> |
| | |
| | | </div> |
| | | <el-dialog :title="title" :visible.sync="riskSourceVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> |
| | | <el-form ref="riskSourceForm" :rules="riskSourceFormRules" :model="riskSourceForm" label-position="right" label-width="165px"> |
| | | <el-form-item label="生产装置名称" prop="name"> |
| | | <el-input v-model="riskSourceForm.name" class="analyseUnit_input"> |
| | | <el-form-item label="生产装置名称" prop="produceDeviceName"> |
| | | <el-input v-model="riskSourceForm.produceDeviceName" class="analyseUnit_input" placeholder="请输入生产装置名称"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="风险等级" prop="level"> |
| | | <el-select v-model="riskSourceForm.level" class="analyseUnit_input"> |
| | | <el-option |
| | | v-for="item in levelList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="可能导致事故的主要原因" prop="accidentDesc"> |
| | | <el-input v-model="riskSourceForm.accidentDesc" class="analyseUnit_input"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="区域位置" prop="location"> |
| | | <el-input v-model="riskSourceForm.location" class="analyseUnit_input"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属部门" prop="depId"> |
| | | <el-select v-model="riskSourceForm.depId" class="analyseUnit_input"> |
| | | <el-select v-model="riskSourceForm.depId" class="analyseUnit_input" placeholder="请选择所属部门"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="风险等级" prop="riskLevel"> |
| | | <el-select v-model="riskSourceForm.riskLevel" class="analyseUnit_input" placeholder="请选择风险等级"> |
| | | <el-option |
| | | v-for="item in levelList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="区域位置" prop="location"> |
| | | <el-input v-model="riskSourceForm.location" class="analyseUnit_input" placeholder="请填写区域位置"> |
| | | </el-input> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <div align="right"> |
| | | <el-button @click="riskSourceVisible = false">取消</el-button> |
| | |
| | | importDialogFormVisible:false, |
| | | riskSourceVisible:false, |
| | | riskSourceFormRules:{ |
| | | name: [{ required: true, message: '风险源名称不能为空', trigger: 'blur' }], |
| | | level: [{ required: true, message: '风险等级不能为空', trigger: 'change' }], |
| | | accidentDesc: [{ required: true, message: '可能导致事故的主要原因不能为空', trigger: 'blur' }], |
| | | location: [{ required: true, message: '区域位置不能为空', trigger: 'blur' }], |
| | | depId: [{ required: true, message: '所属部门不能为空', trigger: 'change' }], |
| | | produceDeviceName: [{ required: true, message: '请填写生产装置名称', trigger: 'blur' }], |
| | | depId: [{ required: true, message: '请选择部门', trigger: 'change' }], |
| | | riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], |
| | | location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] |
| | | }, |
| | | riskSourceForm:{ |
| | | accidentDesc: "", |
| | | produceDeviceName: '', |
| | | depId: null, |
| | | editUid: null, |
| | | id: null, |
| | | level: null, |
| | | location: "", |
| | | name: "", |
| | | riskLevel: null, |
| | | location: '' |
| | | }, |
| | | listQuery:{ |
| | | startTime:'', |
| | | endTime:'', |
| | | status:'', |
| | | level:'', |
| | | depId:'', |
| | | depName:'', |
| | | location:'', |
| | | pageIndex:1, |
| | | pageSize:10, |
| | | name:'', |
| | | riskLevel: null, |
| | | status: 1, |
| | | depId:null, |
| | | produceDeviceName: null |
| | | }, |
| | | } |
| | | }, |
| | |
| | | this.listLoading = true |
| | | let res = await getRiskSourceList(this.listQuery) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = JSON.parse(res.data.message).totalCount |
| | | this.riskSourceData = res.data.result |
| | | this.recordTotal = res.data.count |
| | | this.riskSourceData = res.data.data |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | |
| | | } |
| | | } |
| | | }, |
| | | parseNumber (value,type) { |
| | | if (type === '风险等级') { |
| | | return this.levelList.find((item) => item.id === value).name; |
| | | } else if (type === '状态') { |
| | | return this.statusList.find((item) => item.id === value).name; |
| | | } |
| | | }, |
| | | showRiskSourceForm(value,type){ |
| | | this.riskSourceVisible = true |
| | | this.$nextTick(() =>{ |
| | |
| | | if(type === '新增'){ |
| | | this.title = '新增' |
| | | this.riskSourceForm = { |
| | | accidentDesc: "", |
| | | produceDeviceName: '', |
| | | depId: null, |
| | | editUid: null, |
| | | id: null, |
| | | level: null, |
| | | location: "", |
| | | name: "", |
| | | riskLevel: null, |
| | | location: '' |
| | | } |
| | | }else{ |
| | | this.title = '编辑' |
| | | for( let key in this.riskSourceForm){ |
| | | this.riskSourceForm[key] = JSON.parse(JSON.stringify(value))[key] |
| | | } |
| | | this.riskSourceForm.id = JSON.parse(JSON.stringify(value)).id |
| | | } |
| | | }, |
| | | submitRiskSourceForm(){ |
| | |
| | | padding-bottom: 10px; |
| | | } |
| | | .analyseUnit_input{ |
| | | width:90%; |
| | | } |
| | | .analyseUnit_box{ |
| | | width:200px; |
| | | } |
| | | </style> |