forked from xxhjsb/hbt-prevention-ui
Compare commits
23 Commits
master
...
kongyeqing
| Author | SHA1 | Date |
|---|---|---|
|
|
a930cbf338 | |
|
|
748be50781 | |
|
|
c15160e682 | |
|
|
2e07bad9cd | |
|
|
969a3fe1fd | |
|
|
4326768a2b | |
|
|
a2b47a315e | |
|
|
d76d951c2f | |
|
|
088c113af0 | |
|
|
b715d9e86d | |
|
|
0608cdd7c0 | |
|
|
b956f31151 | |
|
|
12d1d4aad2 | |
|
|
6cb7a20083 | |
|
|
564ce831e2 | |
|
|
c1efb4549a | |
|
|
4c8063c87e | |
|
|
8976191796 | |
|
|
39135ebc1b | |
|
|
f1f66ae87e | |
|
|
385b163a0e | |
|
|
cdef5d6121 | |
|
|
4e1028b914 |
|
|
@ -5,9 +5,9 @@ VUE_APP_TITLE = 汉邦唐全真数字服务平台
|
|||
# 网关地址
|
||||
VUE_APP_GATEWAY_URL="/dev-api"
|
||||
# 服务地址
|
||||
VUE_APP_BASE_API_URL="http://192.168.2.3:8081/"
|
||||
VUE_APP_BASE_API_URL="http://192.168.2.187:8081"
|
||||
# 服务前-- 请严格遵守格式 不允许换行
|
||||
VUE_APP_SERVICE_PREFIX= '{"system":"/system","prevention":"/prevention-yx"}'
|
||||
VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file-zy","prevention":"/prevention-yx"}'
|
||||
# 是否显示全部菜单
|
||||
VUE_APP_ALL_MENU = false
|
||||
# 微前端地址
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ VUE_APP_TITLE = 汉邦唐全真数字服务平台
|
|||
# 网关地址
|
||||
VUE_APP_GATEWAY_URL="/prod-api"
|
||||
# 服务地址
|
||||
VUE_APP_BASE_API_URL="http://192.168.2.3:8081"
|
||||
VUE_APP_BASE_API_URL="http://192.168.2.187:8080"
|
||||
# 服务前-- 请严格遵守格式 不允许换行
|
||||
VUE_APP_SERVICE_PREFIX= '{"knowledge":"/knowledge","system":"/system"}'
|
||||
# 是否显示全部菜单
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "test",
|
||||
"name": "prevention",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
"hbt-common": "0.0.7",
|
||||
"mapbox-gl": "^2.15.0",
|
||||
"mockjs": "^1.1.0",
|
||||
"moment": "^2.29.4",
|
||||
"screenfull": "^6.0.2",
|
||||
"vue": "^2.6.14",
|
||||
"vue-class-component": "^7.2.3",
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ body{
|
|||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.mapboxgl-map{
|
||||
min-height: 400px;
|
||||
}
|
||||
.v-modal{
|
||||
z-index: 98 !important;
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
|
|
@ -12,9 +12,9 @@ import Mock from "mockjs"
|
|||
// import { MockData } from './mock';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
// Vue.config.warnHandler = ()=>{
|
||||
Vue.config.warnHandler = ()=>{
|
||||
|
||||
// }
|
||||
}
|
||||
document.title = process.env.VUE_APP_TITLE || '汉邦唐全真数字服务平台';
|
||||
|
||||
// if(process.env.NODE_ENV==="development"){
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,36 +4,37 @@
|
|||
<span>{{modelMap[viewModel]}}</span>
|
||||
<div class="actions">
|
||||
<div class="btn" @click="drawScreenFull">全屏</div>
|
||||
<i class="btn el-icon-close" @click="visible=false"></i>
|
||||
<i class="btn el-icon-close" @click="closePop()"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-box">
|
||||
<div class="update-box">
|
||||
<div class="form-box">
|
||||
<FormComponent v-if="viewModel!=='list'" labelWidth="56px" :fullBtn="true" :btnPosition="'center'" @change="change" :data.sync="updateParams" @actionCallback="callback" :options="options" :actions="actions"></FormComponent>
|
||||
<FormComponent v-if="viewModel!=='list'" labelWidth="56px" :isReadonly="isReadonly" :fullBtn="true" :btnPosition="'center'" @change="change" :data.sync="updateParams" @actionCallback="callback" :options="options" :actions="actions"></FormComponent>
|
||||
<FormComponent v-else labelWidth="56px" @change="change" :data.sync="listParams" :options="listForm" ></FormComponent>
|
||||
</div>
|
||||
<div class="tree-box" v-if="viewModel==='list'">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current
|
||||
<el-tree :data="treeData" :props="{children:'children',label:'name'}" :expand-on-click-node="false" default-expand-all highlight-current
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree" @node-click="handleNodeClick">
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<span class="text-block">{{ node.label }}</span>
|
||||
<span>
|
||||
<el-button
|
||||
v-if="!data.geoJson || data.geoJson==='[]'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => drawNode(data)">
|
||||
绘制
|
||||
</el-button>
|
||||
<!-- <el-tag v-else size="mini" type="success">已绘制</el-tag> -->
|
||||
<el-tag v-else size="mini" type="success">已绘制</el-tag>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div class="map-box" ref="draw">
|
||||
<MapComponent :center="center" @onLoad="getMap"></MapComponent>
|
||||
<MapComponent @onLoad="getMap"></MapComponent>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -46,6 +47,8 @@ import screenfull from "screenfull"
|
|||
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
|
||||
import MapboxDraw from '@mapbox/mapbox-gl-draw';
|
||||
import * as turf from '@turf/turf'
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
@Component({
|
||||
components:{
|
||||
MapComponent,
|
||||
|
|
@ -54,42 +57,10 @@ import * as turf from '@turf/turf'
|
|||
})
|
||||
export default class DrawComponent extends Vue {
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
value: '123',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}];
|
||||
public unitService = new UnitService()
|
||||
public areaService = new AreaService()
|
||||
|
||||
public treeData = [] as any;
|
||||
|
||||
public modelMap = {
|
||||
list:"批量绘制",
|
||||
|
|
@ -109,7 +80,6 @@ export default class DrawComponent extends Vue {
|
|||
}
|
||||
|
||||
public map:any;
|
||||
public center = [-91.874, 42.76];
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
|
|
@ -132,6 +102,8 @@ export default class DrawComponent extends Vue {
|
|||
})
|
||||
@PropSync("model")
|
||||
public viewModel:string;
|
||||
@Prop()
|
||||
public isReadonly:boolean;
|
||||
@PropSync("show",{
|
||||
required:true,
|
||||
default:true
|
||||
|
|
@ -153,6 +125,10 @@ export default class DrawComponent extends Vue {
|
|||
if(this.positions.length){
|
||||
this.flyToCenter(16)
|
||||
}
|
||||
if(this.map){
|
||||
|
||||
this.addAllPolygon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,23 +136,28 @@ export default class DrawComponent extends Vue {
|
|||
onModelChanges(newVal){
|
||||
if(newVal==="list"){
|
||||
this.fromList = true;
|
||||
this.positions = this.getAllFeatures(this.treeData);
|
||||
if(this.positions.length){
|
||||
this.addAllPolygon();
|
||||
}
|
||||
this.setTreeData();
|
||||
}
|
||||
this.buildUpdate()
|
||||
}
|
||||
@Watch("visible",{immediate:true,deep:true})
|
||||
onVisibleChanges(newVal){
|
||||
// console.log("close")
|
||||
// if(!newVal){
|
||||
// }
|
||||
}
|
||||
|
||||
@Emit("onClose")
|
||||
onClose(data){
|
||||
//Emit false
|
||||
}
|
||||
|
||||
created(){
|
||||
// this.positions = [] as any;
|
||||
}
|
||||
|
||||
public flyToCenter(zoom){
|
||||
public flyToCenter(zoom,timer?){
|
||||
if(!this.map ){
|
||||
setTimeout(()=>{
|
||||
this.flyToCenter(zoom)
|
||||
})
|
||||
return
|
||||
}
|
||||
const center = turf.centerOfMass(turf.featureCollection(this.positions));
|
||||
|
|
@ -184,12 +165,24 @@ export default class DrawComponent extends Vue {
|
|||
this.addAllPolygon();
|
||||
}
|
||||
|
||||
public setTreeData(){
|
||||
this.unitService.getUnitTree().then(res=>{
|
||||
this.treeData = res.data;
|
||||
this.positions = this.getAllFeatures(this.treeData);
|
||||
if(this.positions.length && this.map){
|
||||
this.addAllPolygon();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public getMap(map){
|
||||
this.map = map;
|
||||
if(this.viewModel!=="list"){
|
||||
this.map.on('draw.create', this.drawCallback);
|
||||
this.map.on('draw.delete', this.drawCallback);
|
||||
this.map.on('draw.update', this.drawCallback);
|
||||
this.map.on('draw.create', this.drawCallback);
|
||||
this.map.on('draw.delete', this.drawCallback);
|
||||
this.map.on('draw.update', this.drawCallback);
|
||||
if(this.positions.length){
|
||||
this.addAllPolygon();
|
||||
this.flyToCenter(this.fromList?14:16)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -260,9 +253,11 @@ export default class DrawComponent extends Vue {
|
|||
if(!this.map){
|
||||
return
|
||||
}
|
||||
this.map.removeLayer("allDataLayer")
|
||||
this.map.removeLayer("textLayer")
|
||||
this.map.removeSource("allDataSource")
|
||||
if(this.map.getSource("allDataSource")){
|
||||
this.map.removeLayer("allDataLayer")
|
||||
this.map.removeLayer("textLayer")
|
||||
this.map.removeSource("allDataSource")
|
||||
}
|
||||
}
|
||||
|
||||
public drawCallback(e){
|
||||
|
|
@ -273,6 +268,7 @@ export default class DrawComponent extends Vue {
|
|||
}else{
|
||||
this.positions.splice(this.positions.findIndex((item:any)=>item.id===e.features[0].id),1)
|
||||
}
|
||||
console.log(this.positions)
|
||||
}
|
||||
|
||||
public drawScreenFull(){
|
||||
|
|
@ -284,7 +280,7 @@ export default class DrawComponent extends Vue {
|
|||
// 树节点过滤
|
||||
public filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
}
|
||||
|
||||
public change(data,meta){
|
||||
|
|
@ -294,15 +290,22 @@ export default class DrawComponent extends Vue {
|
|||
}
|
||||
|
||||
public handleNodeClick(node){
|
||||
this.positions = JSON.parse(node.geoJson);
|
||||
const geoJson = JSON.parse(node.geoJson);
|
||||
if(!geoJson.length){
|
||||
return
|
||||
}
|
||||
const center = turf.centerOfMass(turf.featureCollection(geoJson));
|
||||
this.map.flyTo({center: center.geometry.coordinates, zoom: 18});
|
||||
}
|
||||
|
||||
public drawNode(data){
|
||||
if(data.area_id){
|
||||
this.params =Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]"},data) as any;
|
||||
if(data.areaId){
|
||||
this.viewModel = "unit"
|
||||
}else{
|
||||
this.viewModel = "area"
|
||||
}
|
||||
|
||||
}
|
||||
// 点击绘制
|
||||
public drawCallBack(){
|
||||
|
|
@ -343,12 +346,16 @@ export default class DrawComponent extends Vue {
|
|||
feature.properties = this.updateParams
|
||||
})
|
||||
this.updateParams.geoJson = JSON.stringify(this.positions);
|
||||
this.params = this.updateParams;
|
||||
if(this.fromList){
|
||||
this.viewModel = "list";
|
||||
this.destoryDraw();
|
||||
|
||||
const service = this.viewModel==='unit'?this.unitService:this.areaService;
|
||||
service.addOrUpdate(this.updateParams,false).then(res=>{
|
||||
this.viewModel = "list";
|
||||
this.destoryDraw();
|
||||
this.setTreeData()
|
||||
})
|
||||
this.onClose(false)
|
||||
}else{
|
||||
this.params = this.updateParams;
|
||||
this.visible = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -359,10 +366,13 @@ export default class DrawComponent extends Vue {
|
|||
if(action.value==="draw"){
|
||||
this.drawCallBack();
|
||||
}else if(action.value==="save"){
|
||||
this.doSave()
|
||||
}else {
|
||||
if(this.fromList){
|
||||
this.viewModel = "list";
|
||||
this.draw.deleteAll()
|
||||
if(this.hasInitDraw){
|
||||
this.draw.deleteAll()
|
||||
}
|
||||
}else{
|
||||
this.visible = false;
|
||||
}
|
||||
|
|
@ -423,10 +433,19 @@ export default class DrawComponent extends Vue {
|
|||
mounted(){
|
||||
}
|
||||
|
||||
|
||||
public closePop(){
|
||||
this.removeMap();
|
||||
this.updateParams = {} as any;
|
||||
this.onClose(false)
|
||||
this.visible = false;
|
||||
}
|
||||
|
||||
public removeMap(){
|
||||
this.map.off('draw.create', this.drawCallback);
|
||||
this.map.off('draw.delete', this.drawCallback);
|
||||
this.map.off('draw.update', this.drawCallback);
|
||||
this.removeLayer();
|
||||
this.map.remove();
|
||||
this.map = null;
|
||||
}
|
||||
|
|
@ -445,6 +464,9 @@ export default class DrawComponent extends Vue {
|
|||
.el-tree-node__content{
|
||||
height: auto;
|
||||
}
|
||||
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .el-button--text{
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
}
|
||||
.draw-box{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="map" :id="id"></div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Emit, Prop, Vue } from 'vue-property-decorator';
|
||||
import { Component, Emit, Prop, PropSync, Vue } from 'vue-property-decorator';
|
||||
import mapboxgl from "mapbox-gl";
|
||||
import "mapbox-gl/dist/mapbox-gl.css"
|
||||
@Component
|
||||
|
|
@ -15,7 +15,7 @@ export default class MapComponent extends Vue {
|
|||
})
|
||||
id:string;
|
||||
|
||||
@Prop({
|
||||
@PropSync("position",{
|
||||
required:false,
|
||||
default:()=>{
|
||||
return [118.751353,31.969568]
|
||||
|
|
@ -39,7 +39,7 @@ export default class MapComponent extends Vue {
|
|||
// accessToken :"pk.eyJ1IjoiMTgzODI0ZHl0IiwiYSI6ImNqbHExNDVjZzI0ZmUza2wxMDhocnlyem4ifQ.FZoJzmqTtli8hAvvAc1OPA",
|
||||
container: this.id,
|
||||
style: 'mapbox://styles/mapbox/streets-v9',
|
||||
center: [118.751353,31.969568],
|
||||
center: this.center,
|
||||
zoom: 16,
|
||||
});
|
||||
this.map.on("load",()=>{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,553 @@
|
|||
<template>
|
||||
<!-- 排查任务 -->
|
||||
<div v-if="visible">
|
||||
<FormComponent :options="triUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="updataParams"
|
||||
:isReadonly="isReadonly" :actions="subActions" @actionCallback="callback($event)" :full-btn="true"
|
||||
btnPosition="center" @change="change">
|
||||
<div class="sub-title">排查任务制定</div>
|
||||
<TableComponent :tableData="updataParams.tasks" :tableColumn="tableColumn" @actionCallback="taskAdd($event)"
|
||||
:actions="!isReadonly ? tableActions : []" actionPosition="flex-start" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updataParams.tasks" tooltip-effect="dark" height="250" border
|
||||
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showTaskModel(scope.row, true)">查看</el-button>
|
||||
<el-button :v-if="!isReadonly" type="text" @click="showTaskModel(scope.row)">编辑</el-button>
|
||||
<el-button :v-if="!isReadonly" type="text" @click="deleteTask(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'新增'" :visible.sync="showSubUpdate" width="700px"
|
||||
:before-close="handleCloseTask">
|
||||
<FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="taskUpdataParams" :actions="subActions" :full-btn="true" btnPosition="center"
|
||||
@actionCallback="taskCallback" @change="taskSelectChange">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import FormComponent from 'hbt-common/components/common/form.component.vue';
|
||||
import { Component, Emit, Prop, PropSync, Vue, Watch } from 'vue-property-decorator';
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue"
|
||||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
import WorkService from '@/service/work.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
import SystemService from "hbt-common/service/system.service"
|
||||
import JobHazardService from '@/service/jobHazard.service';
|
||||
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
|
||||
import { L_COLUMN, L_VALUE, S_COLUMN, S_VALUE } from '@/mock/lsRisk';
|
||||
import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk';
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
UnitTreeComponent,
|
||||
ButtonListComponent,
|
||||
}
|
||||
})
|
||||
export default class MeasureComponent extends Vue {
|
||||
|
||||
public systemService = new SystemService();
|
||||
|
||||
public dictData = {
|
||||
measuresSort: [],
|
||||
|
||||
} as any;
|
||||
//任务排查
|
||||
public currentTaskData = { datas: [], deleteIds: [] } as any;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public triUpdateOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
public secondTypeItem = [];
|
||||
|
||||
// public updataParams = {} as any;
|
||||
|
||||
//实施措施
|
||||
public currentMeasureData = {
|
||||
datas: [],
|
||||
deleteIds: [],
|
||||
} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public showSubUpdate = false;
|
||||
|
||||
|
||||
//管控措施
|
||||
public measuresSelectData = {} as any;
|
||||
|
||||
public measuresUpdateForm() {
|
||||
this.triUpdateOptions = [{
|
||||
name: "管控方式",
|
||||
key: "controlWay",
|
||||
format: "controlWayName",
|
||||
type: "select",
|
||||
width: "100%",
|
||||
require: true,
|
||||
datas: this.$store.state.prevention_measure_type
|
||||
}, {
|
||||
name: "管控措施分类",
|
||||
key: "firstType",
|
||||
format: "firstTypeName",
|
||||
type: "treeSelect",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
width: "40%",
|
||||
datas: this.dictData.measuresSort
|
||||
}, {
|
||||
key: "secondType",
|
||||
type: "treeSelect",
|
||||
format: "secondTypeName",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
width: "25%",
|
||||
datas: this.secondTypeItem
|
||||
}, {
|
||||
key: "thirdType",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "25%",
|
||||
}, {
|
||||
|
||||
name: "措施描述",
|
||||
key: "description",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "100%"
|
||||
}];
|
||||
}
|
||||
|
||||
//排查任务制定
|
||||
public taskUpdateOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
//排查任务
|
||||
public taskUpdataParams = {} as any;
|
||||
|
||||
//排查任务类型
|
||||
public taskType = [] as any;
|
||||
|
||||
public tasksSelectData = {} as any;
|
||||
|
||||
//包报对应像
|
||||
public taskItem = [] as any;
|
||||
|
||||
public taskIsReadonly = false;
|
||||
|
||||
public taskCurrentId = -1;
|
||||
|
||||
public taskUpdateForm() {
|
||||
this.taskUpdateOptions = [{
|
||||
name: "是否为重大危险源包保责任履职",
|
||||
key: "insuranceDutyFlag",
|
||||
format: "insuranceDutyFlagName",
|
||||
type: "radio",
|
||||
width: "100%",
|
||||
labelWidth: 'auto',
|
||||
require: true,
|
||||
datas: [
|
||||
{
|
||||
name: "否",
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
name: "是",
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: "任务类型",
|
||||
key: "taskType",
|
||||
format: "taskTypeName",
|
||||
type: "treeSelect",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.taskType,
|
||||
expandLevel: Infinity,
|
||||
disable: !(this.taskUpdataParams.insuranceDutyFlag === 1),
|
||||
}, {
|
||||
name: "包保任务对应项",
|
||||
key: "taskItem",
|
||||
format: "taskItemName",
|
||||
type: "treeSelect",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
hide: !(this.taskUpdataParams.insuranceDutyFlag === 1),
|
||||
datas: this.taskItem
|
||||
}, {
|
||||
name: "隐患排查任务",
|
||||
key: "name",
|
||||
type: "text",
|
||||
width: "100%",
|
||||
require: true,
|
||||
}, {
|
||||
name: "执行岗位",
|
||||
key: "executePostCode",
|
||||
format: "executePostName",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.$store.state.postList,
|
||||
},
|
||||
{
|
||||
name: "责任人",
|
||||
key: "chargeUserId",
|
||||
format: "chargeUserName",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.$store.state.userList,
|
||||
}, {
|
||||
name: "排查周期",
|
||||
key: "reviewCycleValue",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
}, {
|
||||
key: "reviewCycleUnit",
|
||||
type: "select",
|
||||
require: true,
|
||||
format: 'reviewCycleValueName',
|
||||
datas: this.$store.state.prevention_cycle_unit
|
||||
}, {
|
||||
name: "工作开始时间",
|
||||
key: "startTime",
|
||||
type: "time",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
|
||||
}, {
|
||||
name: "工作结束时间",
|
||||
key: "endTime",
|
||||
type: "time",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
|
||||
}]
|
||||
}
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "fourSubAdd",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
@Prop()
|
||||
public isReadonly: boolean;
|
||||
@PropSync("show", {
|
||||
required: true,
|
||||
default: true
|
||||
})
|
||||
public visible: boolean;
|
||||
@PropSync("data", {
|
||||
required: true,
|
||||
})
|
||||
public updataParams!: any;
|
||||
@PropSync("tabledata", {
|
||||
required: true,
|
||||
})
|
||||
public measureData!: any;
|
||||
|
||||
created() {
|
||||
this.dictData.measuresSort = this.$store.state.prevention_measures_sort.map((item) => {
|
||||
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
|
||||
return {
|
||||
label: item.name,
|
||||
id: item.value,
|
||||
}
|
||||
})
|
||||
this.secondTypeItem = this.measuresSelectData[this.updataParams.firstType]
|
||||
if (this.updataParams.tasks && this.updataParams.tasks.length > 0) {
|
||||
this.updataParams.tasks.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
}
|
||||
this.measuresUpdateForm()
|
||||
this.taskUpdateForm()
|
||||
this.buildTable()
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
// 排查任务制定
|
||||
this.tableColumn.push({ name: '序号', key: "index" });
|
||||
this.tableColumn.push({ name: "任务名称", key: "name" })
|
||||
this.tableColumn.push({ name: "执行岗位", key: "executePostName" })
|
||||
this.tableColumn.push({ name: "执行人", key: "chargeUserName" })
|
||||
this.tableColumn.push({ name: "执行周期", key: "reviewCycleValue" })
|
||||
this.tableColumn.push({
|
||||
name: "单位", key: "reviewCycleUnit", render: (data) => {
|
||||
return this.$store.getters.prevention_cycle_unit_map[data.reviewCycleUnit]
|
||||
}
|
||||
})
|
||||
}
|
||||
public change(data, item) {
|
||||
//措施类型
|
||||
if (item && item.key === 'controlWay') {
|
||||
this.updataParams.controlWayName = this.$store.getters.prevention_measure_type_map[data]
|
||||
}
|
||||
//措施一
|
||||
if (item && item.key === "firstType") {
|
||||
this.updataParams.firstTypeName = this.selectName(this.dictData.measuresSort, data)
|
||||
this.secondTypeItem = this.measuresSelectData[data]
|
||||
}
|
||||
//措施二
|
||||
if (item && item.key === 'secondType') {
|
||||
this.updataParams.secondTypeName = this.selectName(this.secondTypeItem, data)
|
||||
}
|
||||
this.measuresUpdateForm()
|
||||
}
|
||||
|
||||
public selectName(selectGroup, data) {
|
||||
if (selectGroup && selectGroup.length > 0) {
|
||||
const map = {};
|
||||
selectGroup.forEach((item: any) => {
|
||||
if (item.value) {
|
||||
map[item.value] = item.name
|
||||
} else if (item.id) {
|
||||
map[item.id] = item.label
|
||||
}
|
||||
|
||||
})
|
||||
return map[data]
|
||||
}
|
||||
}
|
||||
|
||||
public treeSelectData(data) {
|
||||
return data.map((item) => {
|
||||
return {
|
||||
label: item.dictLabel,
|
||||
id: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
//排查任务
|
||||
public showTaskModel(row, isReadonly) {
|
||||
this.taskType = this.taskItemSelect()
|
||||
if (isReadonly) {
|
||||
this.taskIsReadonly = true
|
||||
this.taskUpdataParams = JSON.parse(JSON.stringify(row))
|
||||
this.taskUpdataParams.taskTypeName = this.$store.getters.prevention_task_type_map[row.taskType]
|
||||
this.taskUpdataParams.reviewCycleValueName = this.$store.getters.prevention_cycle_unit_map[row.reviewCycleUnit]
|
||||
if (this.taskUpdataParams.taskType && this.taskUpdataParams.taskItem) {
|
||||
const taskItemName = {} as any;
|
||||
this.tasksSelectData[row.taskType].map((item) => {
|
||||
taskItemName[item.id] = item.label
|
||||
})
|
||||
this.taskUpdataParams.taskItemName = taskItemName[this.taskUpdataParams.taskItem]
|
||||
}
|
||||
this.taskCurrentId = 0
|
||||
} else if (!isReadonly) {
|
||||
this.taskIsReadonly = false
|
||||
this.taskUpdataParams = JSON.parse(JSON.stringify(row))
|
||||
this.taskCurrentId = 0
|
||||
if (row.insuranceDutyFlag === 0) {
|
||||
this.taskUpdataParams.taskType = 0
|
||||
this.taskUpdataParams.insuranceDutyFlagName = '否'
|
||||
this.taskUpdataParams.taskTypeName = '日常任务'
|
||||
} else if (row.insuranceDutyFlag === 1) {
|
||||
this.taskType = this.taskType.filter(item => item.id !== 0)
|
||||
this.taskUpdataParams.insuranceDutyFlagName = "是"
|
||||
this.taskItem = this.tasksSelectData[this.taskUpdataParams.taskType]
|
||||
}
|
||||
this.taskUpdataParams.executePostCode = parseInt(row.executePostCode)
|
||||
}
|
||||
this.showSubUpdate = true
|
||||
this.taskUpdateForm()
|
||||
}
|
||||
|
||||
//排查任务 --- 包保对应项
|
||||
public taskItemSelect() {
|
||||
return this.$store.state.prevention_task_type.map((item) => {
|
||||
this.tasksSelectData[item.value] = this.treeSelectData(item.children)
|
||||
return {
|
||||
label: item.name,
|
||||
id: item.value,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public handleCloseTask(goOn?) {
|
||||
this.showSubUpdate = false;
|
||||
this.taskIsReadonly = false;
|
||||
this.taskCurrentId = -1;
|
||||
this.taskUpdataParams = {} as any;
|
||||
}
|
||||
|
||||
public taskCallback(data) {
|
||||
if (data && data.value === 'cancel') {
|
||||
this.showSubUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doTaskSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
//排查任务保存
|
||||
public doTaskSave(goOn?) {
|
||||
if (!this.taskUpdataParams.index) {
|
||||
if (!this.updataParams.tasks) {
|
||||
this.updataParams.tasks = []
|
||||
}
|
||||
this.taskUpdataParams.index = this.updataParams.tasks.length + 1;
|
||||
this.updataParams.tasks.push(this.taskUpdataParams);
|
||||
} else {
|
||||
this.updataParams.tasks.splice(this.updataParams.tasks.findIndex(item => item.index === this.taskUpdataParams.index), 1, this.taskUpdataParams)
|
||||
}
|
||||
|
||||
this.updataParams.tasks.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.taskUpdataParams = {} as any;
|
||||
this.showSubUpdate = !!goOn
|
||||
|
||||
}
|
||||
|
||||
public taskAdd() {
|
||||
this.showSubUpdate = true
|
||||
}
|
||||
|
||||
public deleteTask(row) {
|
||||
this.updataParams.tasks.splice(this.updataParams.tasks.findIndex(item => item.index === row.index), 1)
|
||||
if (row.id) {
|
||||
if (!this.updataParams.deleteIds) {
|
||||
this.updataParams.deleteIds = []
|
||||
}
|
||||
this.updataParams.deleteIds.push(row.id)
|
||||
}
|
||||
this.updataParams.tasks.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
}
|
||||
|
||||
//排查任务 -- 下拉选择
|
||||
public taskSelectChange(data, item) {
|
||||
|
||||
if (data !== null && data !== undefined) {
|
||||
if (item && item.key === 'insuranceDutyFlag') {
|
||||
this.taskType = this.taskItemSelect()
|
||||
if (data === 0) {
|
||||
this.taskUpdataParams.taskType = 0
|
||||
this.taskUpdataParams.insuranceDutyFlagName = '否'
|
||||
this.taskUpdataParams.taskTypeName = '日常任务'
|
||||
} else if (data === 1) {
|
||||
this.taskType = this.taskType.filter(item => item.id !== 0)
|
||||
this.taskUpdataParams.taskType = null
|
||||
this.taskUpdataParams.insuranceDutyFlagName = "是"
|
||||
}
|
||||
}
|
||||
|
||||
if (item && item.key === "taskType") {
|
||||
this.taskItem = this.tasksSelectData[data]
|
||||
}
|
||||
// 岗位
|
||||
if (item && item.key === "executePostCode") {
|
||||
this.taskUpdataParams.executePostName = this.$store.getters.post_map[data];
|
||||
}
|
||||
// 执行人
|
||||
if (item && item.key === "chargeUserId") {
|
||||
this.taskUpdataParams.chargeUserName = this.$store.getters.user_map[data];
|
||||
}
|
||||
//任务类型
|
||||
if (item && item.key === 'taskType') {
|
||||
const map = {};
|
||||
this.taskType.forEach((item: any) => {
|
||||
map[item.value] = item.name
|
||||
})
|
||||
this.taskUpdataParams.taskTypeName = map[data]
|
||||
}
|
||||
//任务类型
|
||||
if (item && item.key === 'taskItem') {
|
||||
const map = {};
|
||||
this.taskItem.forEach((item: any) => {
|
||||
map[item.value] = item.name
|
||||
})
|
||||
this.taskUpdataParams.taskItemName = map[data]
|
||||
}
|
||||
this.taskUpdateForm()
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data) {
|
||||
if (data && data.value === 'cancel') {
|
||||
this.visible = false;
|
||||
this.updataParams = {} as any;
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doMeasureSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doMeasureSave(goOn) {
|
||||
if (!this.updataParams.tasks) {
|
||||
this.updataParams.tasks = []
|
||||
}
|
||||
if (!this.updataParams.index) {
|
||||
this.updataParams.index = this.currentMeasureData.datas.length + 1;
|
||||
this.updataParams.tasksNum = this.updataParams.tasks.length
|
||||
this.currentMeasureData.datas.push(this.updataParams);
|
||||
} else {
|
||||
this.updataParams.tasksNum = this.updataParams.tasks.length
|
||||
this.currentMeasureData.datas.splice(this.currentMeasureData.datas.findIndex(item => item.index === this.updataParams.index), 1, this.updataParams)
|
||||
}
|
||||
|
||||
this.currentMeasureData.datas.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.updataParams = {} as any;
|
||||
this.measureData = this.currentMeasureData;
|
||||
this.visible = !!goOn;
|
||||
}
|
||||
//分析法
|
||||
@Emit("actionCallback")
|
||||
actionCallback(data) {
|
||||
//Emit false
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../views/common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
|
||||
<el-tree :data="treeData" :props="{children:'children',label:'name'}" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Emit, Prop, Vue } from 'vue-property-decorator';
|
||||
import mapboxgl from "mapbox-gl";
|
||||
import "mapbox-gl/dist/mapbox-gl.css"
|
||||
import UnitService from '@/service/unit.service';
|
||||
@Component
|
||||
export default class UnitTreeComponent extends Vue {
|
||||
public unitService:UnitService = new UnitService();
|
||||
public treeData = [] as any;
|
||||
|
||||
@Emit("callback")
|
||||
handleNodeClick(data){
|
||||
//
|
||||
}
|
||||
|
||||
created(){
|
||||
this.unitService.getUnitTree().then(res=>{
|
||||
this.treeData = res.data;
|
||||
})
|
||||
}
|
||||
beforeDestory(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.map{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
const L_LECCOLUMN:any=[
|
||||
{
|
||||
key:"grade",
|
||||
name:"分值",
|
||||
width:"80px",
|
||||
},
|
||||
{
|
||||
key:"name",
|
||||
name:"事故、事件或偏差发生的可能性",
|
||||
|
||||
},
|
||||
];
|
||||
|
||||
const L_LECVALUE:any=[
|
||||
{
|
||||
index:1,
|
||||
grade:10,
|
||||
name:"完全可以预料",
|
||||
},
|
||||
{
|
||||
index:2,
|
||||
grade:6,
|
||||
name:"相当可能;或危害的发生不能被发现(没有监测系统);或在现场没有采取防范、监测、保护、控制措施;或在正常情况下经常发生此类事故、事件或偏差",
|
||||
},
|
||||
{
|
||||
index:3,
|
||||
grade:3,
|
||||
name:"可能,但不经常;或危害的发生不容易被发现;现场没有检测系统或保护措施(如没有保护装置、没有个人防护用品等),也未作过任何监测;或未严格按操作规程执行;或在现场有控制措施,但未有效执行或控制措施不当;或危害在预期情况下发生",
|
||||
},
|
||||
{
|
||||
index:4,
|
||||
grade:1,
|
||||
name:"可能性小,完全意外;或危害的发生容易被发现;现场有监测系统或曾经作过监测;或过去曾经发生类似事故、事件或偏差;或在异常情况下发生过类似事故、事件或偏差",
|
||||
},
|
||||
{
|
||||
index:5,
|
||||
grade:0.5,
|
||||
name:"很不可能,可以设想;危害一旦发生能及时发现,并能定期进行监测",
|
||||
},
|
||||
{
|
||||
index:6,
|
||||
grade:0.2,
|
||||
name:"极不可能;有充分、有效的防范、控制、监测、保护措施;或员工安全卫生意识相当高,严格执行操作规程"
|
||||
},
|
||||
{
|
||||
index:7,
|
||||
grade:0.1,
|
||||
name:"实际不可能"
|
||||
}
|
||||
];
|
||||
|
||||
const E_COLUMN:any=[
|
||||
{
|
||||
key:"grade",
|
||||
name:"分值",
|
||||
width:"80px",
|
||||
},
|
||||
{
|
||||
key:"name",
|
||||
name:"频繁程度",
|
||||
},
|
||||
];
|
||||
|
||||
const E_VALUE:any=[
|
||||
{
|
||||
index:1,
|
||||
grade:10,
|
||||
name:"连续暴露"
|
||||
},
|
||||
{
|
||||
index:2,
|
||||
grade:6,
|
||||
name:"每天工作时间内暴露"
|
||||
},
|
||||
{
|
||||
index:3,
|
||||
grade:3,
|
||||
name:"每周一次或偶然暴露"
|
||||
},
|
||||
{
|
||||
index:4,
|
||||
grade:2,
|
||||
name:"每月一次暴露"
|
||||
},
|
||||
{
|
||||
index:5,
|
||||
grade:1,
|
||||
name:"每年几次暴露"
|
||||
},
|
||||
{
|
||||
index:6,
|
||||
grade:0.5,
|
||||
name:"非常罕见地暴露"
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
const C_COLUMN:any=[
|
||||
{
|
||||
key:"grade",
|
||||
name:"分值",
|
||||
width:"80px",
|
||||
},
|
||||
{
|
||||
key:"condition",
|
||||
name:"法律、法规及其他要求",
|
||||
},
|
||||
{
|
||||
key:"person",
|
||||
name:"人员伤亡",
|
||||
},
|
||||
{
|
||||
key:"losses",
|
||||
name:"直接经济损失(万元)",
|
||||
},
|
||||
{
|
||||
key:"stopwork",
|
||||
name:"停工",
|
||||
},
|
||||
{
|
||||
key:"business",
|
||||
name:"公司形象",
|
||||
},
|
||||
];
|
||||
|
||||
const C_VALUE:any=[
|
||||
{
|
||||
index:1,
|
||||
grade:100,
|
||||
condition:"严重违反法律法规和标准",
|
||||
person:"10人以上死亡,或50人以上重伤",
|
||||
losses:"5000以上",
|
||||
stopwork:"公司停产",
|
||||
business:"重大国际、国内影响",
|
||||
},
|
||||
{
|
||||
index:2,
|
||||
grade:40,
|
||||
condition:"违反法律法规和标准",
|
||||
person:"3人以上10人以下死亡,或10人以上50人以下重伤",
|
||||
losses:"1000以上",
|
||||
stopwork:"装置停工",
|
||||
business:"行业内、省内影响",
|
||||
},
|
||||
{
|
||||
index:3,
|
||||
grade:15,
|
||||
condition:"潜在违反法规和标准",
|
||||
person:"3人以下死亡,或10人以下重伤",
|
||||
losses:"100以上",
|
||||
stopwork:"部分装置停工",
|
||||
business:"地区影响",
|
||||
},
|
||||
{
|
||||
index:4,
|
||||
grade:7,
|
||||
condition:"不符合上级或行业的安全方针、制度、规定等",
|
||||
person:"丧失劳动力、截肢、骨折、听力丧失、慢性病",
|
||||
losses:"10万以上",
|
||||
stopwork:"部分设备停工",
|
||||
business:"公司及周边范围",
|
||||
|
||||
},
|
||||
{
|
||||
index:5,
|
||||
grade:2,
|
||||
condition:"不符合公司的安全操作程序、规定",
|
||||
person:"轻微受伤、间歇不舒服",
|
||||
losses:"1万以上",
|
||||
stopwork:"1套设备停工",
|
||||
business:"引人关注,不利于基本的安全卫生要求",
|
||||
},
|
||||
{
|
||||
index:6,
|
||||
grade:1,
|
||||
condition:"完全符合",
|
||||
person:"无伤亡",
|
||||
losses:"1万以下",
|
||||
stopwork:"没有停工",
|
||||
business:"形象没有受损",
|
||||
},
|
||||
];
|
||||
|
||||
export { L_LECCOLUMN,L_LECVALUE,E_COLUMN,E_VALUE,C_COLUMN,C_VALUE }
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
const L_COLUMN:any=[
|
||||
// {
|
||||
// key:"index",
|
||||
// name:"序号",
|
||||
// width:"80px",
|
||||
// },
|
||||
{
|
||||
key:"grade",
|
||||
name:"等级",
|
||||
width:"80px",
|
||||
},
|
||||
{
|
||||
key:"name",
|
||||
name:"标准",
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
const L_VALUE:any=[
|
||||
{
|
||||
index:1,
|
||||
grade:5,
|
||||
name:"在现场没有采取防范、监测、保护、控制措施,或危害的发生不能被发现(没有监测系统),或在正常情况下经常发生此类事故或事件。",
|
||||
},
|
||||
{
|
||||
index:2,
|
||||
grade:4,
|
||||
name:"危害的发生不容易被发现,现场没有检测系统,也未发生过任何监测,或在现场有控制措施,但未有效执行或控制措施不当,或危害发生或预期情况下发生。",
|
||||
},
|
||||
{
|
||||
index:3,
|
||||
grade:3,
|
||||
name:"没有保护措施(如没有保护装置、没有个人防护用品等),或未严格按操作程序执行,或危害的发生容易被发现(现场有监测系统),或曾经作过监测,或过去曾经发生类似事故或事件。",
|
||||
},
|
||||
{
|
||||
index:4,
|
||||
grade:2,
|
||||
name:"危害一旦发生能及时发现,并定期进行监测,或现场有防范控制措施,并能有效执行,或过去偶尔发生事故或事件。",
|
||||
},
|
||||
{
|
||||
index:5,
|
||||
grade:1,
|
||||
name:"有充分、有效的防范、控制、监测、保护措施,或员工安全卫生意识相当高,严格执行操作规程。极不可能发生事故或事件。",
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
const S_COLUMN:any=[
|
||||
// {
|
||||
// key:"index",
|
||||
// name:"序号",
|
||||
// width:"80px",
|
||||
// },
|
||||
{
|
||||
key:"grade",
|
||||
name:"等级",
|
||||
width:"80px",
|
||||
},
|
||||
{
|
||||
key:"condition",
|
||||
name:"法律、法规及其他要求",
|
||||
},
|
||||
{
|
||||
key:"person",
|
||||
name:"人员",
|
||||
},
|
||||
{
|
||||
key:"losses",
|
||||
name:"直接经济损失",
|
||||
},
|
||||
{
|
||||
key:"stopwork",
|
||||
name:"停工",
|
||||
},
|
||||
{
|
||||
key:"business",
|
||||
name:"企业形象",
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
const S_VALUE:any=[
|
||||
{
|
||||
index:1,
|
||||
grade:5,
|
||||
condition:"违反法律、法规和标准",
|
||||
person:"死亡",
|
||||
losses:"100万元以上",
|
||||
stopwork:"部分装置(>2 套)或设备",
|
||||
business:"重大国际影响",
|
||||
},
|
||||
{
|
||||
index:2,
|
||||
grade:4,
|
||||
condition:"潜在违反法规和标准",
|
||||
person:"丧失劳动能力",
|
||||
losses:"50万元以上",
|
||||
stopwork:"2套装置停工、或设备停工",
|
||||
business:"行业内、省内影响",
|
||||
},
|
||||
{
|
||||
index:3,
|
||||
grade:3,
|
||||
condition:"不符合上级公司或行业的安全方针、制度、规定等",
|
||||
person:"截肢、骨折、听力丧失、慢性病",
|
||||
losses:"1万元以上",
|
||||
stopwork:"1 套装置停工或设备",
|
||||
business:"地区影响",
|
||||
},
|
||||
{
|
||||
index:4,
|
||||
grade:2,
|
||||
condition:"不符合企业的安全操作程序、规定",
|
||||
person:"轻微受伤、间歇不舒服",
|
||||
losses:"1万元以下",
|
||||
stopwork:"受影响不大,几乎不停工",
|
||||
business:"公司及周边范围",
|
||||
|
||||
},
|
||||
{
|
||||
index:5,
|
||||
grade:1,
|
||||
condition:"完全符合",
|
||||
person:"无伤亡",
|
||||
losses:"无损失",
|
||||
stopwork:"没有停工",
|
||||
business:"形象没有受损",
|
||||
},
|
||||
];
|
||||
|
||||
export { L_COLUMN,L_VALUE,S_COLUMN,S_VALUE }
|
||||
|
|
@ -12,10 +12,20 @@ export default class AreaService extends BaseService<any>{
|
|||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/user/list';
|
||||
const url = this.prefix.prevention+'/risk/area';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
public getAreaNumber():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/area/number';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
public getQrCode(params){
|
||||
const url = this.prefix.file+'/qrCode/createQrCode';
|
||||
return this.post(url,params)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/area';
|
||||
|
|
|
|||
|
|
@ -6,11 +6,28 @@ export default class DeviceService extends BaseService<any>{
|
|||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
return this.get(url,params,true)
|
||||
const url = this.prefix.prevention+'/device/inventory/getList';
|
||||
return this.post(url,params)
|
||||
}
|
||||
|
||||
public selectById(id):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/device/inventory/detail?id='+id;
|
||||
return this.get(url,null,true)
|
||||
}
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/device/inventory/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/device/inventory/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention +'/device/inventory/delete';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class DeviceService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/device/anal/getList';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
public selectById(id):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/device/anal/detail?id='+id;
|
||||
return this.get(url,null,true)
|
||||
}
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/device/anal/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/device/anal/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention +'/device/anal/delete';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
// 存草稿
|
||||
public addOrDraft(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/device/anal/addDraft';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,11 +6,11 @@ export default class IdentifyService extends BaseService<any>{
|
|||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/risk/identifyinventory/getList';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/risk/identifyinventory';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,11 +6,36 @@ export default class JobHazardService extends BaseService<any>{
|
|||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/job/anal/getList';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
|
||||
const url = this.prefix.prevention+'/job/anal/delete';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
public selectById(id):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/job/anal/detail?id='+id;
|
||||
return this.get(url,null,true)
|
||||
}
|
||||
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/job/anal/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/job/anal/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
// 存草稿
|
||||
public addOrDraft(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/job/anal/addDraft';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class ManagerService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/manage/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/manage';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
public selectById(id:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/manage/'+id;
|
||||
return this.get(url,null,showLoading)
|
||||
}
|
||||
|
||||
public getNumber():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/manage/number';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/manage';
|
||||
if(add){
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,11 +6,13 @@ export default class MeasuresService extends BaseService<any>{
|
|||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/risk/inventory/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/risk/inventory';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class NoteService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/note/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/note';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
public selectById(id:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/note/'+id;
|
||||
return this.get(url,null,showLoading)
|
||||
}
|
||||
|
||||
public getNumber():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/note/number';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/note';
|
||||
if(add){
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class PlanService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/plan/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/plan';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
// 详情
|
||||
public selectById(id:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/plan/'+id;
|
||||
return this.get(url,null,showLoading)
|
||||
}
|
||||
|
||||
public deliver(params:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/plan/deliver';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/plan';
|
||||
if(add){
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public getRecordTabList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/task/table';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public getRecordList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/task/inspect';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
|
||||
public getTroubleList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/trouble/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class RuleService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/standard/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/standard';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
public getNumber():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/standard/number';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/standard';
|
||||
if(add){
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class TableService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/table/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/table';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
public selectById(id:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/table/'+id;
|
||||
return this.get(url,null,showLoading)
|
||||
}
|
||||
|
||||
public getNumber():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/table/number';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/table';
|
||||
if(add){
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class TaskService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/task/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/trouble';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
public selectById(id:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/task/'+id;
|
||||
return this.get(url,null,showLoading)
|
||||
}
|
||||
|
||||
public getNumber():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/trouble/number';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/trouble';
|
||||
if(add){
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public getRecordTabList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/task/table';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public getRecordList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/task/inspect';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
|
||||
public getTroubleList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/trouble/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
|
||||
public addRecord(params: any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/record';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
|
@ -5,16 +5,38 @@ export default class UnitService extends BaseService<any>{
|
|||
constructor(){
|
||||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
public selectByPage(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/list';
|
||||
return this.get(url,params,true)
|
||||
return this.get(url,params,showLoading)
|
||||
}
|
||||
|
||||
public getListByIds(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/list/byareas';
|
||||
return this.get(url,params,showLoading)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/risk/unit';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
|
||||
public getUnitNumber(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
|
||||
public getUnitTree():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/tree';
|
||||
return this.get(url,null)
|
||||
}
|
||||
|
||||
public updateStatus(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/repair';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit';
|
||||
|
|
|
|||
|
|
@ -6,11 +6,24 @@ export default class WorkService extends BaseService<any>{
|
|||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
return this.get(url,params,true)
|
||||
const url = this.prefix.prevention+'/job/inventory/getList';
|
||||
return this.post(url,params,{},true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
const url = this.prefix.prevention+'/job/inventory';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/job/inventory/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/job/inventory/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,13 +8,190 @@ export default new Vuex.Store({
|
|||
deptList:[],
|
||||
deptTreeList:[],
|
||||
userList:[],
|
||||
postList:[],
|
||||
common_yes_no:[],
|
||||
yesNoMap:{
|
||||
0:"否",
|
||||
1:"是"
|
||||
}
|
||||
prevention_dangrous_level:[],
|
||||
prevention_risk_level:[],
|
||||
prevention_safe_reason:[],
|
||||
prevention_dangrous_type:[],
|
||||
prevention_cycle_unit:[],
|
||||
prevention_danger_check_type:[],
|
||||
prevention_danger_resource:[],
|
||||
prevention_danger_type:[],
|
||||
prevention_occur_step:[],
|
||||
prevention_major_type:[],
|
||||
prevention_device_type:[],
|
||||
prevention_serious_result:[],
|
||||
prevention_security_identifier:[],
|
||||
prevention_majorsign:[],
|
||||
prevention_control_level:[],
|
||||
prevention_measure_type:[],
|
||||
prevention_measures_sort:[],
|
||||
prevention_task_type:[],
|
||||
prevention_evaluate_status:[]
|
||||
},
|
||||
getters: {
|
||||
dept_map:(state)=>{
|
||||
const map = {};
|
||||
state.deptList.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
user_map:(state)=>{
|
||||
const map = {};
|
||||
state.userList.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
post_map:(state)=>{
|
||||
const map = {};
|
||||
state.postList.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
common_yes_no_map:(state)=>{
|
||||
const map = {};
|
||||
state.common_yes_no.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_dangrous_level_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_dangrous_level.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_risk_level_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_risk_level.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_safe_reason_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_safe_reason.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_cycle_unit_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_cycle_unit.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_dangrous_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_dangrous_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_danger_check_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_danger_check_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_device_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_device_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_danger_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_danger_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_danger_resource_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_danger_resource.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_major_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_major_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_occur_step_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_occur_step.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_serious_result_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_serious_result.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_security_identifier_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_security_identifier.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_majorsign_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_majorsign.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_control_level_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_control_level.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_measure_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_measure_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_measures_sort_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_measures_sort.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_task_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_task_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_evaluate_status_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_evaluate_status.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
|
||||
|
|
@ -27,9 +204,70 @@ export default new Vuex.Store({
|
|||
setDeptTreeList(state,data){
|
||||
state.deptTreeList = data;
|
||||
},
|
||||
|
||||
setPostList(state,data){
|
||||
state.postList = data;
|
||||
},
|
||||
set_common_yes_no(state,data){
|
||||
state.common_yes_no = data;
|
||||
}
|
||||
},
|
||||
set_prevention_dangrous_level(state,data){
|
||||
state.prevention_dangrous_level = data;
|
||||
},
|
||||
set_prevention_risk_level(state,data){
|
||||
state.prevention_risk_level = data;
|
||||
},
|
||||
set_prevention_safe_reason(state,data){
|
||||
state.prevention_safe_reason = data;
|
||||
},
|
||||
set_prevention_dangrous_type(state,data){
|
||||
state.prevention_dangrous_type = data;
|
||||
},
|
||||
set_prevention_cycle_unit(state,data){
|
||||
state.prevention_cycle_unit = data;
|
||||
},
|
||||
set_prevention_danger_check_type(state,data){
|
||||
state.prevention_danger_check_type = data;
|
||||
},
|
||||
set_prevention_danger_type(state,data){
|
||||
state.prevention_danger_type = data;
|
||||
},
|
||||
set_prevention_danger_resource(state,data){
|
||||
state.prevention_danger_resource = data;
|
||||
},
|
||||
set_prevention_major_type(state,data){
|
||||
state.prevention_major_type = data;
|
||||
},
|
||||
set_prevention_occur_step(state,data){
|
||||
state.prevention_occur_step = data;
|
||||
},
|
||||
set_prevention_device_type(state,data){
|
||||
state.prevention_device_type = data;
|
||||
},
|
||||
set_prevention_serious_result(state,data){
|
||||
state.prevention_serious_result = data;
|
||||
},
|
||||
set_prevention_security_identifier(state,data){
|
||||
state.prevention_security_identifier = data;
|
||||
},
|
||||
set_prevention_majorsign(state,data){
|
||||
state.prevention_majorsign = data;
|
||||
},
|
||||
set_prevention_control_level(state,data){
|
||||
state.prevention_control_level = data;
|
||||
},
|
||||
set_prevention_measure_type(state,data){
|
||||
state.prevention_measure_type = data;
|
||||
},
|
||||
set_prevention_measures_sort(state,data){
|
||||
state.prevention_measures_sort = data;
|
||||
},
|
||||
set_prevention_task_type(state,data){
|
||||
state.prevention_task_type = data
|
||||
},
|
||||
set_prevention_evaluate_status(state,data){
|
||||
state.prevention_evaluate_status = data
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,40 +2,198 @@
|
|||
<router-view></router-view>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import AreaService from '@/service/area.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import SystemService from 'hbt-common/service/system.service';
|
||||
import { Component,Vue } from 'vue-property-decorator';
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
@Component
|
||||
export default class BlankComponent extends Vue {
|
||||
|
||||
public systemService = new SystemService()
|
||||
created(){
|
||||
public systemService = new SystemService();
|
||||
public areaService = new AreaService();
|
||||
public unitService = new UnitService();
|
||||
created() {
|
||||
Promise.all([
|
||||
this.systemService.getDeptTree(),
|
||||
this.systemService.getDeptList(),
|
||||
this.systemService.getUserList({pageSize:0}),
|
||||
this.systemService.getDictData("common_yes_no")
|
||||
]).then(((results:any)=>{
|
||||
this.$store.commit("setDeptTreeList",results[0].data);
|
||||
this.systemService.getUserList({ pageSize: 0 }),
|
||||
this.systemService.getPostList({ pageSize: 1000 }),
|
||||
this.systemService.getDictData("common_yes_no"),
|
||||
this.systemService.getDictData("prevention_dangrous_level"),
|
||||
this.systemService.getDictData("prevention_risk_level"),
|
||||
this.systemService.getDictData("prevention_safe_reason"),
|
||||
this.systemService.getDictData("prevention_dangrous_type"),
|
||||
this.systemService.getDictData("prevention_cycle_unit"),
|
||||
this.systemService.getDictData("prevention_danger_check_type"),
|
||||
this.systemService.getDictData("prevention_danger_resource"),
|
||||
this.systemService.getDictData("prevention_danger_type"),
|
||||
this.systemService.getDictData("prevention_major_type"),
|
||||
this.systemService.getDictData("prevention_occur_step"),
|
||||
this.systemService.getDictData("prevention_device_type"),
|
||||
|
||||
this.$store.commit("setDeptList",results[1].data.map((item)=>{
|
||||
this.systemService.getDictData("prevention_serious_result"),
|
||||
this.systemService.getDictData("prevention_security_identifier"),
|
||||
this.systemService.getDictData("prevention_majorsign"),
|
||||
this.systemService.getDictData("prevention_control_level"),
|
||||
this.systemService.getDictData("prevention_measure_type"),
|
||||
this.systemService.getDictData("prevention_measures_sort"),
|
||||
this.systemService.getDictData("prevention_task_type"),
|
||||
this.systemService.getDictData("prevention_evaluate_status"),
|
||||
]).then(((results: any) => {
|
||||
this.$store.commit("setDeptTreeList", results[0].data);
|
||||
this.$store.commit("setUserList", results[2].data.datas.map((item) => {
|
||||
return {
|
||||
name:item.deptName,
|
||||
value:item.deptId
|
||||
name: item.nickName,
|
||||
value: item.userId
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("setUserList",results[2].data.datas.map((item)=>{
|
||||
|
||||
this.$store.commit("setPostList", results[3].rows.map((item) => {
|
||||
return {
|
||||
name:item.nickName,
|
||||
value:item.userId
|
||||
name: item.postName,
|
||||
value: item.postId
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_common_yes_no",results[3].data.map(item=>{
|
||||
|
||||
|
||||
this.$store.commit("set_common_yes_no", results[4].data.map(item => {
|
||||
return {
|
||||
name:item.dictLabel,
|
||||
value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_dangrous_level", results[5].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_risk_level", results[6].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_safe_reason", results[7].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_dangrous_type", results[8].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_device_type", results[9].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_cycle_unit", results[9].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_danger_check_type", results[10].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_danger_resource", results[11].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_danger_type", results[12].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_major_type", results[13].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_occur_step", results[14].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_device_type", results[15].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_serious_result", results[16].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("set_prevention_security_identifier", results[17].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_majorsign", results[18].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_control_level", results[19].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_measure_type", results[20].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_measures_sort", results[21].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
children: item.children
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_task_type", results[22].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
children: item.children
|
||||
}
|
||||
}))
|
||||
this.$store.commit("set_prevention_evaluate_status", results[23].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("setDeptList", results[1].data.map((item) => {
|
||||
return {
|
||||
name: item.deptName,
|
||||
value: item.deptId
|
||||
}
|
||||
}))
|
||||
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
::v-deep {
|
||||
.color_0 {
|
||||
color: #F56C6C
|
||||
}
|
||||
.color_1 {
|
||||
color: #68C23A
|
||||
}
|
||||
|
|
@ -51,7 +54,10 @@
|
|||
&.active {
|
||||
&::before {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
content: "";
|
||||
background: #68C23A;
|
||||
z-index: 1;
|
||||
|
|
@ -135,4 +141,13 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.tips{
|
||||
color: #F56C6C;
|
||||
margin-left: -43px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: -20px;
|
||||
font-size: 20px;
|
||||
scale:0.5;
|
||||
}
|
||||
|
|
@ -9,21 +9,49 @@ import AreaService from "@/service/area.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import NoteService from '@/service/note.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import MapComponent from "@/components/map.component.vue"
|
||||
import mapboxgl from "mapbox-gl";
|
||||
import moment from 'moment';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
MapComponent
|
||||
},
|
||||
})
|
||||
export default class HiddenDangerClapComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new NoteService();
|
||||
|
||||
public areaService = new AreaService();
|
||||
|
||||
public unitService = new UnitService();
|
||||
|
||||
public areaList = [];
|
||||
|
||||
public unitList = [];
|
||||
|
||||
public params = {} as any;
|
||||
// 是否显示删改查按钮
|
||||
public isBase = true;
|
||||
|
||||
public isAction = false;
|
||||
|
||||
public isPlan = false;
|
||||
|
||||
public tableActionWidth = "150px";
|
||||
|
||||
public isReadonly = false;
|
||||
public account = JSON.parse(localStorage.getItem("account") as string);
|
||||
public showMap = false;
|
||||
public center = [118.751353,31.969568];
|
||||
public marker:any;
|
||||
|
||||
public map:any;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
|
|
@ -55,106 +83,28 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
value:"reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查标题",
|
||||
key:"areaId",
|
||||
name:"整改编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域编号",
|
||||
key:"no",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"区域名称",
|
||||
key:"areaName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"deptId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"isDangrous",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:0
|
||||
},{
|
||||
name:"否",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"重大危险源名称",
|
||||
key:"dangrousName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"重大危险源等级",
|
||||
key:"level",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"一级",
|
||||
value:0
|
||||
},{
|
||||
name:"二级",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
type:"btn",
|
||||
name:"区域绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
type:"primary"
|
||||
}]
|
||||
}];
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
public photoList = [] as any;
|
||||
public fileList = [] as any;
|
||||
|
||||
public showDraw = false;
|
||||
public currentUrl:any;
|
||||
public showFile = false;
|
||||
|
||||
public drawModel = "list";
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
value:"cancel"
|
||||
},{
|
||||
name:"保存并继续添加",
|
||||
name:"保存并下发",
|
||||
value:"saveAndContinue",
|
||||
type:"primary"
|
||||
},{
|
||||
|
|
@ -164,18 +114,332 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
}];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public levelMap = ["","一般隐患","重大隐患"]
|
||||
public reformModeMap = ["","即查即改","限期整改"]
|
||||
|
||||
|
||||
created(){
|
||||
this.loadAreaData()
|
||||
this.loadUnitData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData(){
|
||||
this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
|
||||
this.areaList = res.data.datas.map(item=>{
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(id?){
|
||||
this.unitService.selectByPage({pageSize:1000,areaId:id},false).then((res:any)=>{
|
||||
this.unitList = res.data.datas.map(item=>{
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public buildUpdateForm(){
|
||||
this.updateOptions = [{
|
||||
name:"隐患编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
disable:true
|
||||
},{
|
||||
name:"隐患来源",
|
||||
key:"type",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
disable:true,
|
||||
},{
|
||||
name:"检查区域",
|
||||
key:"areaId",
|
||||
format:"areaName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"检查单元",
|
||||
key:"unitId",
|
||||
format:"unitName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.unitList
|
||||
},{
|
||||
name:"整改标题",
|
||||
key:"title",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查类型",
|
||||
key:"inspectType",
|
||||
format:"inspectTypeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_danger_check_type,
|
||||
},{
|
||||
name:"隐患类别",
|
||||
key:"dangerType",
|
||||
format:"dangerTypeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_danger_type,
|
||||
},{
|
||||
name:"检查人员",
|
||||
key:"inspectUserId",
|
||||
format:"inspectUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList,
|
||||
},{
|
||||
name:"检查时间",
|
||||
key:"inspectTime",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"隐患级别",
|
||||
key:"level",
|
||||
format:"levelName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"一般隐患",
|
||||
value:1
|
||||
},{
|
||||
name:"重大隐患",
|
||||
value:2
|
||||
}]
|
||||
},{
|
||||
name:"整改方式",
|
||||
key:"reformMode",
|
||||
format:"reformModeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"即查即改",
|
||||
value:1
|
||||
},{
|
||||
name:"限期整改",
|
||||
value:2
|
||||
}]
|
||||
},{
|
||||
name:"隐患位置",
|
||||
key:"locationName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
unit:{
|
||||
type:"btn",
|
||||
name:this.isReadonly?"查看定位":"点击定位",
|
||||
value:"fixed",
|
||||
btnType:"primary"
|
||||
}
|
||||
},{
|
||||
name:"隐患分类",
|
||||
key:"classify",
|
||||
format:"classifyName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
},{
|
||||
name:"整改部门",
|
||||
key:"reformDeptId",
|
||||
format:"reformDeptName",
|
||||
type:"treeSelect",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
expandLevel:Infinity,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptTreeList
|
||||
},{
|
||||
name:"整改人员",
|
||||
key:"reformUserId",
|
||||
format:"reformUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList,
|
||||
},{
|
||||
name:"验证人员",
|
||||
key:"verifyUserId",
|
||||
format:"verifyUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList,
|
||||
},{
|
||||
name:"要求整改日期",
|
||||
key:"reformDeadline",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
format:"yyyy-MM-dd HH",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"问题描述",
|
||||
key:"description",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"隐患照片",
|
||||
key:"photo",
|
||||
ref:"photo",
|
||||
type:"upload",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
onSucess:this.onSuccess,
|
||||
onMove:this.onRemove,
|
||||
showError:false,
|
||||
autoUpload:true,
|
||||
onPreview:this.onPreview,
|
||||
accept:"image/png, image/jpeg",
|
||||
listType:"picture-card",
|
||||
fileList:this.photoList,
|
||||
icon:"el-icon-plus",
|
||||
},{
|
||||
name:"相关附件",
|
||||
key:"file",
|
||||
ref:"file",
|
||||
type:"upload",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
onSucess:this.onSuccess2,
|
||||
onMove:this.onRemove2,
|
||||
onPreview:this.onPreview,
|
||||
autoUpload:true,
|
||||
accept:"image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType:"text",
|
||||
tip:this.isReadonly?"":"请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList:this.fileList,
|
||||
btn:[{
|
||||
name:"上传",
|
||||
value:"upload",
|
||||
hide:this.isReadonly,
|
||||
size:"small",
|
||||
type:"primary"
|
||||
}]
|
||||
},{
|
||||
name:"违章人数",
|
||||
key:"violateNumber",
|
||||
type:"number",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
},{
|
||||
name:"专业分类",
|
||||
key:"professionClassify",
|
||||
format:"professionClassifyName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_major_type,
|
||||
},{
|
||||
name:"发生环节",
|
||||
key:"occurNode",
|
||||
format:"occurNodeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_occur_step,
|
||||
},{
|
||||
name:"违反规定条款",
|
||||
key:"violateTerm",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
showError:false,
|
||||
},{
|
||||
name:"隐患整改要求",
|
||||
key:"reformDemand",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
showError:false,
|
||||
}]
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'整改单编号',key:"areaName"});
|
||||
this.tableColumn.push({name:'整改部门',key:"areaName"});
|
||||
this.tableColumn.push({name:'隐患级别',key:"deptName"});
|
||||
this.tableColumn.push({name:'整改单编号',key:"number"});
|
||||
this.tableColumn.push({name:'整改部门',key:"reformDeptName"});
|
||||
this.tableColumn.push({name:'隐患级别',render:(data)=>{
|
||||
return this.levelMap[data.level]
|
||||
}});
|
||||
this.tableColumn.push({name:'隐患状态',key:"person"});
|
||||
this.tableColumn.push({name:'检查人员',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'检查人员',key:"inspectUserName"});
|
||||
}
|
||||
public getMap(map){
|
||||
this.map = map;
|
||||
this.addMarker();
|
||||
}
|
||||
|
||||
public addMarker(){
|
||||
this.marker = new mapboxgl.Marker({draggable:!this.isReadonly})
|
||||
.setLngLat(this.center)
|
||||
.addTo(this.map);
|
||||
this.map.flyTo({center:this.center})
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
if(item && item.key === "areaId"){
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
if(item && item.key === "inspectUserId"){
|
||||
this.updateParams.inspectUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
if(item && item.key === "reformDeptId"){
|
||||
this.updateParams.reformDeptName = this.$store.getters.dept_map[data]
|
||||
}
|
||||
if(item && item.key === "reformUserId"){
|
||||
this.updateParams.reformUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
if(item && item.key === "verifyUserId"){
|
||||
this.updateParams.verifyUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
|
|
@ -192,15 +456,16 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
}else if(data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdateModel(-1)
|
||||
this.showUpdateModel()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
}else if(data.value ==="fixed"){
|
||||
this.showMap = true
|
||||
|
||||
}else if(data.value.indexOf("save")>=0){
|
||||
this.doSave();
|
||||
}else{
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
|
|
@ -213,15 +478,147 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
public showUpdateModel(row?,isRead?){
|
||||
this.isReadonly = !!isRead;
|
||||
this.fileList = [];
|
||||
this.photoList = [];
|
||||
this.updateParams = {
|
||||
type:"随手拍",
|
||||
locationName:"",
|
||||
inspectUserId:this.account.userId,
|
||||
inspectUserName:this.account.nickName,
|
||||
number:null,
|
||||
inspectTime:moment().format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
this.currentId = id;
|
||||
this.showUpdate = true
|
||||
if(!row){
|
||||
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.updateParams.number = res.data;
|
||||
this.center = [118.751353,31.969568];
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}else{
|
||||
if(isRead){
|
||||
delete this.updateParams.photo;
|
||||
}
|
||||
this.tableService.selectById(row.id).then((res:any)=>{
|
||||
Object.assign(this.updateParams,{
|
||||
classifyName:this.$store.getters.prevention_dangrous_type_map[res.data.classify],
|
||||
dangerTypeName:this.$store.getters.prevention_danger_type_map[res.data.dangerType],
|
||||
inspectTypeName:this.$store.getters.prevention_danger_check_type_map[res.data.inspectType],
|
||||
levelName:this.levelMap[res.data.level],
|
||||
occurNodeName:this.$store.getters.prevention_occur_step_map[res.data.occurNode],
|
||||
professionClassifyName:this.$store.getters.prevention_major_type_map[res.data.professionClassify],
|
||||
reformModeName:this.reformModeMap[res.data.reformMode],
|
||||
unitName:(this.unitList.find((item:any)=>item.value===res.data.unitId) as any).name,
|
||||
areaName:(this.areaList.find((item:any)=>item.value===res.data.areaId) as any).name,
|
||||
},res.data)
|
||||
// 地图定位
|
||||
this.center = [res.data.locationLng,res.data.locationLat];
|
||||
this.buildUpdateForm()
|
||||
|
||||
// 获取url
|
||||
if(res.data.resourceId){
|
||||
this.tableService.getFileUrls({ids:res.data.resourceId.split(",")}).then((photos:any)=>{
|
||||
this.photoList = photos.data.map(item=>{
|
||||
return {
|
||||
name:item.originalName,
|
||||
url:item.url,
|
||||
type:item.type,
|
||||
id:item.id
|
||||
}
|
||||
})
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
if(res.data.resourceOtherId){
|
||||
this.tableService.getFileUrls({ids:res.data.resourceOtherId.split(",")}).then((files:any)=>{
|
||||
this.fileList = files.data.map(item=>{
|
||||
return {
|
||||
name:item.originalName,
|
||||
url:item.url,
|
||||
type:item.type,
|
||||
id:item.id
|
||||
}
|
||||
})
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
this.showUpdate = true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public onDragEnd() {
|
||||
const lngLat = this.marker.getLngLat();
|
||||
this.updateParams.locationLng = lngLat.lng;
|
||||
this.updateParams.locationLat = lngLat.lat;
|
||||
this.center = [lngLat.lng,lngLat.lat]
|
||||
// this.updateParams.locationName = lngLat.lng+","+lngLat.lat;
|
||||
this.handleClose()
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
if(this.showMap){
|
||||
this.showMap = false;
|
||||
this.marker.remove();
|
||||
this.marker = null;
|
||||
return
|
||||
}
|
||||
this.showUpdate = false;
|
||||
this.updateParams = {} as any;
|
||||
}
|
||||
|
||||
public onSuccess(res,file,fileList){
|
||||
if(res.code===200){
|
||||
this.photoList.push({
|
||||
name:res.data.originalName,
|
||||
url:res.data.url,
|
||||
type:res.data.type,
|
||||
id:res.data.id
|
||||
});
|
||||
this.updateParams.photo = this.photoList.length
|
||||
}
|
||||
}
|
||||
public onSuccess2(res,file,fileList){
|
||||
if(res.code===200){
|
||||
this.fileList.push({
|
||||
name:res.data.originalName,
|
||||
url:res.data.url,
|
||||
type:res.data.type,
|
||||
id:res.data.id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public onRemove(file,fileList){
|
||||
this.photoList.splice(this.photoList.findIndex(item=>item.id === file.response.data.id),1)
|
||||
this.updateParams.photo = this.photoList.length
|
||||
}
|
||||
public onRemove2(file,fileList){
|
||||
this.fileList.splice(this.fileList.findIndex(item=>item.id === file.response.data.id),1)
|
||||
}
|
||||
|
||||
public onPreview(file){
|
||||
console.log(file)
|
||||
if(file.type.indexOf("png")>=0 || file.type.indexOf("jp")>=0){
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
}else{
|
||||
window.open(file.url,"_blank")
|
||||
}
|
||||
}
|
||||
public doSave(){
|
||||
this.updateParams.resourceId = this.photoList.map(item=>item.id).join(",")
|
||||
this.updateParams.resourceName = this.photoList.map(item=>item.name).join(",")
|
||||
this.updateParams.resourceOtherId = this.fileList.map(item=>item.id).join(",")
|
||||
this.updateParams.resourceOtherName = this.fileList.map(item=>item.name).join(",")
|
||||
this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then(res=>{
|
||||
this.$message.success(!this.updateParams.id?"新增成功!":"编辑成功");
|
||||
this.handleClose();
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -246,4 +643,5 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
<style lang="scss" scoped src="../common.component.scss">
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -2,33 +2,40 @@
|
|||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
:full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
<el-table-column v-if="!isAction" type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" @click="" v-html="item.render(scope.row)" style="pointer-events: none;" @click="showCheckTable($event,scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" :width="rowActionWidth">
|
||||
<el-table-column label="操作" :width="tableActionWidth">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" v-if="isFile" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="showUpdateModel(0)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" v-if="isPlan" @click="showUpdateModel(0)">下发</el-button>
|
||||
<el-button type="text" v-if="isPlan" @click="showUpdateModel(0)">检查情况</el-button>
|
||||
<el-button type="text" v-if="isAction" @click="showUpdateModel(0)">检查</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" v-if="isPlan && !scope.row.status" @click="openSendModel(scope.row)">下发</el-button>
|
||||
<el-button type="text" v-if="isPlan && scope.row.planType===2 && !scope.row.state" @click="changeState(scope.row)">启用</el-button>
|
||||
<el-button type="text" v-if="isPlan && scope.row.planType===2 && scope.row.state" @click="changeState(scope.row)">停用</el-button>
|
||||
<el-button type="text" v-if="isPlan" @click="openRecordModel(scope.row)">检查情况</el-button>
|
||||
<el-button type="text" v-if="isAction && scope.row.status!==2" @click="openRecordModel(scope.row)">检查</el-button>
|
||||
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
|
||||
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button>
|
||||
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">中断</el-button>
|
||||
|
|
@ -41,15 +48,178 @@
|
|||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
<div class="model-box" v-if="showDraw">
|
||||
<div class="mask"></div>
|
||||
<DrawComponent :model="drawModel" :show.sync="showDraw"></DrawComponent>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
<!-- 检查表记录 -->
|
||||
<el-dialog v-if="isPlan || isAction" :close-on-click-modal="false" :title="isPlan?'检查表记录':'检查表'" :visible.sync="showRecord" width="980px"
|
||||
:before-close="handleClose">
|
||||
<div class="full">
|
||||
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
||||
<el-radio-button :label="item.id" v-for="item in tableTabs" :key="item.id">{{item.name}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
<div class="full" style="margin: 20px 0;">
|
||||
<el-table :data="currentTable.tableItems" tooltip-effect="dark" border width="100%" height="250">
|
||||
<el-table-column label="序号" width="60">
|
||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查项目" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemName}}</div>
|
||||
<el-input type="text" v-else v-model="scope.row.name"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查内容" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemContent}}</div>
|
||||
<el-input type="textarea" v-else v-model="scope.row.content"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查依据" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.itemReason}}</div>
|
||||
<el-input type="textarea" v-else v-model="scope.row.reason"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查人">
|
||||
<div slot-scope="scope">{{scope.row.itemExecuteNames}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查结果" width="160px">
|
||||
<div slot-scope="scope">
|
||||
<span v-if="hideActions || isPlan || (isAction && !scope.row.userIds.includes(account.userId))" :class="'color_'+scope.row.itemResult">{{['异常','正常'][scope.row.itemResult]}}</span>
|
||||
<el-radio-group v-else v-model="scope.row.itemResult" >
|
||||
<el-radio :label="1">正常</el-radio>
|
||||
<el-radio :label="0">异常</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查记录" width="280px">
|
||||
<div slot-scope="scope">
|
||||
<span v-if="hideActions || isPlan">{{scope.row.itemRecord}}</span>
|
||||
<el-input v-else type="textarea" v-model="scope.row.itemRecord"></el-input>
|
||||
</div>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sub-title" v-if="!hideActions">隐患登记情况</div>
|
||||
<div class="full" v-if="isAction && !hideActions">
|
||||
<el-button type="success" plain @click="showUpdateModel()" icon="el-icon-plus">添加</el-button>
|
||||
<el-button type="danger" plain @click="callback({value:'delete'})" icon="el-icon-delete">批量删除</el-button>
|
||||
</div>
|
||||
|
||||
<div class="full" style="margin-bottom: 20px;" v-if="!hideActions">
|
||||
<el-table ref="multipleTable" @selection-change="handleSelectionChange" :data="troubleTableData" border tooltip-effect="dark" width="100%" height="250">
|
||||
<el-table-column v-if="isAction" type="selection" label="全选" width="60">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="隐患类型" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope">{{$store.getters.prevention_dangrous_type_map[scope.row.classify]}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="隐患等级" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope">{{levelMap[scope.row.level]}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="整改方式" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope">{{reformModeMap[scope.row.reformMode]}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="隐患描述" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope">
|
||||
{{scope.row.description}}
|
||||
<el-image
|
||||
style="width: 60px; margin-left: 10px;"
|
||||
:src="currentUrl"
|
||||
:preview-src-list="srcList">
|
||||
</el-image>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="整改部门" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope">{{scope.row.reformDeptName}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="责任人">
|
||||
<div slot-scope="scope"> {{scope.row.reformUserName}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" v-if="isAction">
|
||||
<div slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="full" style="text-align: center;" v-if="isAction">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="doCheck" v-if="!hideActions">保存并提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'" :visible.sync="showUpdate" width="980px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="currentId>0" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="callback"
|
||||
<FormComponent ref="form" :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change"
|
||||
btn-position="center"></FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 下发 -->
|
||||
<el-dialog v-if="isPlan" :close-on-click-modal="false" title="下发" :visible.sync="showSend" width="980px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="sendOptions" :data.sync="sendParams" @change="change" :fullBtn="true" btn-position="center" @actionCallback="sendCallback" :actions="updateActions">
|
||||
<div class="full" style="margin-bottom: 20px;">
|
||||
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
||||
<el-radio-button :label="item.id" v-for="item in tableTabs" :key="item.id">{{item.name}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="full" style="margin-bottom: 20px;">
|
||||
<el-table :data="currentTable.tableItems" tooltip-effect="dark" border height="100%" width="100%" style="min-height:400px;">
|
||||
<el-table-column label="序号" width="60">
|
||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查项目" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.name}}</div>
|
||||
<el-input type="text" v-else v-model="scope.row.name"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查内容" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.content}}</div>
|
||||
<el-input type="textarea" v-else v-model="scope.row.content"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查依据" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" v-if="!scope.row.edit">{{scope.row.reason}}</div>
|
||||
<el-input type="textarea" v-else v-model="scope.row.reason"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column label="选择执行人">
|
||||
<div slot-scope="scope">
|
||||
<el-select v-model="scope.row.userList" multiple filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in $store.state.userList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<div slot-scope="scope">
|
||||
<el-button type="text" v-if="!scope.row.edit" @click="scope.row.edit = true">编辑</el-button>
|
||||
<el-button type="text" v-else @click="scope.row.edit = false">确定</el-button>
|
||||
<el-button type="text">删除</el-button>
|
||||
</div>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog v-if="showMap" :close-on-click-modal="false" destroy-on-close title="地图定位" :visible.sync="showMap" width="980px"
|
||||
:before-close="handleClose">
|
||||
<MapComponent @onLoad="getMap"></MapComponent>
|
||||
<div class="full" style="margin-top: 20px; text-align: center;">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onDragEnd">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close width="680px">
|
||||
<img :src="currentUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
@ -5,7 +5,7 @@ import template from "./common.component.html"
|
|||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue"
|
||||
import AreaService from "@/service/area.service"
|
||||
import ManagerService from "@/service/manager.service"
|
||||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
|
|
@ -18,7 +18,7 @@ import DrawComponent from '@/components/draw.component.vue';
|
|||
},
|
||||
})
|
||||
export default class HiddenDangerFilesComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new ManagerService();
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
|
|
@ -35,11 +35,6 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
value:"reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
|
|
@ -54,40 +49,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
name:"反向选择",
|
||||
value:"reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"隐患等级",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"区域1",
|
||||
value:0
|
||||
},{
|
||||
name:"区域2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"隐患分类",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"区域1",
|
||||
value:0
|
||||
},{
|
||||
name:"区域2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"整改方式",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"区域1",
|
||||
value:0
|
||||
},{
|
||||
name:"区域2",
|
||||
value:1
|
||||
}]
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
|
|
@ -199,8 +161,38 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
|
||||
}
|
||||
|
||||
public getTableCallback(){
|
||||
this.formOptions = [{
|
||||
name:"隐患等级",
|
||||
key:"level",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"一般隐患",
|
||||
value:1
|
||||
},{
|
||||
name:"重大隐患",
|
||||
value:2
|
||||
}]
|
||||
},{
|
||||
name:"隐患分类",
|
||||
key:"classify",
|
||||
type:"select",
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
},{
|
||||
name:"整改方式",
|
||||
key:"reformMode",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"即查即改",
|
||||
value:1
|
||||
},{
|
||||
name:"限期整改",
|
||||
value:2
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"areaName"});
|
||||
this.tableColumn.push({name:'隐患整改状态',key:"areaName"});
|
||||
this.tableColumn.push({name:'隐患来源',key:"deptName"});
|
||||
this.tableColumn.push({name:'隐患标题',key:"person"});
|
||||
|
|
|
|||
|
|
@ -2,29 +2,36 @@
|
|||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
:full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-else :prop="item.key" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(0)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -32,15 +39,76 @@
|
|||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
<div class="model-box" v-if="showDraw">
|
||||
<div class="mask"></div>
|
||||
<DrawComponent :model="drawModel" :show.sync="showDraw"></DrawComponent>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="currentId>0" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="callback"
|
||||
btn-position="center"></FormComponent>
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change"
|
||||
btn-position="center">
|
||||
<div class="sub-title" v-if="isManager">检查项目</div>
|
||||
|
||||
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn"
|
||||
@actionCallback="subCallback($event)" actionPosition="flex-start" :actions="!isReadonly?updateTableActions:[]"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
|
||||
<el-table ref="multipleTable" :data="updateParams.tableItems" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" label="全选" width="40" v-if="!isReadonly">
|
||||
</el-table-column>
|
||||
<template v-for="item in updateTableColumn">
|
||||
<el-table-column v-if="item.render" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200" v-if="!isReadonly">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showSubUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showSubUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="doSubDelete([scope.$index])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'" :visible.sync="showSubUpdate"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="subCallback" :actions="updateActions" :full-btn="true" @change="subChange"
|
||||
btn-position="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="'批量添加'" :visible.sync="showSubMutilUpdate"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="mutilAddOptions" @change="loadRuleTable" :data.sync="ruleParams"></FormComponent>
|
||||
<TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn" @pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')"
|
||||
:showFooter="true">
|
||||
|
||||
<el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" label="全选" width="40px" >
|
||||
</el-table-column>
|
||||
<template v-for="item in updateTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
<div class="dis-flex" style="justify-content: center; margin-top: 20px;">
|
||||
<el-button @click="cancelMutilAdd"> 取消</el-button>
|
||||
<el-button type="primary" @click="doMutilAdd"> 确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -5,10 +5,11 @@ import template from "./rules.component.html"
|
|||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue"
|
||||
import AreaService from "@/service/area.service"
|
||||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import RuleService from '@/service/rule.service';
|
||||
import { number } from 'echarts';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
|
|
@ -18,10 +19,14 @@ import DrawComponent from '@/components/draw.component.vue';
|
|||
},
|
||||
})
|
||||
export default class RulesComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new RuleService();
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public isManager = false;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
|
|
@ -54,93 +59,14 @@ export default class RulesComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查项目",
|
||||
key:"areaId",
|
||||
key:"name",
|
||||
type:"text",
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域编号",
|
||||
key:"no",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"区域名称",
|
||||
key:"areaName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"deptId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"isDangrous",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:0
|
||||
},{
|
||||
name:"否",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"重大危险源名称",
|
||||
key:"dangrousName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"重大危险源等级",
|
||||
key:"level",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"一级",
|
||||
value:0
|
||||
},{
|
||||
name:"二级",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
type:"btn",
|
||||
name:"区域绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
type:"primary"
|
||||
}]
|
||||
}];
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
|
||||
public showDraw = false;
|
||||
|
|
@ -168,58 +94,141 @@ export default class RulesComponent extends BaseRecordComponent<any> {
|
|||
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"areaName"});
|
||||
this.tableColumn.push({name:'检查项目',key:"areaName"});
|
||||
this.tableColumn.push({name:'检查内容',key:"deptName"});
|
||||
this.tableColumn.push({name:'检查依据',key:"person"});
|
||||
this.tableColumn.push({name:'分类',key:"isDangrous"});
|
||||
public getTableCallback(){
|
||||
this.updateOptions = [{
|
||||
name:"检查标准编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
disable:true,
|
||||
},{
|
||||
name:"检查项目",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查内容",
|
||||
key:"content",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查依据",
|
||||
key:"reason",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"类型",
|
||||
key:"type",
|
||||
format:"typeName",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'检查项目',key:"name"});
|
||||
this.tableColumn.push({name:'检查内容',key:"content",showTip:true});
|
||||
this.tableColumn.push({name:'检查依据',key:"reason",showTip:true});
|
||||
this.tableColumn.push({name:'分类',key:"type",render:(data)=>{
|
||||
return this.$store.getters.prevention_dangrous_type_map[data.type]
|
||||
}});
|
||||
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
//
|
||||
}
|
||||
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if(data && data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
}else if(data && data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
}else if(data && data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
}else if(data && data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdateModel(-1)
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
}else if(data && data.value === "add"){
|
||||
this.showUpdateModel()
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id));
|
||||
this.clearSelect()
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSave(data.value!=="save")
|
||||
}else{
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
this.params = {
|
||||
name:"",
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public doSave(goOn?){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
|
||||
this.showUpdate = !!goOn;
|
||||
this.updateParams = {number:null} as any;
|
||||
if(goOn){
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.updateParams.number = res.data
|
||||
})
|
||||
}
|
||||
this.getTableData();
|
||||
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
|
||||
public showUpdateModel(row?,isRead?){
|
||||
|
||||
this.updateParams = Object.assign({number:null})
|
||||
this.isReadonly = !!isRead;
|
||||
if(!row){
|
||||
this.currentId = -1;
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.updateParams.number = res.data
|
||||
})
|
||||
}else{
|
||||
this.updateParams = Object.assign({number:null,typeName:this.$store.getters.prevention_dangrous_type_map[row.type]},row)
|
||||
this.currentId = row.id;
|
||||
}
|
||||
this.currentId = id;
|
||||
this.clearSelect();
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public clearSelect(){
|
||||
(this.$refs.multipleTable as any).clearSelection();
|
||||
this.selectData = [];
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
this.showUpdate = false;
|
||||
this.clearSelect();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,13 @@ import template from "./rules.component.html"
|
|||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue"
|
||||
import AreaService from "@/service/area.service"
|
||||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import TableService from '@/service/table.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
import RuleService from '@/service/rule.service';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
|
|
@ -18,20 +21,29 @@ import DrawComponent from '@/components/draw.component.vue';
|
|||
},
|
||||
})
|
||||
export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new TableService();
|
||||
public unitService = new UnitService()
|
||||
public areaService = new AreaService()
|
||||
|
||||
public ruleService = new RuleService()
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public subIsReadonly = false;
|
||||
public isManager = true;
|
||||
|
||||
public areaList = [];
|
||||
public unitList = [];
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
|
|
@ -44,6 +56,24 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
}];
|
||||
public updateTableActions = [{
|
||||
name:"添加",
|
||||
value:"subAdd",
|
||||
plain:true,
|
||||
icon:"el-icon-plus",
|
||||
type:"success"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"subDelete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
},{
|
||||
name:"批量添加",
|
||||
value:"subMutilAdd",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
|
|
@ -54,99 +84,24 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查表名称",
|
||||
key:"areaId",
|
||||
key:"name",
|
||||
type:"text"
|
||||
}];
|
||||
public mutilAddOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域编号",
|
||||
key:"no",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"区域名称",
|
||||
key:"areaName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"deptId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"isDangrous",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:0
|
||||
},{
|
||||
name:"否",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"重大危险源名称",
|
||||
key:"dangrousName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"重大危险源等级",
|
||||
key:"level",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"一级",
|
||||
value:0
|
||||
},{
|
||||
name:"二级",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
type:"btn",
|
||||
name:"区域绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
type:"primary"
|
||||
}]
|
||||
}];
|
||||
|
||||
|
||||
public showDraw = false;
|
||||
|
||||
public drawModel = "list";
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
public updateTableData = {datas:[]};
|
||||
public updateTableColumn = [] as any;
|
||||
public showSubUpdate = false;
|
||||
public showSubMutilUpdate = false;
|
||||
public ruleParams = {
|
||||
pageSize:10,
|
||||
pageNum:1
|
||||
}
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
|
|
@ -161,68 +116,407 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
type:"primary"
|
||||
}];
|
||||
|
||||
public subUpdateOptions = [{
|
||||
name:"检查项目",
|
||||
type:"text",
|
||||
require:true,
|
||||
showError:false,
|
||||
width:"100%",
|
||||
key:"name",
|
||||
},{
|
||||
name:"检查内容",
|
||||
type:"textarea",
|
||||
require:true,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
key:"content",
|
||||
},{
|
||||
name:"检查依据",
|
||||
type:"textarea",
|
||||
require:true,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
key:"reason",
|
||||
}]
|
||||
|
||||
public subUpdateActions = [{
|
||||
name:"取消",
|
||||
value:"cancelSub"
|
||||
},{
|
||||
name:"确定",
|
||||
value:"saveSub",
|
||||
type:"primary"
|
||||
}];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
|
||||
created(){
|
||||
this.loadAreaData();
|
||||
this.loadRuleTable();
|
||||
}
|
||||
|
||||
public loadRuleTable(num?,type?){
|
||||
if(type && num){
|
||||
this.ruleParams[type] = num
|
||||
}else{
|
||||
this.ruleParams = {
|
||||
pageSize:10,
|
||||
pageNum:1
|
||||
}
|
||||
}
|
||||
this.ruleService.selectByPage(this.ruleParams).then((res:any)=>{
|
||||
this.updateTableData = res.data;
|
||||
this.updateTableData.datas.forEach((item:any,index)=>{
|
||||
item.index = index+1;
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
public buildUpdateForm(){
|
||||
|
||||
this.mutilAddOptions = [{
|
||||
name:"检查项目",
|
||||
key:"name",
|
||||
type:"text"
|
||||
},{
|
||||
name:"类型",
|
||||
key:"type",
|
||||
clearable:true,
|
||||
type:"select",
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
this.updateOptions = [{
|
||||
name:"检查表编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
disable:true,
|
||||
},{
|
||||
name:"检查表名称",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"适用区域",
|
||||
key:"areas",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"适用单元",
|
||||
key:"units",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.unitList
|
||||
},{
|
||||
name:"适用对象",
|
||||
key:"targets",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:"0-12312312312"
|
||||
},{
|
||||
name:"否",
|
||||
value:"1-12312312312"
|
||||
}]
|
||||
},{
|
||||
name:"适用部门",
|
||||
key:"depts",
|
||||
multiple:true,
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptList
|
||||
},{
|
||||
name:"适用类型",
|
||||
key:"types",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
multiple:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData(){
|
||||
this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
|
||||
this.areaList = res.data.datas.map(item=>{
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.loadUnitData()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(ids?){
|
||||
this.unitService.getListByIds({areaIds:ids},false).then((res:any)=>{
|
||||
this.unitList = res.data.map(item=>{
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
public getNumber(){
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.updateParams.number = res.data
|
||||
})
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"areaName"});
|
||||
this.tableColumn.push({name:'检查表名称',key:"areaName"});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName"});
|
||||
this.tableColumn.push({name:'单元名称',key:"person"});
|
||||
this.tableColumn.push({name:'对象名称',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'编制部门',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'适用类型',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'编制人',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'编制时间',key:"isDangrous"});
|
||||
this.tableColumn = [];
|
||||
this.tableColumn.push({name:'检查表名称',key:"name"});
|
||||
this.tableColumn.push({name:'区域名称',key:"areas"});
|
||||
this.tableColumn.push({name:'单元名称',key:"units"});
|
||||
this.tableColumn.push({name:'对象名称',key:"targets"});
|
||||
this.tableColumn.push({name:'适用部门',key:"depts"});
|
||||
this.tableColumn.push({name:'适用类型',key:"types",filters:this.$store.state.prevention_dangrous_type.map(item=>{
|
||||
return {
|
||||
text:item.name,
|
||||
value:item.name,
|
||||
}
|
||||
}),filterMethod:(data,row)=>{
|
||||
return row.types.indexOf(data)>=0;
|
||||
}});
|
||||
this.tableColumn.push({name:'编制人',key:"createBy"});
|
||||
this.tableColumn.push({name:'编制时间',key:"createTime"});
|
||||
this.updateTableColumn = [];
|
||||
|
||||
this.updateTableColumn.push({name:'序号',key:"index",width:"60px"});
|
||||
this.updateTableColumn.push({name:'检查项目',key:"name",showTip:true});
|
||||
this.updateTableColumn.push({name:'检查内容',key:"content",showTip:true});
|
||||
this.updateTableColumn.push({name:'检查依据',key:"reason",showTip:true});
|
||||
if(this.showSubMutilUpdate){
|
||||
this.updateTableColumn.push({name:'检查类型',key:"reason",render:(data)=>{
|
||||
return this.$store.getters.prevention_dangrous_type_map[data.type]
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public change(data,item){
|
||||
|
||||
// 区域
|
||||
if(item && item.key==="areas"){
|
||||
if(this.updateParams.units.length){
|
||||
this.updateParams.units = [];
|
||||
}
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if(data && data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
}else if(data &&data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
}else if(data &&data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
}else if(data && data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdateModel(-1)
|
||||
}else if(data.value === "delete"){
|
||||
}else if(data && data.value === "add"){
|
||||
this.showUpdateModel()
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSave(data.value!=="save")
|
||||
}else if(data && data.value === "cancel"){
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
|
||||
public subChange(data,item){
|
||||
//
|
||||
}
|
||||
|
||||
public subCallback(data){
|
||||
if(data && data.value==="subAdd"){
|
||||
this.showSubUpdateModel()
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSubSave(data.value!=="save")
|
||||
}else if(data && data.value==="cancel"){
|
||||
this.handleClose()
|
||||
}else if(data && data.value==="subDelete"){
|
||||
this.doSubDelete(this.selectData.map((item:any)=>item.index -1))
|
||||
}else if(data && data.value==="subMutilAdd"){
|
||||
this.showSubMutilUpdate = true;
|
||||
this.buildTable()
|
||||
this.clearSelect()
|
||||
}
|
||||
}
|
||||
|
||||
public doMutilAdd(){
|
||||
this.selectData.forEach((item:any)=>{
|
||||
if(!this.updateParams.tableItems.find(itm=>itm.id===item.id)){
|
||||
this.updateParams.tableItems.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
})
|
||||
this.clearSelect()
|
||||
this.showSubMutilUpdate=false;
|
||||
this.buildTable();
|
||||
}
|
||||
|
||||
public cancelMutilAdd(){
|
||||
this.clearSelect();
|
||||
this.ruleParams = {
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
}
|
||||
this.showSubMutilUpdate=false;
|
||||
this.buildTable();
|
||||
|
||||
}
|
||||
|
||||
public clearSelect(){
|
||||
(this.$refs.multipleTable as any).clearSelection();
|
||||
this.selectData = [];
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
this.params = {
|
||||
name:"",
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
} as any;
|
||||
|
||||
this.ruleParams = {
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
}
|
||||
}
|
||||
|
||||
public showSubUpdateModel(row?,isRead?){
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = !!isRead;
|
||||
if(row){
|
||||
this.subUpdateParams = JSON.parse(JSON.stringify(row))
|
||||
}
|
||||
this.showSubUpdate = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
public showUpdateModel(row?,isRead?){
|
||||
this.updateParams = {number:null,tableItems:[]} as any;
|
||||
this.isReadonly = !!isRead;
|
||||
this.clearSelect()
|
||||
|
||||
this.buildUpdateForm();
|
||||
if(!row){
|
||||
this.currentId = -1;
|
||||
this.getNumber();
|
||||
this.showUpdate = true;
|
||||
}else{
|
||||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId,true).then((res:any)=>{
|
||||
if(isRead){
|
||||
this.updateParams = Object.assign(res.data,row)
|
||||
}else{
|
||||
this.updateParams = res.data;
|
||||
this.loadUnitData(res.data.areas)
|
||||
}
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
})
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}
|
||||
this.currentId = id;
|
||||
this.showUpdate = true
|
||||
}
|
||||
public doSubSave(goOn?){
|
||||
if(!this.subUpdateParams.index){
|
||||
this.subUpdateParams.index = this.updateParams.tableItems.length+1;
|
||||
this.updateParams.tableItems.push(this.subUpdateParams);
|
||||
}else{
|
||||
this.updateParams.tableItems.splice(this.updateParams.tableItems.findIndex(item=>item.index ===this.subUpdateParams.index),1,this.subUpdateParams)
|
||||
}
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
})
|
||||
this.subUpdateParams = {} as any;
|
||||
this.showSubUpdate = !!goOn
|
||||
}
|
||||
|
||||
public doSubDelete(indexs){
|
||||
for(let i = this.updateParams.tableItems.length-1;i>=0;i--){
|
||||
if(indexs.includes(i)){
|
||||
this.updateParams.tableItems.splice(i,1)
|
||||
}
|
||||
}
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
})
|
||||
this.clearSelect()
|
||||
}
|
||||
|
||||
public doSave(goOn?){
|
||||
this.updateParams.depts = this.updateParams.depts.map(item=>{
|
||||
return {
|
||||
id:item,
|
||||
name:this.$store.getters.dept_map[item]
|
||||
}
|
||||
})
|
||||
|
||||
this.updateParams.targets = this.updateParams.targets.map(item=>{
|
||||
return {
|
||||
id:item,
|
||||
name:item
|
||||
}
|
||||
})
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then(res=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
|
||||
this.getTableData();
|
||||
this.showUpdate = !!goOn;
|
||||
this.updateParams = {areas:[],depts:[],units:[],types:[],targets:[],number:null} as any;
|
||||
})
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
if(this.showSubMutilUpdate){
|
||||
this.showSubMutilUpdate = false;
|
||||
this.buildTable();
|
||||
return
|
||||
}
|
||||
if(this.showSubUpdate){
|
||||
this.showSubUpdate = false;
|
||||
return
|
||||
}
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,21 +9,38 @@ import AreaService from "@/service/area.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import TaskService from '@/service/task.service';
|
||||
import MapComponent from "@/components/map.component.vue"
|
||||
import mapboxgl from "mapbox-gl";
|
||||
import moment from 'moment';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
MapComponent
|
||||
},
|
||||
})
|
||||
export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new TaskService();
|
||||
|
||||
public isAction = true;
|
||||
// 显示计划列表按钮
|
||||
public isPlan = false;
|
||||
// 是否显示删改查按钮
|
||||
public isBase = false;
|
||||
public isFile = false;
|
||||
public tableActionWidth="60px";
|
||||
public statusList = ["","检查中","已检查","未检查"];
|
||||
public account = JSON.parse(localStorage.getItem("account") as string);
|
||||
// 是否隐藏隐患登记情况
|
||||
public hideActions = false;
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
public idReadonly = false;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
|
|
@ -34,162 +51,326 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查项目",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"区域1",
|
||||
value:0
|
||||
},{
|
||||
name:"区域2",
|
||||
value:1
|
||||
}]
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域编号",
|
||||
key:"no",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"区域名称",
|
||||
key:"areaName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"deptId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"isDangrous",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:0
|
||||
},{
|
||||
name:"否",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"重大危险源名称",
|
||||
key:"dangrousName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"重大危险源等级",
|
||||
key:"level",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"一级",
|
||||
value:0
|
||||
},{
|
||||
name:"二级",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
type:"btn",
|
||||
name:"区域绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
type:"primary"
|
||||
}]
|
||||
}];
|
||||
|
||||
|
||||
public showDraw = false;
|
||||
|
||||
public drawModel = "list";
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
value:"cancel"
|
||||
},{
|
||||
name:"保存并继续添加",
|
||||
value:"saveAndContinue",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"save",
|
||||
type:"primary"
|
||||
}];
|
||||
public tableActions = [];
|
||||
public footerActions = [];
|
||||
public formOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
public updateParams = {} as any
|
||||
|
||||
public showRecord = false;
|
||||
public recordParams = {
|
||||
taskId:null,
|
||||
tableId:null,
|
||||
} as any;
|
||||
|
||||
public tableTabs = [] as any;
|
||||
|
||||
public currentTable = {} as any;
|
||||
|
||||
public currentTableId:any = null;
|
||||
|
||||
public troubleTableData = [] as any;
|
||||
public selectData = [];
|
||||
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public showMap = false;
|
||||
public center = [118.751353,31.969568];
|
||||
public marker:any;
|
||||
public isReadonly = false;
|
||||
public fileList = [] as any;
|
||||
public photoList = [] as any;
|
||||
public map:any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = "";
|
||||
|
||||
public levelMap = ["","一般隐患","重大隐患"]
|
||||
public reformModeMap = ["","即查即改","限期整改"]
|
||||
|
||||
created(){
|
||||
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"areaName"});
|
||||
this.tableColumn.push({name:'检查表名称',key:"areaName"});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName"});
|
||||
this.tableColumn.push({name:'单元名称',key:"person"});
|
||||
this.tableColumn.push({name:'对象名称',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'编制部门',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'适用类型',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'编制人',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'编制时间',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'检查名称',key:"planName"});
|
||||
this.tableColumn.push({name:'检查类型',render:(data)=>{
|
||||
return this.$store.getters.prevention_danger_check_type_map[data.inspectType]
|
||||
}});
|
||||
this.tableColumn.push({name:'检查对象',key:"analControlNames"});
|
||||
this.tableColumn.push({name:'检查时间',key:"checkTime"});
|
||||
this.tableColumn.push({name:'检查负责人',key:"chargeUserName"});
|
||||
this.tableColumn.push({name:'检查表',key:"tableNum",render:(data)=>{
|
||||
return "<span class='link'>"+(data.tableNum || 0)+"</span>"
|
||||
}});
|
||||
this.tableColumn.push({name:'数据生成时间',key:"createTime"});
|
||||
this.tableColumn.push({name:'检查周期',key:"inspectCycleValue"});
|
||||
this.tableColumn.push({name:'单位',render:(data)=>{
|
||||
return this.$store.getters.prevention_cycle_unit_map[data.inspectCycleUnit]
|
||||
}});
|
||||
this.tableColumn.push({name:'状态',filters:[{
|
||||
text:"检查中",
|
||||
value:1
|
||||
},{
|
||||
text:"已检查",
|
||||
value:2
|
||||
},{
|
||||
text:"未检查",
|
||||
value:3
|
||||
}],filterMethod:(data,row)=>{
|
||||
return row.status === data
|
||||
},key:"status",render:(data)=>{
|
||||
return "<span class='color_"+(data.status-1)+"'>"+(this.statusList[data.status] || '')+"</span>"
|
||||
|
||||
}});
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public getTableCallback(){
|
||||
this.formOptions = [{
|
||||
name:"检查名称",
|
||||
key:"planName",
|
||||
type:"text",
|
||||
},{
|
||||
name:"检查项目",
|
||||
key:"inspectType",
|
||||
type:"select",
|
||||
datas:this.$store.state.prevention_danger_check_type
|
||||
}];
|
||||
this.updateOptions = [{
|
||||
name:"隐患编号",
|
||||
key:"number",
|
||||
disable:true,
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
type:"text"
|
||||
},{
|
||||
name:"隐患标题",
|
||||
key:"title",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
type:"text"
|
||||
},{
|
||||
name:"隐患描述",
|
||||
width:"100%",
|
||||
key:"description",
|
||||
require:true,
|
||||
showError:false,
|
||||
type:"text"
|
||||
},{
|
||||
name:"隐患级别",
|
||||
key:"level",
|
||||
format:"levelName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"一般隐患",
|
||||
value:1
|
||||
},{
|
||||
name:"重大隐患",
|
||||
value:2
|
||||
}]
|
||||
},{
|
||||
name:"整改方式",
|
||||
key:"reformMode",
|
||||
format:"reformModeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"即查即改",
|
||||
value:1
|
||||
},{
|
||||
name:"限期整改",
|
||||
value:2
|
||||
}]
|
||||
},{
|
||||
name:"隐患位置",
|
||||
key:"locationName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
unit:{
|
||||
type:"btn",
|
||||
name:this.isReadonly?"查看定位":"点击定位",
|
||||
value:"fixed",
|
||||
btnType:"primary"
|
||||
}
|
||||
},{
|
||||
name:"隐患分类",
|
||||
key:"classify",
|
||||
format:"classifyName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
},{
|
||||
name:"整改部门",
|
||||
key:"reformDeptId",
|
||||
format:"reformDeptName",
|
||||
type:"treeSelect",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
expandLevel:Infinity,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptTreeList
|
||||
},{
|
||||
name:"整改责任人",
|
||||
key:"reformUserId",
|
||||
format:"reformUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList,
|
||||
},{
|
||||
name:"验证人",
|
||||
key:"verifyUserId",
|
||||
format:"verifyUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList,
|
||||
},{
|
||||
name:"整改时限",
|
||||
key:"reformDeadline",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
format:"yyyy-MM-dd HH",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"隐患类别",
|
||||
key:"dangerType",
|
||||
format:"dangerTypeName",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_danger_type,
|
||||
},{
|
||||
name:"隐患照片",
|
||||
key:"photo",
|
||||
ref:"photo",
|
||||
type:"upload",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
onSucess:this.onSuccess,
|
||||
onMove:this.onRemove,
|
||||
showError:false,
|
||||
autoUpload:true,
|
||||
onPreview:this.onPreview,
|
||||
accept:"image/png, image/jpeg",
|
||||
listType:"picture-card",
|
||||
fileList:this.photoList,
|
||||
icon:"el-icon-plus",
|
||||
},{
|
||||
name:"相关附件",
|
||||
key:"file",
|
||||
ref:"file",
|
||||
type:"upload",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
onSucess:this.onSuccess2,
|
||||
onMove:this.onRemove2,
|
||||
onPreview:this.onPreview,
|
||||
autoUpload:true,
|
||||
accept:"image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType:"text",
|
||||
tip:this.isReadonly?"":"请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList:this.fileList,
|
||||
btn:[{
|
||||
name:"上传",
|
||||
value:"upload",
|
||||
hide:this.isReadonly,
|
||||
size:"small",
|
||||
type:"primary"
|
||||
}]
|
||||
},{
|
||||
name:"违章人数",
|
||||
key:"violateNumber",
|
||||
type:"number",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
},{
|
||||
name:"专业分类",
|
||||
key:"professionClassify",
|
||||
format:"professionClassifyName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_major_type,
|
||||
},{
|
||||
name:"属性分类",
|
||||
key:"attributeClassify",
|
||||
format:"attributeClassifyName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_safe_reason,
|
||||
},{
|
||||
name:"发生环节",
|
||||
key:"occurNode",
|
||||
format:"occurNodeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_occur_step,
|
||||
},{
|
||||
name:"违反规定条款",
|
||||
key:"violateTerm",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
showError:false,
|
||||
},{
|
||||
name:"隐患整改要求",
|
||||
key:"reformDemand",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
showError:false,
|
||||
}]
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
if(item && item.key === "inspectUserId"){
|
||||
this.updateParams.inspectUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
if(item && item.key === "reformDeptId"){
|
||||
this.updateParams.reformDeptName = this.$store.getters.dept_map[data]
|
||||
}
|
||||
if(item && item.key === "reformUserId"){
|
||||
this.updateParams.reformUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
if(item && item.key === "verifyUserId"){
|
||||
this.updateParams.verifyUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public callback(data,type){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData()
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
this.getTableData()
|
||||
|
|
@ -202,18 +383,31 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdateModel(-1)
|
||||
}else if(data.value === "delete"){
|
||||
console.log(this.selectData)
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
this.getTroubleList();
|
||||
}else if(data.value ==="fixed"){
|
||||
this.showMap = true
|
||||
|
||||
}else if(data.value.indexOf("save")>=0){
|
||||
this.doSave();
|
||||
}else{
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
|
||||
public doSave(){
|
||||
this.updateParams.resourceId = this.photoList.map(item=>item.id).join(",")
|
||||
this.updateParams.resourceName = this.photoList.map(item=>item.name).join(",")
|
||||
this.updateParams.resourceOtherId = this.fileList.map(item=>item.id).join(",")
|
||||
this.updateParams.resourceOtherName = this.fileList.map(item=>item.name).join(",")
|
||||
this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then(res=>{
|
||||
this.$message.success(!this.updateParams.id?"新增成功!":"编辑成功");
|
||||
this.handleClose();
|
||||
this.getTroubleList();
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
this.params = {
|
||||
|
|
@ -222,19 +416,210 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
} as any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
}
|
||||
this.currentId = id;
|
||||
this.showUpdate = true
|
||||
public getMap(map){
|
||||
this.map = map;
|
||||
this.addMarker();
|
||||
}
|
||||
public addMarker(){
|
||||
this.marker = new mapboxgl.Marker({draggable:!this.isReadonly})
|
||||
.setLngLat(this.center)
|
||||
.addTo(this.map);
|
||||
this.map.flyTo({center:this.center})
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
this.showUpdate = false;
|
||||
if(this.showMap){
|
||||
this.showMap = false;
|
||||
this.marker.remove();
|
||||
this.marker = null;
|
||||
return
|
||||
}
|
||||
if(this.showUpdate){
|
||||
this.showUpdate = false;
|
||||
this.updateParams = {} as any;
|
||||
return
|
||||
}
|
||||
if(this.showRecord){
|
||||
if(this.hideActions){
|
||||
this.hideActions = false;
|
||||
}
|
||||
this.showRecord = false;
|
||||
this.recordParams = {
|
||||
taskId:null,
|
||||
tableId:null,
|
||||
|
||||
}
|
||||
this.tableTabs = [];
|
||||
this.currentTable = {} as any;
|
||||
this.currentTableId = null
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
public onDragEnd() {
|
||||
const lngLat = this.marker.getLngLat();
|
||||
this.updateParams.locationLng = lngLat.lng;
|
||||
this.updateParams.locationLat = lngLat.lat;
|
||||
this.center = [lngLat.lng,lngLat.lat]
|
||||
// this.updateParams.locationName = lngLat.lng+","+lngLat.lat;
|
||||
this.handleClose()
|
||||
}
|
||||
|
||||
|
||||
public onSuccess(res,file,fileList){
|
||||
if(res.code===200){
|
||||
this.photoList.push({
|
||||
name:res.data.originalName,
|
||||
url:res.data.url,
|
||||
type:res.data.type,
|
||||
id:res.data.id
|
||||
});
|
||||
this.updateParams.photo = this.photoList.length || null
|
||||
}
|
||||
}
|
||||
public onSuccess2(res,file,fileList){
|
||||
if(res.code===200){
|
||||
this.fileList.push({
|
||||
name:res.data.originalName,
|
||||
url:res.data.url,
|
||||
type:res.data.type,
|
||||
id:res.data.id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public onRemove(file,fileList){
|
||||
this.photoList.splice(this.photoList.findIndex(item=>item.id === file.response.data.id),1)
|
||||
this.updateParams.photo = this.photoList.length
|
||||
}
|
||||
public onRemove2(file,fileList){
|
||||
this.fileList.splice(this.fileList.findIndex(item=>item.id === file.response.data.id),1)
|
||||
}
|
||||
|
||||
public onPreview(file){
|
||||
if(file.type.indexOf("png")>=0 || file.type.indexOf("jp")>=0){
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
}else{
|
||||
window.open(file.url,"_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public showUpdateModel(row?,isRead?){
|
||||
this.isReadonly = !!isRead;
|
||||
this.fileList = [];
|
||||
this.photoList = [];
|
||||
this.updateParams = {
|
||||
taskId:this.recordParams.taskId,
|
||||
locationName:"",
|
||||
inspectUserId:this.account.userId,
|
||||
inspectUserName:this.account.nickName,
|
||||
number:null,
|
||||
planId:this.recordParams.planId,
|
||||
inspectTime:moment().format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
if(!row){
|
||||
this.tableService.getNumber().then(res=>{
|
||||
this.updateParams.number = res.data;
|
||||
this.center = [118.751353,31.969568];
|
||||
this.getTableCallback();
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}else{
|
||||
|
||||
if(isRead){
|
||||
delete this.updateParams.photo;
|
||||
}
|
||||
|
||||
Object.assign(this.updateParams,{
|
||||
classifyName:this.$store.getters.prevention_dangrous_type_map[row.classify],
|
||||
dangerTypeName:this.$store.getters.prevention_danger_type_map[row.dangerType],
|
||||
inspectTypeName:this.$store.getters.prevention_danger_check_type_map[row.inspectType],
|
||||
levelName:this.levelMap[row.level],
|
||||
attributeClassifyName:this.$store.getters.prevention_safe_reason_map[row.attributeClassify],
|
||||
professionClassifyName:this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||
reformModeName:this.reformModeMap[row.reformMode],
|
||||
},row)
|
||||
// 获取url
|
||||
if(row.resourceId){
|
||||
this.tableService.getFileUrls({ids:row.resourceId.split(",")}).then((photos:any)=>{
|
||||
this.photoList = photos.data.map(item=>{
|
||||
return {
|
||||
name:item.originalName,
|
||||
url:item.url,
|
||||
type:item.type,
|
||||
id:item.id
|
||||
}
|
||||
})
|
||||
this.getTableCallback()
|
||||
})
|
||||
}
|
||||
if(row.resourceOtherId){
|
||||
this.tableService.getFileUrls({ids:row.resourceOtherId.split(",")}).then((files:any)=>{
|
||||
this.fileList = files.data.map(item=>{
|
||||
return {
|
||||
name:item.originalName,
|
||||
url:item.url,
|
||||
type:item.type,
|
||||
id:item.id
|
||||
}
|
||||
})
|
||||
this.getTableCallback()
|
||||
})
|
||||
}
|
||||
|
||||
this.center = [row.locationLng,row.locationLat];
|
||||
|
||||
this.showUpdate = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public openRecordModel(row){
|
||||
this.showRecord = true;
|
||||
this.recordParams.taskId = row.id;
|
||||
this.recordParams.planId = row.planId
|
||||
this.getTabsData()
|
||||
this.getTroubleList();
|
||||
}
|
||||
public getTabsData(){
|
||||
this.tableService.getRecordTabList(this.recordParams).then((res:any)=>{
|
||||
this.tableTabs = res.data.map(item=>{
|
||||
return {
|
||||
name:item.tableName,
|
||||
id:item.tableId,
|
||||
tableItems:[]
|
||||
}
|
||||
})
|
||||
this.tableTabs.forEach(async item=>{
|
||||
this.recordParams.tableId = item.id;
|
||||
const datas = (await this.tableService.getRecordList(this.recordParams)).data as any;
|
||||
item.tableItems = datas.map(subItem=>{
|
||||
subItem.userIds = subItem.itemExecuteIds?subItem.itemExecuteIds.split(",").map(id=>+id):[];
|
||||
// 属于自己的必填 未避免多集检索 默认正常
|
||||
if(subItem.userIds.includes(this.account.userId)){
|
||||
console.log(subItem.userIds)
|
||||
if(!subItem.itemResult && subItem.itemResult!==0){
|
||||
subItem.itemResult = 1
|
||||
}
|
||||
}
|
||||
return subItem
|
||||
})
|
||||
})
|
||||
this.currentTableId = this.tableTabs[0].id;
|
||||
this.currentTable = this.tableTabs[0]
|
||||
})
|
||||
}
|
||||
|
||||
public getTroubleList(){
|
||||
this.tableService.getTroubleList(this.recordParams).then(res=>{
|
||||
this.troubleTableData = res.data
|
||||
})
|
||||
}
|
||||
|
||||
public sendTabChange(data){
|
||||
this.currentTable = this.tableTabs.find(item=>item.id===data)
|
||||
}
|
||||
|
||||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
|
|
@ -255,6 +640,46 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
public handleSelectionChange(data){
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public doCheck(){
|
||||
const params = [] as any;
|
||||
let total = 0;
|
||||
this.tableTabs.forEach(item=>{
|
||||
total+=item.tableItems.length;
|
||||
item.tableItems.forEach(subItem=>{
|
||||
console.log(subItem)
|
||||
if(subItem.userIds.includes(this.account.userId)){
|
||||
params.push({
|
||||
content:subItem.itemRecord,
|
||||
resultFlag:subItem.itemResult,
|
||||
taskTableId:subItem.itemId,
|
||||
taskId:this.recordParams.taskId,
|
||||
inspectUserId:this.account.userId,
|
||||
inspectUserName:this.account.nickName,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableService.addRecord({
|
||||
dangerInspectTaskRecords:params,
|
||||
total,
|
||||
}).then(res=>{
|
||||
this.$message.success("检查成功");
|
||||
this.handleClose();
|
||||
this.getTableData()
|
||||
})
|
||||
}
|
||||
|
||||
public showCheckTable(el,data){
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if(isTarget){
|
||||
this.hideActions = true;
|
||||
this.openRecordModel(data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ import AreaService from "@/service/area.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import PlanService from '@/service/plan.service';
|
||||
import SystemService from 'hbt-common/service/system.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import TableService from '@/service/table.service';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
|
|
@ -18,7 +22,15 @@ import DrawComponent from '@/components/draw.component.vue';
|
|||
},
|
||||
})
|
||||
export default class PlanComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new PlanService();
|
||||
|
||||
public systemService = new SystemService();
|
||||
|
||||
public areaService = new AreaService();
|
||||
|
||||
public unitService = new UnitService();
|
||||
|
||||
public checkTableService = new TableService();
|
||||
|
||||
public params = {} as any;
|
||||
// 是否显示删改查按钮
|
||||
|
|
@ -26,6 +38,22 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
// 显示计划列表按钮
|
||||
public isPlan = true;
|
||||
|
||||
public isFile = false;
|
||||
|
||||
public isAction = false;
|
||||
|
||||
public isReadonly = false;
|
||||
public isManager = false;
|
||||
|
||||
public showSend = false;
|
||||
|
||||
public showRecord = false;
|
||||
|
||||
public tableActionWidth="300px"
|
||||
|
||||
public levelMap = ["","一般隐患","重大隐患"]
|
||||
public reformModeMap = ["","即查即改","限期整改"]
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
|
|
@ -58,107 +86,27 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查标题",
|
||||
key:"areaId",
|
||||
key:"name",
|
||||
type:"text",
|
||||
}];
|
||||
|
||||
public sendOptions = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域编号",
|
||||
key:"no",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"区域名称",
|
||||
key:"areaName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"deptId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"isDangrous",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:0
|
||||
},{
|
||||
name:"否",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"重大危险源名称",
|
||||
key:"dangrousName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"重大危险源等级",
|
||||
key:"level",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"一级",
|
||||
value:0
|
||||
},{
|
||||
name:"二级",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
type:"btn",
|
||||
name:"区域绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
type:"primary"
|
||||
}]
|
||||
}];
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
|
||||
public showDraw = false;
|
||||
|
||||
public drawModel = "list";
|
||||
public areaList = [] as any;
|
||||
public areaMap = {} as any;
|
||||
public unitList = [] as any;
|
||||
public unitMap = {} as any;
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
value:"cancel"
|
||||
},{
|
||||
name:"保存并继续添加",
|
||||
value:"saveAndContinue",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"save",
|
||||
|
|
@ -166,67 +114,493 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public troubleTableData = [] as any;
|
||||
|
||||
public planType = [{
|
||||
name:"单次计划",
|
||||
value:1,
|
||||
},{
|
||||
name:"长期计划",
|
||||
value:2,
|
||||
}];
|
||||
public planTypeMap = {
|
||||
1:"单次计划",
|
||||
2:"长期计划"
|
||||
}
|
||||
|
||||
public stateMap = ["停用","启用"];
|
||||
|
||||
public sendParams = {
|
||||
tables:[]
|
||||
} as any;
|
||||
|
||||
public recordParams = {
|
||||
taskId:null,
|
||||
tableId:null,
|
||||
} as any;
|
||||
|
||||
public recordData = {} as any;
|
||||
public tableTabs = [] as any;
|
||||
public currentTable = {} as any;
|
||||
|
||||
public currentTableId:any = null;
|
||||
|
||||
public currentSendRow:any;
|
||||
|
||||
public currentPlan:any;
|
||||
|
||||
|
||||
|
||||
|
||||
created(){
|
||||
|
||||
this.loadAreaData();
|
||||
this.loadUnitData();
|
||||
this.getCheckList();
|
||||
}
|
||||
|
||||
public buildUpdateForm(){
|
||||
this.updateOptions = [{
|
||||
name:"计划类型",
|
||||
key:"planType",
|
||||
type:"radio",
|
||||
width:"100%",
|
||||
format:"planTypeName",
|
||||
require:true,
|
||||
disable:this.updateParams.id,
|
||||
showError:false,
|
||||
datas:this.planType
|
||||
},{
|
||||
name:"检查标题",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"类型",
|
||||
key:"inspectType",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
format:"inspectTypeName",
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_danger_check_type
|
||||
},{
|
||||
name:"巡检周期",
|
||||
key:"inspectCycleValue",
|
||||
type:"number",
|
||||
hide:this.updateParams.planType===1,
|
||||
controls:false,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"巡检周期单位",
|
||||
key:"inspectCycleUnit",
|
||||
format:"inspectCycleUnitName",
|
||||
type:"select",
|
||||
hide:this.updateParams.planType===1,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_cycle_unit
|
||||
},{
|
||||
name:"检查区域",
|
||||
key:"areaIds",
|
||||
format:"areaNames",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"检查单元",
|
||||
key:"unitIds",
|
||||
format:"unitNames",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
multiple:true,
|
||||
showError:false,
|
||||
datas:this.unitList
|
||||
},{
|
||||
name:"检查对象",
|
||||
key:"analControlIds",
|
||||
format:"analControlNames",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
multiple:true,
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"是",
|
||||
value:"1-123123123"
|
||||
},{
|
||||
name:"否",
|
||||
value:"0-1231221312"
|
||||
}]
|
||||
},{
|
||||
name:"计划检查时间",
|
||||
key:"startTime",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
hide:this.updateParams.planType===1,
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查时间",
|
||||
key:"time",
|
||||
type:"date",
|
||||
hide:this.updateParams.planType===2,
|
||||
subType:"datetimerange",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"检查负责人",
|
||||
key:"chargeUserId",
|
||||
format:"chargeUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
filterable:true,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
name:"检查范围",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"scope",
|
||||
require:true,
|
||||
showError:false,
|
||||
placeholder:"请输入检查范围"
|
||||
|
||||
},{
|
||||
name:"检查目的",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"purpose",
|
||||
require:true,
|
||||
showError:false,
|
||||
placeholder:"请输入检查目的"
|
||||
|
||||
}]
|
||||
}
|
||||
|
||||
public getCheckList(){
|
||||
this.checkTableService.selectByPage({pageSize:1000}).then((res:any)=>{
|
||||
this.sendOptions = [{
|
||||
name:"选择检查表",
|
||||
key:"tables",
|
||||
type:"select",
|
||||
require:true,
|
||||
width:"600px",
|
||||
multiple:true,
|
||||
showError:false,
|
||||
datas:res.data.datas.map(item=>{
|
||||
return{
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
})
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData(){
|
||||
this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
|
||||
this.areaList = res.data.datas.map(item=>{
|
||||
this.areaMap[item.id]=item.name;
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(ids?){
|
||||
this.unitService.getListByIds({areaIds:ids},false).then((res:any)=>{
|
||||
this.unitList = res.data.map(item=>{
|
||||
this.unitMap[item.id]=item.name;
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'检查标题',key:"areaName"});
|
||||
this.tableColumn.push({name:'检查类型',key:"areaName"});
|
||||
this.tableColumn.push({name:'检查时间',key:"deptName"});
|
||||
this.tableColumn.push({name:'检查负责人',key:"person"});
|
||||
this.tableColumn.push({name:'检查范围',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'发现隐患数量',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'检查标题',key:"name",width:"100px"});
|
||||
this.tableColumn.push({name:'检查类型',width:"100px",render:(data)=>{
|
||||
return this.$store.getters.prevention_danger_check_type_map[data.inspectType]
|
||||
}});
|
||||
this.tableColumn.push({name:'检查时间',width:"270px",render:(data)=>{
|
||||
return data.startTime + (data.endTime?'~'+data.endTime:"")
|
||||
}});
|
||||
this.tableColumn.push({name:'检查负责人',key:"chargeUserName",width:"100px"});
|
||||
this.tableColumn.push({name:'检查范围',width:"270px",key:"scope"});
|
||||
this.tableColumn.push({name:'发现隐患数量',key:"dangerCount",width:"120px"});
|
||||
this.tableColumn.push({name:'检查类型',render:(data)=>{
|
||||
return this.planTypeMap[data.planType]
|
||||
}});
|
||||
this.tableColumn.push({name:'状态',render:(data)=>{
|
||||
return data.planType==1?"--":`<span class="color_${data.state}">${this.stateMap[data.state]}</span>`
|
||||
}});
|
||||
}
|
||||
// 构建下发列表数据
|
||||
public buildSendTable(datas){
|
||||
// 因为保存的时候需要提交所有的列表 所以要把所有的列表都查出来
|
||||
if(!datas.length){
|
||||
this.tableTabs = [];
|
||||
this.currentTableId=null;
|
||||
this.currentTable = {tableItems:[]} as any
|
||||
|
||||
}
|
||||
datas.forEach(async (item)=>{
|
||||
if(this.tableTabs.find(items=>items.id === item)){
|
||||
return false
|
||||
}
|
||||
const data = (await this.checkTableService.selectById(item)).data as any;
|
||||
data.tableItems = data.tableItems.map(itm=>{
|
||||
return Object.assign({
|
||||
edit:false,
|
||||
tableId:data.id,
|
||||
tableItemId:itm.id,
|
||||
tableName:data.name,
|
||||
userList:[this.currentPlan.chargeUserId],
|
||||
},itm)
|
||||
})
|
||||
|
||||
if(!this.currentTableId){
|
||||
this.currentTableId = data.id;
|
||||
this.currentTable = data;
|
||||
}
|
||||
this.tableTabs.push(data)
|
||||
});
|
||||
for(let i = this.tableTabs.length-1;i>=0;i--){
|
||||
const item = this.tableTabs[i];
|
||||
if(!datas.includes(item.id)){
|
||||
this.tableTabs.splice(i,1)
|
||||
}
|
||||
}
|
||||
console.log(this.tableTabs)
|
||||
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public sendTabChange(data){
|
||||
this.currentTable = this.tableTabs.find(item=>item.id===data)
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
if(item && item.key === "tables"){
|
||||
this.buildSendTable(data);
|
||||
}
|
||||
if(item && item.key === "planType"){
|
||||
this.buildUpdateForm();
|
||||
}
|
||||
if(item && item.key === "areaIds"){
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
if(item && item.key === "chargeUserId"){
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
if(item && item.key==="analControlIds"){
|
||||
this.updateParams.analControls = data.map((itm)=>{
|
||||
return {
|
||||
id:itm,
|
||||
name:itm
|
||||
}
|
||||
})
|
||||
}
|
||||
if(item && item.key === "time"){
|
||||
if(data && data.length){
|
||||
this.updateParams.startTime = data[0]
|
||||
this.updateParams.endTime = data[1]
|
||||
}else{
|
||||
this.updateParams.startTime = null
|
||||
this.updateParams.endTime = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data,type){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if(data && data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
}else if(data && data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
}else if(data && data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
}else if(data && data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdateModel(-1)
|
||||
}else if(data.value === "delete"){
|
||||
}else if(data && data.value === "add"){
|
||||
this.showUpdateModel()
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
}else if(data && data.value === "save"){
|
||||
this.doSave()
|
||||
}else if(data && data.value === "cancel"){
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
|
||||
public sendCallback(data){
|
||||
if(data && data.value === "save"){
|
||||
this.tableService.deliver({
|
||||
deliverContents:this.tableTabs.map(item=>item.tableItems).flat(1).map(item=>{
|
||||
item.executor = item.userList.map(userId=>{
|
||||
return{
|
||||
id:userId,
|
||||
name:this.$store.getters.user_map[userId]
|
||||
}
|
||||
})
|
||||
return item
|
||||
}),
|
||||
planReq:this.currentPlan,
|
||||
}).then(()=>{
|
||||
this.$message.success("下发成功!")
|
||||
this.currentPlan=null;
|
||||
this.showSend = false;
|
||||
this.tableTabs = [];
|
||||
this.sendParams.tables = [];
|
||||
this.getTableData()
|
||||
})
|
||||
}else if(data && data.value === "cancel"){
|
||||
this.handleClose()
|
||||
}
|
||||
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
this.params = {
|
||||
name:"",
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
// 打开增改查弹窗
|
||||
public showUpdateModel(row?,isRead?){
|
||||
this.isReadonly = !!isRead;
|
||||
if(row){
|
||||
this.updateParams = Object.assign({
|
||||
analControls:row.analControlIds,
|
||||
planTypeName:this.planTypeMap[row.planType],
|
||||
time:isRead?row.startTime+"~"+row.endTime :[row.startTime,row.endTime],
|
||||
areaNames:row.areaIds.map(item=>this.areaMap[item]).join(";"),
|
||||
unitNames:row.unitIds.map(item=>this.unitMap[item]).join(";"),
|
||||
inspectTypeName:this.$store.getters.prevention_danger_check_type_map[row.inspectType],
|
||||
inspectCycleUnitName:this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit]
|
||||
},row);
|
||||
}else{
|
||||
this.updateParams = {planType:1} as any;
|
||||
}
|
||||
this.currentId = id;
|
||||
this.buildUpdateForm();
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
// 打开下发弹窗
|
||||
public openSendModel(row){
|
||||
this.currentPlan = row;
|
||||
this.showSend = true;
|
||||
this.tableTabs = [];
|
||||
}
|
||||
|
||||
public openRecordModel(row){
|
||||
this.showRecord = true;
|
||||
this.recordParams.taskId = row.latestExecuteId;
|
||||
this.recordParams.planId = row.id
|
||||
this.getTabsData()
|
||||
this.getTroubleList();
|
||||
}
|
||||
|
||||
public getTabsData(){
|
||||
this.tableService.getRecordTabList(this.recordParams).then((res:any)=>{
|
||||
this.tableTabs = res.data.map(item=>{
|
||||
return {
|
||||
name:item.tableName,
|
||||
id:item.tableId,
|
||||
tableItems:[]
|
||||
}
|
||||
})
|
||||
this.tableTabs.forEach(async item=>{
|
||||
this.recordParams.tableId = item.id;
|
||||
const datas = (await this.tableService.getRecordList(this.recordParams)).data as any;
|
||||
item.tableItems = datas;
|
||||
})
|
||||
this.currentTableId = this.tableTabs[0].id;
|
||||
this.currentTable = this.tableTabs[0]
|
||||
})
|
||||
}
|
||||
public getTroubleList(){
|
||||
this.tableService.getTroubleList(this.recordParams).then(res=>{
|
||||
this.troubleTableData = res.data
|
||||
})
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
this.tableTabs = [];
|
||||
this.currentTableId = null;
|
||||
this.currentTable = {tableItems:[]} as any;
|
||||
if(this.showSend){
|
||||
this.sendParams.tables = [];
|
||||
this.tableTabs = [];
|
||||
this.currentPlan = null;
|
||||
this.showSend = false;
|
||||
|
||||
return
|
||||
}
|
||||
if(this.showRecord){
|
||||
this.showRecord = false;
|
||||
this.recordParams = {
|
||||
taskId:null,
|
||||
tableId:null,
|
||||
|
||||
}
|
||||
return
|
||||
}
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
public doSave(){
|
||||
this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then(res=>{
|
||||
this.$message.success(!this.updateParams.id?"新增成功!":"编辑成功!")
|
||||
this.getTableData();
|
||||
this.handleClose();
|
||||
})
|
||||
}
|
||||
|
||||
public changeState(row){
|
||||
this.tableService.addOrUpdate({
|
||||
id:row.id,
|
||||
state:+!row.state,
|
||||
oldState:row.state
|
||||
},false).then(res=>{
|
||||
this.$message.success(row.state?"停用成功":"启用成功!")
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
|
|
|
|||
|
|
@ -27,18 +27,11 @@ export default class HomeComponent extends Vue {
|
|||
// 柱图
|
||||
public barChart:any
|
||||
|
||||
// or
|
||||
B = 2;
|
||||
// or 仅内部可用
|
||||
private C = 3;
|
||||
// or 可被继承类调用
|
||||
protected D = 4;
|
||||
// 组件渲染完成
|
||||
mounted(){
|
||||
window.addEventListener("resize",this.resize)
|
||||
}
|
||||
beforeDestory(){
|
||||
console.log(123)
|
||||
window.removeEventListener("resize",this.resize)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,20 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
majorHazardFlag:null
|
||||
} as any;
|
||||
|
||||
public filters = [{
|
||||
text:"未绘制",
|
||||
value:0
|
||||
},{
|
||||
text:"已绘制",
|
||||
value:1
|
||||
}]
|
||||
|
||||
public isArea = true;
|
||||
public showQrCode = false;
|
||||
public qrUrl = "";
|
||||
|
||||
|
||||
|
||||
|
||||
// 列表搜索条件按钮
|
||||
public formActions = [{
|
||||
|
|
@ -105,6 +119,7 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
name:"区域编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
disable:true,
|
||||
showError:false,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
|
|
@ -137,6 +152,7 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
},{
|
||||
name:"属于重大危险源",
|
||||
key:"majorHazardFlag",
|
||||
format:"majorHazardFlagName",
|
||||
type:"radio",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
|
|
@ -186,7 +202,22 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
size:"small",
|
||||
icon:"el-icon-edit-outline",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"查看绘制",
|
||||
value:"readDraw",
|
||||
hide:!this.isReadonly,
|
||||
height:"36px",
|
||||
size:"small",
|
||||
icon:"el-icon-edit-outline",
|
||||
type:"primary"
|
||||
}]
|
||||
},{
|
||||
name:"分析对象编号",
|
||||
key:"analTargetNum",
|
||||
type:"text",
|
||||
showError:false,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
}];
|
||||
|
||||
this.updateActions = [{
|
||||
|
|
@ -219,14 +250,40 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
}]
|
||||
}
|
||||
|
||||
public getQrCode(row){
|
||||
this.tableService.getQrCode({
|
||||
url:"/",
|
||||
id:row.id,
|
||||
system:"prevention",
|
||||
type:0,
|
||||
data:"",
|
||||
params:{
|
||||
"区域名称" : row.name,
|
||||
"区域编号" : row.number,
|
||||
"责任人" : row.chargeUserName,
|
||||
"责任部门" : row.chargeDeptName,
|
||||
"重大危险源名称" : row.majorHazardName
|
||||
}
|
||||
}).then((res:any)=>{
|
||||
this.showQrCode = true;
|
||||
this.qrUrl = res.data.url;
|
||||
})
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'区域名称',key:"name"});
|
||||
this.tableColumn.push({name:'责任部门',key:"chargeDeptName"});
|
||||
this.tableColumn.push({name:'责任人',key:"chargeUserName"});
|
||||
this.tableColumn.push({name:'是否属于重大危险源',key:"majorHazardFlag",render:(data)=>{
|
||||
return this.$store.state.yesNoMap[data.majorHazardFlag]
|
||||
return this.$store.getters.common_yes_no_map[data.majorHazardFlag]
|
||||
}});
|
||||
this.tableColumn.push({name:'绘制情况',render:(data)=>{
|
||||
this.tableColumn.push({name:'绘制情况',filters:this.filters,filterMethod:(data,row)=>{
|
||||
if(data){
|
||||
return row.geoJson && row.geoJson!=="[]"
|
||||
}else{
|
||||
return !row.geoJson || row.geoJson === "[]"
|
||||
}
|
||||
}, render:(data)=>{
|
||||
if(data.geoJson==='[]' || !data.geoJson){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
|
|
@ -235,50 +292,83 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
}});
|
||||
}
|
||||
|
||||
public callback(data,item?){
|
||||
public doDraw(){
|
||||
if(!this.updateParams.name){
|
||||
this.$message.error("请先输入区域名称");
|
||||
return
|
||||
}
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}
|
||||
|
||||
public getCreateNumber(){
|
||||
this.tableService.getAreaNumber().then((res)=>{
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]",number:res.data} as any;
|
||||
this.buildFormOptions();
|
||||
this.showUpdate = true
|
||||
})
|
||||
}
|
||||
|
||||
public doSave(goOn?){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"修改成功!");
|
||||
if(goOn){
|
||||
this.getCreateNumber();
|
||||
}else{
|
||||
this.handleClose();
|
||||
}
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
public change(data,item?){
|
||||
// 新增编辑选择部门
|
||||
if(item && item.key === "chargeDeptId"){
|
||||
this.updateParams.chargeDeptName = this.$store.getters.dept_map[data];
|
||||
}
|
||||
// 新增编辑选择人员
|
||||
if(item && item.key === "chargeUserId"){
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data];
|
||||
}
|
||||
// 新增编辑选择是否重大危险源
|
||||
if(item && item.key === "majorHazardFlag"){
|
||||
this.updateOptions[5].hide = !data;
|
||||
this.updateOptions[6].hide = !data;
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if(data && data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
}else if(data && data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
}else if(data && data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
}else if(data && data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
}else if(data && data.value === "add"){
|
||||
this.showUpdateModel()
|
||||
}else if(data.value === "delete"){
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
if(!this.updateParams.name){
|
||||
this.$message.error("请先输入区域名称");
|
||||
return
|
||||
}
|
||||
this.drawModel = "area";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
}else if(data && (data.value === "draw" || data.value==="readDraw")){
|
||||
this.doDraw()
|
||||
}else if(data && data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "submit"){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"修改成功!");
|
||||
this.handleClose();
|
||||
this.getTableData();
|
||||
})
|
||||
}else if(data.value === "saveAndContinue"){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success("新增成功!");
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]"} as any
|
||||
})
|
||||
}else if(data.value === "cancel"){
|
||||
}else if(data && data.value === "submit"){
|
||||
this.doSave()
|
||||
}else if(data && data.value === "saveAndContinue"){
|
||||
this.doSave(true)
|
||||
}else if(data && data.value === "cancel"){
|
||||
this.updateParams = {} as any;
|
||||
this.handleClose();
|
||||
}
|
||||
|
|
@ -299,14 +389,15 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
public showUpdateModel(data?,isRead?){
|
||||
if(!data){
|
||||
this.currentId = -1;
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]"} as any
|
||||
this.getCreateNumber();
|
||||
}else{
|
||||
this.currentId = data.id;
|
||||
this.updateParams = Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]"},data);
|
||||
this.updateParams = Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]",majorHazardFlagName:this.$store.getters.common_yes_no_map[data.majorHazardFlag]},data);
|
||||
|
||||
this.isReadonly = !!isRead;
|
||||
this.buildFormOptions();
|
||||
this.isReadonly = !!isRead
|
||||
this.showUpdate = true
|
||||
}
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
|
|
|
|||
|
|
@ -1,47 +1,75 @@
|
|||
<div class="common-box dis-flex " >
|
||||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
:full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选">
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-else :prop="item.key" :filters="item.filters" :label="item.name"
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200">
|
||||
<el-table-column label="操作" width="245">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text">二维码</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" @click="getQrCode(scope.row)">二维码</el-button>
|
||||
<el-button type="text" v-if="!isArea && scope.row.status===1"
|
||||
@click="doTurnOff(scope.row,0)">停用</el-button>
|
||||
<el-button type="text" v-if="!isArea && scope.row.status===0 "
|
||||
@click="doTurnOff(scope.row,1)">恢复</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
<div class="model-box" v-if="showDraw">
|
||||
<div class="mask"></div>
|
||||
<DrawComponent :model.sync="drawModel" :data.sync="updateParams" :show.sync="showDraw"></DrawComponent>
|
||||
<DrawComponent :model.sync="drawModel" :isReadonly="isReadonly" :data.sync="updateParams" :show.sync="showDraw"
|
||||
@onClose="getTableData"></DrawComponent>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="callback"
|
||||
btn-position="center"></FormComponent>
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':currentId===-1?'新增':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true"
|
||||
@change="change" btn-position="center">
|
||||
<span class="tips" v-if="isArea">*注:安全风险分析对象编码即危险化学品登记综合服务系统中的危险源编码</span>
|
||||
|
||||
|
||||
<div class="sub-title" v-if="!isArea && isReadonly">停用/检修记录</div>
|
||||
|
||||
<TableComponent v-if="!isArea && isReadonly" :tableData="repairTableData" :tableColumn="repairTableColumn"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'查看二维码'" :visible.sync="showQrCode">
|
||||
<img :src="qrUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
<el-dialog :close-on-click-modal="false" v-if="!isArea" width="500px" :title="'停用/恢复登记'"
|
||||
:visible.sync="showTurnOff">
|
||||
<FormComponent :options="turnOffForm" labelWidth="110px" labelAlign="right" :data.sync="turnOffParams"
|
||||
@actionCallback="doTurnOffAction" :actions="turnOffAction" btn-position="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -1,27 +1,35 @@
|
|||
<div class="common-box dis-flex " >
|
||||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border
|
||||
style="width: 100%">
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" style="pointer-events: none;" @click="addVal($event,scope.row)" v-html="item.render(scope.row)"></div>
|
||||
<div slot-scope="scope" style="pointer-events: none;" @click="addVal($event,scope.row)"
|
||||
v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" v-if="scope.row.analFlag && !scope.row.edit" @click="scope.row.edit = true">修改</el-button>
|
||||
<el-button type="text" v-if="!scope.row.analFlag || scope.row.edit" @click="saveVal(scope.row)">保存</el-button>
|
||||
<el-button type="text" v-if="scope.row.analFlag && !scope.row.edit"
|
||||
@click="scope.row.edit = true">修改</el-button>
|
||||
<el-button type="text" v-if="!scope.row.analFlag || scope.row.edit"
|
||||
@click="saveVal(scope.row)">保存</el-button>
|
||||
<el-button type="text" v-if="scope.row.edit" @click="scope.row.edit = false">取消</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -30,30 +38,35 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" >
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate">
|
||||
<img style="width:100%" src="../../../../assets/images/4.jpg" alt="">
|
||||
</el-dialog>
|
||||
<el-dialog :close-on-click-modal="false" :title="popTitle" :visible.sync="showPop" width="1000px">
|
||||
<el-table :data="riskDatas" border style="width: 100%; margin-bottom: 20px;" :span-method="colSpan">
|
||||
<el-dialog :close-on-click-modal="false" :title="popTitle" :visible.sync="showPop" width="1000px">
|
||||
<el-table :data="riskDatas" border style="width: 100%; margin-bottom: 20px;" :span-method="colSpan">
|
||||
<el-table-column prop="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="name" label="项目"></el-table-column>
|
||||
<el-table-column label="取值标准">
|
||||
<el-table-column prop="noInvolved" label="是否涉及">
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===0}" @click="selectRow(scope.row,0)">
|
||||
<el-table-column label="取值标准">
|
||||
<el-table-column prop="noInvolved" label="是否涉及">
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===0}"
|
||||
@click="selectRow(scope.row,0)">
|
||||
<span>不涉及</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type1" label="1">
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===1}" @click="selectRow(scope.row,1)"><span>{{scope.row.type1}}</span></div>
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===1}"
|
||||
@click="selectRow(scope.row,1)"><span>{{scope.row.type1}}</span></div>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type2" label="2">
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===2}" @click="selectRow(scope.row,2)"><span>{{scope.row.type2}}</span></div>
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===2}"
|
||||
@click="selectRow(scope.row,2)"><span>{{scope.row.type2}}</span></div>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type3" label="3">
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===3}" @click="selectRow(scope.row,3)"><span>{{scope.row.type3}}</span></div>
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===3}"
|
||||
@click="selectRow(scope.row,3)"><span>{{scope.row.type3}}</span></div>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type4" label="4">
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}" @click="selectRow(scope.row,4)"><span>{{scope.row.type4}}</span></div>
|
||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}"
|
||||
@click="selectRow(scope.row,4)"><span>{{scope.row.type4}}</span></div>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="value" :label="popTitle==='L值取值'?'Ln':'Sn'">
|
||||
|
|
@ -64,6 +77,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="result" :label="popTitle==='L值取值'?'L':'S'"></el-table-column>
|
||||
</el-table>
|
||||
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true"></ButtonListComponent>
|
||||
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
|
||||
</ButtonListComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -44,7 +44,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
key:"name",
|
||||
type:"text",
|
||||
}];
|
||||
|
||||
|
|
@ -64,7 +64,8 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
name:"取消",
|
||||
value:"cancel",
|
||||
type:""
|
||||
}]
|
||||
}];
|
||||
public numberForMat = ["","(Ⅳ)","(Ⅲ)","(Ⅱ)","(Ⅰ)"]
|
||||
|
||||
|
||||
created(){
|
||||
|
|
@ -72,8 +73,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"areaName"});
|
||||
this.tableColumn.push({name:'区域名称',key:"areaName"});
|
||||
this.tableColumn.push({name:'区域名称',key:"name"});
|
||||
this.tableColumn.push({name:'区域内发生事故的可能性/L',width:"195",render:(data)=>{
|
||||
if(!data.analFlag|| data.edit){
|
||||
return "<span class='link l-value'>"+(data.analLikelihoodValue || "选取L值")+"</span>"
|
||||
|
|
@ -91,7 +91,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
|
||||
}});
|
||||
this.tableColumn.push({name:'区域固有风险',render:(data)=>{
|
||||
return "<span class='color_"+data.analRiskLevel+"'>"+data.analRiskLevel+"</span>"
|
||||
return "<span class='color_"+data.analRiskLevel+"'>"+(data.analRiskLevel?(this.$store.getters.prevention_risk_level_map[data.analRiskLevel]+this.numberForMat[data.analRiskLevel]):'')+"</span>"
|
||||
}});
|
||||
this.tableColumn.push({name:'评估完成情况',key:"status",render:(data)=>{
|
||||
if(data.edit){
|
||||
|
|
@ -104,7 +104,12 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
}});
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
this.getTableData()
|
||||
|
|
@ -162,10 +167,13 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
this.$message.error("请选取S值");
|
||||
return
|
||||
}
|
||||
row.edit = false;
|
||||
// 因为按索引取值 所以要-1
|
||||
row.analRiskLevel=riskLevel[row.analLikelihoodValue - 1][row.analSeverityValue - 1]
|
||||
row.analFlag = 1;
|
||||
row.analRiskLevel=riskLevel[row.analLikelihoodValue - 1][row.analSeverityValue - 1];
|
||||
row.analFlag = 1;
|
||||
this.tableService.addOrUpdate(row,false,true).then((res)=>{
|
||||
this.$message.success("保存成功")
|
||||
row.edit = false;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div class="common-tree-box">
|
||||
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
|
|
@ -17,17 +16,23 @@
|
|||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -37,9 +42,62 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams"></FormComponent>
|
||||
<el-dialog :close-on-click-modal="false" :title=" isReadonly?'详情':currentId>0?'编辑':'新增'" :visible.sync="showUpdate"
|
||||
width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams" @change="changes" :actions="updateActions" @actionCallback="callback"
|
||||
:full-btn="true" btnPosition="center">
|
||||
<div class="sub-title">检查项目</div>
|
||||
<TableComponent :tableData="tableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="projectCallback($event)" :actions="!isReadonly?tableActions:[]"
|
||||
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.items" tooltip-effect="dark" height="250" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40" v-if="!isReadonly">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100" v-if="!isReadonly">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showSubmodal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showSubmodal(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteProData([scope.row.index - 1])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="proIsReadonly?'详情':updateProParams.index ?'编辑' :'新增'"
|
||||
:visible.sync="showProject" width="700px" :before-close="handleProClose">
|
||||
<FormComponent :options="projectOptions" :isReadonly="proIsReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateProParams" :actions="proIsReadonly ? [] :updateActions" @actionCallback="subCallback"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="检查项目" :visible.sync="showProtable" width="800"
|
||||
:before-close="handleClosePro">
|
||||
<TableComponent :tableData="currentProTableData" :tableColumn="subTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
|
||||
style="width: 100%">
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from "./device.component.html"
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
|
|
@ -8,158 +8,406 @@ import TableComponent from "hbt-common/components/common/table.component.vue"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
import DeviceService from '@/service/device.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
UnitTreeComponent,
|
||||
},
|
||||
})
|
||||
|
||||
export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new DeviceService();
|
||||
public unitService = new UnitService();
|
||||
public areaService = new AreaService();
|
||||
|
||||
public params = {} as any;
|
||||
public params = {
|
||||
areaName: "",
|
||||
unitName: "",
|
||||
} as any;
|
||||
public isReadonly = false;
|
||||
public currentId = -1;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
public treeData = [] as any;
|
||||
|
||||
public areaList = [];
|
||||
public unitList = [];
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
//检查项目
|
||||
public showProject = false;
|
||||
public updateProParams = {} as any;
|
||||
public proIsReadonly = false;
|
||||
public showProtable = false;
|
||||
public currentProTableData = {
|
||||
datas: []
|
||||
} as any;
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitName",
|
||||
type: "text",
|
||||
}];
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "选择区域",
|
||||
key: "areaId",
|
||||
format: "areaName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.areaList
|
||||
}, {
|
||||
name: "选择单元",
|
||||
key: "unitId",
|
||||
format: "unitName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.unitList
|
||||
}, {
|
||||
name: "责任部门",
|
||||
key: "chargeDeptId",
|
||||
format: "chargeDeptName",
|
||||
type: "treeSelect",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
datas: this.$store.state.deptTreeList,
|
||||
}, {
|
||||
name: "责任人",
|
||||
key: "chargeUserId",
|
||||
format: "chargeUserName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList
|
||||
}, {
|
||||
name: "设备名称",
|
||||
key: "name",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
}, {
|
||||
name: "设备类型",
|
||||
key: "type",
|
||||
format: "typeName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.prevention_device_type
|
||||
}, {
|
||||
name: "涉及岗位",
|
||||
key: "postCode",
|
||||
format: "postName",
|
||||
multiple: true,
|
||||
require: true,
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.postList
|
||||
}, {
|
||||
name: "安全因素",
|
||||
key: "safetyFactor",
|
||||
format: 'safetyFactorName',
|
||||
require: true,
|
||||
type: "select",
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_safe_reason
|
||||
},
|
||||
{
|
||||
name: "辨识人",
|
||||
key: "identifyUserId",
|
||||
format: "identifyUserName",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.userList
|
||||
}, {
|
||||
name: "辨识时间",
|
||||
key: "identifyTime",
|
||||
type: "date",
|
||||
subType: "date",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
public projectOptions: FormOption<BtnOption>[] = [
|
||||
{
|
||||
name: "检查项目",
|
||||
key: "name",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
},
|
||||
{
|
||||
name: "检查标准",
|
||||
key: "standard",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
public updateParams = {
|
||||
items: [],
|
||||
} as any;
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
@Watch("$store.state.deptList", { immediate: true, deep: true })
|
||||
onChanges() {
|
||||
this.loadAreaData()
|
||||
}
|
||||
|
||||
|
||||
created() {
|
||||
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(id?) {
|
||||
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
|
||||
this.unitList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
console.log(data)
|
||||
public handleNodeClick(data) {
|
||||
this.params.unitName = "";
|
||||
this.params.areaName = "";
|
||||
if (data.areaId) {
|
||||
this.params.unitName = data.name
|
||||
} else {
|
||||
this.params.areaName = data.name
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险分析单元',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'设备名称',key:"person"});
|
||||
this.tableColumn.push({name:'设备类别',key:"person"});
|
||||
this.tableColumn.push({name:'检查项目',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName", width: "200px" });
|
||||
this.tableColumn.push({ name: '风险分析单元', key: "unitName", width: "200px" });
|
||||
this.tableColumn.push({ name: '设备名称', key: "name" });
|
||||
this.tableColumn.push({
|
||||
name: '设备类别', key: "type", render: (data) => {
|
||||
if (data.type) {
|
||||
return this.$store.getters.prevention_device_type_map[data.type];
|
||||
}
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'责任人',key:"person"});
|
||||
this.tableColumn.push({name:'责任部门',key:"person"});
|
||||
this.tableColumn.push({name:'涉及岗位',key:"person"});
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '检查项目', key: "itemNum", render: (data) => {
|
||||
return "<span class='link'>" + (data.itemNum ? data.itemNum : 0) + "</span>"
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '责任人', key: "chargeUserName" });
|
||||
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
|
||||
this.tableColumn.push({ name: '涉及岗位', key: "postName" });
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", width: "60" });
|
||||
this.subTableColumn.push({ name: '检查项目', key: "name" });
|
||||
this.subTableColumn.push({ name: '检查标准', key: "standard" });
|
||||
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public showPros(el, data) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if (isTarget) {
|
||||
this.showProtable = true;
|
||||
this.currentProTableData.datas = data.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleClosePro() {
|
||||
this.showProtable = false;
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
// 部门
|
||||
if (item && item.key === "chargeDeptId") {
|
||||
this.updateParams.chargeDeptName = this.$store.getters.dept_map[data];
|
||||
}
|
||||
//责任人
|
||||
if (item && item.key === 'chargeUserId') {
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data];
|
||||
}
|
||||
// 区域
|
||||
if (item && item.key === "areaId") {
|
||||
if (this.updateParams.unitId) {
|
||||
this.updateParams.unitId = null;
|
||||
}
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
// 岗位
|
||||
if (item && item.key === "postCode") {
|
||||
this.updateParams.postName = data.map(itm => this.$store.getters.post_map[itm]).join(";");
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data) {
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData)
|
||||
} else if (data.value === "add") {
|
||||
this.isReadonly = false;
|
||||
this.currentId = -1;
|
||||
this.updateParams = { items: [], } as any;
|
||||
this.showUpdate = true
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else if (data && data.value === "cancel") {
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
this.showUpdate = true
|
||||
public showUpdateModel(row, isReadonly) {
|
||||
this.updateParams = { items: [], } as any;
|
||||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId).then((res: any) => {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true;
|
||||
this.updateParams = Object.assign({
|
||||
safetyFactorName: res.data.safetyFactor.split(";").map(item => this.$store.getters.prevention_safe_reason_map[item]).join(";"),
|
||||
identifyUserName: this.$store.getters.user_map[res.data.identifyUserId],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type],
|
||||
}, res.data)
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.updateParams = res.data;
|
||||
this.updateParams.safetyFactor = res.data.safetyFactor.split(";").map(item => parseInt(item))
|
||||
this.updateParams.postCode = res.data.postCode.split(";").map(item => parseInt(item))
|
||||
this.loadUnitData(res.data.areas)
|
||||
}
|
||||
this.updateParams.items.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
public doSave(goOn?) {
|
||||
// 新增
|
||||
this.updateParams.itemNum = this.updateParams.items.length;
|
||||
this.updateParams.postCode = this.updateParams.postCode.join(";")
|
||||
this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(";")
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {
|
||||
items: [],
|
||||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
|
@ -167,22 +415,83 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.userId === item.userId);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
//检查项目
|
||||
public projectCallback(data) {
|
||||
if (data && data.value === 'add') {
|
||||
this.showProject = true
|
||||
} else if (data && data.value === 'delete') {
|
||||
// 批量删除步骤
|
||||
this.deleteProData(this.selectData.map((itm: any) => itm.index - 1))
|
||||
}
|
||||
}
|
||||
//查看 编辑
|
||||
public showSubmodal(row, isReadonly) {
|
||||
this.proIsReadonly = false;
|
||||
this.showProject = true
|
||||
if (isReadonly) {
|
||||
this.proIsReadonly = true
|
||||
this.updateProParams = JSON.parse(JSON.stringify(row));
|
||||
} else {
|
||||
this.updateProParams = JSON.parse(JSON.stringify(row));
|
||||
}
|
||||
}
|
||||
//删除
|
||||
public deleteProData(indexs) {
|
||||
for (let i = this.updateParams.items.length - 1; i >= 0; i--) {
|
||||
if (indexs.includes(i)) {
|
||||
this.updateParams.items.splice(i, 1)
|
||||
}
|
||||
}
|
||||
this.updateParams.items.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
|
||||
}
|
||||
public subCallback(data) {
|
||||
if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSaveProject(data.value !== "save")
|
||||
} else if (data && data.value === "cancel") {
|
||||
this.handleProClose()
|
||||
}
|
||||
}
|
||||
|
||||
public doSaveProject(goOn) {
|
||||
// 如果是新增步骤
|
||||
if (this.updateProParams) {
|
||||
// 新增
|
||||
if (!this.updateProParams.index) {
|
||||
this.updateProParams.index = this.updateParams.items.length + 1;
|
||||
this.updateParams.items.push(this.updateProParams);
|
||||
} else {
|
||||
this.updateParams.items.splice(this.updateParams.items.findIndex(item => item.index === this.updateProParams.index), 1, this.updateProParams)
|
||||
}
|
||||
this.updateProParams = {} as any;
|
||||
this.showProject = !!goOn;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
public handleProClose() {
|
||||
this.showProject = false;
|
||||
this.updateProParams = {} as any;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div class="common-tree-box">
|
||||
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
|
|
@ -17,29 +16,100 @@
|
|||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,null,true)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
<el-dialog :close-on-click-modal="false" :title="!updateParams.id?'新增':isReadonly?'详情':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams"></FormComponent>
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="callback" @change="changes">
|
||||
<div class="sub-title">安全检查表分析法</div>
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="callback($event)" :actions="isReadonly? []:subTableActions" actionPosition="flex-start"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.items" tooltip-effect="dark" height="250" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isReadonly || isModifyonly" type="text"
|
||||
@click="showSubModel(scope.row,true)">查看</el-button>
|
||||
<el-button v-if="isModifyonly" type="text" @click="showSubModel(scope.row)">修改</el-button>
|
||||
<el-button v-if="!isReadonly && !isModifyonly" type="text"
|
||||
@click="showSubModel(scope.row)">评价</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
<FormComponent :options="subBasicRiskOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="callback" @change="changes" @action="updateActions"
|
||||
:actions="isReadonly? []:updateActions" :full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
<!-- 评估矩阵 -->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showMatrixModal" :title="'区域风险等级判定准则'">
|
||||
<img style="width:100%" src="../../../../assets/images/5.png" alt="">
|
||||
</el-dialog>
|
||||
<!-- 评价 -->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showSubUpdate" width="880px"
|
||||
:before-close="handleAnalyClose">
|
||||
<AnalEvaluationComponent :isReadonly="analyIsReadonly" :data.sync="analysisUpdateParams"
|
||||
:show.sync="showSubUpdate" @actionCallback="analyCallback" :tabledata.sync="updateParams"
|
||||
:areaList="areaList" :type="'device'"></AnalEvaluationComponent>
|
||||
</el-dialog>
|
||||
<!-- 检查项目 -->
|
||||
<el-dialog :close-on-click-modal="false" title="检查项目" :show-close="false" :visible.sync="showProtable"
|
||||
width="880px">
|
||||
<FormComponent labelWidth="110px" labelAlign="right" :actions="proActions" @actionCallback="proCallback"
|
||||
:full-btn="true" btnPosition="center">
|
||||
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250"
|
||||
border style="width: 100%">
|
||||
<template v-for="item in proTableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from "./deviceAnal.component.html"
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
|
|
@ -8,205 +8,855 @@ import TableComponent from "hbt-common/components/common/table.component.vue"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import DeviceService from '@/service/device.service';
|
||||
import AnalEvaluationComponent from '@/components/analEvaluation.component.vue';
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
|
||||
import DeviceService from '@/service/deviceAnal.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
import DiviceService from '@/service/device.service';
|
||||
import SystemService from "hbt-common/service/system.service";
|
||||
import moment from "moment"
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
AnalEvaluationComponent,
|
||||
UnitTreeComponent,
|
||||
ButtonListComponent
|
||||
},
|
||||
})
|
||||
export default class DeviceAnalManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new DeviceService();
|
||||
public unitService = new UnitService();
|
||||
public areaService = new AreaService();
|
||||
public systemService = new SystemService();
|
||||
public diviceService = new DiviceService();
|
||||
|
||||
public params = {} as any;
|
||||
public params = {
|
||||
areaName: "",
|
||||
unitName: "",
|
||||
} as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
public treeData = [] as any;
|
||||
|
||||
public areaList = [];
|
||||
public unitList = [];
|
||||
public diviceList = [];
|
||||
public isReadonly = false;
|
||||
public isModifyonly = false;
|
||||
public subTableColumn = [] as any;
|
||||
public currentId = -1;
|
||||
|
||||
public sourceMap = {} as any;
|
||||
public craftMap = {} as any;
|
||||
public chemicaltMap = {} as any
|
||||
public majorsignMap = {} as any;
|
||||
|
||||
//检查项目
|
||||
public showProtable = false;
|
||||
|
||||
public proTableColumn = [] as any;
|
||||
|
||||
public currentProTableData = {
|
||||
datas: []
|
||||
} as any;
|
||||
|
||||
public proActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
//数据字典
|
||||
public dictData = {
|
||||
source: [],
|
||||
craft: [],
|
||||
chemical: [],
|
||||
mainPerson: [],
|
||||
craftPerson: [],
|
||||
operatePerson: [],
|
||||
measuresSort: [],
|
||||
riskControlLevel: [],
|
||||
seriousResult: [],
|
||||
identifier: [],
|
||||
majorsign: [],
|
||||
} as any;
|
||||
//评估矩阵
|
||||
public showMatrixModal = false;
|
||||
//评价
|
||||
public showSubUpdate = false;
|
||||
|
||||
public analyIsReadonly = false;
|
||||
//危害分析评价
|
||||
public analysisUpdateParams = {
|
||||
riskChoose: [],
|
||||
remainChoose: [],
|
||||
remainLevel: null,
|
||||
riskLevel: null,
|
||||
datas: []
|
||||
|
||||
} as any;
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"作业活动",
|
||||
key:"unitId",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"单元1",
|
||||
value:0
|
||||
},{
|
||||
name:"单元2",
|
||||
value:1
|
||||
}]
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: '存草稿',
|
||||
value: 'addDraft',
|
||||
type: "primay"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitName",
|
||||
type: "text",
|
||||
},];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public updateParams = {
|
||||
majorSign: [],
|
||||
items: [],
|
||||
evaluateTime: moment().format('YYYY-MM-DD'),
|
||||
evaluateUserId: this.account.userId,
|
||||
evaluateUserName: this.account.nickName,
|
||||
} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
public subSelectData = []
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
public subBasicRiskOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
public subTableActions: BtnOption[] = [];
|
||||
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "区域名称",
|
||||
key: "areaId",
|
||||
format: "areaName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.areaList
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitId",
|
||||
format: "unitName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.unitList
|
||||
}, {
|
||||
name: "责任部门",
|
||||
key: "chargeDeptName",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "责任人",
|
||||
key: "chargeUserName",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "设备名称",
|
||||
key: "deviceInventoryId",
|
||||
format: 'name',
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.diviceList,
|
||||
}, {
|
||||
name: "设备类型",
|
||||
key: "type",
|
||||
format: "typeName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
datas: this.$store.state.prevention_device_type
|
||||
}, {
|
||||
name: "涉及岗位",
|
||||
key: "postName",
|
||||
type: "text",
|
||||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "评价人",
|
||||
key: "evaluateUserId",
|
||||
format: "evaluateUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
type: "select",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList
|
||||
}, {
|
||||
name: "评价时间",
|
||||
key: "evaluateTime",
|
||||
type: "date",
|
||||
subType: "date",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
}, {
|
||||
name: "是否为两大一重",
|
||||
key: "majorSign",
|
||||
format: "majorSignName",
|
||||
type: "checkbox",
|
||||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
datas: this.$store.state.prevention_majorsign,
|
||||
}, {
|
||||
name: "重大危险源",
|
||||
key: "majorHazard",
|
||||
hide: !this.updateParams.majorSign.includes(1) || this.updateParams.majorSign.includes(0),
|
||||
type: "select",
|
||||
format: "majorHazardName",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
datas: this.dictData.source
|
||||
|
||||
}, {
|
||||
name: "重点监管工艺",
|
||||
key: "regulatoryProcess",
|
||||
format: "regulatoryProcessName",
|
||||
hide: !this.updateParams.majorSign.includes(2) || this.updateParams.majorSign.includes(0),
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
datas: this.dictData.craft,
|
||||
}, {
|
||||
name: "重点监管化学品",
|
||||
key: "regulatoryChemical",
|
||||
format: "regulatoryChemicalName",
|
||||
hide: !this.updateParams.majorSign.includes(3) || this.updateParams.majorSign.includes(0),
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
datas: this.dictData.chemical,
|
||||
}];
|
||||
|
||||
this.subTableActions = [{
|
||||
name: "批量删除",
|
||||
value: "subDelete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}, {
|
||||
name: "评估矩阵",
|
||||
value: "estimateMatrix",
|
||||
type: "primary"
|
||||
}];
|
||||
this.subBasicRiskOptions = [{
|
||||
name: "风险等级",
|
||||
key: "riskLevel",
|
||||
format: 'riskLevelName',
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
}, {
|
||||
name: "残余风险等级",
|
||||
key: "remainRiskLevel",
|
||||
format: "remainRiskLevelName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
}]
|
||||
}
|
||||
|
||||
@Watch("$store.state.deptList", { immediate: true, deep: true })
|
||||
onChanges() {
|
||||
this.loadAreaData()
|
||||
}
|
||||
@Watch("updateParams", { immediate: true, deep: true })
|
||||
onCountValueChange() {
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
created() {
|
||||
Promise.all([
|
||||
this.systemService.getDictData("prevention_risk_source"),
|
||||
this.systemService.getDictData("prevention_risk_craft"),
|
||||
this.systemService.getDictData("prevention_risk_chemical"),
|
||||
]).then(((results: any) => {
|
||||
this.dictData.source = results[0].data.map((item) => {
|
||||
this.sourceMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.craft = results[1].data.map((item) => {
|
||||
this.craftMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.chemical = results[2].data.map((item) => {
|
||||
this.chemicaltMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.buildUpdateForm()
|
||||
}));
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.unitList = [];
|
||||
this.diviceList = [];
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : 0,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(id?) {
|
||||
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
|
||||
this.unitList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
deptId: item.chargeDeptId,
|
||||
userId: item.chargeUserId,
|
||||
deptName: item.chargeDeptName,
|
||||
userName: item.chargeUserName,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
console.log(data)
|
||||
public handleNodeClick(data) {
|
||||
this.params.unitName = "";
|
||||
this.params.areaName = "";
|
||||
if (data.areaId) {
|
||||
this.params.unitName = data.name
|
||||
} else {
|
||||
this.params.areaName = data.name
|
||||
}
|
||||
this.getTableData()
|
||||
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险分析单元',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'设备名称',key:"person"});
|
||||
this.tableColumn.push({name:'设备类别',key:"person"});
|
||||
this.tableColumn.push({name:'检查项目',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName", width: "150px" });
|
||||
this.tableColumn.push({ name: '风险分析单元', key: "unitName", width: "150px" });
|
||||
this.tableColumn.push({ name: '设备名称', key: "name", });
|
||||
this.tableColumn.push({
|
||||
name: '设备类别', key: "type", render: (data) => {
|
||||
if (data.riskLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
|
||||
}
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'责任人',key:"person"});
|
||||
this.tableColumn.push({name:'责任部门',key:"person"});
|
||||
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '检查项目', key: "itemNum", render: (data) => {
|
||||
return "<span class='link'>" + (data.itemNum ? data.itemNum : 0) + "</span>"
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'残余风险等级',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
});
|
||||
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
|
||||
this.tableColumn.push({ name: '责任人', key: "chargeUserName" });
|
||||
this.tableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
}
|
||||
}});
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '残余风险等级', key: "remainRiskLevel", width: "150px", render: (data) => {
|
||||
return "<span class='color_" + data.remainRiskLevel + "'>" + (data.remainRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.remainRiskLevel]) : '') + "</span>"
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status", render: (data) => {
|
||||
if (data.status) {
|
||||
return "<span class='color_" + data.status + "'>" + (data.status ? (this.$store.getters.prevention_evaluate_status_map[data.status]) : '') + "</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//分析评价
|
||||
this.subTableColumn.push({ name: '序号', key: "index" });
|
||||
this.subTableColumn.push({ name: '检查项目', key: "itemName" });
|
||||
this.subTableColumn.push({ name: '检查标准', key: "itemStandard", showTip: true, width: "200px" });
|
||||
this.subTableColumn.push({ name: '风险源', key: "riskSource" });
|
||||
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis" });
|
||||
this.subTableColumn.push({
|
||||
name: '最严重后果', key: "seriousResult", width: "200px", render: (data) => {
|
||||
if (data.seriousResult) {
|
||||
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
if (data.riskLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({ name: '评估方法', key: "riskChoose", });
|
||||
this.subTableColumn.push({
|
||||
name: '残余风险等级', key: "remainLevel", width: "200px", render: (data) => {
|
||||
if (data.remainLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.remainLevel]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({ name: '评估方法', key: "remainChoose", });
|
||||
this.subTableColumn.push({
|
||||
name: '管控措施', key: "measuresNum", render: (data) => {
|
||||
if (data.measuresNum) {
|
||||
return data.measuresNum
|
||||
} else {
|
||||
if (data.measures && data.measures.length) {
|
||||
return data.measures.length
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//检查项目、
|
||||
this.proTableColumn.push({ name: '序号', key: "index" });
|
||||
this.proTableColumn.push({ name: '检查项目', key: "itemName" });
|
||||
this.proTableColumn.push({ name: '检查标准', key: "itemStandard", showTip: true, width: "200px" });
|
||||
this.proTableColumn.push({ name: '风险源', key: "riskSource" });
|
||||
this.proTableColumn.push({
|
||||
name: '可能发生事故', key: "seriousResult", width: "150px", render: (data) => {
|
||||
if (data.seriousResult) {
|
||||
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
});
|
||||
this.proTableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
if (data.riskLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.proTableColumn.push({
|
||||
name: '残余风险等级', key: "remainLevel", width: "150px", render: (data) => {
|
||||
if (data.remainLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.remainLevel]
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public callback(data) {
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === "add") {
|
||||
this.isReadonly = false;
|
||||
this.showUpdate = true
|
||||
this.updateParams = {
|
||||
majorSign: [],
|
||||
items: [],
|
||||
evaluateTime: moment().format('YYYY-MM-DD'),
|
||||
evaluateUserId: this.account.userId,
|
||||
evaluateUserName: this.account.nickName,
|
||||
} as any
|
||||
} else if (data.value === "cancel") {
|
||||
this.handleClose()
|
||||
} else if (data.value === "estimateMatrix") {
|
||||
this.showMatrixModal = true
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
this.isReadonly = false;
|
||||
} else if (data && data.value === 'addDraft') {
|
||||
this.doSaveDraft()
|
||||
this.isReadonly = false;
|
||||
} else if (data && data.value === "subDelete") {
|
||||
if (this.subSelectData.length > 0) {
|
||||
if (!this.updateParams.deleteIds) {
|
||||
this.updateParams.deleteIds = []
|
||||
}
|
||||
this.subSelectData.map((itemData: any) => {
|
||||
this.updateParams.deleteIds.push(itemData.id)
|
||||
this.updateParams.items.splice(this.updateParams.items.findIndex(item => item.index === itemData.index), 1)
|
||||
})
|
||||
this.updateParams.items.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
this.updateParams.itemNum = this.updateParams.items.length
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
// 区域
|
||||
if (item && item.key === "areaId") {
|
||||
this.diviceList = [];
|
||||
if (this.updateParams.unitId) {
|
||||
this.updateParams.unitId = null;
|
||||
}
|
||||
const areaData = this.areaList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
this.updateParams.chargeDeptName = null;
|
||||
this.updateParams.chargeUserId = null;
|
||||
this.updateParams.chargeUserName = null;
|
||||
this.updateParams.chargeDeptId = null;
|
||||
|
||||
public showUpdateModel(id){
|
||||
this.showUpdate = true
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.deviceName = null;
|
||||
this.updateParams.deviceInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
//单元
|
||||
if (item && item.key === 'unitId') {
|
||||
const unitData = this.unitList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.chargeDeptName = unitData.deptName;
|
||||
this.updateParams.chargeUserId = unitData.userId;
|
||||
this.updateParams.chargeUserName = unitData.userName;
|
||||
this.updateParams.chargeDeptId = unitData.deptId;
|
||||
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.deviceName = null;
|
||||
this.updateParams.deviceInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
this.loadJobData(data)
|
||||
|
||||
}
|
||||
//设备
|
||||
if (item && item.key === 'deviceInventoryId') {
|
||||
const diviceData = this.diviceList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.type = diviceData.type;
|
||||
this.updateParams.postName = diviceData.postName;
|
||||
this.updateParams.postCode = diviceData.postCode;
|
||||
this.updateParams.deviceName = diviceData.name;
|
||||
this.updateParams.name = diviceData.name;
|
||||
this.updateParams.items = diviceData.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
item.itemName = item.name;
|
||||
item.itemStandard = item.standard;
|
||||
return item
|
||||
})
|
||||
this.updateParams.itemNum = diviceData.items.length;
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
//是否为两大一重
|
||||
if (item && item.key === 'majorSign') {
|
||||
if (data.includes(0)) {
|
||||
data.splice(0, data.length)
|
||||
data.push(0)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
}
|
||||
//加载设备设施清单列表
|
||||
public loadJobData(id?) {
|
||||
this.diviceService.selectByPage({ pageSize: 1000, unitId: id }).then((res: any) => {
|
||||
this.diviceList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
type: item.type,
|
||||
postCode: item.postCode,
|
||||
postName: item.postName,
|
||||
items: item.items,
|
||||
itemNum: item.itemNum
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
//检查项目
|
||||
public showPros(el, data) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if (isTarget) {
|
||||
this.showProtable = true;
|
||||
this.currentProTableData.datas = data.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
//检查项目--关闭
|
||||
public proCallback() {
|
||||
this.showProtable = false;
|
||||
}
|
||||
//评价信息
|
||||
public showUpdateModel(row, isReadonly, isModifyonly) {
|
||||
this.updateParams = { number: null, tableItems: [] } as any;
|
||||
if (!row) {
|
||||
this.currentId = -1;
|
||||
this.showUpdate = true;
|
||||
} else {
|
||||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId).then((res: any) => {
|
||||
if (isReadonly) {
|
||||
this.updateParams = Object.assign({
|
||||
majorHazardName: !res.data.majorHazard ? null : res.data.majorHazard.split(";").map(item => this.sourceMap[item]).join(";"),
|
||||
regulatoryProcessName: !res.data.regulatoryProcess ? null : res.data.regulatoryProcess.split(";").map(item => this.craftMap[item]).join(";"),
|
||||
regulatoryChemicalName: !res.data.regulatoryChemical ? null : res.data.regulatoryChemical.split(";").map(item => this.chemicaltMap[item]).join(";"),
|
||||
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(";").map(item => this.$store.getters.prevention_majorsign_map[item]).join(";"),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type]
|
||||
}, res.data)
|
||||
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
|
||||
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
|
||||
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
|
||||
this.updateParams.items = this.updateParams.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
this.isReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.isModifyonly = true
|
||||
this.updateParams = res.data;
|
||||
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
|
||||
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
|
||||
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
|
||||
this.loadUnitData(res.data.areas)
|
||||
this.loadJobData(res.data.unitId)
|
||||
this.updateParams.items.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
}
|
||||
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
//保存 更新
|
||||
public doSave(goOn?) {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
if (!this.updateParams.id) {
|
||||
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
|
||||
this.updateParams.items = this.updateParams.steps
|
||||
this.updateParams.itemNum = this.updateParams.steps.length
|
||||
} else {
|
||||
this.updateParams.itemNum = this.updateParams.items.length
|
||||
}
|
||||
}
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id ? true : false).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
//存草稿
|
||||
public doSaveDraft() {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
|
||||
this.updateParams.items = this.updateParams.steps
|
||||
this.updateParams.itemNum = this.updateParams.steps.length
|
||||
} else {
|
||||
this.updateParams.itemNum = this.updateParams.items.length
|
||||
}
|
||||
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.showUpdate = false;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.userId === item.userId);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
public handleSubSelectionChange(data) {
|
||||
this.subSelectData = data
|
||||
}
|
||||
|
||||
//分析评价
|
||||
public showSubModel(row, isReadonly) {
|
||||
this.updateParams.steps = this.updateParams.items
|
||||
this.analysisUpdateParams = {
|
||||
riskChoose: [],
|
||||
remainChoose: [],
|
||||
} as any;
|
||||
if (row) {
|
||||
if (isReadonly) {
|
||||
this.analyIsReadonly = true;
|
||||
this.analysisUpdateParams = Object.assign({
|
||||
seriousResultName: row.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";"),
|
||||
safetySignName: row.safetySign.split(";").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";"),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
|
||||
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
|
||||
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[row.deviceType]
|
||||
}, row)
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
|
||||
} else {
|
||||
this.analyIsReadonly = false
|
||||
// 暂存数据 用于取消修改
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult)
|
||||
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign)
|
||||
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(";") : []
|
||||
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(";") : []
|
||||
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName
|
||||
this.analysisUpdateParams.deviceName = this.updateParams.name
|
||||
this.analysisUpdateParams.deviceType = this.updateParams.type
|
||||
}
|
||||
}
|
||||
this.showSubUpdate = true
|
||||
}
|
||||
|
||||
//数组转字符串
|
||||
public arrayChangeString(data) {
|
||||
if (data && data.length > 0) {
|
||||
if (data instanceof Array) {
|
||||
return data.join(";")
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
//字符串转数组
|
||||
public stringChangeArray(data) {
|
||||
if (data) {
|
||||
return data.split(";").map((item) => parseInt(item))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -1,33 +1,40 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div class="common-tree-box">
|
||||
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
:full-btn="false" @change="changes" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
|
||||
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border tooltip-effect="dark"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" style="pointer-events: none;" @click="showSteps($event,scope.row)"
|
||||
v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -37,30 +44,34 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions"
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" @change="changes" labelWidth="110px"
|
||||
labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
<div class="sub-title">作业步骤</div>
|
||||
|
||||
<TableComponent :tableData="tableData" :tableColumn="subTableColumn" @actionCallback="callback($event)"
|
||||
:actions="subTableActions" actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="callback($event)" :actions="!isReadonly?subTableActions:[]" actionPosition="flex-start"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="250" border row-key="checked"
|
||||
<el-table ref="multipleTable" :data="updateParams.steps" tooltip-effect="dark" height="250" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
<el-table-column type="selection" label="全选" width="40" v-if="!isReadonly">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key">
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="操作" width="100" v-if="!isReadonly">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="showSubUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="doSubDelete(scope.row.index - 1)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -68,12 +79,29 @@
|
|||
</TableComponent>
|
||||
</FormComponent>
|
||||
|
||||
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
:visible.sync="showSubUpdate" width="500" :before-close="handleClose">
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
<el-dialog :close-on-click-modal="false" :title="!stepUpdateParams.id?'新增':'编辑'" :visible.sync="showSubUpdate"
|
||||
width="500" :before-close="handleClose">
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" @change="changes" labelAlign="right" :data.sync="stepUpdateParams"
|
||||
:full-btn="true" btnPosition="center" @actionCallback="callback" :actions="updateActions"></FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="作业步骤" :visible.sync="showSteptable" width="800"
|
||||
:before-close="handleClose">
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentStepTableData.datas" tooltip-effect="dark" height="250" border style="width: 100%">
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from "./work.component.html"
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
|
|
@ -8,57 +8,42 @@ import TableComponent from "hbt-common/components/common/table.component.vue"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
import WorkService from '@/service/work.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
UnitTreeComponent
|
||||
},
|
||||
})
|
||||
export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new WorkService();
|
||||
public unitService = new UnitService()
|
||||
public areaService = new AreaService()
|
||||
|
||||
public params = {} as any;
|
||||
public params = {
|
||||
areaName:"",
|
||||
unitName:"",
|
||||
name:""
|
||||
} as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
|
||||
public currentStepTableData = {
|
||||
datas:[]
|
||||
} as any;
|
||||
|
||||
public stepUpdateParams = {} as any;
|
||||
|
||||
public currentId = -1;
|
||||
|
||||
public treeData = [] as any;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
|
|
@ -82,18 +67,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
}];
|
||||
public subTableActions = [{
|
||||
name:"添加",
|
||||
value:"subAdd",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"subDelete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
}];
|
||||
public subTableActions:BtnOption[] = [];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
|
|
@ -104,15 +78,15 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
key:"areaName",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
key:"unitName",
|
||||
type:"text",
|
||||
},{
|
||||
name:"作业活动",
|
||||
key:"unitId",
|
||||
key:"name",
|
||||
type:"text",
|
||||
}];
|
||||
|
||||
|
|
@ -120,119 +94,13 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
public updateParams = {} as any;
|
||||
public selectData = [];
|
||||
|
||||
public areaList = [];
|
||||
public unitList = [];
|
||||
|
||||
public updateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"选择区域",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"区域1",
|
||||
value:0
|
||||
},{
|
||||
name:"区域2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"选择单元",
|
||||
key:"unitId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"单元1",
|
||||
value:0
|
||||
},{
|
||||
name:"单元2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"deptId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"作业名称",
|
||||
key:"workName",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"作业地点",
|
||||
key:"position",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
},{
|
||||
name:"涉及岗位",
|
||||
key:"job",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"岗位1",
|
||||
value:0
|
||||
},{
|
||||
name:"岗位2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"安全因素",
|
||||
key:"safeKey",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"因素1",
|
||||
value:0
|
||||
},{
|
||||
name:"因素2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"辨识人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"辨识时间",
|
||||
key:"time",
|
||||
type:"date",
|
||||
subType:"date",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
format:"yyyy-MM-dd"
|
||||
}];
|
||||
public isReadonly = false;
|
||||
|
||||
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
|
||||
|
||||
|
||||
|
|
@ -251,104 +119,354 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
public showSubUpdate = false;
|
||||
|
||||
public subUpdateOptions:FormOption<BtnOption>[] = [{
|
||||
name:"步骤名称",
|
||||
key:"stepName",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
},{
|
||||
name:"作业步骤描述",
|
||||
key:"stepName",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
},{
|
||||
name:"作业地点",
|
||||
key:"stepName",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"作业人",
|
||||
key:"person",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"人员1",
|
||||
value:0
|
||||
},{
|
||||
name:"人员2",
|
||||
value:1
|
||||
}]
|
||||
}]
|
||||
public showSteptable = false;
|
||||
|
||||
public subUpdateOptions:FormOption<BtnOption>[] = [];
|
||||
@Watch("$store.state.deptList",{immediate:true,deep:true})
|
||||
onChanges(){
|
||||
this.loadAreaData()
|
||||
}
|
||||
|
||||
created(){
|
||||
}
|
||||
|
||||
public buildUpdateForm(){
|
||||
this.updateOptions=[{
|
||||
name:"选择区域",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
format:"areaName",
|
||||
showError:false,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"选择单元",
|
||||
key:"unitId",
|
||||
type:"select",
|
||||
format:"unitName",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.unitList
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"chargeDeptId",
|
||||
format:"chargeDeptName",
|
||||
type:"treeSelect",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
expandLevel:Infinity,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptTreeList
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"chargeUserId",
|
||||
format:"chargeUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
name:"作业名称",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"作业地点",
|
||||
key:"location",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
showError:false,
|
||||
name:"涉及岗位",
|
||||
key:"postCode",
|
||||
format:"postName",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:this.$store.state.postList
|
||||
},{
|
||||
name:"安全因素",
|
||||
key:"safetyFactor",
|
||||
format:"safetyFactorName",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_safe_reason
|
||||
},{
|
||||
name:"辨识人",
|
||||
key:"identifyUserId",
|
||||
format:"identifyUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
name:"辨识时间",
|
||||
key:"identifyTime",
|
||||
type:"date",
|
||||
subType:"date",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
format:"yyyy-MM-dd"
|
||||
}];
|
||||
|
||||
this.subTableActions = [{
|
||||
name:"添加",
|
||||
value:"subAdd",
|
||||
icon:"el-icon-plus",
|
||||
hide:this.isReadonly,
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"subDelete",
|
||||
plain:true,
|
||||
hide:this.isReadonly,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
}];
|
||||
this.subUpdateOptions=[{
|
||||
name:"步骤名称",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"作业步骤描述",
|
||||
key:"description",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"作业地点",
|
||||
key:"location",
|
||||
type:"text",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"chargeUserId",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
name:"作业人",
|
||||
key:"workerId",
|
||||
type:"select",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.userList
|
||||
}]
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData(){
|
||||
this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
|
||||
this.areaList = res.data.datas.map(item=>{
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(id?){
|
||||
this.unitService.selectByPage({pageSize:1000,areaId:id},false).then((res:any)=>{
|
||||
this.unitList = res.data.datas.map(item=>{
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
console.log(data)
|
||||
this.params.unitName="";
|
||||
this.params.areaName="";
|
||||
if(data.areaId){
|
||||
this.params.unitName = data.name
|
||||
}else{
|
||||
this.params.areaName = data.name
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险分析单元',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'作业活动',key:"person"});
|
||||
this.tableColumn.push({name:'作业步骤',key:"person"});
|
||||
this.tableColumn.push({name:'责任部门',key:"person"});
|
||||
this.tableColumn.push({name:'责任人',key:"person"});
|
||||
this.tableColumn.push({name:'作业地点',key:"person"});
|
||||
this.tableColumn.push({name:'涉及岗位',key:"person"});
|
||||
this.tableColumn.push({name:'区域名称',key:"areaName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险分析单元',key:"unitName",width:"200px"});
|
||||
this.tableColumn.push({name:'作业活动',key:"name",showTip:true});
|
||||
this.tableColumn.push({name:'作业步骤',key:"stepNum",render:(data)=>{
|
||||
return "<span class='link'>"+(data.stepNum?data.stepNum:0)+"</span>"
|
||||
}});
|
||||
this.tableColumn.push({name:'责任部门',key:"chargeDeptName"});
|
||||
this.tableColumn.push({name:'责任人',key:"chargeUserName"});
|
||||
this.tableColumn.push({name:'作业地点',key:"location",showTip:true});
|
||||
this.tableColumn.push({name:'涉及岗位',key:"postName",width:"200px",showTip:true});
|
||||
|
||||
|
||||
this.subTableColumn.push({name:'序号',key:"person"});
|
||||
this.subTableColumn.push({name:'步骤名称',key:"person"});
|
||||
this.subTableColumn.push({name:'作业步骤描述',key:"person",showTip:true,});
|
||||
this.subTableColumn.push({name:'作业地点',key:"person"});
|
||||
this.subTableColumn.push({name:'责任人',key:"person"});
|
||||
this.subTableColumn.push({name:'作业人',key:"person"});
|
||||
this.subTableColumn.push({name:'序号',key:"index",width:"60"});
|
||||
this.subTableColumn.push({name:'步骤名称',key:"name"});
|
||||
this.subTableColumn.push({name:'作业步骤描述',key:"description",showTip:true,});
|
||||
this.subTableColumn.push({name:'作业地点',key:"location",showTip:true});
|
||||
this.subTableColumn.push({name:'责任人',key:"chargeUserName"});
|
||||
this.subTableColumn.push({name:'作业人',key:"workerName"});
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public showSteps(el,data){
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if(isTarget){
|
||||
this.showSteptable = true;
|
||||
this.currentStepTableData.datas = data.steps.map((item,index)=>{
|
||||
item.index=index+1;
|
||||
return item
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public changes(data,item){
|
||||
// 部门
|
||||
if(item && item.key === "chargeDeptId"){
|
||||
this.updateParams.chargeDeptName = this.$store.getters.dept_map[data];
|
||||
}
|
||||
// 新增编辑选择人员
|
||||
if(item && item.key === "chargeUserId"){
|
||||
if(this.showSubUpdate){
|
||||
this.stepUpdateParams.chargeUserName = this.$store.getters.user_map[data];
|
||||
return
|
||||
}
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data];
|
||||
}
|
||||
// 新增编辑选择人员
|
||||
if(item && item.key === "workerId"){
|
||||
this.stepUpdateParams.workerName = this.$store.getters.user_map[data];
|
||||
}
|
||||
// 辨识人
|
||||
if(item && item.key === "identifyUserId"){
|
||||
this.updateParams.identifyUserName = this.$store.getters.user_map[data];
|
||||
}
|
||||
// 区域
|
||||
if(item && item.key==="areaId"){
|
||||
if(this.updateParams.unitId){
|
||||
this.updateParams.unitId = null;
|
||||
}
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
// 岗位
|
||||
if(item && item.key==="postCode"){
|
||||
this.updateParams.postName = data.map(itm=>this.$store.getters.post_map[itm]).join(";");
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if(data && data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
}else if(data && data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
}else if(data && data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
}else if(data && data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdate = true
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "subAdd"){
|
||||
this.showSubUpdate = true
|
||||
}else if(data && data.value === "add"){
|
||||
this.showUpdateModel();
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((itm:any)=>itm.id))
|
||||
}else if(data && data.value === "subAdd"){
|
||||
this.showSubUpdateModel()
|
||||
}else if(data && data.value === "subDelete"){
|
||||
// 批量删除步骤
|
||||
this.doSubDelete(this.selectData.map((itm:any)=>itm.index - 1))
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSave(data.value!=="save")
|
||||
}else if(data && data.value === "cancel"){
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
|
||||
public showSubUpdateModel(row?){
|
||||
this.stepUpdateParams = {} as any;
|
||||
if(row){
|
||||
this.stepUpdateParams = JSON.parse(JSON.stringify(row));
|
||||
}
|
||||
this.showSubUpdate = true;
|
||||
}
|
||||
|
||||
public doSubDelete(indexs){
|
||||
for(let i = this.updateParams.steps.length-1;i>=0;i--){
|
||||
if(indexs.includes(i)){
|
||||
this.updateParams.steps.splice(i,1)
|
||||
}
|
||||
}
|
||||
this.updateParams.steps.forEach((item,index)=>{
|
||||
item.index = index+1;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
public doSave(goOn?){
|
||||
// 如果是新增步骤
|
||||
if(this.showSubUpdate){
|
||||
// 新增
|
||||
if(!this.stepUpdateParams.index){
|
||||
this.stepUpdateParams.index = this.updateParams.steps.length+1;
|
||||
this.updateParams.steps.push(this.stepUpdateParams);
|
||||
}else{
|
||||
this.updateParams.steps.splice(this.updateParams.steps.findIndex(item=>item.index ===this.stepUpdateParams.index),1,this.stepUpdateParams)
|
||||
}
|
||||
this.stepUpdateParams = {} as any;
|
||||
this.showSubUpdate=!!goOn;
|
||||
return
|
||||
}
|
||||
// 新增清单
|
||||
this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(",");
|
||||
this.updateParams.stepNum = this.updateParams.steps.length;
|
||||
this.updateParams.postCode = this.updateParams.postCode.join(";")
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功!");
|
||||
this.updateParams = {
|
||||
postCode:[],
|
||||
safetyFactor:[]
|
||||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
this.params = {
|
||||
areaName:"",
|
||||
unitName:"",
|
||||
name:"",
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
} as any;
|
||||
|
|
@ -356,16 +474,45 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
public showUpdateModel(row?,isRead?){
|
||||
this.isReadonly = !!isRead;
|
||||
if(!row){
|
||||
this.currentId = -1;
|
||||
this.updateParams = {steps:[]} as any;
|
||||
}else{
|
||||
this.currentId = row.id;
|
||||
this.updateParams = JSON.parse(JSON.stringify(row));
|
||||
|
||||
if(!this.updateParams.steps){
|
||||
this.updateParams.steps = [];
|
||||
}
|
||||
this.updateParams.steps.forEach((item,index)=>{
|
||||
item.index = index+1;
|
||||
});
|
||||
this.currentStepTableData.datas = this.updateParams.steps;
|
||||
if(!isRead){
|
||||
this.updateParams.postCode = this.updateParams.postCode.split(";").map(item=>+item);
|
||||
this.updateParams.safetyFactor = this.updateParams.safetyFactor.split(",").map(item=>+item);
|
||||
}else{
|
||||
this.updateParams.safetyFactor = this.updateParams.safetyFactor.split(",").map(item=>+item);
|
||||
this.updateParams.safetyFactorName = this.updateParams.safetyFactor.map(item=>this.$store.getters.prevention_safe_reason_map[item]).join(",")
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
}
|
||||
// 防止选中后影响表单内列表选中
|
||||
this.selectData = [];
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
if(this.showSubUpdate){
|
||||
this.showSubUpdate = false;
|
||||
this.stepUpdateParams = {} as any;
|
||||
return
|
||||
}
|
||||
this.showSteptable = false;
|
||||
this.showUpdate = false;
|
||||
this.updateParams = {} as any;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +1,38 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div class="common-tree-box">
|
||||
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
:full-btn="false" @change="changes" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
|
||||
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row,false,true)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -37,9 +41,76 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
<el-dialog :close-on-click-modal="false" :title="!updateParams.id?'新增':isReadonly?'详情':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams"></FormComponent>
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="callback" @change="changes">
|
||||
<div class="sub-title">工作危害分析法</div>
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="callback($event)" :actions="isReadonly? []:subTableActions" actionPosition="flex-start"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
|
||||
<el-table ref="multipleTable" :data="updateParams.steps" tooltip-effect="dark" height="250" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isReadonly" type="text"
|
||||
@click="showSubModel(scope.row,isReadonly)">查看</el-button>
|
||||
<el-button v-if="isModifyonly" type="text" @click="showSubModel(scope.row)">修改</el-button>
|
||||
<el-button v-if="!isReadonly" type="text" @click="showSubModel(scope.row)">评价</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
<FormComponent :options="subBasicRiskOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="callback" @change="changes"
|
||||
:actions="isReadonly? []:updateActions" :full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
|
||||
</el-dialog>
|
||||
<!-- 评估矩阵 -->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showMatrixModal" width="500px" :title="'区域风险等级判定准则'">
|
||||
<img style="width:100%" src="../../../../assets/images/5.png" alt="">
|
||||
</el-dialog>
|
||||
<!-- 危害分析评价 -->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showSubUpdate" width="880px"
|
||||
:before-close="handleAnalyClose">
|
||||
<AnalEvaluationComponent :isReadonly="analyIsReadonly" :data.sync="analysisUpdateParams"
|
||||
:show.sync="showSubUpdate" @actionCallback="analyCallback" :tabledata.sync="updateParams"
|
||||
:areaList="areaList" :type="'work'"></AnalEvaluationComponent>
|
||||
</el-dialog>
|
||||
<!-- 检查项目 -->
|
||||
<el-dialog :close-on-click-modal="false" title="检查项目" :show-close="false" :visible.sync="showProtable"
|
||||
width="940px">
|
||||
<FormComponent labelWidth="110px" labelAlign="right" :actions="proActions" @actionCallback="proCallback"
|
||||
:full-btn="true" btnPosition="center">
|
||||
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250"
|
||||
border style="width: 100%">
|
||||
<template v-for="item in proTableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from "./workAnal.component.html"
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
|
|
@ -8,192 +8,828 @@ import TableComponent from "hbt-common/components/common/table.component.vue"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
import AnalEvaluationComponent from '@/components/analEvaluation.component.vue';
|
||||
import WorkService from '@/service/work.service';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
import SystemService from "hbt-common/service/system.service"
|
||||
import JobHazardService from '@/service/jobHazard.service';
|
||||
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
|
||||
import moment from "moment"
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
AnalEvaluationComponent,
|
||||
UnitTreeComponent,
|
||||
ButtonListComponent
|
||||
},
|
||||
})
|
||||
export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new JobHazardService();
|
||||
public unitService = new UnitService();
|
||||
public areaService = new AreaService();
|
||||
public systemService = new SystemService();
|
||||
// public diviceService = new DiviceService();
|
||||
public workService = new WorkService();
|
||||
|
||||
public params = {} as any;
|
||||
public params = {
|
||||
areaName: "",
|
||||
unitName: "",
|
||||
} as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
public treeData = [] as any;
|
||||
|
||||
public areaList = [];
|
||||
public unitList = [];
|
||||
public jobList = [];
|
||||
public isReadonly = false;
|
||||
public isModifyonly = false;
|
||||
public subTableColumn = [] as any;
|
||||
public currentId = -1;
|
||||
|
||||
public sourceMap = {} as any;
|
||||
public craftMap = {} as any;
|
||||
public chemicaltMap = {} as any
|
||||
public majorsignMap = {} as any;
|
||||
|
||||
//检查项目
|
||||
public showProtable = false;
|
||||
|
||||
public proTableColumn = [] as any;
|
||||
|
||||
public currentProTableData = {
|
||||
datas: []
|
||||
} as any;
|
||||
|
||||
public proActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
//数据字典
|
||||
public dictData = {
|
||||
source: [],
|
||||
craft: [],
|
||||
chemical: [],
|
||||
mainPerson: [],
|
||||
craftPerson: [],
|
||||
operatePerson: [],
|
||||
measuresSort: [],
|
||||
riskControlLevel: [],
|
||||
seriousResult: [],
|
||||
identifier: [],
|
||||
majorsign: [],
|
||||
} as any;
|
||||
//评估矩阵
|
||||
public showMatrixModal = false;
|
||||
//评价
|
||||
public showSubUpdate = false;
|
||||
|
||||
public analyIsReadonly = false;
|
||||
//危害分析评价
|
||||
public analysisUpdateParams = {
|
||||
riskChoose: [],
|
||||
remainChoose: [],
|
||||
remainLevel: null,
|
||||
riskLevel: null,
|
||||
datas: []
|
||||
|
||||
} as any;
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"作业活动",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: '存草稿',
|
||||
value: 'addDraft',
|
||||
type: "primay"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitName",
|
||||
type: "text",
|
||||
},];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public updateParams = {
|
||||
majorSign: [],
|
||||
steps: [],
|
||||
evaluateTime: moment().format('YYYY-MM-DD'),
|
||||
evaluateUserId: this.account.userId,
|
||||
evaluateUserName: this.account.nickName,
|
||||
} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
public subSelectData = []
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
public subBasicRiskOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
public subTableActions: BtnOption[] = [];
|
||||
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "区域名称",
|
||||
key: "areaId",
|
||||
format: "areaName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.areaList
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitId",
|
||||
format: "unitName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.unitList
|
||||
}, {
|
||||
name: "责任部门",
|
||||
key: "chargeDeptName",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "责任人",
|
||||
key: "chargeUserName",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "作业名称",
|
||||
key: "jobInventoryId",
|
||||
format: 'jobInventoryName',
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.jobList,
|
||||
}, {
|
||||
name: "作业地点",
|
||||
key: "location",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "涉及岗位",
|
||||
key: "postName",
|
||||
type: "text",
|
||||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "评价人",
|
||||
key: "evaluateUserId",
|
||||
format: "evaluateUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
type: "select",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList
|
||||
}, {
|
||||
name: "评价时间",
|
||||
key: "evaluateTime",
|
||||
type: "date",
|
||||
subType: "date",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
}, {
|
||||
name: "是否为两大一重",
|
||||
key: "majorSign",
|
||||
format: "majorSignName",
|
||||
type: "checkbox",
|
||||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
datas: this.$store.state.prevention_majorsign,
|
||||
}, {
|
||||
name: "重大危险源",
|
||||
key: "majorHazard",
|
||||
hide: !this.updateParams.majorSign.includes(1) || this.updateParams.majorSign.includes(0),
|
||||
type: "select",
|
||||
format: "majorHazardName",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
datas: this.dictData.source
|
||||
|
||||
}, {
|
||||
name: "重点监管工艺",
|
||||
key: "regulatoryProcess",
|
||||
format: "regulatoryProcessName",
|
||||
hide: !this.updateParams.majorSign.includes(2) || this.updateParams.majorSign.includes(0),
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
datas: this.dictData.craft,
|
||||
}, {
|
||||
name: "重点监管化学品",
|
||||
key: "regulatoryChemical",
|
||||
format: "regulatoryChemicalName",
|
||||
hide: !this.updateParams.majorSign.includes(3) || this.updateParams.majorSign.includes(0),
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
datas: this.dictData.chemical,
|
||||
}];
|
||||
|
||||
this.subTableActions = [{
|
||||
name: "批量删除",
|
||||
value: "subDelete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}, {
|
||||
name: "评估矩阵",
|
||||
value: "estimateMatrix",
|
||||
type: "primary"
|
||||
}];
|
||||
this.subBasicRiskOptions = [{
|
||||
name: "风险等级",
|
||||
key: "riskLevel",
|
||||
format: 'riskLevelName',
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
}, {
|
||||
name: "残余风险等级",
|
||||
key: "remainRiskLevel",
|
||||
format: "remainRiskLevelName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
}]
|
||||
}
|
||||
|
||||
@Watch("$store.state.deptList", { immediate: true, deep: true })
|
||||
onChanges() {
|
||||
this.loadAreaData()
|
||||
}
|
||||
@Watch("updateParams", { immediate: true, deep: true })
|
||||
onCountValueChange() {
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
created() {
|
||||
Promise.all([
|
||||
this.systemService.getDictData("prevention_risk_source"),
|
||||
this.systemService.getDictData("prevention_risk_craft"),
|
||||
this.systemService.getDictData("prevention_risk_chemical"),
|
||||
]).then(((results: any) => {
|
||||
this.dictData.source = results[0].data.map((item) => {
|
||||
this.sourceMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.craft = results[1].data.map((item) => {
|
||||
this.craftMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.chemical = results[2].data.map((item) => {
|
||||
this.chemicaltMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.buildUpdateForm()
|
||||
}));
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.unitList = [];
|
||||
this.jobList = [];
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : 0,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(id?) {
|
||||
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
|
||||
this.unitList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
deptId: item.chargeDeptId,
|
||||
userId: item.chargeUserId,
|
||||
deptName: item.chargeDeptName,
|
||||
userName: item.chargeUserName,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
console.log(data)
|
||||
public handleNodeClick(data) {
|
||||
this.params.unitName = "";
|
||||
this.params.areaName = "";
|
||||
if (data.areaId) {
|
||||
this.params.unitName = data.name
|
||||
} else {
|
||||
this.params.areaName = data.name
|
||||
}
|
||||
this.getTableData()
|
||||
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险分析单元',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'作业活动',key:"person"});
|
||||
this.tableColumn.push({name:'作业步骤',key:"person"});
|
||||
this.tableColumn.push({name:'责任部门',key:"person"});
|
||||
this.tableColumn.push({name:'责任人',key:"person"});
|
||||
this.tableColumn.push({name:'作业地点',key:"person"});
|
||||
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName", width: "150px" });
|
||||
this.tableColumn.push({ name: '风险分析单元', key: "unitName", width: "150px" });
|
||||
this.tableColumn.push({ name: '作业活动', key: "jobInventoryName", });
|
||||
this.tableColumn.push({
|
||||
name: '作业步骤', key: "stepNum", render: (data) => {
|
||||
return "<span class='link'>" + (data.stepNum ? data.stepNum : 0) + "</span>"
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'残余风险等级',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
});
|
||||
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
|
||||
this.tableColumn.push({ name: '责任人', key: "chargeUserName" });
|
||||
this.tableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
}
|
||||
}});
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '残余风险等级', key: "remainRiskLevel", width: "150px", render: (data) => {
|
||||
return "<span class='color_" + data.remainRiskLevel + "'>" + (data.remainRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.remainRiskLevel]) : '') + "</span>"
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status", render: (data) => {
|
||||
if (data.status) {
|
||||
return "<span class='color_" + data.status + "'>" + (data.status ? (this.$store.getters.prevention_evaluate_status_map[data.status]) : '') + "</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//分析评价
|
||||
this.subTableColumn.push({ name: '序号', key: "index" });
|
||||
this.subTableColumn.push({ name: '步骤名称', key: "name" });
|
||||
this.subTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" });
|
||||
this.subTableColumn.push({ name: '作业地点', key: "location" }); this.subTableColumn.push({ name: '风险源', key: "riskSource" });
|
||||
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis" });
|
||||
this.subTableColumn.push({
|
||||
name: '最严重后果', key: "seriousResult", width: "200px", render: (data) => {
|
||||
if (data.seriousResult) {
|
||||
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
if (data.riskLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({ name: '评估方法', key: "riskChoose", });
|
||||
this.subTableColumn.push({
|
||||
name: '残余风险等级', key: "remainLevel", width: "200px", render: (data) => {
|
||||
if (data.remainLevel) {
|
||||
return this.$store.getters.prevention_risk_level_map[data.remainRiskLevel]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({ name: '评估方法', key: "remainChoose", });
|
||||
this.subTableColumn.push({
|
||||
name: '管控措施', key: "measuresNum", render: (data) => {
|
||||
if (data.measuresNum) {
|
||||
return data.measuresNum
|
||||
} else {
|
||||
if (data.measures && data.measures.length) {
|
||||
return data.measures.length
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//作业步骤
|
||||
this.proTableColumn.push({ name: '序号', key: "index" });
|
||||
this.proTableColumn.push({ name: '步骤名称', key: "name" });
|
||||
this.proTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" });
|
||||
this.proTableColumn.push({ name: '作业地点', key: "location" });
|
||||
this.proTableColumn.push({ name: '风险源', key: "riskSource" });
|
||||
this.proTableColumn.push({
|
||||
name: '可能发生事故', key: "seriousResult", width: "150px", render: (data) => {
|
||||
if (data.seriousResult) {
|
||||
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
});
|
||||
this.proTableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
if (data.riskLevel) {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
this.proTableColumn.push({
|
||||
name: '残余风险等级', key: "remainLevel", width: "150px", render: (data) => {
|
||||
if (data.remainLevel) {
|
||||
return "<span class='color_" + data.remainLevel + "'>" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public callback(data) {
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === "add") {
|
||||
this.isReadonly = false;
|
||||
this.showUpdate = true
|
||||
this.updateParams = {
|
||||
majorSign: [],
|
||||
items: [],
|
||||
evaluateTime: moment().format('YYYY-MM-DD'),
|
||||
evaluateUserId: this.account.userId,
|
||||
evaluateUserName: this.account.nickName,
|
||||
} as any
|
||||
} else if (data.value === "cancel") {
|
||||
this.handleClose()
|
||||
} else if (data.value === "estimateMatrix") {
|
||||
this.showMatrixModal = true
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
this.isReadonly = false;
|
||||
} else if (data && data.value === 'addDraft') {
|
||||
this.doSaveDraft()
|
||||
this.isReadonly = false;
|
||||
} else if (data && data.value === "subDelete") {
|
||||
if (this.subSelectData.length > 0) {
|
||||
if (!this.updateParams.deleteIds) {
|
||||
this.updateParams.deleteIds = []
|
||||
}
|
||||
this.subSelectData.map((itemData: any) => {
|
||||
this.updateParams.deleteIds.push(itemData.id)
|
||||
this.updateParams.steps.splice(this.updateParams.steps.findIndex(item => item.index === itemData.index), 1)
|
||||
})
|
||||
this.updateParams.steps.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
this.updateParams.stepNum = this.updateParams.steps.length
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
// 区域
|
||||
if (item && item.key === "areaId") {
|
||||
this.jobList = [];
|
||||
if (this.updateParams.unitId) {
|
||||
this.updateParams.unitId = null;
|
||||
}
|
||||
const areaData = this.areaList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
this.updateParams.chargeDeptName = null;
|
||||
this.updateParams.chargeUserId = null;
|
||||
this.updateParams.chargeUserName = null;
|
||||
this.updateParams.chargeDeptId = null;
|
||||
|
||||
public showUpdateModel(id){
|
||||
this.showUpdate = true
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.jobInventoryName = null;
|
||||
this.updateParams.jobInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
//单元
|
||||
if (item && item.key === 'unitId') {
|
||||
const unitData = this.unitList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.chargeDeptName = unitData.deptName;
|
||||
this.updateParams.chargeUserId = unitData.userId;
|
||||
this.updateParams.chargeUserName = unitData.userName;
|
||||
this.updateParams.chargeDeptId = unitData.deptId;
|
||||
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.jobInventoryName = null;
|
||||
this.updateParams.jobInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
this.loadJobData(data)
|
||||
|
||||
}
|
||||
//作业清单
|
||||
if (item && item.key === 'jobInventoryId') {
|
||||
const jobData = this.jobList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.location = jobData.location;
|
||||
this.updateParams.postCode = jobData.postCode;
|
||||
this.updateParams.postName = jobData.postName;
|
||||
this.updateParams.steps = jobData.steps;
|
||||
this.updateParams.jobInventoryName = jobData.name;
|
||||
this.updateParams.stepNum = jobData.steps.length;
|
||||
this.updateParams.steps.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
//是否为两大一重
|
||||
if (item && item.key === 'majorSign') {
|
||||
if (data.includes(0)) {
|
||||
data.splice(0, data.length)
|
||||
data.push(0)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
}
|
||||
//加载作业清单列表
|
||||
public loadJobData(id?) {
|
||||
this.workService.selectByPage({ pageSize: 1000, unitId: id }).then((res: any) => {
|
||||
this.jobList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
location: item.location,
|
||||
postCode: item.postCode,
|
||||
postName: item.postName,
|
||||
steps: item.steps,
|
||||
stepNum: item.stepNum
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
//作业步骤
|
||||
public showPros(el, data) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if (isTarget) {
|
||||
this.showProtable = true;
|
||||
this.currentProTableData.datas = data.steps.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
//作业步骤--关闭
|
||||
public proCallback() {
|
||||
this.showProtable = false;
|
||||
}
|
||||
//评价信息
|
||||
public showUpdateModel(row, isReadonly, isModifyonly) {
|
||||
this.updateParams = { majorSign: [], steps: [], } as any;
|
||||
if (!row) {
|
||||
this.currentId = -1;
|
||||
this.showUpdate = true;
|
||||
} else {
|
||||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId).then((res: any) => {
|
||||
if (isReadonly) {
|
||||
this.updateParams = Object.assign({
|
||||
majorHazardName: !res.data.majorHazard ? null : res.data.majorHazard.split(";").map(item => this.sourceMap[item]).join(";"),
|
||||
regulatoryProcessName: !res.data.regulatoryProcess ? null : res.data.regulatoryProcess.split(";").map(item => this.craftMap[item]).join(";"),
|
||||
regulatoryChemicalName: !res.data.regulatoryChemical ? null : res.data.regulatoryChemical.split(";").map(item => this.chemicaltMap[item]).join(";"),
|
||||
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(";").map(item => this.$store.getters.prevention_majorsign_map[item]).join(";"),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type]
|
||||
}, res.data)
|
||||
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
|
||||
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
|
||||
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
|
||||
this.updateParams.steps = this.updateParams.steps.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
this.isReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.isModifyonly = true
|
||||
this.updateParams = res.data;
|
||||
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
|
||||
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
|
||||
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
|
||||
this.loadUnitData(res.data.areas)
|
||||
this.loadJobData(res.data.unitId)
|
||||
this.updateParams.steps.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
}
|
||||
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
//保存 更新
|
||||
public doSave(goOn?) {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id ? true : false).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
//存草稿
|
||||
public doSaveDraft() {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.showUpdate = false;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.userId === item.userId);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
public handleSubSelectionChange(data) {
|
||||
this.subSelectData = data
|
||||
}
|
||||
|
||||
//分析评价
|
||||
public showSubModel(row, isReadonly) {
|
||||
this.analysisUpdateParams = {
|
||||
riskChoose: [],
|
||||
remainChoose: [],
|
||||
} as any;
|
||||
if (row) {
|
||||
if (isReadonly) {
|
||||
this.analyIsReadonly = true;
|
||||
this.analysisUpdateParams = Object.assign({
|
||||
seriousResultName: row.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";"),
|
||||
safetySignName: row.safetySign.split(";").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";"),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
|
||||
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
|
||||
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
|
||||
}, row)
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
|
||||
} else {
|
||||
this.analyIsReadonly = false
|
||||
// 暂存数据 用于取消修改
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult)
|
||||
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign)
|
||||
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(";") : []
|
||||
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(";") : []
|
||||
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName
|
||||
}
|
||||
}
|
||||
this.showSubUpdate = true
|
||||
}
|
||||
|
||||
//数组转字符串
|
||||
public arrayChangeString(data) {
|
||||
if (data && data.length > 0) {
|
||||
if (data instanceof Array) {
|
||||
return data.join(";")
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
//字符串转数组
|
||||
public stringChangeArray(data) {
|
||||
if (data) {
|
||||
return data.split(";").map((item) => parseInt(item))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<div class="common-box dis-flex " >
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box">
|
||||
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
|
|
@ -10,13 +9,18 @@
|
|||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
|
||||
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
|
|
@ -26,18 +30,28 @@
|
|||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="showUpdateModel(scope.row)">查看</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
<el-dialog :close-on-click-modal="false" :title="'详情'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
|
||||
<div class="sub-title">风险辨识情况</div>
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="subUpdateParams"></FormComponent>
|
||||
<div class="sub-title">风险评估情况</div>
|
||||
<FormComponent :options="subRiskOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="riskUpdateParams"></FormComponent>
|
||||
<div class="sub-title">残余风险评估情况</div>
|
||||
<FormComponent :options="subRemnantsOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="remainUpdateParams"></FormComponent>
|
||||
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
|
||||
</ButtonListComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -9,158 +9,433 @@ import IdentifyService from "@/service/identify.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
ButtonListComponent,
|
||||
UnitTreeComponent,
|
||||
},
|
||||
})
|
||||
export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new IdentifyService();
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
public params = {
|
||||
areaId:null,
|
||||
unitId:null,
|
||||
} as any;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "管控对象",
|
||||
key: "controlName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "分析对象",
|
||||
key: "analName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
public updateParams = {} as any;
|
||||
public selectData = [];
|
||||
//风险辨识情况
|
||||
public subUpdateParams = {} as any;
|
||||
//风险评估情况
|
||||
public riskUpdateParams = {} as any;
|
||||
//残余风险评估情况
|
||||
public remainUpdateParams = {} as any;
|
||||
|
||||
created(){
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
//风险评估
|
||||
public subRiskOptions: FormOption<BtnOption>[] = [];
|
||||
//残余风险评估
|
||||
public subRemnantsOptions: FormOption<BtnOption>[] = [];
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "管控对象",
|
||||
key: "controlName",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "分析对象",
|
||||
key: "analName",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "风险源",
|
||||
key: "riskSource",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)"
|
||||
},
|
||||
{
|
||||
name: "最严重后果",
|
||||
key: "seriousResult",
|
||||
format: "seriousResultName",
|
||||
type: "select",
|
||||
require: true,
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.prevention_serious_result,
|
||||
},
|
||||
{
|
||||
name: "危害分析",
|
||||
key: "hazardAnalysis",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(100% - 20px)"
|
||||
},
|
||||
{
|
||||
name: "安全警示标识",
|
||||
key: "safetySign",
|
||||
format: "safetySignName",
|
||||
type: "select",
|
||||
require: true,
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.prevention_security_identifier,
|
||||
},
|
||||
{
|
||||
name: "设置复评时间",
|
||||
key: "reviewStartTime",
|
||||
type: "date",
|
||||
subType: "date",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
},];
|
||||
|
||||
this.subRiskOptions = [
|
||||
{
|
||||
name: "LS法:",
|
||||
key: "riskLSValue",
|
||||
type: "text",
|
||||
// width: "20px",
|
||||
}, {
|
||||
name: "L值:",
|
||||
key: "lslvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "S值:",
|
||||
key: "lssvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "R值:",
|
||||
key: "lsrvalue",
|
||||
type: "text",
|
||||
width: "20%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "风险等级:",
|
||||
key: "lsgrade",
|
||||
format: 'lsgradeName',
|
||||
type: "text",
|
||||
width: "20%",
|
||||
labelWidth: "60px",
|
||||
}, {
|
||||
name: "LEC法:",
|
||||
key: "riskLECValue",
|
||||
type: "text",
|
||||
// labelWidth: "30px",
|
||||
}, {
|
||||
name: "L值:",
|
||||
key: "leclvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "E值:",
|
||||
key: "lecevalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "C值:",
|
||||
key: "leccvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "D值:",
|
||||
key: "lecdvalue",
|
||||
type: "text",
|
||||
width: "15%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "风险等级:",
|
||||
key: "lecgrade",
|
||||
format: "lecgradeName",
|
||||
type: "text",
|
||||
width: "20%",
|
||||
labelWidth: "60px",
|
||||
}, {
|
||||
name: "风险等级",
|
||||
key: "riskLevel",
|
||||
format: "riskLevelName",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "100%",
|
||||
}, {
|
||||
name: "管控层级",
|
||||
key: "riskControlLevel",
|
||||
format: "riskControlLevelName",
|
||||
type: "text",
|
||||
require: true,
|
||||
}];
|
||||
|
||||
this.subRemnantsOptions = [
|
||||
{
|
||||
name: "LS法:",
|
||||
key: "remainLSValue",
|
||||
type: "text",
|
||||
// width: "30px",
|
||||
}, {
|
||||
name: "L值:",
|
||||
key: "lslvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "S值:",
|
||||
key: "lssvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "R值:",
|
||||
key: "lsrvalue",
|
||||
type: "text",
|
||||
width: "20%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "风险等级:",
|
||||
key: "lsgrade",
|
||||
format: "lsgradeName",
|
||||
type: "text",
|
||||
width: "20%",
|
||||
labelWidth: "60px",
|
||||
}, {
|
||||
name: "LEC法:",
|
||||
key: "remainLECValue",
|
||||
type: "text",
|
||||
// width: "30px",
|
||||
}, {
|
||||
name: "L值:",
|
||||
key: "leclvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "E值:",
|
||||
key: "lecevalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "C值:",
|
||||
key: "leccvalue",
|
||||
type: "text",
|
||||
width: "10%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "D值:",
|
||||
key: "lecdvalue",
|
||||
type: "text",
|
||||
width: "15%",
|
||||
labelWidth: "40px",
|
||||
}, {
|
||||
name: "风险等级:",
|
||||
key: "lecgrade",
|
||||
format: "lecgradeName",
|
||||
type: "text",
|
||||
width: "20%",
|
||||
labelWidth: "60px",
|
||||
}, {
|
||||
name: "风险等级",
|
||||
key: "remainLevel",
|
||||
format: "remainLevelName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},];
|
||||
}
|
||||
|
||||
created() {
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
console.log(data)
|
||||
public handleNodeClick(data) {
|
||||
this.params.unitId = "";
|
||||
this.params.areaId = "";
|
||||
if (data.areaId) {
|
||||
this.params.unitId = data.id
|
||||
} else {
|
||||
this.params.areaId = data.id
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
|
||||
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
|
||||
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" });
|
||||
this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" });
|
||||
this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" });
|
||||
this.tableColumn.push({
|
||||
name: '事故后果', key: "seriousResult", width: "250px", render: (data) => {
|
||||
if (data.seriousResult) {
|
||||
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'残余风险等级', width:"110px",key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'评估人',key:"person"});
|
||||
this.tableColumn.push({name:'评估时间',key:"person",width:"150px"});
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '残余风险等级', width: "110px", key: "remainLevel", render: (data) => {
|
||||
return "<span class='color_" + data.remainLevel + "'>" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "</span>"
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '评估人', key: "appraiser" });
|
||||
this.tableColumn.push({ name: '评估时间', key: "appraiseTime", width: "150px" });
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public callback(data) {
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
public showUpdateModel(row) {
|
||||
this.showUpdate = true
|
||||
const tmprow = JSON.parse(JSON.stringify(row))
|
||||
this.subUpdateParams = tmprow
|
||||
this.subUpdateParams.safetySignName = tmprow.safetySign.split(';').map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";")
|
||||
this.subUpdateParams.seriousResultName = tmprow.seriousResult.split(';').map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
|
||||
//风险评估
|
||||
this.riskUpdateParams.riskLevelName = this.$store.getters.prevention_risk_level_map[tmprow.riskLevel]
|
||||
this.riskUpdateParams.riskControlLevelName = this.$store.getters.prevention_control_level_map[tmprow.riskControlLevel]
|
||||
if (tmprow.riskLsValue) {
|
||||
const riskLsValue = JSON.parse(tmprow.riskLsValue)
|
||||
const tmpRiskLsValue = {}
|
||||
for (let key in riskLsValue) {
|
||||
if (key.indexOf('ls') !== -1) {
|
||||
tmpRiskLsValue[key] = riskLsValue[key];
|
||||
}
|
||||
}
|
||||
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLsValue }
|
||||
this.riskUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade]
|
||||
}
|
||||
if (tmprow.riskLecValue) {
|
||||
const riskLecValue = JSON.parse(tmprow.riskLecValue)
|
||||
const tmpRiskLecValue = {}
|
||||
for (let key in riskLecValue) {
|
||||
if (key.indexOf('lec') !== -1) {
|
||||
tmpRiskLecValue[key] = riskLecValue[key];
|
||||
}
|
||||
}
|
||||
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLecValue }
|
||||
this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade]
|
||||
}
|
||||
|
||||
//残余风险评估
|
||||
this.remainUpdateParams.remainLevelName = this.$store.getters.prevention_risk_level_map[tmprow.remainLevel]
|
||||
if (tmprow.remainLsValue) {
|
||||
const remainLsValue = JSON.parse(tmprow.remainLsValue)
|
||||
const tmpRemainLsValue = {}
|
||||
for (let key in remainLsValue) {
|
||||
if (key.indexOf('ls') !== -1) {
|
||||
tmpRemainLsValue[key] = remainLsValue[key];
|
||||
}
|
||||
}
|
||||
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLsValue }
|
||||
this.remainUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lsgrade]
|
||||
|
||||
}
|
||||
if (tmprow.remainLecValue) {
|
||||
const remainLecValue = JSON.parse(tmprow.remainLecValue)
|
||||
const tmpRemainLecValue = {}
|
||||
for (let key in remainLecValue) {
|
||||
if (key.indexOf('lec') !== -1) {
|
||||
tmpRemainLecValue[key] = remainLecValue[key];
|
||||
}
|
||||
}
|
||||
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLecValue }
|
||||
this.remainUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lecgrade]
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
|
@ -168,22 +443,26 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
|||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.userId === item.userId);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public subCallback() {
|
||||
this.showUpdate = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<div class="common-box dis-flex " >
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box">
|
||||
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
|
|
@ -10,33 +9,56 @@
|
|||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
||||
:footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
|
||||
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
|
||||
<!-- 管控措施详情 -->
|
||||
<el-dialog :close-on-click-modal="false" title="管控措施" :show-close="false" :visible.sync="showProtable"
|
||||
width="940px">
|
||||
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
|
||||
style="width: 100%">
|
||||
<template v-for="item in proTableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
|
||||
</ButtonListComponent>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
|
@ -9,158 +9,173 @@ import MeasuresService from "@/service/measures.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
|
||||
import UnitTreeComponent from '@/components/tree.component.vue';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
ButtonListComponent,
|
||||
UnitTreeComponent,
|
||||
},
|
||||
})
|
||||
export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new MeasuresService();
|
||||
|
||||
public params = {} as any;
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 2',
|
||||
children: [{
|
||||
label: '二级 2-1',
|
||||
children: [{
|
||||
label: '三级 2-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 2-2',
|
||||
children: [{
|
||||
label: '三级 2-2-1'
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
label: '一级 3',
|
||||
children: [{
|
||||
label: '二级 3-1',
|
||||
children: [{
|
||||
label: '三级 3-1-1'
|
||||
}]
|
||||
}, {
|
||||
label: '二级 3-2',
|
||||
children: [{
|
||||
label: '三级 3-2-1'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
public showProtable = false;
|
||||
|
||||
public currentProTableData = {
|
||||
datas: []
|
||||
} as any;
|
||||
|
||||
public proTableColumn = [] as any;
|
||||
|
||||
//管控措施
|
||||
public measuresSelectData = {} as any;
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"清空",
|
||||
icon:"el-icon-tickets",
|
||||
value:"reset"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
public tableActions = [{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "管控对象",
|
||||
key: "controlName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "分析对象",
|
||||
key: "analName",
|
||||
type: "text",
|
||||
}];
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
public updateParams = {} as any;
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
|
||||
created() {
|
||||
this.$store.state.prevention_measures_sort.map((item) => {
|
||||
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
|
||||
})
|
||||
}
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
console.log(data)
|
||||
public handleNodeClick(data) {
|
||||
this.params.unitId = "";
|
||||
this.params.areaId = "";
|
||||
if (data.areaId) {
|
||||
this.params.unitId = data.id
|
||||
} else {
|
||||
this.params.areaId = data.id
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
|
||||
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
|
||||
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" });
|
||||
this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" });
|
||||
this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" });
|
||||
this.tableColumn.push({
|
||||
name: '事故后果', key: "seriousResult", width: "200px", render: (data) => {
|
||||
if (data.seriousResult) {
|
||||
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'措施详情', width:"110px",key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", width: "100px", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'涉及岗位',key:"person"});
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '措施详情', width: "100px", key: "measureNum", render: (data) => {
|
||||
return "<span class='link'>" + (data.details ? data.details.length : 0) + "</span>"
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '涉及岗位', key: "postName" });
|
||||
|
||||
|
||||
//管控措施详情
|
||||
this.proTableColumn.push({ name: '序号', key: "index" });
|
||||
this.proTableColumn.push({
|
||||
name: '措施类型一', key: "firstTypeName", render: (data) => {
|
||||
if (data.firstType) {
|
||||
return this.$store.getters.prevention_measures_sort_map[data.firstType]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.proTableColumn.push({
|
||||
name: '措施类型二', key: "secondTypeName",
|
||||
render: (data) => {
|
||||
if (data.firstType) {
|
||||
const secondTypeItem = this.measuresSelectData[data.firstType]
|
||||
return this.selectName(secondTypeItem, data.secondType)
|
||||
}
|
||||
}
|
||||
});
|
||||
this.proTableColumn.push({ name: '措施类型三', key: "thirdType" });
|
||||
this.proTableColumn.push({ name: '管控措施', key: "description" });
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
public callback(data) {
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
// 删除数据
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
public showUpdateModel(id) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
|
@ -168,22 +183,64 @@ export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
|
|||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.userId === item.userId);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
//管控措施
|
||||
public showPros(el, data) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if (isTarget) {
|
||||
this.showProtable = true;
|
||||
this.currentProTableData.datas = data.details.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//管控措施--关闭
|
||||
public subCallback() {
|
||||
this.showProtable = false;
|
||||
}
|
||||
|
||||
public treeSelectData(data) {
|
||||
return data.map((item) => {
|
||||
return {
|
||||
label: item.dictLabel,
|
||||
id: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public selectName(selectGroup, data) {
|
||||
if (selectGroup && selectGroup.length > 0) {
|
||||
const map = {};
|
||||
selectGroup.forEach((item: any) => {
|
||||
if (item.value) {
|
||||
map[item.value] = item.name
|
||||
} else if (item.id) {
|
||||
map[item.id] = item.label
|
||||
}
|
||||
|
||||
})
|
||||
return map[data]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import FormOption from "hbt-common/models/formOptions"
|
|||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import AreaService from '@/service/area.service';
|
||||
import moment from "moment"
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
|
|
@ -25,6 +26,24 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
public params = {} as any;
|
||||
|
||||
public isArea = false;
|
||||
|
||||
public repairTableData = {datas:[]};
|
||||
|
||||
public repairTableColumn = [] as any;
|
||||
|
||||
|
||||
public filters = [{
|
||||
text:"未绘制",
|
||||
value:0
|
||||
},{
|
||||
text:"已绘制",
|
||||
value:1
|
||||
}]
|
||||
public showQrCode = false;
|
||||
|
||||
public qrUrl = "";
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public formActions = [{
|
||||
|
|
@ -77,73 +96,206 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
public areaList = [] as any;
|
||||
public areaNoMap = {} as any;
|
||||
|
||||
|
||||
|
||||
public updateActions:BtnOption[] = [];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
|
||||
public showTurnOff = false;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public turnOffParams = {} as any;
|
||||
|
||||
public turnOffForm = [] as any;
|
||||
|
||||
public turnOffAction = [{
|
||||
name:"取消",
|
||||
value:"cancelStatus"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"saveStatus",
|
||||
type:"primary"
|
||||
}]
|
||||
|
||||
created(){
|
||||
this.getAreaList();
|
||||
}
|
||||
|
||||
public buildTurnOffForm(){
|
||||
this.turnOffForm = [{
|
||||
name:"停用/恢复",
|
||||
type:"radio",
|
||||
key:"status",
|
||||
require:true,
|
||||
disable:true,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
datas:[{
|
||||
name:"停用",
|
||||
value:0
|
||||
},{
|
||||
name:"恢复",
|
||||
value:1
|
||||
}]
|
||||
},{
|
||||
name:"停用开始时间",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
hide:this.turnOffParams.status===1,
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
key:"startTime",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"停用结束时间",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
hide:this.turnOffParams.status===1,
|
||||
key:"endTime",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"原因",
|
||||
type:"textarea",
|
||||
key:"reason",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"登记人",
|
||||
type:"text",
|
||||
key:"registerUserName",
|
||||
disable:true,
|
||||
require:true,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
},{
|
||||
name:"登记时间",
|
||||
type:"text",
|
||||
key:"registerTime",
|
||||
disable:true,
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
}]
|
||||
}
|
||||
|
||||
public doTurnOff(data,status){
|
||||
this.turnOffParams = {
|
||||
status:status,
|
||||
unitId:data.id,
|
||||
startTime:"",
|
||||
endTime:"",
|
||||
riskUnitStatus:status,
|
||||
registerUserId:this.account.userId,
|
||||
registerUserName:this.account.nickName,
|
||||
registerTime:moment().format("YYYY-MM-DD HH:mm"),
|
||||
|
||||
}
|
||||
this.showTurnOff = true;
|
||||
this.buildTurnOffForm();
|
||||
}
|
||||
|
||||
public doTurnOffAction(data){
|
||||
if(data && data.value==="saveStatus"){
|
||||
this.tableService.updateStatus(this.turnOffParams,true).then((res)=>{
|
||||
this.$message.success(this.turnOffParams.status?"启用成功":"停用成功");
|
||||
this.getTableData();
|
||||
this.showTurnOff = false;
|
||||
})
|
||||
}else{
|
||||
this.showTurnOff = false;
|
||||
}
|
||||
}
|
||||
|
||||
public buildFormOptions(){
|
||||
this.updateOptions = [{
|
||||
name:"选择区域",
|
||||
key:"areaId",
|
||||
placeholder:"请选择区域名称",
|
||||
width:"calc(50% - 20px)",
|
||||
type:"select",
|
||||
require:true,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"区域编号",
|
||||
key:"areaNo",
|
||||
type:"text",
|
||||
disable:true,
|
||||
width:"calc(50% - 20px)",
|
||||
},{
|
||||
name:"单元编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"chargeDeptId",
|
||||
format:"chargeDeptName",
|
||||
type:"treeSelect",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
expandLevel:Infinity,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptTreeList
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"chargeUserId",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
type:"btn",
|
||||
name:"单元绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
height:"36px",
|
||||
hide:this.isReadonly,
|
||||
size:"small",
|
||||
icon:"el-icon-edit-outline",
|
||||
type:"primary"
|
||||
}]
|
||||
}];
|
||||
name:"选择区域",
|
||||
key:"areaId",
|
||||
placeholder:"请选择区域名称",
|
||||
width:"calc(50% - 20px)",
|
||||
type:"select",
|
||||
require:true,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"区域编号",
|
||||
key:"areaNo",
|
||||
type:"text",
|
||||
disable:true,
|
||||
width:"calc(50% - 20px)",
|
||||
},{
|
||||
name:"单元编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
disable:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"chargeDeptId",
|
||||
format:"chargeDeptName",
|
||||
type:"treeSelect",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
expandLevel:Infinity,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptTreeList
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"chargeUserId",
|
||||
format:"chargeUserName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
type:"btn",
|
||||
name:"单元绘制",
|
||||
width:"calc(50% - 20px)",
|
||||
btn:[{
|
||||
name:"开始绘制",
|
||||
value:"draw",
|
||||
height:"36px",
|
||||
hide:this.isReadonly,
|
||||
size:"small",
|
||||
icon:"el-icon-edit-outline",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"查看绘制",
|
||||
value:"readDraw",
|
||||
hide:!this.isReadonly,
|
||||
height:"36px",
|
||||
size:"small",
|
||||
icon:"el-icon-edit-outline",
|
||||
type:"primary"
|
||||
}]
|
||||
},{
|
||||
name:"停用/检修状态",
|
||||
key:"status",
|
||||
width:"calc(50% - 20px)",
|
||||
format:"statusName",
|
||||
type:"select",
|
||||
disable:this.currentId!=-1,
|
||||
require:true,
|
||||
datas:[{
|
||||
name:"启用",
|
||||
value:1,
|
||||
},{
|
||||
name:"停用",
|
||||
value:0,
|
||||
}]
|
||||
}];
|
||||
|
||||
this.updateActions = [{
|
||||
name:"取消",
|
||||
|
|
@ -170,17 +322,51 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
}]
|
||||
}
|
||||
|
||||
public getQrCode(row){
|
||||
this.areaService.getQrCode({
|
||||
url:"/",
|
||||
id:row.id,
|
||||
system:"prevention",
|
||||
type:0,
|
||||
data:"",
|
||||
params:{
|
||||
"区域编号" : row.areaNo,
|
||||
"单元名称" : row.name,
|
||||
"单元编号" : row.number,
|
||||
"责任人" : row.chargeUserName,
|
||||
"责任部门" : row.chargeDeptName,
|
||||
}
|
||||
}).then((res:any)=>{
|
||||
this.showQrCode = true;
|
||||
this.qrUrl = res.data.url;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'风险分析单元',key:"name"});
|
||||
this.tableColumn.push({name:'责任部门',key:"chargeDeptName"});
|
||||
this.tableColumn.push({name:'责任人',key:"chargeUserName"});
|
||||
this.tableColumn.push({name:'绘制情况',render:(data)=>{
|
||||
this.tableColumn.push({name:'绘制情况',filters:this.filters,filterMethod:(data,row)=>{
|
||||
if(data){
|
||||
return row.geoJson && row.geoJson!=="[]"
|
||||
}else{
|
||||
return !row.geoJson || row.geoJson === "[]"
|
||||
}
|
||||
},render:(data)=>{
|
||||
if(data.geoJson==='[]' || !data.geoJson){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
}
|
||||
}});
|
||||
|
||||
this.repairTableColumn.push({name:"序号",key:"index"});
|
||||
this.repairTableColumn.push({name:"停用开始时间",key:"startTime"});
|
||||
this.repairTableColumn.push({name:"停用开始时间",key:"endTime"});
|
||||
this.repairTableColumn.push({name:"原因",key:"reason"});
|
||||
this.repairTableColumn.push({name:"登记人",key:"registerUserName"});
|
||||
this.repairTableColumn.push({name:"登记时间",key:"registerTime"});
|
||||
}
|
||||
|
||||
public getAreaList(){
|
||||
|
|
@ -196,59 +382,80 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
})
|
||||
}
|
||||
|
||||
public callback(data,item?){
|
||||
|
||||
public doDraw(){
|
||||
console.log("openDraw")
|
||||
if(!this.updateParams.name){
|
||||
this.$message.error("请先输入单元名称");
|
||||
return
|
||||
}
|
||||
this.drawModel = "unit";
|
||||
this.showDraw = true;
|
||||
}
|
||||
public getCreateNumber(params){
|
||||
this.tableService.getUnitNumber(params).then((res)=>{
|
||||
this.updateParams.number = res.data;
|
||||
})
|
||||
}
|
||||
public doSave(goOn?){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"修改成功!");
|
||||
if(goOn){
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]",status:1,number:null} as any;
|
||||
}else{
|
||||
this.handleClose();
|
||||
}
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
// 新增编辑选择部门
|
||||
if(item && item.key === "chargeDeptId"){
|
||||
this.updateParams.chargeDeptName = this.$store.state.deptList.find(item=>item.value === data)?.name;
|
||||
this.updateParams.chargeDeptName = this.$store.getters.dept_map[data];
|
||||
}
|
||||
// 新增编辑选择人员
|
||||
if(item && item.key === "chargeUserId"){
|
||||
this.updateParams.chargeUserName = this.$store.state.userList.find(item=>item.value === data)?.name;
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data];
|
||||
}
|
||||
// 新增编辑选择区域
|
||||
if(item && item.key === "areaId"){
|
||||
console.log(item)
|
||||
this.updateParams.areaNo = this.areaNoMap[data];
|
||||
console.log(this.updateParams)
|
||||
this.getCreateNumber({areaNo:this.updateParams.areaNo})
|
||||
}
|
||||
}
|
||||
public callback(data,type){
|
||||
if(type){
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
if(data && data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
}else if(data && data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
}else if(data && data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data.value === "selectAll"){
|
||||
}else if(data && data.value === "selectAll"){
|
||||
this.selectAll()
|
||||
}else if(data.value === "add"){
|
||||
}else if(data && data.value === "add"){
|
||||
this.showUpdateModel()
|
||||
}else if(data.value === "delete"){
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "draw"){
|
||||
if(!this.updateParams.name){
|
||||
this.$message.error("请先输入单元名称");
|
||||
return
|
||||
}
|
||||
this.drawModel = "unit";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "drawList"){
|
||||
}else if(data && (data.value === "draw" || data.value==="readDraw")){
|
||||
this.doDraw()
|
||||
}else if(data && data.value === "drawList"){
|
||||
this.drawModel = "list";
|
||||
this.showDraw = true;
|
||||
}else if(data.value === "submit"){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"修改成功!");
|
||||
this.handleClose();
|
||||
this.getTableData();
|
||||
})
|
||||
}else if(data.value === "saveAndContinue"){
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{
|
||||
this.$message.success("新增成功!");
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]"} as any
|
||||
})
|
||||
}else if(data.value === "cancel"){
|
||||
}else if(data && data.value === "submit"){
|
||||
this.doSave()
|
||||
}else if(data && data.value === "saveAndContinue"){
|
||||
this.doSave(true)
|
||||
}else if(data && data.value === "cancel"){
|
||||
this.updateParams = {} as any;
|
||||
this.handleClose();
|
||||
}
|
||||
|
|
@ -269,10 +476,17 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
public showUpdateModel(data?,isRead?){
|
||||
if(!data){
|
||||
this.currentId = -1;
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]"} as any
|
||||
this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]",status:1,number:null} as any;
|
||||
this.showUpdate = true
|
||||
}else{
|
||||
this.currentId = data.id;
|
||||
this.updateParams = Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]"},data);
|
||||
this.updateParams = Object.assign({bottomHeight:0,topHeight:0,status:1,geoJson:"[]",number:null,statusName:["停用","启用"][data.status]},data);
|
||||
if(isRead){
|
||||
this.repairTableData.datas = this.updateParams.repairs.map((item,i)=>{
|
||||
item.index = i+1;
|
||||
return item
|
||||
}) || []
|
||||
}
|
||||
this.isReadonly = !!isRead;
|
||||
this.buildFormOptions();
|
||||
}
|
||||
|
|
@ -280,6 +494,7 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public handleClose(){
|
||||
this.updateParams = {} as any;
|
||||
this.showUpdate = false;
|
||||
this.currentId = -1;
|
||||
this.isReadonly = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue