Merge commit '6ecdc5c471dfddfbec62487ee51a2b4ba4e39aaa' into wuyanfu

# Conflicts:
#	src/store/index.ts
#	src/views/blank.component.vue
wuyanfu
吴延福 2023-06-28 09:21:54 +08:00
commit 649209ff2c
21 changed files with 3964 additions and 2103 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,553 @@
<template>
<!-- 排查任务 -->
<div v-if="visible">
<FormComponent :options="triUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="updataParams"
:isReadonly="isReadonly" :actions="subActions" @actionCallback="callback($event)" :full-btn="true"
btnPosition="center" @change="change">
<div class="sub-title">排查任务制定</div>
<TableComponent :tableData="updataParams.tasks" :tableColumn="tableColumn" @actionCallback="taskAdd($event)"
:actions="!isReadonly ? tableActions : []" actionPosition="flex-start" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="updataParams.tasks" tooltip-effect="dark" height="250" border
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showTaskModel(scope.row, true)">查看</el-button>
<el-button :v-if="!isReadonly" type="text" @click="showTaskModel(scope.row)"></el-button>
<el-button :v-if="!isReadonly" type="text" @click="deleteTask(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
<el-dialog :close-on-click-modal="false" :title="'新增'" :visible.sync="showSubUpdate" width="700px"
:before-close="handleCloseTask">
<FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right"
:data.sync="taskUpdataParams" :actions="subActions" :full-btn="true" btnPosition="center"
@actionCallback="taskCallback" @change="taskSelectChange">
</FormComponent>
</el-dialog>
</div>
</template>
<script lang="ts">
import FormComponent from 'hbt-common/components/common/form.component.vue';
import { Component, Emit, Prop, PropSync, Vue, Watch } from 'vue-property-decorator';
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import UnitTreeComponent from '@/components/tree.component.vue';
import WorkService from '@/service/work.service';
import UnitService from '@/service/unit.service';
import AreaService from '@/service/area.service';
import SystemService from "hbt-common/service/system.service"
import JobHazardService from '@/service/jobHazard.service';
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import { L_COLUMN, L_VALUE, S_COLUMN, S_VALUE } from '@/mock/lsRisk';
import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk';
@Component({
components: {
FormComponent,
TableComponent,
DrawComponent,
UnitTreeComponent,
ButtonListComponent,
}
})
export default class MeasureComponent extends Vue {
public systemService = new SystemService();
public dictData = {
measuresSort: [],
} as any;
//
public currentTaskData = { datas: [], deleteIds: [] } as any;
public tableColumn = [] as any;
public triUpdateOptions: FormOption<BtnOption>[] = [];
public secondTypeItem = [];
// public updataParams = {} as any;
//
public currentMeasureData = {
datas: [],
deleteIds: [],
} as any;
public selectData = [];
public showSubUpdate = false;
//
public measuresSelectData = {} as any;
public measuresUpdateForm() {
this.triUpdateOptions = [{
name: "管控方式",
key: "controlWay",
format: "controlWayName",
type: "select",
width: "100%",
require: true,
datas: this.$store.state.prevention_measure_type
}, {
name: "管控措施分类",
key: "firstType",
format: "firstTypeName",
type: "treeSelect",
require: true,
expandLevel: Infinity,
showError: false,
width: "40%",
datas: this.dictData.measuresSort
}, {
key: "secondType",
type: "treeSelect",
format: "secondTypeName",
require: true,
expandLevel: Infinity,
showError: false,
width: "25%",
datas: this.secondTypeItem
}, {
key: "thirdType",
type: "text",
require: true,
width: "25%",
}, {
name: "措施描述",
key: "description",
type: "text",
require: true,
width: "100%"
}];
}
//
public taskUpdateOptions: FormOption<BtnOption>[] = [];
//
public taskUpdataParams = {} as any;
//
public taskType = [] as any;
public tasksSelectData = {} as any;
//
public taskItem = [] as any;
public taskIsReadonly = false;
public taskCurrentId = -1;
public taskUpdateForm() {
this.taskUpdateOptions = [{
name: "是否为重大危险源包保责任履职",
key: "insuranceDutyFlag",
format: "insuranceDutyFlagName",
type: "radio",
width: "100%",
labelWidth: 'auto',
require: true,
datas: [
{
name: "否",
value: 0
},
{
name: "是",
value: 1
}
]
}, {
name: "任务类型",
key: "taskType",
format: "taskTypeName",
type: "treeSelect",
width: "calc(50% - 20px)",
require: true,
datas: this.taskType,
expandLevel: Infinity,
disable: !(this.taskUpdataParams.insuranceDutyFlag === 1),
}, {
name: "包保任务对应项",
key: "taskItem",
format: "taskItemName",
type: "treeSelect",
width: "calc(50% - 20px)",
require: true,
expandLevel: Infinity,
showError: false,
hide: !(this.taskUpdataParams.insuranceDutyFlag === 1),
datas: this.taskItem
}, {
name: "隐患排查任务",
key: "name",
type: "text",
width: "100%",
require: true,
}, {
name: "执行岗位",
key: "executePostCode",
format: "executePostName",
type: "select",
width: "calc(50% - 20px)",
require: true,
datas: this.$store.state.postList,
},
{
name: "责任人",
key: "chargeUserId",
format: "chargeUserName",
type: "select",
width: "calc(50% - 20px)",
require: true,
datas: this.$store.state.userList,
}, {
name: "排查周期",
key: "reviewCycleValue",
type: "text",
width: "calc(50% - 20px)",
require: true,
}, {
key: "reviewCycleUnit",
type: "select",
require: true,
format: 'reviewCycleValueName',
datas: this.$store.state.prevention_cycle_unit
}, {
name: "工作开始时间",
key: "startTime",
type: "time",
width: "calc(50% - 20px)",
require: true,
hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
}, {
name: "工作结束时间",
key: "endTime",
type: "time",
width: "calc(50% - 20px)",
require: true,
hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
}]
}
public subActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public tableActions = [{
name: "添加",
value: "fourSubAdd",
icon: "el-icon-plus",
type: "primary"
}];
@Prop()
public isReadonly: boolean;
@PropSync("show", {
required: true,
default: true
})
public visible: boolean;
@PropSync("data", {
required: true,
})
public updataParams!: any;
@PropSync("tabledata", {
required: true,
})
public measureData!: any;
created() {
this.dictData.measuresSort = this.$store.state.prevention_measures_sort.map((item) => {
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
return {
label: item.name,
id: item.value,
}
})
this.secondTypeItem = this.measuresSelectData[this.updataParams.firstType]
if (this.updataParams.tasks && this.updataParams.tasks.length > 0) {
this.updataParams.tasks.forEach((item, index) => {
item.index = index + 1
return item
})
}
this.measuresUpdateForm()
this.taskUpdateForm()
this.buildTable()
}
public buildTable() {
//
this.tableColumn.push({ name: '序号', key: "index" });
this.tableColumn.push({ name: "任务名称", key: "name" })
this.tableColumn.push({ name: "执行岗位", key: "executePostName" })
this.tableColumn.push({ name: "执行人", key: "chargeUserName" })
this.tableColumn.push({ name: "执行周期", key: "reviewCycleValue" })
this.tableColumn.push({
name: "单位", key: "reviewCycleUnit", render: (data) => {
return this.$store.getters.prevention_cycle_unit_map[data.reviewCycleUnit]
}
})
}
public change(data, item) {
//
if (item && item.key === 'controlWay') {
this.updataParams.controlWayName = this.$store.getters.prevention_measure_type_map[data]
}
//
if (item && item.key === "firstType") {
this.updataParams.firstTypeName = this.selectName(this.dictData.measuresSort, data)
this.secondTypeItem = this.measuresSelectData[data]
}
//
if (item && item.key === 'secondType') {
this.updataParams.secondTypeName = this.selectName(this.secondTypeItem, data)
}
this.measuresUpdateForm()
}
public selectName(selectGroup, data) {
if (selectGroup && selectGroup.length > 0) {
const map = {};
selectGroup.forEach((item: any) => {
if (item.value) {
map[item.value] = item.name
} else if (item.id) {
map[item.id] = item.label
}
})
return map[data]
}
}
public treeSelectData(data) {
return data.map((item) => {
return {
label: item.dictLabel,
id: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
})
}
public handleSelectionChange(data) {
this.selectData = data;
}
//
public showTaskModel(row, isReadonly) {
this.taskType = this.taskItemSelect()
if (isReadonly) {
this.taskIsReadonly = true
this.taskUpdataParams = JSON.parse(JSON.stringify(row))
this.taskUpdataParams.taskTypeName = this.$store.getters.prevention_task_type_map[row.taskType]
this.taskUpdataParams.reviewCycleValueName = this.$store.getters.prevention_cycle_unit_map[row.reviewCycleUnit]
if (this.taskUpdataParams.taskType && this.taskUpdataParams.taskItem) {
const taskItemName = {} as any;
this.tasksSelectData[row.taskType].map((item) => {
taskItemName[item.id] = item.label
})
this.taskUpdataParams.taskItemName = taskItemName[this.taskUpdataParams.taskItem]
}
this.taskCurrentId = 0
} else if (!isReadonly) {
this.taskIsReadonly = false
this.taskUpdataParams = JSON.parse(JSON.stringify(row))
this.taskCurrentId = 0
if (row.insuranceDutyFlag === 0) {
this.taskUpdataParams.taskType = 0
this.taskUpdataParams.insuranceDutyFlagName = '否'
this.taskUpdataParams.taskTypeName = '日常任务'
} else if (row.insuranceDutyFlag === 1) {
this.taskType = this.taskType.filter(item => item.id !== 0)
this.taskUpdataParams.insuranceDutyFlagName = "是"
this.taskItem = this.tasksSelectData[this.taskUpdataParams.taskType]
}
this.taskUpdataParams.executePostCode = parseInt(row.executePostCode)
}
this.showSubUpdate = true
this.taskUpdateForm()
}
// ---
public taskItemSelect() {
return this.$store.state.prevention_task_type.map((item) => {
this.tasksSelectData[item.value] = this.treeSelectData(item.children)
return {
label: item.name,
id: item.value,
}
})
}
public handleCloseTask(goOn?) {
this.showSubUpdate = false;
this.taskIsReadonly = false;
this.taskCurrentId = -1;
this.taskUpdataParams = {} as any;
}
public taskCallback(data) {
if (data && data.value === 'cancel') {
this.showSubUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
this.doTaskSave(data.value !== "save")
}
}
//
public doTaskSave(goOn?) {
if (!this.taskUpdataParams.index) {
if (!this.updataParams.tasks) {
this.updataParams.tasks = []
}
this.taskUpdataParams.index = this.updataParams.tasks.length + 1;
this.updataParams.tasks.push(this.taskUpdataParams);
} else {
this.updataParams.tasks.splice(this.updataParams.tasks.findIndex(item => item.index === this.taskUpdataParams.index), 1, this.taskUpdataParams)
}
this.updataParams.tasks.forEach((item, i) => {
item.index = i + 1
})
this.taskUpdataParams = {} as any;
this.showSubUpdate = !!goOn
}
public taskAdd() {
this.showSubUpdate = true
}
public deleteTask(row) {
this.updataParams.tasks.splice(this.updataParams.tasks.findIndex(item => item.index === row.index), 1)
if (row.id) {
if (!this.updataParams.deleteIds) {
this.updataParams.deleteIds = []
}
this.updataParams.deleteIds.push(row.id)
}
this.updataParams.tasks.forEach((item, i) => {
item.index = i + 1
})
}
// --
public taskSelectChange(data, item) {
if (data !== null && data !== undefined) {
if (item && item.key === 'insuranceDutyFlag') {
this.taskType = this.taskItemSelect()
if (data === 0) {
this.taskUpdataParams.taskType = 0
this.taskUpdataParams.insuranceDutyFlagName = '否'
this.taskUpdataParams.taskTypeName = '日常任务'
} else if (data === 1) {
this.taskType = this.taskType.filter(item => item.id !== 0)
this.taskUpdataParams.taskType = null
this.taskUpdataParams.insuranceDutyFlagName = "是"
}
}
if (item && item.key === "taskType") {
this.taskItem = this.tasksSelectData[data]
}
//
if (item && item.key === "executePostCode") {
this.taskUpdataParams.executePostName = this.$store.getters.post_map[data];
}
//
if (item && item.key === "chargeUserId") {
this.taskUpdataParams.chargeUserName = this.$store.getters.user_map[data];
}
//
if (item && item.key === 'taskType') {
const map = {};
this.taskType.forEach((item: any) => {
map[item.value] = item.name
})
this.taskUpdataParams.taskTypeName = map[data]
}
//
if (item && item.key === 'taskItem') {
const map = {};
this.taskItem.forEach((item: any) => {
map[item.value] = item.name
})
this.taskUpdataParams.taskItemName = map[data]
}
this.taskUpdateForm()
}
}
public callback(data) {
if (data && data.value === 'cancel') {
this.visible = false;
this.updataParams = {} as any;
} else if (data && data.value.indexOf("save") >= 0) {
this.doMeasureSave(data.value !== "save")
}
}
public doMeasureSave(goOn) {
if (!this.updataParams.tasks) {
this.updataParams.tasks = []
}
if (!this.updataParams.index) {
this.updataParams.index = this.currentMeasureData.datas.length + 1;
this.updataParams.tasksNum = this.updataParams.tasks.length
this.currentMeasureData.datas.push(this.updataParams);
} else {
this.updataParams.tasksNum = this.updataParams.tasks.length
this.currentMeasureData.datas.splice(this.currentMeasureData.datas.findIndex(item => item.index === this.updataParams.index), 1, this.updataParams)
}
this.currentMeasureData.datas.forEach((item, i) => {
item.index = i + 1
})
this.updataParams = {} as any;
this.measureData = this.currentMeasureData;
this.visible = !!goOn;
}
//
@Emit("actionCallback")
actionCallback(data) {
//Emit false
}
}
</script>
<style lang="scss" scoped src="../views/common.component.scss"></style>

View File

@ -0,0 +1,39 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class DeviceService extends BaseService<any>{
constructor(){
super()
}
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/device/anal/getList';
return this.get(url,params)
}
public selectById(id):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/device/anal/detail?id='+id;
return this.get(url,null,true)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/device/anal/add';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/device/anal/update';
return this.put(url,params,{},showLoading)
}
}
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention +'/device/anal/delete';
return this.deleteBatch(url,params,{},true)
}
// 存草稿
public addOrDraft(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/device/anal/addDraft';
return this.post(url,params,{},showLoading)
}
}

