forked from xxhjsb/hbt-prevention-ui
Compare commits
44 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
b82206e6fd | |
|
|
0bb62a94fd | |
|
|
13add5a58d | |
|
|
fa4040e98c | |
|
|
2425733ec9 | |
|
|
6cd30de6e2 | |
|
|
1462d94ea8 | |
|
|
b42a97172f | |
|
|
11bade31b5 | |
|
|
0766894045 | |
|
|
f210a60f6a | |
|
|
a8573a7a53 | |
|
|
697d636900 | |
|
|
6a900c846b | |
|
|
2c11288a17 | |
|
|
26766bc914 | |
|
|
c44396a8f4 | |
|
|
3fc32115e2 | |
|
|
649209ff2c | |
|
|
858c131d56 | |
|
|
6ecdc5c471 | |
|
|
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-zsz","bpm":"/bpm-zsz"}'
|
||||
# 是否显示全部菜单
|
||||
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,573 @@
|
|||
<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="500" 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="操作" fixed="right" 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 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,
|
||||
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: "100%",
|
||||
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: "number",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
}, {
|
||||
key: "reviewCycleUnit",
|
||||
type: "select",
|
||||
require: true,
|
||||
format: 'reviewCycleValueName',
|
||||
datas: this.$store.state.prevention_cycle_unit,
|
||||
width: "calc(30% - 20px)",
|
||||
}, {
|
||||
name: "1次",
|
||||
key: "times",
|
||||
type: 'null',
|
||||
width: "30px",
|
||||
labelWidth: "10px"
|
||||
}, {
|
||||
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;
|
||||
@Watch("data", { immediate: true, deep: true })
|
||||
onParamsValueChange() {
|
||||
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()
|
||||
}
|
||||
|
||||
@PropSync("tabledata", {
|
||||
required: true,
|
||||
})
|
||||
public measureData!: any;
|
||||
|
||||
created() {
|
||||
|
||||
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.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
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
|
||||
})
|
||||
}).catch(() => {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
//排查任务 -- 下拉选择
|
||||
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.measureData.measures.length + 1;
|
||||
this.updataParams.tasksNum = this.updataParams.tasks.length
|
||||
this.measureData.measures.push(this.updataParams);
|
||||
} else {
|
||||
this.updataParams.tasksNum = this.updataParams.tasks.length
|
||||
this.measureData.measures.splice(this.measureData.measures.findIndex(item => item.index === this.updataParams.index), 1, this.updataParams)
|
||||
}
|
||||
this.updataParams = {} as any;
|
||||
this.visible = !!goOn;
|
||||
}
|
||||
//分析法
|
||||
@Emit("actionCallback")
|
||||
actionCallback(data) {
|
||||
//Emit false
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../views/common.component.scss"></style>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .vue-treeselect__label {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<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 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 = [{
|
||||
name:"全部",
|
||||
children:res.data
|
||||
}];
|
||||
})
|
||||
}
|
||||
beforeDestory(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</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';
|
||||
|
|
@ -25,4 +35,9 @@ export default class AreaService extends BaseService<any>{
|
|||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
public getAnalControls():Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls';
|
||||
return this.get(url,null,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -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,45 @@
|
|||
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)
|
||||
}
|
||||
|
||||
//查询设备
|
||||
public selectDeviceByUnit(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/device/inventory/filter/list';
|
||||
return this.post(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,11 +6,22 @@ export default class DutyService 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/task/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/list';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
// 更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/task';
|
||||
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,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,42 @@ 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)
|
||||
}
|
||||
|
||||
//查询作业活动
|
||||
public selectWorkByUnit(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/job/inventory/filter/list';
|
||||
return this.post(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
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/manageList';
|
||||
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 selectByPage2(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/danger/manage/dataList';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -6,11 +6,22 @@ export default class MeasuresReportService 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/control/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/control';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
|
||||
public selectById(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/task/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
|
||||
// 更新
|
||||
public addOrUpdate(params: any,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/control/batch';
|
||||
return this.put(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 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class WorkFlowService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
|
||||
public startWorkFlow(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.bpm+'/workflow-task/create-process';
|
||||
return this.post(url,params,{},true)
|
||||
}
|
||||
|
||||
public again(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.bpm+'/workflow-task/again-candidate';
|
||||
return this.post(url,params,{},true)
|
||||
}
|
||||
public taskHandle(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.bpm+'/workflow-task/task-handle';
|
||||
return this.post(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -8,16 +8,219 @@ 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:[],
|
||||
analControlList:[],
|
||||
prevention_serious_result:[],
|
||||
prevention_security_identifier:[],
|
||||
prevention_majorsign:[],
|
||||
prevention_control_level:[],
|
||||
prevention_measure_type:[],
|
||||
prevention_measures_sort:[],
|
||||
prevention_task_type:[],
|
||||
prevention_evaluate_status:[],
|
||||
prevention_task_status:[],
|
||||
prevention_hazard_category:[]
|
||||
},
|
||||
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_anal_control_map:(state)=>{
|
||||
const map = {};
|
||||
state.analControlList.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
|
||||
},
|
||||
prevention_task_status_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_task_status.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_hazard_category_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_hazard_category.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
|
||||
setAnalCntrol(state,data){
|
||||
state.analControlList = data;
|
||||
},
|
||||
setDeptList(state,data){
|
||||
state.deptList = data;
|
||||
},
|
||||
|
|
@ -27,9 +230,76 @@ 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
|
||||
},
|
||||
set_prevention_task_status(state,data){
|
||||
state.prevention_task_status = data
|
||||
},
|
||||
set_prevention_hazard_category(state,data){
|
||||
state.prevention_hazard_category = data
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,40 +2,217 @@
|
|||
<router-view></router-view>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import AreaService from '@/service/area.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();
|
||||
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"),
|
||||
this.areaService.getAnalControls(),
|
||||
this.systemService.getDictData("prevention_task_status"),
|
||||
this.systemService.getDictData("prevention_hazard_category"),
|
||||
]).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("setAnalCntrol", results[24].data)
|
||||
|
||||
|
||||
this.$store.commit("set_prevention_task_status", results[25].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
console.log('results[26]',results[26]);
|
||||
|
||||
this.$store.commit("set_prevention_hazard_category", results[26].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;
|
||||
|
|
@ -114,6 +120,8 @@
|
|||
height: 1px;
|
||||
margin-top: 8px;
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #EEEEEE;
|
||||
padding: 24px 24px 0;
|
||||
|
|
@ -135,4 +143,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,20 +9,51 @@ 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 WorkFlowService from "@/service/workFlow.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
|
||||
},
|
||||
})
|
||||
} as any)
|
||||
export default class HiddenDangerClapComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new NoteService();
|
||||
|
||||
public areaService = new AreaService();
|
||||
|
||||
public unitService = new UnitService();
|
||||
public workFlowService = new WorkFlowService()
|
||||
|
||||
public areaList = [];
|
||||
|
||||
public unitList = [];
|
||||
|
||||
public params = {} as any;
|
||||
// 是否显示删改查按钮
|
||||
public isBase = true;
|
||||
public isClap = 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:"查询",
|
||||
|
|
@ -55,127 +86,369 @@ 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:"保存并继续添加",
|
||||
value:"saveAndContinue",
|
||||
name:"保存并下发",
|
||||
value:"submit",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"save",
|
||||
value:"draft",
|
||||
type:"primary"
|
||||
}];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public levelMap = ["","一般隐患","重大隐患"]
|
||||
public statusMap = ["未下发","已下发"];
|
||||
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:"person"});
|
||||
this.tableColumn.push({name:'检查人员',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'整改单编号',width:"200px",key:"number"});
|
||||
this.tableColumn.push({name:'隐患描述',key:"description",width:"300px"});
|
||||
this.tableColumn.push({name:'整改部门',width:"100px",key:"reformDeptName"});
|
||||
this.tableColumn.push({name:'隐患级别',render:(data)=>{
|
||||
return this.levelMap[data.level]
|
||||
}});
|
||||
this.tableColumn.push({name:'隐患位置',key:"locationName"});
|
||||
this.tableColumn.push({name:'检查时间',width:"150px",key:"inspectTime"});
|
||||
this.tableColumn.push({name:'检查人员',key:"inspectUserName"});
|
||||
this.tableColumn.push({name:'下发状态',render:(data)=>{
|
||||
return `<span class="color_"${data.status}>${this.statusMap[data.status] || ""}</span>`
|
||||
}});
|
||||
}
|
||||
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 +465,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 ==="draft" || data.value ==="submit"){
|
||||
this.doSave(data.value === "submit");
|
||||
}else{
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
|
|
@ -213,15 +487,182 @@ 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],
|
||||
attributeClassifyName:this.$store.getters.prevention_safe_reason_map[row.attributeClassify],
|
||||
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.updateParams.photo = this.photoList.length || null;
|
||||
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 || 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 || null;
|
||||
}
|
||||
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(isSubmit){
|
||||
if(!isSubmit){
|
||||
this.updateParams.status = 0
|
||||
}else{
|
||||
this.updateParams.status = 1
|
||||
}
|
||||
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?"新增成功!":"编辑成功");
|
||||
if(isSubmit){
|
||||
this.startWorkFlow([res.data],[this.updateParams.reformUserId])
|
||||
}else{
|
||||
this.getTableData();
|
||||
}
|
||||
this.handleClose();
|
||||
})
|
||||
}
|
||||
|
||||
public startWorkFlow(ids,userIds){
|
||||
const keyValue = ids.map(id=>{
|
||||
return {
|
||||
F_Id:id,
|
||||
F_FormId:1742822461669376,
|
||||
F_Type:2,
|
||||
F_UrlAddress:"ceshi1"
|
||||
}
|
||||
})
|
||||
this.workFlowService.startWorkFlow({
|
||||
"F_Id": "1743872031226688",
|
||||
"relationTaskList": "[]",
|
||||
"keyValue": JSON.stringify(keyValue),
|
||||
"userJson": "[]",
|
||||
"fileValue": [],
|
||||
"nextNodeName":"确认",
|
||||
"nodeName":"上报",
|
||||
"userList": userIds
|
||||
}).then((res:any)=>{
|
||||
this.getTableData()
|
||||
// 发起工作流成功
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -246,4 +687,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,38 +2,50 @@
|
|||
<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)"
|
||||
<div class="full" v-if="isManager">
|
||||
<el-radio-group text-color="#409EFF" fill="transparent" size="medium" v-model="params.type" @change="tabTableChange">
|
||||
<el-radio-button :label="item.value" v-for="item in tabs" :key="item.value">{{item.name}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<TableComponent style="flex: 1; height: 1px;" :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 && !(isManager && params.type>1)" type="selection" fixed 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="rowCallback($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="操作" fixed="right" :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="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>
|
||||
<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="isBase || isFile" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)" :disabled="isPlan && ((scope.row.planType===2 && scope.row.state) || (scope.row.planType===1 && scope.row.status)) || (isManager && scope.row.status)" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase" :disabled="(isPlan && ((scope.row.planType===2 && (scope.row.state || scope.row.status)) || (scope.row.planType===1 && scope.row.status))) || (isManager && scope.row.status)" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" v-if="isPlan && !scope.row.status" :disabled="scope.row.planType===2 && scope.row.state===0 " @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 && params.type===4 && scope.row.status<5" @click="changeStatus(scope.row,60+scope.row.status)">中断</el-button>
|
||||
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status>10" @click="changeStatus(scope.row,scope.row.status-60)">恢复</el-button>
|
||||
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5" @click="changeStatus(scope.row,7)">作废</el-button>
|
||||
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">处理</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -41,15 +53,205 @@
|
|||
</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 || (isAction && !scope.row.userIds.includes(account.userId))">{{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" style="margin-bottom: 20px;" 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" fixed="left" 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" style="display: flex; align-items: center;">
|
||||
{{scope.row.description}}
|
||||
<el-image
|
||||
style="width: 60px; margin-left: 10px;"
|
||||
:src="scope.row.urls[0]"
|
||||
:preview-src-list="scope.row.urls">
|
||||
</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="操作" fixed="right" 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"
|
||||
<div class="sub-title" v-if="isManager || isFile" >隐患信息</div>
|
||||
<FormComponent ref="form" :options="updateOptions" :isReadonly="isReadonly || ((isManager || isFile) && updateParams.status>1)" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change"
|
||||
btn-position="center"></FormComponent>
|
||||
|
||||
<div class="sub-title" v-if="((isManager || isFile) && updateParams.status>1 && !(updateParams.status===2 && isReadonly))
|
||||
|| ((isManager || isFile) && updateParams.reformConfirmFlag!==null && updateParams.reformConfirmFlag!==undefined)" >隐患确认</div>
|
||||
<FormComponent v-if="(isManager || isFile) && updateParams.status>1 && !(updateParams.status===2 && isReadonly)
|
||||
|| ((isManager || isFile) && updateParams.reformConfirmFlag!==null && updateParams.reformConfirmFlag!==undefined)" :options="updateOptions2" :isReadonly="isReadonly || (isManager && updateParams.status>2)
|
||||
|| ((isManager || isFile) && updateParams.status!==2 && updateParams.reformConfirmFlag!==null && updateParams.reformConfirmFlag!==undefined)"" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change"
|
||||
btn-position="center"></FormComponent>
|
||||
|
||||
|
||||
<div class="sub-title" v-if="((isManager || isFile) && updateParams.status>2 && !(updateParams.status===3 && isReadonly))
|
||||
|| ((isManager || isFile) && updateParams.executeConfirmFlag!==null && updateParams.executeConfirmFlag!==undefined)" >隐患整改</div>
|
||||
<FormComponent v-if="((isManager || isFile) && updateParams.status>2 && !(updateParams.status===3 && isReadonly))
|
||||
|| ((isManager || isFile) && updateParams.executeConfirmFlag!==null && updateParams.executeConfirmFlag!==undefined)" :options="updateOptions3" :isReadonly="isReadonly || (isManager && updateParams.status>3)
|
||||
|| ((isManager || isFile) && updateParams.status!==3 && updateParams.executeConfirmFlag!==null && updateParams.executeConfirmFlag!==undefined)" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change"
|
||||
btn-position="center"></FormComponent>
|
||||
|
||||
|
||||
<div class="sub-title" v-if="((isManager || isFile) && updateParams.status>3 && !(updateParams.status===4 && isReadonly))
|
||||
|| ((isManager || isFile) && updateParams.verifyConfirmFlag!==null && updateParams.verifyConfirmFlag!==undefined)" >隐患验证</div>
|
||||
<FormComponent v-if="(isManager && updateParams.status>3 && !(updateParams.status===4 && isReadonly))
|
||||
|| ((isManager || isFile) && updateParams.verifyConfirmFlag!==null && updateParams.verifyConfirmFlag!==undefined)" :options="updateOptions4" :isReadonly="isReadonly || (isManager && updateParams.status>4)
|
||||
|| ((isManager || isFile) && updateParams.status!==4 && updateParams.verifyConfirmFlag!==null && updateParams.verifyConfirmFlag!==undefined)" 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="操作" fixed="right">
|
||||
<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,20 +5,21 @@ 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';
|
||||
import MapComponent from "@/components/map.component.vue"
|
||||
import mapboxgl from "mapbox-gl";
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
MapComponent
|
||||
},
|
||||
})
|
||||
} as any)
|
||||
export default class HiddenDangerFilesComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new AreaService();
|
||||
public tableService = new ManagerService();
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
|
|
@ -35,11 +36,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,164 +50,555 @@ 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;
|
||||
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 updateOptions:FormOption<BtnOption>[] = [];
|
||||
public updateOptions2:FormOption<BtnOption>[] = [];
|
||||
public updateOptions3:FormOption<BtnOption>[] = [];
|
||||
public updateOptions4:FormOption<BtnOption>[] = [];
|
||||
public updateActions = [];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public levelMap = ["","一般隐患","重大隐患"]
|
||||
public reformModeMap = ["","即查即改","限期整改"];
|
||||
public executeResultMap = ["","完成","降低标准完成","未完成","延期完成","延期未完成"];
|
||||
public isReadonly = true
|
||||
public isSureMap = ["未确认","确认"];
|
||||
public isPassMap = ["不通过","通过"];
|
||||
public isAcceptMap = ["不接受","接受"];
|
||||
|
||||
public fileList = [] as any;
|
||||
public photoList = [] as any;
|
||||
|
||||
public fileList2 = [] as any;
|
||||
public photoList2 = [] as any;
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
public center = [118.751353,31.969568];
|
||||
public marker:any = null;
|
||||
public map:any = null;
|
||||
public showMap = false;
|
||||
public executeResultList= [{
|
||||
text:"完成",
|
||||
value:1
|
||||
},{
|
||||
text:"降低标准完成",
|
||||
value:2
|
||||
},{
|
||||
text:"未完成",
|
||||
value:3
|
||||
},{
|
||||
text:"延期完成",
|
||||
value:4,
|
||||
},{
|
||||
text:"延期未完成",
|
||||
value:5
|
||||
}];
|
||||
|
||||
created(){
|
||||
|
||||
}
|
||||
|
||||
public getTableData(){
|
||||
this.tableService.selectByPage2(this.params).then(res=>{
|
||||
this.tableData = res.data as any;
|
||||
this.getTableCallback();
|
||||
})
|
||||
}
|
||||
|
||||
public getMap(map){
|
||||
this.map = map;
|
||||
this.addMarker();
|
||||
}
|
||||
public addMarker(){
|
||||
this.marker = new mapboxgl.Marker({draggable:!this.isReadonly && this.updateParams.status<2})
|
||||
.setLngLat(this.center)
|
||||
.addTo(this.map);
|
||||
this.map.flyTo({center:this.center})
|
||||
}
|
||||
|
||||
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 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
|
||||
}]
|
||||
}]
|
||||
|
||||
this.updateOptions = [{
|
||||
name:"隐患编号",
|
||||
key:"number",
|
||||
disable:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
type:"text"
|
||||
},{
|
||||
name:"隐患来源",
|
||||
key:"source",
|
||||
format:"sourceName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_danger_resource
|
||||
},{
|
||||
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.updateParams.status>1 || 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:"photo",
|
||||
ref:"photo",
|
||||
type:"upload",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
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,
|
||||
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:"dangerType",
|
||||
format:"dangerTypeName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_danger_type,
|
||||
},{
|
||||
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:"violateNumber",
|
||||
type:"number",
|
||||
width:"calc(50% - 20px)",
|
||||
showError:false,
|
||||
},{
|
||||
name:"专业分类",
|
||||
key:"professionClassify",
|
||||
format:"professionClassifyName",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
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,
|
||||
}]
|
||||
|
||||
this.updateOptions2 = [{
|
||||
name:"隐患确认",
|
||||
key:"reformConfirmFlag",
|
||||
format:"reformConfirmFlagName",
|
||||
type:"radio",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"原因说明",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"reformReasonDescription",
|
||||
require:true,
|
||||
hide:this.updateParams.reformConfirmFlag,
|
||||
showError:false,
|
||||
placeholder:"请输入未确认原因"
|
||||
},{
|
||||
name:"治理人",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
key:"executeUserId",
|
||||
format:"executeUserName",
|
||||
showError:false,
|
||||
hide:this.updateParams.reformConfirmFlag===0,
|
||||
datas:this.$store.state.userList
|
||||
},{
|
||||
name:"治理时限",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
key:"executeDeadline",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
showError:false,
|
||||
hide:this.updateParams.reformConfirmFlag===0,
|
||||
},{
|
||||
name:"治理措施及要求",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"executeMeasure",
|
||||
require:true,
|
||||
hide:this.updateParams.reformConfirmFlag===0,
|
||||
showError:false,
|
||||
placeholder:"请输入治理措施与要求"
|
||||
},{
|
||||
name:"治理资金",
|
||||
type:"number",
|
||||
width:"35%",
|
||||
key:"executeMoney",
|
||||
require:true,
|
||||
hide:this.updateParams.reformConfirmFlag===0,
|
||||
showError:false,
|
||||
unit:{
|
||||
name:"¥",
|
||||
type:"text"
|
||||
}
|
||||
},{
|
||||
name:"",
|
||||
type:"textarea",
|
||||
width:"calc(65% - 40px)",
|
||||
key:"executeMoneySource",
|
||||
hide:this.updateParams.reformConfirmFlag===0,
|
||||
placeholder:"请输入资金来源"
|
||||
},{
|
||||
name:"确认人",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
key:"realConfirmUserName",
|
||||
require:true,
|
||||
disable:true,
|
||||
},{
|
||||
name:"确认时间",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
key:"realConfirmTime",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
showError:false,
|
||||
}]
|
||||
this.updateOptions3 = [{
|
||||
name:"接受确认",
|
||||
key:"executeConfirmFlag",
|
||||
format:"executeConfirmFlagName",
|
||||
type:"radio",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"整改结果",
|
||||
key:"executeResult",
|
||||
format:"executeResultName",
|
||||
type:"radio",
|
||||
hide:this.updateParams.executeConfirmFlag===0,
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.executeResultList
|
||||
},{
|
||||
name:"治理情况汇报",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"executeSituation",
|
||||
require:true,
|
||||
hide:this.updateParams.executeConfirmFlag===0,
|
||||
showError:false,
|
||||
placeholder:"请输入治理措施与要求"
|
||||
},{
|
||||
name:"原因说明",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"executeReasonDescription",
|
||||
require:true,
|
||||
hide:this.updateParams.executeConfirmFlag,
|
||||
showError:false,
|
||||
placeholder:"请输入未确认原因"
|
||||
},{
|
||||
name:"照片及相关附件",
|
||||
key:"file2",
|
||||
type:"upload",
|
||||
hide:this.updateParams.executeConfirmFlag===0,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
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.fileList2,
|
||||
btn:[{
|
||||
name:"点击上传附件",
|
||||
value:"upload",
|
||||
hide:this.isReadonly,
|
||||
size:"small",
|
||||
type:"primary"
|
||||
}]
|
||||
},{
|
||||
name:"整改人",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
key:"realExecuteUserName",
|
||||
require:true,
|
||||
disable:true,
|
||||
},{
|
||||
name:"整改时间",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
key:"realExecuteTime",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
showError:false,
|
||||
}]
|
||||
this.updateOptions4 = [{
|
||||
name:"验证结果",
|
||||
key:"verifyConfirmFlag",
|
||||
format:"verifyConfirmFlagName",
|
||||
type:"radio",
|
||||
width:"100%",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"验证情况",
|
||||
type:"textarea",
|
||||
width:"100%",
|
||||
key:"verifySituation",
|
||||
placeholder:"请输入验证情况"
|
||||
},{
|
||||
name:"照片",
|
||||
key:"photo2",
|
||||
type:"upload",
|
||||
width:"100%",
|
||||
autoUpload:true,
|
||||
onPreview:this.onPreview,
|
||||
accept:"image/png, image/jpeg",
|
||||
listType:"picture-card",
|
||||
fileList:this.photoList2,
|
||||
icon:"el-icon-plus",
|
||||
},{
|
||||
name:"验证人",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
key:"realVerifyUserName",
|
||||
require:true,
|
||||
disable:true,
|
||||
},{
|
||||
name:"验证时间",
|
||||
type:"date",
|
||||
subType:"datetime",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
key:"realVerifyTime",
|
||||
format:"yyyy-MM-dd HH:mm",
|
||||
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:"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:"isDangrous"});
|
||||
this.tableColumn.push({name:'整改结果',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'整改时限',key:"isDangrous"});
|
||||
this.tableColumn.push({name:'隐患整改状态',width:"120",filters:[{text:"已整改",value:5},{text:"已作废",value:7},{text:"整改中",value:0}],filterMethod:(data,row)=>{
|
||||
return row.status == data;
|
||||
},render:(data)=>{
|
||||
if(data.status===5){
|
||||
return "<span class='color_1'>已整改</span>"
|
||||
}else if(data.status===7){
|
||||
return "已作废"
|
||||
}else{
|
||||
return "<span class='color_2'>整改中</span>"
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'隐患来源',width:"150",render:(data)=>this.$store.getters.prevention_danger_resource_map[data.source]});
|
||||
this.tableColumn.push({name:'隐患标题',width:"150",key:"title"});
|
||||
this.tableColumn.push({name:'隐患描述',width:"300",key:"description"});
|
||||
this.tableColumn.push({name:'隐患等级',render:(data)=>this.levelMap[data.level]});
|
||||
this.tableColumn.push({name:'隐患分类',render:(data)=>this.$store.getters.prevention_dangrous_type_map[data.dangerType]});
|
||||
this.tableColumn.push({name:'整改方式',render:(data)=>this.reformModeMap[data.reformMode]});
|
||||
this.tableColumn.push({name:'隐患位置',width:"150",key:"locationName"});
|
||||
this.tableColumn.push({name:'治理责任人',width:"100",key:"executeUserName"});
|
||||
this.tableColumn.push({name:'整改结果',width:"100",filters:this.executeResultList,filterMethod:(data,row)=>{
|
||||
return row.executeResult == data;
|
||||
},render:(data)=>this.executeResultMap[data.executeResult]});
|
||||
this.tableColumn.push({name:'整改时限',width:"120",key:"reformDeadline"});
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
|
|
@ -227,16 +614,14 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
// 全选
|
||||
}else if(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.value ==="cancel"){
|
||||
this.handleClose()
|
||||
|
||||
}else if(data.value ==="fixed"){
|
||||
this.showMap = true
|
||||
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
|
|
@ -249,14 +634,98 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
public showUpdateModel(row){
|
||||
Object.assign(this.updateParams,{
|
||||
verifyConfirmFlagName:this.isPassMap[row.verifyConfirmFlag],
|
||||
executeConfirmFlagName:this.isAcceptMap[row.executeConfirmFlag],
|
||||
reformConfirmFlagName:this.isSureMap[row.reformConfirmFlag],
|
||||
executeResultName:this.executeResultMap[row.executeResult],
|
||||
sourceName:this.$store.getters.prevention_danger_resource_map[row.source],
|
||||
attributeClassifyName:this.$store.getters.prevention_safe_reason_map[row.attributeClassify],
|
||||
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],
|
||||
occurNodeName:this.$store.getters.prevention_occur_step_map[row.occurNode],
|
||||
professionClassifyName:this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||
reformModeName:this.reformModeMap[row.reformMode],
|
||||
},row);
|
||||
|
||||
this.getTableCallback()
|
||||
// 获取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()
|
||||
})
|
||||
}
|
||||
|
||||
if(row.executeResourceId){
|
||||
this.tableService.getFileUrls({ids:row.executeResourceId.split(",")}).then((files:any)=>{
|
||||
this.fileList2 = files.data.map(item=>{
|
||||
return {
|
||||
name:item.originalName,
|
||||
url:item.url,
|
||||
type:item.type,
|
||||
id:item.id
|
||||
}
|
||||
})
|
||||
this.getTableCallback()
|
||||
})
|
||||
}
|
||||
if(row.verifyResourceId){
|
||||
this.tableService.getFileUrls({ids:row.verifyResourceId.split(",")}).then((files:any)=>{
|
||||
this.photoList2 = files.data.map(item=>{
|
||||
return {
|
||||
name:item.originalName,
|
||||
url:item.url,
|
||||
type:item.type,
|
||||
id:item.id
|
||||
}
|
||||
})
|
||||
this.getTableCallback()
|
||||
})
|
||||
}
|
||||
this.showUpdate = true
|
||||
}
|
||||
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")
|
||||
}
|
||||
this.currentId = id;
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
if(this.showMap){
|
||||
this.showMap = false;
|
||||
this.marker.remove();
|
||||
this.marker = null;
|
||||
return
|
||||
}
|
||||
this.updateParams = {} as any
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -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 type="selection" fixed 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">
|
||||
<el-table-column label="操作" fixed="right" 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" fixed 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="操作" fixed="right" 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" fixed 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,401 @@ 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:this.$store.state.analControlList,
|
||||
},{
|
||||
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:this.$store.getters.prevention_anal_control_map[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,40 @@ 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 WorkFlowService from "@/service/workFlow.service"
|
||||
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 workFlowService = new WorkFlowService();
|
||||
|
||||
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 +53,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 +385,30 @@ 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"){
|
||||
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:any)=>{
|
||||
this.$message.success(!this.updateParams.id?"新增成功!":"编辑成功");
|
||||
this.handleClose();
|
||||
this.getTroubleList();
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
this.params = {
|
||||
|
|
@ -222,19 +417,214 @@ 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 || null
|
||||
}
|
||||
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:any)=>{
|
||||
this.troubleTableData =res.data.map(data=>{
|
||||
|
||||
data.urls = data.resources.map(source=>source.resourceUrl) || [];
|
||||
return data
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
public sendTabChange(data){
|
||||
this.currentTable = this.tableTabs.find(item=>item.id===data)
|
||||
}
|
||||
|
||||
public toggleAll() {
|
||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||
|
|
@ -255,6 +645,75 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
public handleSelectionChange(data){
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public startWorkFlow(ids,userIds){
|
||||
const keyValue = ids.map(id=>{
|
||||
return {
|
||||
F_Id:id,
|
||||
F_FormId:1742822461669376,
|
||||
F_Type:2,
|
||||
F_UrlAddress:"ceshi1"
|
||||
}
|
||||
})
|
||||
this.workFlowService.startWorkFlow({
|
||||
"F_Id": "1743872031226688",
|
||||
"relationTaskList": "[]",
|
||||
"keyValue": JSON.stringify(keyValue),
|
||||
"userJson": "[]",
|
||||
"fileValue": [],
|
||||
"nextNodeName":"确认",
|
||||
"nodeName":"上报",
|
||||
"userList": userIds
|
||||
}).then((res:any)=>{
|
||||
this.getTableData()
|
||||
// 发起工作流成功
|
||||
})
|
||||
}
|
||||
|
||||
public doCheck(){
|
||||
const params = [] as any;
|
||||
let total = 0;
|
||||
this.tableTabs.forEach(item=>{
|
||||
total+=item.tableItems.length;
|
||||
item.tableItems.forEach(subItem=>{
|
||||
if(subItem.userIds.includes(this.account.userId)){
|
||||
params.push({
|
||||
content:subItem.itemRecord,
|
||||
resultFlag:subItem.itemResult,
|
||||
taskTableId:subItem.taskTableId,
|
||||
taskId:this.recordParams.taskId,
|
||||
inspectUserId:this.account.userId,
|
||||
inspectUserName:this.account.nickName,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableService.addRecord({
|
||||
dangerInspectTaskRecords:params,
|
||||
total,
|
||||
}).then(res=>{
|
||||
this.$message.success("检查成功");
|
||||
if(this.troubleTableData.length){
|
||||
this.troubleTableData.forEach((item)=>{
|
||||
this.startWorkFlow([item.dangerManageId],[item.reformUserId])
|
||||
})
|
||||
}else{
|
||||
this.getTableData()
|
||||
}
|
||||
this.handleClose();
|
||||
})
|
||||
}
|
||||
|
||||
public rowCallback(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,489 @@ 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:this.$store.state.analControlList,
|
||||
},{
|
||||
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:this.$store.getters.prevention_anal_control_map[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:any)=>{
|
||||
this.troubleTableData = res.data.map(data=>{
|
||||
data.urls = data.resources.map(source=>source.resourceUrl) || [];
|
||||
return 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,78 @@
|
|||
<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 type="selection" fixed label="全选">
|
||||
</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">
|
||||
<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="操作" fixed="right" 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">
|
||||
<el-table-column label="操作" fixed="right" 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;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -240,4 +248,4 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss">
|
||||
</style>
|
||||
</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">
|
||||
|
|
@ -15,19 +14,25 @@
|
|||
|
||||
<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 type="selection" fixed 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">
|
||||
<el-table-column label="操作" fixed="right" 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" fixed 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="操作" fixed="right" width="200" 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,441 @@ 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';
|
||||
import moment from "moment";
|
||||
|
||||
@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 formActions = [{
|
||||
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"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"text",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"text",
|
||||
}];
|
||||
public areaList = [];
|
||||
public unitList = [];
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
//检查项目
|
||||
public showProject = false;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public updateProParams = {} as any;
|
||||
public proIsReadonly = false;
|
||||
public showProtable = false;
|
||||
public currentProTableData = {
|
||||
datas: []
|
||||
} as any;
|
||||
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
|
||||
public updateParams = {
|
||||
items: [],
|
||||
identifyUserId: this.account.userId,
|
||||
identifyTime: moment().format('YYYY-MM-DD'),
|
||||
} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
public formActions = [{
|
||||
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"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
|
||||
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 updateActions = [] as any;
|
||||
public buildActionsForm(){
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide:this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
public projectOptions: FormOption<BtnOption>[] = [
|
||||
{
|
||||
name: "检查项目",
|
||||
key: "name",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
},
|
||||
{
|
||||
name: "检查标准",
|
||||
key: "standard",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
@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,
|
||||
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 === "全部" ? "" : 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 === '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;
|
||||
}
|
||||
|
||||
// 部门
|
||||
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: [], identifyUserId: this.account.userId,
|
||||
identifyTime: moment().format('YYYY-MM-DD'),
|
||||
} as any;
|
||||
this.buildActionsForm()
|
||||
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.buildActionsForm()
|
||||
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 +450,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">
|
||||
|
|
@ -15,31 +14,106 @@
|
|||
|
||||
<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 type="selection" fixed 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" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
<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 v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<el-table-column label="操作" fixed="right" 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="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed 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="操作" fixed="right" 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" width="600px" :visible.sync="showMatrixModal" :title="'区域风险等级判定准则'">
|
||||
<img style="width:90%" 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'" :checkRiskType="checkRiskType" ></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>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,34 +1,41 @@
|
|||
<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 type="selection" fixed 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">
|
||||
<el-table-column label="操作" fixed="right" 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)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -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="!updateParams.id'新增':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" fixed 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="操作" fixed="right" 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,391 +8,563 @@ 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 moment from "moment";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
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 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 treeData = [] 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"
|
||||
}];
|
||||
public subTableActions = [{
|
||||
name:"添加",
|
||||
value:"subAdd",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"subDelete",
|
||||
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 subTableActions: BtnOption[] = [];
|
||||
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 formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "单元名称",
|
||||
key: "unitName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "作业活动",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public updateParams = {
|
||||
identifyTime: moment().format('YYYY-MM-DD'),
|
||||
identifyUserId: this.account.userId,
|
||||
} 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>[] = [];
|
||||
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
value:"cancel"
|
||||
},{
|
||||
name:"保存并继续添加",
|
||||
value:"saveAndContinue",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"save",
|
||||
type:"primary"
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
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;
|
||||
|
||||
created(){
|
||||
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,
|
||||
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 === "全部" ? "" : 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"});
|
||||
public buildTable() {
|
||||
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){
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data.value === "reset"){
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data.value === "reverse"){
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(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
|
||||
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 === '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;
|
||||
}
|
||||
// 部门
|
||||
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 && data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data && data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data && data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data && data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} 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.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {
|
||||
postCode: [],
|
||||
safetyFactor: []
|
||||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
areaName: "",
|
||||
unitName: "",
|
||||
name: "",
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(id){
|
||||
public showUpdateModel(row?, isRead?) {
|
||||
this.isReadonly = !!isRead;
|
||||
if (!row) {
|
||||
this.updateParams = {
|
||||
steps: [], identifyTime: moment().format('YYYY-MM-DD'),
|
||||
identifyUserId: this.account.userId,
|
||||
} as any;
|
||||
} else {
|
||||
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){
|
||||
public handleClose() {
|
||||
if (this.showSubUpdate) {
|
||||
this.showSubUpdate = false;
|
||||
this.stepUpdateParams = {} as any;
|
||||
return
|
||||
}
|
||||
this.showSteptable = false;
|
||||
this.isReadonly = false;
|
||||
this.showUpdate = false;
|
||||
this.updateParams = {} as 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;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss">
|
||||
::v-deep{
|
||||
.el-dialog__body .common-btn-box{
|
||||
::v-deep {
|
||||
.el-dialog__body .common-btn-box {
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,42 @@
|
|||
<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 type="selection" fixed 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" :label="item.name" :width="item.width" :key="item.key"
|
||||
:show-overflow-tooltip="item.showTip" :filters="item.filters"
|
||||
:filter-method="item.filterMethod">
|
||||
<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 v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:show-overflow-tooltip="item.showTip" :filters="item.filters"
|
||||
:filter-method="item.filterMethod">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<el-table-column label="操作" fixed="right" 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 +45,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="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed 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="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isReadonly || isModifyonly" 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 && !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"
|
||||
:actions="isReadonly? []:updateActions" :full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
|
||||
</el-dialog>
|
||||
<!-- 评估矩阵 -->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showMatrixModal" width="600px" :title="'区域风险等级判定准则'">
|
||||
<img style="width:90%" 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'" :checkRiskType="checkRiskType"></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>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -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,44 @@
|
|||
</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 type="selection" fixed 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)" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"></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" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="deleteData([scope.row])">排查</el-button>
|
||||
<el-button v-if="scope.row.status===2" type="text"
|
||||
@click="showSubModal(scope.row)">排查</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="800px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:actions="subActions" @actionCallback="subActionCallback" @change="changes" :full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -9,12 +9,16 @@ import DutyService from "@/service/duty.service"
|
|||
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 moment from 'moment';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
UnitTreeComponent,
|
||||
},
|
||||
})
|
||||
export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
||||
|
|
@ -22,140 +26,322 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
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 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: "analControlName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "分析对象",
|
||||
key: "itemName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
public updateParams = {} as any;
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
public fileList = [] as any;
|
||||
public photoList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
|
||||
public currentUrl = null;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public userListName = {} as any;
|
||||
|
||||
public subUpdateOptions = [] as any;
|
||||
public subUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "是否包保责任人任务",
|
||||
key: "insuranceDutyFlag",
|
||||
format: "insuranceDutyFlagName",
|
||||
type: "radio",
|
||||
width: "100%",
|
||||
labelWidth: 'auto',
|
||||
require: true,
|
||||
disable: true,
|
||||
datas: [
|
||||
{
|
||||
name: "否",
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
name: "是",
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: "隐患排查任务",
|
||||
key: "taskName",
|
||||
type: "text",
|
||||
width: "100%",
|
||||
require: true,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "排查结果",
|
||||
key: "result",
|
||||
type: "radio",
|
||||
width: "100%",
|
||||
require: true,
|
||||
datas: [
|
||||
{
|
||||
name: "正常",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
name: "异常",
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: "是否为隐患",
|
||||
key: "dangerFlag",
|
||||
format: "dangerFlagName",
|
||||
type: "radio",
|
||||
width: "100%",
|
||||
labelWidth: 'auto',
|
||||
require: true,
|
||||
disable: this.updateParams.result === 2,
|
||||
datas: [
|
||||
{
|
||||
name: "否",
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
name: "是",
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: "问题描述",
|
||||
key: "taskName",
|
||||
type: "textarea",
|
||||
width: "100%",
|
||||
require: true,
|
||||
}, {
|
||||
name: "隐患类别",
|
||||
key: "taskType",
|
||||
format: "taskTypeName",
|
||||
type: "select",
|
||||
width: "100%",
|
||||
require: true,
|
||||
datas: this.$store.state.prevention_hazard_category,
|
||||
}, {
|
||||
name: "隐患归属人",
|
||||
key: "ownerId",
|
||||
type: "select",
|
||||
width: "100%",
|
||||
require: true,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "IMEI码",
|
||||
key: "imeiCode",
|
||||
type: "text",
|
||||
width: "100%",
|
||||
require: true,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: " 排查人",
|
||||
key: "checkUserId",
|
||||
type: "select",
|
||||
width: "100%",
|
||||
require: true,
|
||||
disable: true,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: " 排查时间",
|
||||
key: "checkTime",
|
||||
type: "text",
|
||||
width: "100%",
|
||||
require: true,
|
||||
disable: true,
|
||||
}, {
|
||||
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
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: "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "点击上传",
|
||||
value: "upload",
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并提交",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}]
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
this.subUpdateForm()
|
||||
}
|
||||
// 树点击
|
||||
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 === "全部" ? "" : data.name
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
this.tableColumn.push({name:'序号',key:"index"});
|
||||
this.tableColumn.push({name:'管控对象',key:"deptName"});
|
||||
this.tableColumn.push({name:'分析对象',key:"deptName"});
|
||||
this.tableColumn.push({name:'管控措施',key:"deptName"});
|
||||
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:'任务状态', width:"110px",key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '管控对象', key: "analControlName" });
|
||||
this.tableColumn.push({ name: '分析对象', key: "itemName" });
|
||||
this.tableColumn.push({ name: '管控措施', key: "measureDescription" });
|
||||
this.tableColumn.push({ name: '隐患排查任务', key: "taskName" });
|
||||
this.tableColumn.push({ name: '结束时间', key: "endTime" });
|
||||
this.tableColumn.push({ name: '责任人', key: "taskChargeUserName" });
|
||||
this.tableColumn.push({ name: '生成时间', key: "generateTime" });
|
||||
this.tableColumn.push({
|
||||
name: '任务状态', width: "110px", key: "status", render: (data) => {
|
||||
if (data.status == 2) {
|
||||
return "<span class='noDraw'>待排查</span>"
|
||||
} else if (data.status == 1) {
|
||||
return "<span>已排查</span>"
|
||||
} else if (data.status == 3) {
|
||||
return "<span class='noDraw'>超期未排查</span>"
|
||||
}
|
||||
},
|
||||
filters: this.$store.state.prevention_task_status.map(item => {
|
||||
return {
|
||||
text: item.name,
|
||||
value: item.value,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
return row.status === data;
|
||||
}
|
||||
}});
|
||||
});
|
||||
}
|
||||
|
||||
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 subActionCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
this.updateParams = {} as any;
|
||||
} else if (data.value === "save") {
|
||||
this.doSave()
|
||||
}
|
||||
}
|
||||
|
||||
public doSave() {
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
this.updateParams.resourceId = resourceId.join(";")
|
||||
}
|
||||
|
||||
this.$store.state.userList.map((item) => {
|
||||
this.userListName[item.value] = item.name
|
||||
})
|
||||
|
||||
|
||||
this.updateParams.taskChargeUserName = this.userListName[this.updateParams.checkUserId]
|
||||
this.updateParams.ownerName = this.userListName[this.updateParams.ownerId]
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id).then((res) => {
|
||||
this.$message.success("编辑成功!");
|
||||
this.showUpdate = false
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
if (item && item.key === "result") {
|
||||
if (data === 2) {
|
||||
this.updateParams.dangerFlag = 1
|
||||
}
|
||||
this.subUpdateForm()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 重置数据
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -163,22 +349,76 @@ export default class DutyManagerComponent 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 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 || null
|
||||
}
|
||||
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 showSubModal(row) {
|
||||
const mathData = Math.floor(Math.random() * 1000);
|
||||
this.updateParams = Object.assign({
|
||||
checkUserId: this.account.userId,
|
||||
checkTime: moment().format('YYYY-MM-DD HH:mm'),
|
||||
imeiCode: moment().format('DDHHmm') + mathData,
|
||||
}, row)
|
||||
this.updateParams.status = 1
|
||||
this.updateParams.endTime = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
this.subUpdateForm()
|
||||
this.showUpdate = true
|
||||
}
|
||||
}
|
||||
</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">
|
||||
|
|
@ -15,7 +14,12 @@
|
|||
|
||||
<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 type="selection" fixed 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">
|
||||
|
|
@ -24,9 +28,9 @@
|
|||
<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">
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="deleteData([scope.row])">查看</el-button>
|
||||
<el-button type="text" @click="showSubModal(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -35,8 +39,10 @@
|
|||
</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="800px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
|
||||
<FormComponent :options="subUpdateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:actions="subActions" @actionCallback="subActionCallback" @change="changes" :full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -9,166 +9,254 @@ import DutyService from "@/service/duty.service"
|
|||
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';
|
||||
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
UnitTreeComponent,
|
||||
},
|
||||
})
|
||||
|
||||
export default class DutyRecordsManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new DutyService();
|
||||
|
||||
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 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:"select",
|
||||
datas:[{
|
||||
name:"部门1",
|
||||
value:0
|
||||
},{
|
||||
name:"部门2",
|
||||
value:1
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "排查结果",
|
||||
key: "result",
|
||||
type: "select",
|
||||
datas: [{
|
||||
name: "正常",
|
||||
value: 1
|
||||
}, {
|
||||
name: "异常",
|
||||
value: 2
|
||||
}]
|
||||
},{
|
||||
name:"是否为隐患",
|
||||
key:"unitId",
|
||||
type:"select",
|
||||
datas:[{
|
||||
name:"单元1",
|
||||
value:0
|
||||
},{
|
||||
name:"单元2",
|
||||
value:1
|
||||
}, {
|
||||
name: "是否为隐患",
|
||||
key: "dangerFlag",
|
||||
type: "select",
|
||||
datas: [{
|
||||
name: "否",
|
||||
value: 0
|
||||
}, {
|
||||
name: "是",
|
||||
value: 1
|
||||
}]
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
public fileList = [] as any;
|
||||
public photoList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
|
||||
public currentUrl = null;
|
||||
|
||||
public subUpdateOptions = [] as any;
|
||||
public subUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "是否包保责任人任务",
|
||||
key: "insuranceDutyFlag",
|
||||
format: "insuranceDutyFlagName",
|
||||
type: "text",
|
||||
labelWidth: 'auto',
|
||||
require: true,
|
||||
with: "100%"
|
||||
}, {
|
||||
name: "隐患排查任务",
|
||||
key: "taskName",
|
||||
type: "text",
|
||||
require: true,
|
||||
with: "calc(50% - 20px)"
|
||||
}, {
|
||||
name: "排查结果",
|
||||
key: "result",
|
||||
format: "resultName",
|
||||
type: "radio",
|
||||
require: true,
|
||||
with: "calc(50% - 20px)"
|
||||
}, {
|
||||
name: "是否为隐患",
|
||||
key: "dangerFlag",
|
||||
format: "dangerFlagName",
|
||||
type: "radio",
|
||||
labelWidth: 'auto',
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
}, {
|
||||
name: "问题描述",
|
||||
key: "taskName",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
}, {
|
||||
name: "隐患类别",
|
||||
key: "dangerType",
|
||||
format: "taskTypeName",
|
||||
type: "select",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
}, {
|
||||
name: "隐患归属人",
|
||||
key: "ownerId",
|
||||
format: "ownerName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "IMEI码",
|
||||
key: "imeiCode",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
},
|
||||
{
|
||||
name: " 排查人",
|
||||
key: "checkUserId",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
},
|
||||
{
|
||||
name: " 排查时间",
|
||||
key: "checkTime",
|
||||
type: "text",
|
||||
width: "100%",
|
||||
require: true,
|
||||
}, {
|
||||
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
format: "resourceIdName",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess2,
|
||||
onMove: this.onRemove2,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg",
|
||||
listType: "picture-card",
|
||||
fileList: this.photoList,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
|
||||
}
|
||||
// 树点击
|
||||
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"});
|
||||
this.tableColumn.push({name:'排查结果', width:"110px",key:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", with: "250px" });
|
||||
this.tableColumn.push({
|
||||
name: '排查结果', width: "110px", key: "result", render: (data) => {
|
||||
if (data.status == 0) {
|
||||
return "<span class='noDraw'>异常</span>"
|
||||
} else if (data.status == 1) {
|
||||
return "<span>正常</span>"
|
||||
}
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'问题描述',key:"deptName"});
|
||||
this.tableColumn.push({name:'排查人',key:"deptName"});
|
||||
this.tableColumn.push({name:'排查时间',key:"person"});
|
||||
this.tableColumn.push({name:'是否为隐患',key:"person"});
|
||||
this.tableColumn.push({name:'隐患归属人',key:"person"});
|
||||
});
|
||||
this.tableColumn.push({ name: '问题描述', key: "description" });
|
||||
this.tableColumn.push({ name: '排查人', key: "checkUserId" });
|
||||
this.tableColumn.push({ name: '排查时间', key: "checkTime" });
|
||||
this.tableColumn.push({
|
||||
name: '是否为隐患', key: "dangerFlag", render: (data) => {
|
||||
if (data.status == 1) {
|
||||
return "<span class='noDraw'>是</span>"
|
||||
} else if (data.status == 0) {
|
||||
return "<span>否</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '隐患归属人', key: "ownerName" });
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -176,22 +264,91 @@ export default class DutyRecordsManagerComponent 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 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 || null
|
||||
}
|
||||
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 showSubModal(row) {
|
||||
this.photoList = []
|
||||
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.subUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
this.updateParams = Object.assign({
|
||||
insuranceDutyFlagName: row.insuranceDutyFlag === 0 ? '否' : '是',
|
||||
resultName: row.result === 1 ? '正常' : '异常',
|
||||
dangerFlagName: row.dangerFlag === 0 ? '否' : '是',
|
||||
taskTypeName: this.$store.getters.prevention_hazard_category_map[row.dangerType]
|
||||
}, row)
|
||||
this.showUpdate = true
|
||||
this.updateParams.resourceId= null
|
||||
this.subUpdateForm()
|
||||
}
|
||||
}
|
||||
</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,34 +9,53 @@
|
|||
</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 type="selection" fixed 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" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
<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" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="操作" fixed="right" 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,441 @@ 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",width:"150px", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
},
|
||||
filters: this.$store.state.prevention_risk_level.map(item => {
|
||||
return {
|
||||
text: item.name,
|
||||
value: item.value,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
return row.riskLevel === data;
|
||||
}
|
||||
}});
|
||||
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 +451,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,60 @@
|
|||
</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 type="selection" fixed 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>
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
<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 v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="操作" fixed="right" 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,181 @@ 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: "150px", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
},
|
||||
filters: this.$store.state.prevention_risk_level.map(item => {
|
||||
return {
|
||||
text: item.name,
|
||||
value: item.value,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
return row.riskLevel === data;
|
||||
}
|
||||
}});
|
||||
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 +191,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>
|
||||
|
|
|
|||
|
|
@ -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,34 +9,54 @@
|
|||
</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">
|
||||
@selection-change="handleSelectionChange" style="width: 100%" highlight-current-row>
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</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 class="cursor td-content" v-if="item.render" :label="item.name"
|
||||
:width="item.width" :key="item.key" :filters="item.filters" :filter-multiple="false"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip">
|
||||
<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" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod" :filter-multiple="false"
|
||||
:show-overflow-tooltip="item.showTip" class="cursor td-content">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="160">
|
||||
<el-table-column label="操作" fixed="right" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row])">查看执行纪律</el-button>
|
||||
<el-button type="text" @click="showSubModal(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" :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,172 +9,334 @@ import MeasureReportService from "@/service/measuresReport.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
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 MeasuresReportManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new MeasureReportService();
|
||||
public unitService = new UnitService();
|
||||
public areaService = new AreaService();
|
||||
|
||||
public params = {} as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
label: '二级 1-1',
|
||||
children: [{
|
||||
label: '三级 1-1-1'
|
||||
}]
|
||||
}]
|
||||
public treeData = [];
|
||||
|
||||
public areaList = {} as any;
|
||||
public unitList = {} as any;
|
||||
|
||||
//管控措施
|
||||
public measuresSelectData = {} as any;
|
||||
|
||||
//排查任务
|
||||
public tasksSelectData = {} as any;
|
||||
|
||||
public proTableColumn = [] as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public currentProTableData = { datas: [] } as any;
|
||||
|
||||
public filterStatusData: any;
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
public filters = [{
|
||||
text: "已发布",
|
||||
value: 0
|
||||
}, {
|
||||
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'
|
||||
}]
|
||||
}]
|
||||
text: "未发布",
|
||||
value: 1
|
||||
}]
|
||||
|
||||
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:"doUpdate",
|
||||
type:"primary"
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}, {
|
||||
name: "发布/终止",
|
||||
value: "doUpdate",
|
||||
type: "primary"
|
||||
}];
|
||||
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 showUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
public updateParams = {} as any;
|
||||
public selectData = [] as any;
|
||||
|
||||
created() {
|
||||
this.$store.state.prevention_measures_sort.map((item) => {
|
||||
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
|
||||
})
|
||||
this.$store.state.prevention_task_type.map((item) => {
|
||||
this.tasksSelectData[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:"status",render:(data)=>{
|
||||
if(data.status==0){
|
||||
return "<span class='noDraw'>未绘制</span>"
|
||||
}else{
|
||||
return "<span>已绘制</span>"
|
||||
public buildTable() {
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status", width: "80px", render: (data) => {
|
||||
if (data.status == 0) {
|
||||
return "<span class='noDraw'>未发布</span>"
|
||||
} else if (data.status == 1) {
|
||||
return "<span>已发布</span>"
|
||||
}
|
||||
},
|
||||
filters: this.filters.map(item => {
|
||||
return {
|
||||
text: item.text,
|
||||
value: item.value,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
this.filterStatusData = data
|
||||
return row.status === data;
|
||||
}
|
||||
}});
|
||||
this.tableColumn.push({name:'区域名称',key:"deptName",width:"200px"});
|
||||
this.tableColumn.push({name:'单元名称',key:"deptName",width:"200px"});
|
||||
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>"
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '区域名称', key: "areaName", width: "130px",
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '单元名称', key: "unitName", width: "130px",
|
||||
});
|
||||
this.tableColumn.push({ name: '管控对象', key: "analControlName", width: "200px" });
|
||||
this.tableColumn.push({ name: '分析对象', key: "itemName", width: "100px" });
|
||||
this.tableColumn.push({ name: '风险源', key: "itemRiskSource", width: "120px" });
|
||||
this.tableColumn.push({
|
||||
name: '事故后果', key: "itemSeriousResult", width: "100px",
|
||||
render: (data) => {
|
||||
if (data.itemSeriousResult) {
|
||||
return data.itemSeriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
}});
|
||||
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:"person"});
|
||||
this.tableColumn.push({name:'排查周期',key:"person"});
|
||||
this.tableColumn.push({name:'单位',key:"person"});
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '风险等级', key: "itemRiskLevel", width: "100px", render: (data) => {
|
||||
return "<span class='color_" + data.itemRiskLevel + "'>" + (data.itemRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.itemRiskLevel]) : '') + "</span>"
|
||||
},
|
||||
filters: this.$store.state.prevention_risk_level.map(item => {
|
||||
return {
|
||||
text: item.name,
|
||||
value: item.value,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
return row.riskLevel === data;
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '管控措施分类', key: "measureFirstType", width: "120px", render: (data) => {
|
||||
if (data.measureFirstType) {
|
||||
return this.$store.getters.prevention_measures_sort_map[data.measureFirstType]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '管控措施分类', width: "120px", key: "measureSecondType",
|
||||
render: (data) => {
|
||||
if (data.measureFirstType) {
|
||||
const secondTypeItem = this.measuresSelectData[data.measureFirstType]
|
||||
return this.selectName(secondTypeItem, data.measureSecondType)
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '管控措施分类', width: "120px", key: "measureThirdType" });
|
||||
this.tableColumn.push({ name: '管控措施', key: "measureDescription", width: "250px" });
|
||||
|
||||
this.tableColumn.push({
|
||||
name: '是否包保责任人任务', width: "150px", key: "insuranceDutyFlag", render: (data) => {
|
||||
if (data.taskItem) {
|
||||
return '是'
|
||||
} else {
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '任务类型', key: "taskType", width: "130px", render: (data) => {
|
||||
if (data.taskType || data.taskType === 0) {
|
||||
return this.$store.getters.prevention_task_type_map[data.taskType]
|
||||
}
|
||||
},
|
||||
filters: this.$store.state.prevention_task_type.map(item => {
|
||||
return {
|
||||
text: item.name,
|
||||
value: item.value,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
return row.taskType === data;
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '包保任务对应项', key: "taskItem", width: "250px", render: (data) => {
|
||||
if (data.taskItem) {
|
||||
if (!this.tasksSelectData[data.taskType] || this.tasksSelectData[data.taskType].length === 0) {
|
||||
this.$store.state.prevention_task_type.map((item) => {
|
||||
this.tasksSelectData[item.value] = this.treeSelectData(item.children)
|
||||
})
|
||||
}
|
||||
const taskItemName = {} as any;
|
||||
this.tasksSelectData[data.taskType].map((item) => {
|
||||
taskItemName[item.id] = item.label
|
||||
})
|
||||
return taskItemName[data.taskItem]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", width: "250px" });
|
||||
this.tableColumn.push({ name: '隐患责任人', key: "taskChargeUserName", width: "100px" });
|
||||
this.tableColumn.push({ name: '岗位', key: "taskExecutePostName" });
|
||||
this.tableColumn.push({ name: '排查周期', key: "taskReviewCycleValue" });
|
||||
this.tableColumn.push({
|
||||
name: '单位', key: "taskReviewCycleUnit", render: (data) => {
|
||||
return this.$store.getters.prevention_cycle_unit_map[data.taskReviewCycleUnit]
|
||||
}
|
||||
});
|
||||
|
||||
//查看执行记录
|
||||
this.proTableColumn.push({ name: '序号', key: "index" });
|
||||
this.proTableColumn.push({ name: '排查时间', key: "taskChargeUserName" });
|
||||
this.proTableColumn.push({ name: '排查人', key: "taskChargeUserName" });
|
||||
this.proTableColumn.push({ name: '排查内容', key: "taskChargeUserName" });
|
||||
this.proTableColumn.push({ name: '排查结果', key: "taskChargeUserName" });
|
||||
this.proTableColumn.push({ name: '是否为隐患', key: "taskChargeUserName" });
|
||||
this.proTableColumn.push({ name: '隐患描述', key: "taskChargeUserName" });
|
||||
this.proTableColumn.push({ name: '隐患归属人', key: "taskChargeUserName" });
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
res.data.datas.map(item => {
|
||||
this.areaList[item.id] = item.name
|
||||
})
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData() {
|
||||
this.unitService.selectByPage({ pageSize: 1000 }, false).then((res: any) => {
|
||||
res.data.datas.map(item => {
|
||||
this.unitList[item.id] = item.name
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
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 === "doUpdate") {
|
||||
//发布--终止
|
||||
this.doUpdate()
|
||||
}
|
||||
}
|
||||
//发布--终止
|
||||
public doUpdate() {
|
||||
if (this.selectData && this.selectData.length > 0) {
|
||||
this.filterStatusData = this.selectData[0]['status']
|
||||
const tmpSelectData = this.selectData.filter((item) => item.status !== this.filterStatusData)
|
||||
if (tmpSelectData.length === 0) {
|
||||
const statusName = this.filterStatusData === 1 ? '终止' : '发布'
|
||||
this.$confirm('确认' + statusName + '所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const updateParams = JSON.parse(JSON.stringify(this.selectData))
|
||||
updateParams.map((item) => {
|
||||
item.status = this.filterStatusData === 0 ? 1 : 0
|
||||
return item
|
||||
})
|
||||
this.tableService.addOrUpdate(updateParams).then((res) => {
|
||||
this.$message.success(statusName + "成功!");
|
||||
this.getTableData();
|
||||
})
|
||||
}).catch(() => {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 重置数据
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -182,22 +344,61 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
|
|||
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 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]
|
||||
}
|
||||
}
|
||||
|
||||
//查看执行记录
|
||||
public showSubModal(id) {
|
||||
this.showProtable = true
|
||||
this.tableService.selectById({ controlId: id }).then((res: any) => {
|
||||
this.currentProTableData.datas = res.data.datas
|
||||
})
|
||||
}
|
||||
|
||||
//执行记录--关闭
|
||||
public subCallback() {
|
||||
this.showProtable = false
|
||||
}
|
||||
|
||||
}
|
||||
</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,207 @@ 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)",
|
||||
format:"areaName",
|
||||
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 +323,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 +383,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 +477,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({areaName:this.areaList.find(item=>item.value===data.areaId)?.name,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 +495,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