View File

@ -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)
}
}

View File

@ -36,10 +36,6 @@ export default class JobHazardService extends BaseService<any>{
// 存草稿
public addOrDraft(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/job/anal/addDraft';
if(add){
return this.post(url,params,{},showLoading)
}else{
return this.put(url,params,{},showLoading)
}
return this.post(url,params,{},showLoading)
}
}

View File

@ -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)
}
}

View File

@ -6,11 +6,16 @@ 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)
}
}

View File

@ -22,6 +22,14 @@ export default new Vuex.Store({
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:[]
},
getters: {
dept_map:(state)=>{
@ -136,6 +144,62 @@ export default new Vuex.Store({
})
return map
},
prevention_serious_result_map:(state)=>{
const map = {};
state.prevention_serious_result.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_security_identifier_map:(state)=>{
const map = {};
state.prevention_security_identifier.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_majorsign_map:(state)=>{
const map = {};
state.prevention_majorsign.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_control_level_map:(state)=>{
const map = {};
state.prevention_control_level.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_measure_type_map:(state)=>{
const map = {};
state.prevention_measure_type.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_measures_sort_map:(state)=>{
const map = {};
state.prevention_measures_sort.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_task_type_map:(state)=>{
const map = {};
state.prevention_task_type.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_evaluate_status_map:(state)=>{
const map = {};
state.prevention_evaluate_status.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
},
mutations: {
@ -190,7 +254,31 @@ export default new Vuex.Store({
},
set_prevention_device_type(state,data){
state.prevention_device_type = data;
}
},
set_prevention_serious_result(state,data){
state.prevention_serious_result = data;
},
set_prevention_security_identifier(state,data){
state.prevention_security_identifier = data;
},
set_prevention_majorsign(state,data){
state.prevention_majorsign = data;
},
set_prevention_control_level(state,data){
state.prevention_control_level = data;
},
set_prevention_measure_type(state,data){
state.prevention_measure_type = data;
},
set_prevention_measures_sort(state,data){
state.prevention_measures_sort = data;
},
set_prevention_task_type(state,data){
state.prevention_task_type = data
},
set_prevention_evaluate_status(state,data){
state.prevention_evaluate_status = data
},
},
actions: {
},

View File

@ -27,10 +27,20 @@ export default class BlankComponent extends Vue {
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.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(),
]).then(((results:any)=>{
this.$store.commit("setDeptTreeList",results[0].data);
this.$store.commit("setUserList",results[2].data.datas.map((item)=>{
]).then(((results: any) => {
this.$store.commit("setDeptTreeList", results[0].data);
this.$store.commit("setUserList", results[2].data.datas.map((item) => {
return {
name: item.nickName,
value: item.userId
@ -82,43 +92,100 @@ export default class BlankComponent extends Vue {
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
}
}))
this.$store.commit("set_prevention_cycle_unit",results[9].data.map(item=>{
this.$store.commit("set_prevention_cycle_unit", results[9].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_danger_check_type",results[10].data.map(item=>{
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
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
}
}))
this.$store.commit("set_prevention_danger_resource",results[11].data.map(item=>{
this.$store.commit("set_prevention_danger_resource", results[11].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_danger_type",results[12].data.map(item=>{
this.$store.commit("set_prevention_danger_type", results[12].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_major_type",results[13].data.map(item=>{
this.$store.commit("set_prevention_major_type", results[13].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_occur_step",results[14].data.map(item=>{
this.$store.commit("set_prevention_occur_step", results[14].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("setAnalCntrol",results[15].data)
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("setDeptList", results[1].data.map((item) => {
return {

View File

@ -72,7 +72,6 @@
</template>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
</el-dialog>
@ -97,8 +96,8 @@
</el-table-column>
</template>
</el-table>
</TableComponent>
</el-dialog>
</div>

View File

@ -149,6 +149,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
}, {
name: "设备类型",
key: "type",
format: "typeName",
type: "select",
require: true,
width: "calc(50% - 20px)",
@ -374,6 +375,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
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

View File

@ -1,7 +1,6 @@
<div class="common-box dis-flex ">
<div class="common-tree-box" v-if="treeData">
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
</el-tree>
<div class="common-tree-box">
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
</div>
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
@ -17,37 +16,41 @@
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="40">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row,null,true)">修改</el-button>
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</div>
</div>
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
<el-dialog :close-on-click-modal="false" :title="!updateParams.id?'新增':isReadonly?'详情':'编辑'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
<FormComponent :options="updateOptions" 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;">
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="250" border
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
:isReadonly="isReadonly" @actionCallback="callback" @change="changes">
<div class="sub-title">安全检查表分析法</div>
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
@actionCallback="callback($event)" :actions="isReadonly? []:subTableActions" actionPosition="flex-start"
:showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="updateParams.items" tooltip-effect="dark" height="250" border
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="40">
</el-table-column>
<template v-for="item in subTableColumn">
@ -59,23 +62,54 @@
:label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" width="100">
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row.userId)">修改</el-button>
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
<el-button v-if="isReadonly || isModifyonly" type="text"
@click="showSubModel(scope.row,true)">查看</el-button>
<el-button v-if="isModifyonly" type="text" @click="showSubModel(scope.row)">修改</el-button>
<el-button v-if="!isReadonly && !isModifyonly" type="text"
@click="showSubModel(scope.row)">评价</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
<FormComponent :options="subBasicRiskOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" @actionCallback="callback" @change="changes" @action="updateActions"
:actions="isReadonly? []:updateActions" :full-btn="true" btnPosition="center">
</FormComponent>
</el-dialog>
<!-- 评估矩阵 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showMatrixModal" :title="'区域风险等级判定准则'">
<img style="width:100%" src="../../../../assets/images/5.png" alt="">
</el-dialog>
<!-- 评价 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showSubUpdate" width="880px"
:before-close="handleAnalyClose">
<AnalEvaluationComponent :isReadonly="analyIsReadonly" :data.sync="analysisUpdateParams"
:show.sync="showSubUpdate" @actionCallback="analyCallback" :tabledata.sync="updateParams"
:areaList="areaList" :type="'device'"></AnalEvaluationComponent>
</el-dialog>
<!-- 检查项目 -->
<el-dialog :close-on-click-modal="false" title="检查项目" :show-close="false" :visible.sync="showProtable"
width="880px">
<FormComponent labelWidth="110px" labelAlign="right" :actions="proActions" @actionCallback="proCallback"
:full-btn="true" btnPosition="center">
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250"
border style="width: 100%">
<template v-for="item in proTableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
</el-table>
</TableComponent>
</FormComponent>
</el-dialog>
<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>
</div>

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { Component, Watch } from 'vue-property-decorator';
import template from "./deviceAnal.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
@ -8,17 +8,33 @@ import TableComponent from "hbt-common/components/common/table.component.vue"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import DeviceService from '@/service/device.service';
import AnalEvaluationComponent from '@/components/analEvaluation.component.vue';
import UnitTreeComponent from '@/components/tree.component.vue';
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import DeviceService from '@/service/deviceAnal.service';
import UnitService from '@/service/unit.service';
import AreaService from '@/service/area.service';
import DiviceService from '@/service/device.service';
import SystemService from "hbt-common/service/system.service";
import moment from "moment"
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
AnalEvaluationComponent,
UnitTreeComponent,
ButtonListComponent
},
})
export default class DeviceAnalManagerComponent extends BaseRecordComponent<any> {
public tableService = new DeviceService();
public unitService = new UnitService();
public areaService = new AreaService();
public systemService = new SystemService();
public diviceService = new DiviceService();
public params = {
areaName: "",
@ -27,6 +43,62 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
public treeData = [] as any;
public areaList = [];
public unitList = [];
public diviceList = [];
public isReadonly = false;
public isModifyonly = false;
public subTableColumn = [] as any;
public currentId = -1;
public sourceMap = {} as any;
public craftMap = {} as any;
public chemicaltMap = {} as any
public majorsignMap = {} as any;
//
public showProtable = false;
public proTableColumn = [] as any;
public currentProTableData = {
datas: []
} as any;
public proActions = [{
name: "取消",
value: "cancel"
}];
//
public dictData = {
source: [],
craft: [],
chemical: [],
mainPerson: [],
craftPerson: [],
operatePerson: [],
measuresSort: [],
riskControlLevel: [],
seriousResult: [],
identifier: [],
majorsign: [],
} as any;
//
public showMatrixModal = false;
//
public showSubUpdate = false;
public analyIsReadonly = false;
//
public analysisUpdateParams = {
riskChoose: [],
remainChoose: [],
remainLevel: null,
riskLevel: null,
datas: []
} as any;
public formActions = [{
name: "查询",
value: "search",
@ -57,37 +129,279 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
name: "反向选择",
value: "reverse"
}];
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: '存草稿',
value: 'addDraft',
type: "primay"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "区域名称",
key: "areaId",
key: "areaName",
type: "text",
}, {
name: "单元名称",
key: "unitId",
key: "unitName",
type: "text",
}, {
name: "作业活动",
key: "unitId",
type: "select",
datas: [{
name: "单元1",
value: 0
}, {
name: "单元2",
value: 1
}]
}];
},];
public showUpdate = false;
public updateParams = {} as any;
public account = JSON.parse(localStorage.getItem("account") as any);
public updateParams = {
majorSign: [],
items: [],
evaluateTime: moment().format('YYYY-MM-DD'),
evaluateUserId: this.account.userId,
evaluateUserName: this.account.nickName,
} as any;
public selectData = [];
created() {
public subSelectData = []
public updateOptions: FormOption<BtnOption>[] = [];
public subBasicRiskOptions: FormOption<BtnOption>[] = [];
public subTableActions: BtnOption[] = [];
public buildUpdateForm() {
this.updateOptions = [{
name: "区域名称",
key: "areaId",
format: "areaName",
type: "select",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.areaList
}, {
name: "单元名称",
key: "unitId",
format: "unitName",
type: "select",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.unitList
}, {
name: "责任部门",
key: "chargeDeptName",
type: "text",
require: true,
width: "calc(50% - 20px)",
disable: true,
}, {
name: "责任人",
key: "chargeUserName",
type: "text",
require: true,
width: "calc(50% - 20px)",
showError: false,
disable: true,
}, {
name: "设备名称",
key: "deviceInventoryId",
format: 'name',
type: "select",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.diviceList,
}, {
name: "设备类型",
key: "type",
format: "typeName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
datas: this.$store.state.prevention_device_type
}, {
name: "涉及岗位",
key: "postName",
type: "text",
width: "calc(100% - 20px)",
require: true,
disable: true,
}, {
name: "评价人",
key: "evaluateUserId",
format: "evaluateUserName",
require: true,
width: "calc(50% - 20px)",
type: "select",
showError: false,
datas: this.$store.state.userList
}, {
name: "评价时间",
key: "evaluateTime",
type: "date",
subType: "date",
width: "calc(50% - 20px)",
require: true,
showError: false,
format: "yyyy-MM-dd"
}, {
name: "是否为两大一重",
key: "majorSign",
format: "majorSignName",
type: "checkbox",
width: "calc(100% - 20px)",
require: true,
datas: this.$store.state.prevention_majorsign,
}, {
name: "重大危险源",
key: "majorHazard",
hide: !this.updateParams.majorSign.includes(1) || this.updateParams.majorSign.includes(0),
type: "select",
format: "majorHazardName",
width: "calc(50% - 20px)",
require: true,
multiple: true,
datas: this.dictData.source
}, {
name: "重点监管工艺",
key: "regulatoryProcess",
format: "regulatoryProcessName",
hide: !this.updateParams.majorSign.includes(2) || this.updateParams.majorSign.includes(0),
type: "select",
width: "calc(50% - 20px)",
require: true,
multiple: true,
datas: this.dictData.craft,
}, {
name: "重点监管化学品",
key: "regulatoryChemical",
format: "regulatoryChemicalName",
hide: !this.updateParams.majorSign.includes(3) || this.updateParams.majorSign.includes(0),
type: "select",
width: "calc(50% - 20px)",
require: true,
multiple: true,
datas: this.dictData.chemical,
}];
this.subTableActions = [{
name: "批量删除",
value: "subDelete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}, {
name: "评估矩阵",
value: "estimateMatrix",
type: "primary"
}];
this.subBasicRiskOptions = [{
name: "风险等级",
key: "riskLevel",
format: 'riskLevelName',
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
datas: this.$store.state.prevention_risk_level
}, {
name: "残余风险等级",
key: "remainRiskLevel",
format: "remainRiskLevelName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
datas: this.$store.state.prevention_risk_level
}]
}
@Watch("$store.state.deptList", { immediate: true, deep: true })
onChanges() {
this.loadAreaData()
}
@Watch("updateParams", { immediate: true, deep: true })
onCountValueChange() {
this.buildUpdateForm()
}
created() {
Promise.all([
this.systemService.getDictData("prevention_risk_source"),
this.systemService.getDictData("prevention_risk_craft"),
this.systemService.getDictData("prevention_risk_chemical"),
]).then(((results: any) => {
this.dictData.source = results[0].data.map((item) => {
this.sourceMap[item.dictValue] = item.dictLabel;
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
}
})
this.dictData.craft = results[1].data.map((item) => {
this.craftMap[item.dictValue] = item.dictLabel;
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
}
})
this.dictData.chemical = results[2].data.map((item) => {
this.chemicaltMap[item.dictValue] = item.dictLabel;
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
}
})
this.buildUpdateForm()
}));
}
//
public loadAreaData() {
this.unitList = [];
this.diviceList = [];
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
this.areaList = res.data.datas.map(item => {
return {
name: item.name,
value: item.id,
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : 0,
}
});
this.buildUpdateForm()
})
}
//
public loadUnitData(id?) {
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
this.unitList = res.data.datas.map(item => {
return {
name: item.name,
value: item.id,
deptId: item.chargeDeptId,
userId: item.chargeUserId,
deptName: item.chargeDeptName,
userName: item.chargeUserName,
}
});
this.buildUpdateForm()
})
}
//
public handleNodeClick(data) {
console.log('data', data)
this.params.unitName = "";
this.params.areaName = "";
if (data.areaId) {
@ -96,40 +410,111 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
this.params.areaName = data.name
}
this.getTableData()
}
public buildTable() {
this.tableColumn.push({ name: '序号', key: "index" });
this.tableColumn.push({ name: '区域名称', key: "deptName", width: "200px" });
this.tableColumn.push({ name: '风险分析单元', key: "deptName", width: "200px" });
this.tableColumn.push({ name: '设备名称', key: "person" });
this.tableColumn.push({ name: '设备类别', key: "person" });
this.tableColumn.push({ name: '区域名称', key: "areaName", width: "150px" });
this.tableColumn.push({ name: '风险分析单元', key: "unitName", width: "150px" });
this.tableColumn.push({ name: '设备名称', key: "name", });
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: "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>"
name: '设备类别', key: "type", render: (data) => {
if (data.riskLevel) {
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
}
}
});
this.tableColumn.push({
name: '残余风险等级', key: "status", render: (data) => {
if (data.status == 0) {
return "<span class='noDraw'>未绘制</span>"
name: '检查项目', key: "itemNum", render: (data) => {
return "<span class='link'>" + (data.itemNum ? data.itemNum : 0) + "</span>"
}
});
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
this.tableColumn.push({ name: '责任人', key: "chargeUserName" });
this.tableColumn.push({
name: '风险等级', key: "riskLevel", render: (data) => {
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
}
});
this.tableColumn.push({
name: '残余风险等级', key: "remainRiskLevel", width: "150px", render: (data) => {
return "<span class='color_" + data.remainRiskLevel + "'>" + (data.remainRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.remainRiskLevel]) : '') + "</span>"
}
});
this.tableColumn.push({
name: '状态', key: "status", render: (data) => {
if (data.status) {
return "<span class='color_" + data.status + "'>" + (data.status ? (this.$store.getters.prevention_evaluate_status_map[data.status]) : '') + "</span>"
}
}
});
//
this.subTableColumn.push({ name: '序号', key: "index" });
this.subTableColumn.push({ name: '检查项目', key: "itemName" });
this.subTableColumn.push({ name: '检查标准', key: "itemStandard", showTip: true, width: "200px" });
this.subTableColumn.push({ name: '风险源', key: "riskSource" });
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis" });
this.subTableColumn.push({
name: '最严重后果', key: "seriousResult", width: "200px", render: (data) => {
if (data.seriousResult) {
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
}
}
});
this.subTableColumn.push({
name: '风险等级', key: "riskLevel", render: (data) => {
if (data.riskLevel) {
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
}
}
});
this.subTableColumn.push({ name: '评估方法', key: "riskChoose", });
this.subTableColumn.push({
name: '残余风险等级', key: "remainLevel", width: "200px", render: (data) => {
if (data.remainLevel) {
return this.$store.getters.prevention_risk_level_map[data.remainLevel]
}
}
});
this.subTableColumn.push({ name: '评估方法', key: "remainChoose", });
this.subTableColumn.push({
name: '管控措施', key: "measuresNum", render: (data) => {
if (data.measuresNum) {
return data.measuresNum
} else {
return "<span>已绘制</span>"
if (data.measures && data.measures.length) {
return data.measures.length
}
}
}
});
//
this.proTableColumn.push({ name: '序号', key: "index" });
this.proTableColumn.push({ name: '检查项目', key: "itemName" });
this.proTableColumn.push({ name: '检查标准', key: "itemStandard", showTip: true, width: "200px" });
this.proTableColumn.push({ name: '风险源', key: "riskSource" });
this.proTableColumn.push({
name: '可能发生事故', key: "seriousResult", width: "150px", render: (data) => {
if (data.seriousResult) {
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
}
}
});
this.proTableColumn.push({
name: '风险等级', key: "riskLevel", render: (data) => {
if (data.riskLevel) {
return this.$store.getters.prevention_risk_level_map[data.riskLevel]
}
}
});
this.proTableColumn.push({
name: '残余风险等级', key: "remainLevel", width: "150px", render: (data) => {
if (data.remainLevel) {
return this.$store.getters.prevention_risk_level_map[data.remainLevel]
}
}
});
@ -150,6 +535,41 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === "add") {
this.isReadonly = false;
this.showUpdate = true
this.updateParams = {
majorSign: [],
items: [],
evaluateTime: moment().format('YYYY-MM-DD'),
evaluateUserId: this.account.userId,
evaluateUserName: this.account.nickName,
} as any
} else if (data.value === "cancel") {
this.handleClose()
} else if (data.value === "estimateMatrix") {
this.showMatrixModal = true
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
this.isReadonly = false;
} else if (data && data.value === 'addDraft') {
this.doSaveDraft()
this.isReadonly = false;
} else if (data && data.value === "subDelete") {
if (this.subSelectData.length > 0) {
if (!this.updateParams.deleteIds) {
this.updateParams.deleteIds = []
}
this.subSelectData.map((itemData: any) => {
this.updateParams.deleteIds.push(itemData.id)
this.updateParams.items.splice(this.updateParams.items.findIndex(item => item.index === itemData.index), 1)
})
this.updateParams.items.forEach((item, index) => {
item.index = index + 1
return item
})
this.updateParams.itemNum = this.updateParams.items.length
}
}
}
//
@ -160,17 +580,205 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
} as any;
}
public changes(data, item) {
//
if (item && item.key === "areaId") {
this.diviceList = [];
if (this.updateParams.unitId) {
this.updateParams.unitId = null;
}
const areaData = this.areaList.find((itm: any) => itm.value === data) as any;
this.updateParams.analRiskLevel = areaData.analRiskLevel
this.updateParams.analRiskLevel = areaData.analRiskLevel
this.updateParams.chargeDeptName = null;
this.updateParams.chargeUserId = null;
this.updateParams.chargeUserName = null;
this.updateParams.chargeDeptId = null;
public showUpdateModel(id) {
this.showUpdate = true
this.updateParams.type = null;
this.updateParams.postName = null;
this.updateParams.postCode = null;
this.updateParams.deviceName = null;
this.updateParams.deviceInventoryId = null;
this.updateParams.name = null;
this.updateParams.steps = [];
this.updateParams.stepNum = 0;
this.loadUnitData(data)
}
//
if (item && item.key === 'unitId') {
const unitData = this.unitList.find((itm: any) => itm.value === data) as any;
this.updateParams.chargeDeptName = unitData.deptName;
this.updateParams.chargeUserId = unitData.userId;
this.updateParams.chargeUserName = unitData.userName;
this.updateParams.chargeDeptId = unitData.deptId;
this.updateParams.type = null;
this.updateParams.postName = null;
this.updateParams.postCode = null;
this.updateParams.deviceName = null;
this.updateParams.deviceInventoryId = null;
this.updateParams.name = null;
this.updateParams.steps = [];
this.updateParams.stepNum = 0;
this.loadJobData(data)
}
//
if (item && item.key === 'deviceInventoryId') {
const diviceData = this.diviceList.find((itm: any) => itm.value === data) as any;
this.updateParams.type = diviceData.type;
this.updateParams.postName = diviceData.postName;
this.updateParams.postCode = diviceData.postCode;
this.updateParams.deviceName = diviceData.name;
this.updateParams.name = diviceData.name;
this.updateParams.items = diviceData.items.map((item, index) => {
item.index = index + 1;
item.itemName = item.name;
item.itemStandard = item.standard;
return item
})
this.updateParams.itemNum = diviceData.items.length;
this.buildUpdateForm()
}
//
if (item && item.key === 'majorSign') {
if (data.includes(0)) {
data.splice(0, data.length)
data.push(0)
}
this.buildUpdateForm()
}
}
//
public loadJobData(id?) {
this.diviceService.selectByPage({ pageSize: 1000, unitId: id }).then((res: any) => {
this.diviceList = res.data.datas.map(item => {
return {
name: item.name,
value: item.id,
type: item.type,
postCode: item.postCode,
postName: item.postName,
items: item.items,
itemNum: item.itemNum
}
});
this.buildUpdateForm()
})
}
//
public showPros(el, data) {
const isTarget = el.target.classList.contains("link");
if (isTarget) {
this.showProtable = true;
this.currentProTableData.datas = data.items.map((item, index) => {
item.index = index + 1;
return item
})
}
}
//--
public proCallback() {
this.showProtable = false;
}
//
public showUpdateModel(row, isReadonly, isModifyonly) {
this.updateParams = { number: null, tableItems: [] } as any;
if (!row) {
this.currentId = -1;
this.showUpdate = true;
} else {
this.currentId = row.id;
this.tableService.selectById(this.currentId).then((res: any) => {
if (isReadonly) {
this.updateParams = Object.assign({
majorHazardName: !res.data.majorHazard ? null : res.data.majorHazard.split(";").map(item => this.sourceMap[item]).join(";"),
regulatoryProcessName: !res.data.regulatoryProcess ? null : res.data.regulatoryProcess.split(";").map(item => this.craftMap[item]).join(";"),
regulatoryChemicalName: !res.data.regulatoryChemical ? null : res.data.regulatoryChemical.split(";").map(item => this.chemicaltMap[item]).join(";"),
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(";").map(item => this.$store.getters.prevention_majorsign_map[item]).join(";"),
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
typeName: this.$store.getters.prevention_device_type_map[res.data.type]
}, res.data)
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
this.updateParams.items = this.updateParams.items.map((item, index) => {
item.index = index + 1;
return item
})
this.isReadonly = true
} else {
this.isReadonly = false
this.isModifyonly = true
this.updateParams = res.data;
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
this.loadUnitData(res.data.areas)
this.loadJobData(res.data.unitId)
this.updateParams.items.forEach((item, i) => {
item.index = i + 1
})
}
this.buildUpdateForm()
this.showUpdate = true;
})
}
}
public handleClose() {
this.showUpdate = false;
}
//
public doSave(goOn?) {
//
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess)
this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical)
this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard)
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
if (!this.updateParams.id) {
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
this.updateParams.items = this.updateParams.steps
this.updateParams.itemNum = this.updateParams.steps.length
} else {
this.updateParams.itemNum = this.updateParams.items.length
}
}
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id ? true : false).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.showUpdate = !!goOn;
this.getTableData();
})
}
//稿
public doSaveDraft() {
//
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess)
this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical)
this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard)
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
this.updateParams.items = this.updateParams.steps
this.updateParams.itemNum = this.updateParams.steps.length
} else {
this.updateParams.itemNum = this.updateParams.items.length
}
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.showUpdate = false;
this.getTableData();
})
}
public toggleAll() {
(this.$refs.multipleTable as any).toggleAllSelection();
}
@ -190,6 +798,65 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
public handleSelectionChange(data) {
this.selectData = data;
}
public handleSubSelectionChange(data) {
this.subSelectData = data
}
//
public showSubModel(row, isReadonly) {
this.updateParams.steps = this.updateParams.items
this.analysisUpdateParams = {
riskChoose: [],
remainChoose: [],
} as any;
if (row) {
if (isReadonly) {
this.analyIsReadonly = true;
this.analysisUpdateParams = Object.assign({
seriousResultName: row.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";"),
safetySignName: row.safetySign.split(";").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";"),
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
typeName: this.$store.getters.prevention_device_type_map[row.deviceType]
}, row)
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
} else {
this.analyIsReadonly = false
//
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult)
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign)
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(";") : []
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(";") : []
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName
this.analysisUpdateParams.deviceName = this.updateParams.name
this.analysisUpdateParams.deviceType = this.updateParams.type
}
}
this.showSubUpdate = true
}
//
public arrayChangeString(data) {
if (data && data.length > 0) {
if (data instanceof Array) {
return data.join(";")
} else {
return data
}
} else {
return null
}
}
//
public stringChangeArray(data) {
if (data) {
return data.split(";").map((item) => parseInt(item))
}
}
}
</script>
<style lang="scss" scoped src="../../../common.component.scss"></style>

View File

@ -11,14 +11,19 @@
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="40">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
@ -46,13 +51,14 @@
:showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="updateParams.steps" tooltip-effect="dark" height="250" border
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="40">
</el-table-column>
<template v-for="item in subTableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
<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">
@ -63,8 +69,7 @@
<el-button v-if="isReadonly" type="text"
@click="showSubModel(scope.row,isReadonly)">查看</el-button>
<el-button v-if="isModifyonly" type="text" @click="showSubModel(scope.row)">修改</el-button>
<el-button v-if="!isReadonly && !isModifyonly" type="text"
@click="showSubModel(scope.row)">评价</el-button>
<el-button v-if="!isReadonly" type="text" @click="showSubModel(scope.row)">评价</el-button>
</template>
</el-table-column>
</el-table>
@ -77,135 +82,35 @@
</el-dialog>
<!-- 评估矩阵 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showMatrixModal" :title="'区域风险等级判定准则'">
<el-dialog :close-on-click-modal="false" :visible.sync="showMatrixModal" width="500px" :title="'区域风险等级判定准则'">
<img style="width:100%" src="../../../../assets/images/5.png" alt="">
</el-dialog>
<!-- 危害分析评价 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showSubUpdate" width="880px"
:before-close="handleAnalyClose">
<div class="sub-title">基本信息</div>
<FormComponent :options="subBasicOptions" labelWidth="110px" labelAlign="right"
:data.sync="analysisUpdateParams" @actionCallback="callback" :isReadonly="analyIsReadonly">
</FormComponent>
<div class="sub-title">风险评估</div>
<FormComponent :options="subRiskOptions" labelWidth="110px" labelAlign="right" :data.sync="analysisUpdateParams"
@actionCallback="callback" @change="handleRiskChange" :isReadonly="analyIsReadonly">
</FormComponent>
<div class="sub-title">管控措施</div>
<FormComponent labelWidth="110px" labelAlign="right" :data.sync="analysisUpdateParams"
@actionCallback="measureCallback" :isReadonly="analyIsReadonly">
<TableComponent :tableData="currentMeasureData.datas" :tableColumn="triTableColumn"
@actionCallback="measureCallback($event)" :actions="analyIsReadonly ? []:triTableActions"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentMeasureData.datas" tooltip-effect="dark" height="250" border
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="40">
</el-table-column>
<template v-for="item in triTableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
:label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showMeasureModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showMeasureModel(scope.row)">编辑</el-button>
<el-button type="text" @click="deleteMeasure(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
<div class="sub-title">残余风险评估</div>
<FormComponent :options="subRemnantsOptions" labelWidth="110px" labelAlign="right"
:data.sync="analysisUpdateParams" @actionCallback="analyCallback" :actions="analyIsReadonly ? []:triActions"
:full-btn="true" btnPosition="center" @change="handleSubRiskChange" :isReadonly="analyIsReadonly">
</FormComponent>
<AnalEvaluationComponent :isReadonly="analyIsReadonly" :data.sync="analysisUpdateParams"
:show.sync="showSubUpdate" @actionCallback="analyCallback" :tabledata.sync="updateParams"
:areaList="areaList" :type="'work'"></AnalEvaluationComponent>
</el-dialog>
<!-- 风险评估方法 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showRiskUpdate" width="800px" :before-close="handleClose">
<FormComponent :options="riskType === 'ls'? riskLSUpdateOptions:riskLECUpdateOptions " labelWidth="110px"
labelAlign="right" :data.sync="methodUpdateParams" @actionCallback="methodCallback" :actions="triActions"
<!-- 检查项目 -->
<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">
</FormComponent>
<div v-if="riskType === 'ls'">
<img style="width:90%" src="../../../../assets/images/3.png" alt="">
<img style="width:80%" src="../../../../assets/images/2.png" alt="">
</div>
<div v-if="riskType === 'lec'">
<img style="width:100%" src="../../../../assets/images/6.png" alt="">
</div>
</el-dialog>
<!-- 风险评估取值 -->
<div v-if="showRiskValueUpdate">
<el-dialog :close-on-click-modal="false" :title="riskTitle" :visible.sync="showRiskValueUpdate" width="750px"
:before-close="handleClose" :show-close="false">
<TableComponent :tableData="riskTableData" :tableColumn="riskTableColumn" @tabCallback="popCallback($event)"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;"
:data.sync="methodUpdateParams">
<el-table ref="singleTable" :data="riskTableData" tooltip-effect="dark" border row-key="checked"
highlight-current-row @current-change="handleCurrentChange" style="width: 100%">
<template v-for="item in riskTableColumn">
<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" style="pointer-events: none;" @click="addVal($event,scope.row)"
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>
</TableComponent>
<ButtonListComponent :actions="triActions" @callback="popCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
</div>
<!--管控措施-->
<el-dialog :close-on-click-modal="false" :title="'管控措施制定'" :visible.sync="showTriUpdate" width="750px"
:before-close="handleMeasureClose">
<FormComponent :options="triUpdateOptions" labelWidth="110px" labelAlign="right"
:data.sync="measureUpdataParams" :isReadonly="measureIsReadonly" :actions="subActions"
@actionCallback="measureCallback($event)" :full-btn="true" btnPosition="center" @change="measureChange">
<div class="sub-title">排查任务制定</div>
<TableComponent :tableData="currentTaskData.datas" :tableColumn="taskTableColumn"
@actionCallback="measureCallback($event)" :actions="!measureIsReadonly?fourTableActions:[]"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentTaskData.datas" tooltip-effect="dark" height="250" border
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
<template v-for="item in taskTableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
:label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showTaskModel(scope.row,true)">查看</el-button>
<el-button :v-if="!measureIsReadonly" type="text"
@click="showTaskModel(scope.row)">编辑</el-button>
<el-button :v-if="!measureIsReadonly" type="text"
@click="deleteTask(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
</el-dialog>
<!-- 排查任务 -->
<el-dialog :close-on-click-modal="false" :title="taskCurrentId === -1 ? '新增':taskIsReadonly?'详情':'编辑'"
:visible.sync="showFourUpdate" 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>

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
<div class="common-box dis-flex " >
<div class="common-tree-box" v-if="treeData">
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
</el-tree>
<div class="common-box dis-flex ">
<div class="common-tree-box">
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
</div>
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
@ -10,13 +9,18 @@
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
:footerActions="footerActions" :actions="tableActions">
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="60">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
@ -26,18 +30,28 @@
</template>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">查看</el-button>
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</div>
</div>
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
<el-dialog :close-on-click-modal="false" :title="'详情'" :visible.sync="showUpdate" width="952px"
:before-close="handleClose">
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
<div class="sub-title">风险辨识情况</div>
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
:data.sync="subUpdateParams"></FormComponent>
<div class="sub-title">风险评估情况</div>
<FormComponent :options="subRiskOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
:data.sync="riskUpdateParams"></FormComponent>
<div class="sub-title">残余风险评估情况</div>
<FormComponent :options="subRemnantsOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
:data.sync="remainUpdateParams"></FormComponent>
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
</div>

View File

@ -9,158 +9,433 @@ import IdentifyService from "@/service/identify.service"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import UnitTreeComponent from '@/components/tree.component.vue';
@Component({
template,
components:{
components: {
FormComponent,
TableComponent,
DrawComponent,
ButtonListComponent,
UnitTreeComponent,
},
})
export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
public tableService = new IdentifyService();
public params = {} as any;
public treeData = [{
label: '一级 1',
children: [{
label: '二级 1-1',
children: [{
label: '三级 1-1-1'
}]
}]
}, {
label: '一级 2',
children: [{
label: '二级 2-1',
children: [{
label: '三级 2-1-1'
}]
}, {
label: '二级 2-2',
children: [{
label: '三级 2-2-1'
}]
}]
}, {
label: '一级 3',
children: [{
label: '二级 3-1',
children: [{
label: '三级 3-1-1'
}]
}, {
label: '二级 3-2',
children: [{
label: '三级 3-2-1'
}]
}]
}]
public params = {
areaId:null,
unitId:null,
} as any;
public formActions = [{
name:"查询",
value:"search",
icon:"el-icon-search",
type:"primary"
},{
name:"清空",
icon:"el-icon-tickets",
value:"reset"
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name:"批量删除",
value:"delete",
plain:true,
icon:"el-icon-delete",
type:"danger"
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public footerActions = [{
name:"选择全部",
value:"selectAll",
type:"primary"
},{
name:"反向选择",
value:"reverse"
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions:FormOption<BtnOption>[] = [{
name:"区域名称",
key:"areaId",
type:"text",
},{
name:"单元名称",
key:"unitId",
type:"text",
public formOptions: FormOption<BtnOption>[] = [{
name: "管控对象",
key: "controlName",
type: "text",
}, {
name: "分析对象",
key: "analName",
type: "text",
}];
public subActions = [{
name: "取消",
value: "cancel"
}];
public showUpdate = false;
public updateParams = {} as any;
public updateParams = {} as any;
public selectData = [];
//
public subUpdateParams = {} as any;
//
public riskUpdateParams = {} as any;
//
public remainUpdateParams = {} as any;
created(){
public updateOptions: FormOption<BtnOption>[] = [] as any;
//
public subRiskOptions: FormOption<BtnOption>[] = [];
//
public subRemnantsOptions: FormOption<BtnOption>[] = [];
public buildUpdateForm() {
this.updateOptions = [{
name: "管控对象",
key: "controlName",
type: "textarea",
require: true,
width: "calc(50% - 20px)",
disable: true,
},
{
name: "分析对象",
key: "analName",
type: "textarea",
require: true,
width: "calc(50% - 20px)",
disable: true,
},
{
name: "风险源",
key: "riskSource",
type: "text",
require: true,
width: "calc(50% - 20px)"
},
{
name: "最严重后果",
key: "seriousResult",
format: "seriousResultName",
type: "select",
require: true,
multiple: true,
width: "calc(50% - 20px)",
datas: this.$store.state.prevention_serious_result,
},
{
name: "危害分析",
key: "hazardAnalysis",
type: "text",
require: true,
width: "calc(100% - 20px)"
},
{
name: "安全警示标识",
key: "safetySign",
format: "safetySignName",
type: "select",
require: true,
multiple: true,
width: "calc(50% - 20px)",
datas: this.$store.state.prevention_security_identifier,
},
{
name: "设置复评时间",
key: "reviewStartTime",
type: "date",
subType: "date",
width: "calc(50% - 20px)",
require: true,
showError: false,
format: "yyyy-MM-dd"
},];
this.subRiskOptions = [
{
name: "LS法",
key: "riskLSValue",
type: "text",
// width: "20px",
}, {
name: "L值",
key: "lslvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "S值",
key: "lssvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "R值",
key: "lsrvalue",
type: "text",
width: "20%",
labelWidth: "40px",
}, {
name: "风险等级:",
key: "lsgrade",
format: 'lsgradeName',
type: "text",
width: "20%",
labelWidth: "60px",
}, {
name: "LEC法",
key: "riskLECValue",
type: "text",
// labelWidth: "30px",
}, {
name: "L值",
key: "leclvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "E值",
key: "lecevalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "C值",
key: "leccvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "D值",
key: "lecdvalue",
type: "text",
width: "15%",
labelWidth: "40px",
}, {
name: "风险等级:",
key: "lecgrade",
format: "lecgradeName",
type: "text",
width: "20%",
labelWidth: "60px",
}, {
name: "风险等级",
key: "riskLevel",
format: "riskLevelName",
type: "text",
require: true,
width: "100%",
}, {
name: "管控层级",
key: "riskControlLevel",
format: "riskControlLevelName",
type: "text",
require: true,
}];
this.subRemnantsOptions = [
{
name: "LS法",
key: "remainLSValue",
type: "text",
// width: "30px",
}, {
name: "L值",
key: "lslvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "S值",
key: "lssvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "R值",
key: "lsrvalue",
type: "text",
width: "20%",
labelWidth: "40px",
}, {
name: "风险等级:",
key: "lsgrade",
format: "lsgradeName",
type: "text",
width: "20%",
labelWidth: "60px",
}, {
name: "LEC法",
key: "remainLECValue",
type: "text",
// width: "30px",
}, {
name: "L值",
key: "leclvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "E值",
key: "lecevalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "C值",
key: "leccvalue",
type: "text",
width: "10%",
labelWidth: "40px",
}, {
name: "D值",
key: "lecdvalue",
type: "text",
width: "15%",
labelWidth: "40px",
}, {
name: "风险等级:",
key: "lecgrade",
format: "lecgradeName",
type: "text",
width: "20%",
labelWidth: "60px",
}, {
name: "风险等级",
key: "remainLevel",
format: "remainLevelName",
type: "select",
require: true,
width: "calc(50% - 20px)",
},];
}
created() {
this.buildUpdateForm()
}
//
public handleNodeClick(data){
console.log(data)
public handleNodeClick(data) {
this.params.unitId = "";
this.params.areaId = "";
if (data.areaId) {
this.params.unitId = data.id
} else {
this.params.areaId = data.id
}
this.getTableData()
}
public buildTable(){
this.tableColumn.push({name:'序号',key:"index"});
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
if(data.status==0){
return "<span class='noDraw'>未绘制</span>"
}else{
return "<span>已绘制</span>"
public buildTable() {
this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" });
this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" });
this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" });
this.tableColumn.push({
name: '事故后果', key: "seriousResult", width: "250px", render: (data) => {
if (data.seriousResult) {
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
}
}
}});
this.tableColumn.push({name:'残余风险等级', width:"110px",key:"status",render:(data)=>{
if(data.status==0){
return "<span class='noDraw'>未绘制</span>"
}else{
return "<span>已绘制</span>"
});
this.tableColumn.push({
name: '风险等级', key: "riskLevel", render: (data) => {
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
}
}});
this.tableColumn.push({name:'评估人',key:"person"});
this.tableColumn.push({name:'评估时间',key:"person",width:"150px"});
});
this.tableColumn.push({
name: '残余风险等级', width: "110px", key: "remainLevel", render: (data) => {
return "<span class='color_" + data.remainLevel + "'>" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "</span>"
}
});
this.tableColumn.push({ name: '评估人', key: "appraiser" });
this.tableColumn.push({ name: '评估时间', key: "appraiseTime", width: "150px" });
}
public callback(data){
public callback(data) {
//
if(data.value==="search"){
if (data.value === "search") {
this.getTableData()
//
}else if(data.value === "reset"){
//
} else if (data.value === "reset") {
this.reset()
//
}else if(data.value === "reverse"){
//
} else if (data.value === "reverse") {
this.toggleAll()
//
}else if(data.value === "selectAll"){
//
} else if (data.value === "selectAll") {
this.selectAll()
}else if(data.value === "delete"){
this.deleteData(this.selectData.map((item:any)=>item.id))
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
}
}
//
public reset(){
public reset() {
this.params = {
pageNum:1,
pageSize:20,
pageNum: 1,
pageSize: 20,
} as any;
}
public showUpdateModel(id){
public showUpdateModel(row) {
this.showUpdate = true
const tmprow = JSON.parse(JSON.stringify(row))
this.subUpdateParams = tmprow
this.subUpdateParams.safetySignName = tmprow.safetySign.split(';').map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";")
this.subUpdateParams.seriousResultName = tmprow.seriousResult.split(';').map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
//
this.riskUpdateParams.riskLevelName = this.$store.getters.prevention_risk_level_map[tmprow.riskLevel]
this.riskUpdateParams.riskControlLevelName = this.$store.getters.prevention_control_level_map[tmprow.riskControlLevel]
if (tmprow.riskLsValue) {
const riskLsValue = JSON.parse(tmprow.riskLsValue)
const tmpRiskLsValue = {}
for (let key in riskLsValue) {
if (key.indexOf('ls') !== -1) {
tmpRiskLsValue[key] = riskLsValue[key];
}
}
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLsValue }
this.riskUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade]
}
if (tmprow.riskLecValue) {
const riskLecValue = JSON.parse(tmprow.riskLecValue)
const tmpRiskLecValue = {}
for (let key in riskLecValue) {
if (key.indexOf('lec') !== -1) {
tmpRiskLecValue[key] = riskLecValue[key];
}
}
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLecValue }
this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade]
}
//
this.remainUpdateParams.remainLevelName = this.$store.getters.prevention_risk_level_map[tmprow.remainLevel]
if (tmprow.remainLsValue) {
const remainLsValue = JSON.parse(tmprow.remainLsValue)
const tmpRemainLsValue = {}
for (let key in remainLsValue) {
if (key.indexOf('ls') !== -1) {
tmpRemainLsValue[key] = remainLsValue[key];
}
}
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLsValue }
this.remainUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lsgrade]
}
if (tmprow.remainLecValue) {
const remainLecValue = JSON.parse(tmprow.remainLecValue)
const tmpRemainLecValue = {}
for (let key in remainLecValue) {
if (key.indexOf('lec') !== -1) {
tmpRemainLecValue[key] = remainLecValue[key];
}
}
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLecValue }
this.remainUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lecgrade]
}
this.buildUpdateForm()
}
public handleClose(){
public handleClose() {
this.showUpdate = false;
}
@ -168,22 +443,26 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
public toggleAll() {
(this.$refs.multipleTable as any).toggleAllSelection();
}
public selectAll(){
if(!this.selectData.length){
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
}else{
this.tableData.datas.forEach((item,index)=>{
const find = this.selectData.find((data:any)=>data.userId === item.userId);
if(!find){
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.userId === item.userId);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data){
public handleSelectionChange(data) {
this.selectData = data;
}
public subCallback() {
this.showUpdate = false
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>

View File

@ -1,7 +1,6 @@
<div class="common-box dis-flex " >
<div class="common-tree-box" v-if="treeData">
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
</el-tree>
<div class="common-box dis-flex ">
<div class="common-tree-box">
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
</div>
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
@ -10,33 +9,56 @@
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
:footerActions="footerActions" :actions="tableActions">
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" label="全选" width="60">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</div>
</div>
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
:before-close="handleClose">
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
<!-- 管控措施详情 -->
<el-dialog :close-on-click-modal="false" title="管控措施" :show-close="false" :visible.sync="showProtable"
width="940px">
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
style="width: 100%">
<template v-for="item in proTableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
</el-table>
</TableComponent>
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
</div>

View File

@ -9,158 +9,173 @@ import MeasuresService from "@/service/measures.service"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import UnitTreeComponent from '@/components/tree.component.vue';
@Component({
template,
components:{
components: {
FormComponent,
TableComponent,
DrawComponent,
ButtonListComponent,
UnitTreeComponent,
},
})
export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
public tableService = new MeasuresService();
public params = {} as any;
public params = {
areaId: null,
unitId: null,
} as any;
public treeData = [{
label: '一级 1',
children: [{
label: '二级 1-1',
children: [{
label: '三级 1-1-1'
}]
}]
}, {
label: '一级 2',
children: [{
label: '二级 2-1',
children: [{
label: '三级 2-1-1'
}]
}, {
label: '二级 2-2',
children: [{
label: '三级 2-2-1'
}]
}]
}, {
label: '一级 3',
children: [{
label: '二级 3-1',
children: [{
label: '三级 3-1-1'
}]
}, {
label: '二级 3-2',
children: [{
label: '三级 3-2-1'
}]
}]
}]
public showProtable = false;
public currentProTableData = {
datas: []
} as any;
public proTableColumn = [] as any;
//
public measuresSelectData = {} as any;
public formActions = [{
name:"查询",
value:"search",
icon:"el-icon-search",
type:"primary"
},{
name:"清空",
icon:"el-icon-tickets",
value:"reset"
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name:"批量删除",
value:"delete",
plain:true,
icon:"el-icon-delete",
type:"danger"
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public footerActions = [{
name:"选择全部",
value:"selectAll",
type:"primary"
},{
name:"反向选择",
value:"reverse"
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions:FormOption<BtnOption>[] = [{
name:"区域名称",
key:"areaId",
type:"text",
},{
name:"单元名称",
key:"unitId",
type:"text",
public formOptions: FormOption<BtnOption>[] = [{
name: "管控对象",
key: "controlName",
type: "text",
}, {
name: "分析对象",
key: "analName",
type: "text",
}];
public subActions = [{
name: "取消",
value: "cancel"
}];
public showUpdate = false;
public updateParams = {} as any;
public updateParams = {} as any;
public selectData = [];
created(){
created() {
this.$store.state.prevention_measures_sort.map((item) => {
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
})
}
//
public handleNodeClick(data){
console.log(data)
public handleNodeClick(data) {
this.params.unitId = "";
this.params.areaId = "";
if (data.areaId) {
this.params.unitId = data.id
} else {
this.params.areaId = data.id
}
this.getTableData()
}
public buildTable(){
this.tableColumn.push({name:'序号',key:"index"});
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
if(data.status==0){
return "<span class='noDraw'>未绘制</span>"
}else{
return "<span>已绘制</span>"
public buildTable() {
this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" });
this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" });
this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" });
this.tableColumn.push({
name: '事故后果', key: "seriousResult", width: "200px", render: (data) => {
if (data.seriousResult) {
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
}
}
}});
this.tableColumn.push({name:'措施详情', width:"110px",key:"status",render:(data)=>{
if(data.status==0){
return "<span class='noDraw'>未绘制</span>"
}else{
return "<span>已绘制</span>"
});
this.tableColumn.push({
name: '风险等级', key: "riskLevel", width: "100px", render: (data) => {
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
}
}});
this.tableColumn.push({name:'涉及岗位',key:"person"});
});
this.tableColumn.push({
name: '措施详情', width: "100px", key: "measureNum", render: (data) => {
return "<span class='link'>" + (data.details ? data.details.length : 0) + "</span>"
}
});
this.tableColumn.push({ name: '涉及岗位', key: "postName" });
//
this.proTableColumn.push({ name: '序号', key: "index" });
this.proTableColumn.push({
name: '措施类型一', key: "firstTypeName", render: (data) => {
if (data.firstType) {
return this.$store.getters.prevention_measures_sort_map[data.firstType]
}
}
});
this.proTableColumn.push({
name: '措施类型二', key: "secondTypeName",
render: (data) => {
if (data.firstType) {
const secondTypeItem = this.measuresSelectData[data.firstType]
return this.selectName(secondTypeItem, data.secondType)
}
}
});
this.proTableColumn.push({ name: '措施类型三', key: "thirdType" });
this.proTableColumn.push({ name: '管控措施', key: "description" });
}
public callback(data){
public callback(data) {
//
if(data.value==="search"){
if (data.value === "search") {
this.getTableData()
//
}else if(data.value === "reset"){
//
} else if (data.value === "reset") {
this.reset()
//
}else if(data.value === "reverse"){
//
} else if (data.value === "reverse") {
this.toggleAll()
//
}else if(data.value === "selectAll"){
//
} else if (data.value === "selectAll") {
this.selectAll()
}else if(data.value === "delete"){
this.deleteData(this.selectData.map((item:any)=>item.id))
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
}
}
//
public reset(){
public reset() {
this.params = {
pageNum:1,
pageSize:20,
pageNum: 1,
pageSize: 20,
} as any;
}
//
public showUpdateModel(id){
public showUpdateModel(id) {
this.showUpdate = true
}
public handleClose(){
public handleClose() {
this.showUpdate = false;
}
@ -168,22 +183,64 @@ export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
public toggleAll() {
(this.$refs.multipleTable as any).toggleAllSelection();
}
public selectAll(){
if(!this.selectData.length){
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
}else{
this.tableData.datas.forEach((item,index)=>{
const find = this.selectData.find((data:any)=>data.userId === item.userId);
if(!find){
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.userId === item.userId);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data){
public handleSelectionChange(data) {
this.selectData = data;
}
//
public showPros(el, data) {
const isTarget = el.target.classList.contains("link");
if (isTarget) {
this.showProtable = true;
this.currentProTableData.datas = data.details.map((item, index) => {
item.index = index + 1;
return item
})
}
}
//--
public subCallback() {
this.showProtable = false;
}
public treeSelectData(data) {
return data.map((item) => {
return {
label: item.dictLabel,
id: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
})
}
public selectName(selectGroup, data) {
if (selectGroup && selectGroup.length > 0) {
const map = {};
selectGroup.forEach((item: any) => {
if (item.value) {
map[item.value] = item.name
} else if (item.id) {
map[item.id] = item.label
}
})
return map[data]
}
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>

View File

@ -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,9 +9,9 @@
</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">
@ -27,17 +26,32 @@
<el-table-column label="操作" 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>

View File

@ -9,172 +9,268 @@ 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'
}]
}]
}, {
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 = [];
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 subActions = [{
name: "取消",
value: "cancel"
}];
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 updateParams = {} as any;
public selectData = [];
created(){
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", render: (data) => {
if (data.status == 1) {
return "<span class='noDraw'>未发布</span>"
} else {
return "<span>已发布</span>"
}
}
}});
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: "200px",
});
this.tableColumn.push({
name: '单元名称', key: "unitName", width: "200px",
});
this.tableColumn.push({ name: '管控对象', key: "analControlName", width: "200px" });
this.tableColumn.push({ name: '分析对象', key: "itemName", width: "200px" });
this.tableColumn.push({ name: '风险源', key: "itemRiskSource", width: "200px" });
this.tableColumn.push({
name: '事故后果', key: "itemSeriousResult", width: "250px",
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", render: (data) => {
return "<span class='color_" + data.itemRiskLevel + "'>" + (data.itemRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.itemRiskLevel]) : '') + "</span>"
}
});
this.tableColumn.push({
name: '管控措施分类', key: "measureFirstType", width: "200px", render: (data) => {
if (data.measureFirstType) {
return this.$store.getters.prevention_measures_sort_map[data.measureFirstType]
}
}
});
this.tableColumn.push({
name: '管控措施分类', key: "measureSecondType",
render: (data) => {
if (data.measureFirstType) {
const secondTypeItem = this.measuresSelectData[data.measureFirstType]
return this.selectName(secondTypeItem, data.measureSecondType)
}
}
});
this.tableColumn.push({ name: '管控措施分类', key: "measureThirdType" });
this.tableColumn.push({ name: '管控措施', key: "measureDescription" });
this.tableColumn.push({
name: '是否包保责任人任务', key: "insuranceDutyFlag", render: (data) => {
if (data.taskItem) {
return '是'
} else {
return '否'
}
}
});
this.tableColumn.push({
name: '任务类型', key: "taskType", render: (data) => {
if (data.taskType || data.taskType === 0) {
return this.$store.getters.prevention_task_type_map[data.taskType]
}
}
});
this.tableColumn.push({
name: '包保任务对应项', key: "taskItem", width: "200px", 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: "150px" });
this.tableColumn.push({ name: '隐患责任人', key: "taskChargeUserName" });
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))
}
}
//
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 +278,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>