feat:页面bug优化,包保责任制和安全研判

dev
kongyeqing 2023-08-28 16:15:12 +08:00
parent 88350e30c9
commit 16f8e29e7c
46 changed files with 7828 additions and 87 deletions

View File

@ -85,7 +85,7 @@
<el-dialog :close-on-click-modal="false" :title="'管控措施制定'" :visible.sync="subUpdate" width="952px" <el-dialog :close-on-click-modal="false" :title="'管控措施制定'" :visible.sync="subUpdate" width="952px"
:before-close="handleMeasureClose"> :before-close="handleMeasureClose">
<MeasureComponent @actionCallback="dataCallback" :data.sync="measuresData" :show.sync="subUpdate" <MeasureComponent @actionCallback="dataCallback" :data.sync="measuresData" :show.sync="subUpdate"
:tabledata.sync="analysisUpdateParams" :isReadonly="measureIsReadonly"> :tabledata.sync="analysisUpdateParams" :isReadonly="measureIsReadonly" :outermostData="outermostData">
</MeasureComponent> </MeasureComponent>
</el-dialog> </el-dialog>
@ -206,6 +206,7 @@ export default class AnalEvaluationComponent extends Vue {
@PropSync("tabledata", { @PropSync("tabledata", {
required: true, required: true,
}) })
public outermostData!:any
public updateParams: any; public updateParams: any;
@Prop() @Prop()

View File

@ -0,0 +1,34 @@
<template>
<el-tree :data="treeData" :props="{ children: 'children', label: 'name' }" :expand-on-click-node="false" default-expand-all
highlight-current @node-click="handleNodeClick">
</el-tree>
</template>
<script lang="ts">
import { Component, Emit, Prop, Vue } from 'vue-property-decorator';
import MaintenanceInfoService from '@/service/maintenanceInfo.service';
@Component
export default class CompanyTreeComponent extends Vue {
public MaintenanceInfoService: MaintenanceInfoService = new MaintenanceInfoService();
public treeData = [] as any;
@Emit("callback")
handleNodeClick(data) {
//
}
created() {
this.MaintenanceInfoService.getCompanyTree().then(res => {
console.log('res', res);
this.treeData = [{
name:"全部",
children:res.data
}];
})
}
beforeDestory() {
//
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -121,7 +121,7 @@ export default class MeasureComponent extends Vue {
width: "25%", width: "25%",
datas: this.secondTypeItem datas: this.secondTypeItem
}, { }, {
name:"", name: "",
key: "thirdType", key: "thirdType",
type: "text", type: "text",
require: true, require: true,
@ -164,7 +164,8 @@ export default class MeasureComponent extends Vue {
width: "100%", width: "100%",
labelWidth: '210px', labelWidth: '210px',
require: true, require: true,
showError:false, showError: false,
disable: this.outermostData.majorSign && this.outermostData.majorSign.includes(0),
datas: [ datas: [
{ {
name: "否", name: "否",
@ -185,7 +186,7 @@ export default class MeasureComponent extends Vue {
datas: this.taskType, datas: this.taskType,
expandLevel: Infinity, expandLevel: Infinity,
disable: !(this.taskUpdataParams.insuranceDutyFlag === 1), disable: !(this.taskUpdataParams.insuranceDutyFlag === 1),
showError:false, showError: false,
}, { }, {
name: "包保任务对应项", name: "包保任务对应项",
key: "taskItem", key: "taskItem",
@ -203,7 +204,7 @@ export default class MeasureComponent extends Vue {
type: "textarea", type: "textarea",
width: "100%", width: "100%",
require: true, require: true,
showError:false, showError: false,
}, { }, {
name: "执行岗位", name: "执行岗位",
key: "executePostCode", key: "executePostCode",
@ -212,7 +213,7 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
datas: this.$store.state.postList, datas: this.$store.state.postList,
showError:false, showError: false,
}, },
{ {
name: "责任人", name: "责任人",
@ -222,14 +223,14 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
datas: this.$store.state.userList, datas: this.$store.state.userList,
showError:false, showError: false,
}, { }, {
name: "排查周期 每隔", name: "排查周期 每隔",
key: "reviewCycleValue", key: "reviewCycleValue",
type: "number", type: "number",
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError:false, showError: false,
// labelWidth:"130px" // labelWidth:"130px"
}, { }, {
key: "reviewCycleUnit", key: "reviewCycleUnit",
@ -238,14 +239,14 @@ export default class MeasureComponent extends Vue {
format: 'reviewCycleValueName', format: 'reviewCycleValueName',
datas: this.$store.state.prevention_cycle_unit, datas: this.$store.state.prevention_cycle_unit,
width: "calc(30% - 20px)", width: "calc(30% - 20px)",
showError:false, showError: false,
}, { }, {
name: "1次", name: "1次",
key: "times", key: "times",
type: 'null', type: 'null',
width: "30px", width: "30px",
labelWidth: "50px", labelWidth: "50px",
showError:false, showError: false,
}, { }, {
name: "工作开始时间", name: "工作开始时间",
key: "startTime", key: "startTime",
@ -253,7 +254,7 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
hide: !(this.taskUpdataParams.reviewCycleUnit === 7), hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
showError:false, showError: false,
}, { }, {
name: "工作结束时间", name: "工作结束时间",
key: "endTime", key: "endTime",
@ -261,16 +262,16 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
hide: !(this.taskUpdataParams.reviewCycleUnit === 7), hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
showError:false, showError: false,
},{ }, {
name: "开始执行时间", name: "开始执行时间",
key: "executeStartTime", key: "executeStartTime",
format: "yyyy-MM-dd HH:mm", format: "yyyy-MM-dd HH:mm",
type: "date", type: "date",
subType:'datetime', subType: 'datetime',
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError:false, showError: false,
},] },]
} }
@ -296,6 +297,9 @@ export default class MeasureComponent extends Vue {
@Prop() @Prop()
public isReadonly: boolean; public isReadonly: boolean;
@Prop()
public outermostData!: any
@PropSync("show", { @PropSync("show", {
required: true, required: true,
default: true default: true
@ -329,10 +333,11 @@ export default class MeasureComponent extends Vue {
@PropSync("tabledata", { @PropSync("tabledata", {
required: true, required: true,
}) })
public tableData!: any;
public measureData!: any; public measureData!: any;
created() { created() {
this.buildTable() this.buildTable()
} }
@ -397,7 +402,7 @@ export default class MeasureComponent extends Vue {
// //
public showTaskModel(row, isReadonly) { public showTaskModel(row, isReadonly) {
this.taskType = this.taskItemSelect() this.taskType = this.taskItemSelect();
if (isReadonly) { if (isReadonly) {
this.taskIsReadonly = true this.taskIsReadonly = true
this.taskUpdataParams = JSON.parse(JSON.stringify(row)) this.taskUpdataParams = JSON.parse(JSON.stringify(row))
@ -486,7 +491,16 @@ export default class MeasureComponent extends Vue {
} }
public taskAdd() { public taskAdd() {
this.showSubUpdate = true this.taskType = this.taskItemSelect()
this.taskUpdataParams = {} as any;
if (this.outermostData.majorSign && this.outermostData.majorSign.includes(0)) {
this.taskUpdataParams.insuranceDutyFlag = 0;
this.taskUpdataParams.taskType = 0
this.taskUpdataParams.insuranceDutyFlagName = '否'
this.taskUpdataParams.taskTypeName = '日常任务'
}
this.taskUpdateForm();
this.showSubUpdate = true;
} }
public deleteTask(row) { public deleteTask(row) {
@ -512,7 +526,6 @@ export default class MeasureComponent extends Vue {
// -- // --
public taskSelectChange(data, item) { public taskSelectChange(data, item) {
if (data !== null && data !== undefined) { if (data !== null && data !== undefined) {
if (item && item.key === 'insuranceDutyFlag') { if (item && item.key === 'insuranceDutyFlag') {
this.taskType = this.taskItemSelect() this.taskType = this.taskItemSelect()
@ -555,13 +568,13 @@ export default class MeasureComponent extends Vue {
this.taskUpdataParams.taskItemName = map[data] this.taskUpdataParams.taskItemName = map[data]
} }
// //
if(item && item.key === 'executeStartTime'){ if (item && item.key === 'executeStartTime') {
const now = moment().format("YYYY-MM-DD HH:mm"); const now = moment().format("YYYY-MM-DD HH:mm");
if (now > data) { if (now > data) {
this.$message.error("开始执行时间不能早于当前时间") this.$message.error("开始执行时间不能早于当前时间")
this.taskUpdataParams.executeStartTime = null; this.taskUpdataParams.executeStartTime = null;
return return
} }
} }
this.taskUpdateForm() this.taskUpdateForm()
} }

View File

@ -0,0 +1,273 @@
<template>
<div>
<!-- 安全状态 -->
<div class="status">
<div class="title">{{ noticeDataList.state.description }}</div>
<el-form ref="form" :model="basicForm" label-width="80px" class="form">
<div v-for="(items, index) in noticeDataList.state.content" :key="index" class="line-content">
<div class="content-items" v-if="!items.children" :style="{ width: items.width }">
<span class="content-children-item-title">
<p v-if="items.required" style="color: #f56c6c;padding-right: 5px;"> * </p> {{ items.name }}
</span>
<el-form-item :prop="items.key"
:rules="{ required: items.required, message: `${items.name}不能为空`, trigger: 'blur' }">
<!-- 数字框-number -->
<el-input-number v-if="items.type === 'number'" :disabled="items.disable"
:controls="items.controls" v-model="items[items.key]"
:min="items.min !== undefined ? items.min : 0" :max="items.max"
:placeholder="items.placeholder || '请输入'"></el-input-number>
<!-- 单选-radio -->
<el-radio-group v-model="items.key" :disabled="items.disable" v-if="items.type === 'radio'">
<el-radio v-for="data in items.datas" :key="data.value" :disabled="data.disable"
:label="data.value">{{ data.name }}</el-radio>
</el-radio-group>
</el-form-item>
</div>
<div v-else-if="items.children" class="content-children">
<span class="children-title">{{ items.name }}</span>
<div class="content-children-item">
<div v-for="(item, idx) in items.children" :key="idx" class="children-content-item"
:style="{ width: item.width }">
<span class="content-children-item-title"
:style="{ width: item.labelWidth ? item.labelWidth : 'auto' }">
<p v-if="item.required" style="color: #f56c6c;padding-right: 5px;"> * </p>
{{ item.name }}
</span>
<div>
<el-form-item :prop="item.key"
:rules="{ required: item.required, message: `${items.name}不能为空`, trigger: 'blur' }">
<!-- 数字框-number -->
<el-input-number v-if="item.type === 'number'" :disabled="item.disable"
:controls="item.controls" v-model="item[items.key]"
:min="items.min !== undefined ? item.min : 0" :max="item.max"
:placeholder="item.placeholder || '请输入'"></el-input-number>
<!-- 单选-radio -->
<el-radio-group v-model="item.key" :disabled="item.disable"
v-if="item.type === 'radio'">
<el-radio v-for="data in item.datas" :key="data.value" :disabled="data.disable"
:label="data.value">{{ data.name }}</el-radio>
</el-radio-group>
</el-form-item>
</div>
</div>
</div>
</div>
</div>
</el-form>
</div>
<!-- 风险研判情况 -->
<div class="judgment-situation">
<div class="title">{{ noticeDataList.situation.description }}</div>
<el-form ref="judgmentForm" :model="judgmentForm" label-width="80px" class="form">
<div v-for="(items, index) in noticeDataList.situation.content" :key="index" class="line-content">
<div class="content-items" v-if="!items.children" :style="{ width: items.width }">
<span class="content-children-item-title">
<p v-if="items.required" style="color: #f56c6c;padding-right: 5px;"> * </p> {{ items.name }}
</span>
<el-form-item :prop="items.key"
:rules="{ required: items.required, message: `${items.name}不能为空`, trigger: 'blur' }">
<!-- 数字框-number -->
<el-input-number v-if="items.type === 'number'" :disabled="items.disable"
:controls="items.controls" v-model="items[items.key]"
:min="items.min !== undefined ? items.min : 0" :max="items.max"
:placeholder="items.placeholder || '请输入'"></el-input-number>
<!-- 单选-radio -->
<el-radio-group v-model="items.key" :disabled="items.disable" v-if="items.type === 'radio'">
<el-radio v-for="data in items.datas" :key="data.value" :disabled="data.disable"
:label="data.value">{{ data.name }}</el-radio>
</el-radio-group>
</el-form-item>
</div>
<div v-else-if="items.children" class="content-children">
<span class="children-title">{{ items.name }}</span>
<div class="content-children-item">
<div v-for="(item, idx) in items.children" :key="idx" class="children-content-item"
:style="{ width: item.width }">
<span class="content-children-item-title"
:style="{ width: item.labelWidth ? item.labelWidth : 'auto' }">
<p v-if="item.required" style="color: #f56c6c;padding-right: 5px;"> * </p>
{{ item.name }}
</span>
<div>
<el-form-item :prop="item.key"
:rules="{ required: item.required, message: `${items.name}不能为空`, trigger: 'blur' }">
<!-- 数字框-number -->
<el-input-number v-if="item.type === 'number'" :disabled="item.disable"
:controls="item.controls" v-model="item[items.key]"
:min="items.min !== undefined ? item.min : 0" :max="item.max"
:placeholder="item.placeholder || '请输入'"></el-input-number>
<!-- 单选-radio -->
<el-radio-group v-model="item.key" :disabled="item.disable"
v-if="item.type === 'radio'">
<el-radio v-for="data in item.datas" :key="data.value" :disabled="data.disable"
:label="data.value">{{ data.name }}</el-radio>
</el-radio-group>
</el-form-item>
</div>
</div>
</div>
</div>
</div>
</el-form>
</div>
<!-- 安全承诺 -->
<div class="promise">
<div class="title">{{ noticeDataList.promise.description }}</div>
<div class="promise-content">
<el-input type="textarea" :rows="3" v-model="promise"></el-input>
</div>
</div>
</div>
</template>
<script lang="ts">
import { Component, Emit, Prop, PropSync, Vue, Watch } from 'vue-property-decorator';
import noticeData from '@/mock/teamCommitmentLetter'
@Component({
components: {
}
})
export default class NoticeComponent extends Vue {
//
public noticeDataList = JSON.parse(JSON.stringify(noticeData))
public basicForm = {} as any;
public judgmentForm = {} as any;
public promise = '今天我班组已根据岗位风险辨识管控相关内容以及安全风险评估表进行安全风险研判,各项安全风险防控措施已落实到位,我承诺本岗位处于安全运行状态,涉及罐区、仓库等重大危险源安全风险的到有效管控。' as any;
//
}
</script>
<style lang="scss" scoped>
::v-deep {
.el-form-item {
margin-bottom: 0px;
}
.el-form-item__content {
margin-left: 40px !important;
}
}
.status {
width: 100%;
display: flex;
flex-direction: row;
}
.judgment-situation {
width: 100%;
display: flex;
flex-direction: row;
}
.promise {
width: 100%;
display: flex;
flex-direction: row;
border-bottom: 1px solid #D1DBE5;
}
.promise-content {
width: 90%;
padding: 5px 10px;
border-top: 1px solid #D1DBE5;
}
.form {
width: 90%;
}
.title {
display: flex;
width: 10%;
border-right: 1px solid #D1DBE5;
border-top: 1px solid #D1DBE5;
text-align: center;
align-items: center;
}
.line-content {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
}
.content-items {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: 5px 10px;
border-top: 1px solid #D1DBE5;
}
.children-title {
width: 10%;
height: 100%;
text-align: center;
padding: 0px 8px;
}
.content-children {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
border-top: 1px solid #D1DBE5;
align-items: center;
justify-content: center;
}
.content-children-item {
width: 90%;
height: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
border-left: 1px solid #D1DBE5;
}
.content-children-item-title {
// width: 200px;
height: 100%;
display: flex;
align-items: center;
}
.children-content-item {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid #D1DBE5;
padding: 5px 10px;
&:last-child {
border-bottom: 0px solid #D1DBE5;
}
}
</style>

View File

@ -0,0 +1,91 @@
export default [{
index:0,
title:"生产装置的安全生产状态",
content:'1.生产装置的温度、压力、组分、液位、流量等主要工艺参数是否处于指标范围',
result:"处于指标范围",
measure:'无',
},
{
index:1,
title:"生产装置的安全生产状态",
content:'2.压力容器、压力管道等特种设备是否处于安全运行状态',
result:"处于安全运行状态",
measure:'无',
},
{
index:2,
title:"生产装置的安全生产状态",
content:'3.各类设备设施的静动密封是否完好无泄漏',
result:"完好无泄露",
measure:'无',
},
{
index:3,
title:"生产装置的安全生产状态",
content:'4.超限报警、紧急切断、联锁等各类安全设施配备是否完好投用,并可靠运行',
result:"完好投用,并可靠运行",
measure:'无',
},
{
index:4,
title:"危险化学品罐区、仓库等重大危险源的安全运行状态",
content:'5.储罐、管道、机泵、阀门及仪表系统是否完好无泄漏',
result:"完好无泄露",
measure:'无',
},
{
index:5,
title:"危险化学品罐区、仓库等重大危险源的安全运行状态",
content:'6.储罐的液位、温度、压力是否超限运行',
result:"否",
measure:'无',
},
{
index:6,
title:"危险化学品罐区、仓库等重大危险源的安全运行状态",
content:'7.内浮顶储罐运行中浮盘是否可能落底',
result:"否",
measure:'无',
},
{
index:7,
title:"危险化学品罐区、仓库等重大危险源的安全运行状态",
content:'8.油气储罐手动切水、切罐、装卸车时是否确保人员在岗',
result:"相关人员在岗在位",
measure:'无',
},
{
index:8,
title:"危险化学品罐区、仓库等重大危险源的安全运行状态",
content:'9.可燃及有毒气体报警和联锁是否处于可靠运行状态',
result:"处于可靠运行状态",
measure:'无',
},
{
index:9,
title:"危险化学品罐区、仓库等重大危险源的安全运行状态",
content:'10.仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存',
result:"不涉及",
measure:'无',
},
{
index:10,
title:"高危生产活动及作业的安全风险可控状态",
content:'11.装置开停车是否制定开停车方案,试生产是否制定试生产方案并经专家论证',
result:"不涉及",
measure:'无',
},
{
index:11,
title:"高危生产活动及作业的安全风险可控状态",
content:'12.各项特殊作业、检维修作业、承包商作业是否健全和完善相关管理制度,作业过程是否进行安全风险辨识,严格程序确认和作业许可审批,加强现场监督,危险化学品罐区动火作业是否做到升级管理等',
result:"不涉及",
measure:'无',
},
{
index:12,
title:"高危生产活动及作业的安全风险可控状态",
content:'13.各项变更的审批程序是否符合规定',
result:"不涉及",
measure:'无',
},]

View File

@ -0,0 +1,544 @@
export default {
state: {
description: "班组安全状态",
content: [
{
name: "研判风险点 /处",
key: "department",
type: "number",
required: true,
width: "100%",
},
{
name: "各风险点已落实管控措施",
key: "department",
type: "radio",
required: true,
width: "100%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "作业基本情况",
key: "basicwork",
width:"100%",
children: [
{
name: "已落实特殊作业的风险辨识、作业许可及管控措施",
key: "department",
type: "radio",
required: true,
width: "100%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "特级动火作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "一级动火作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "二级动火作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "受限空间作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "高处作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "起重吊装作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "断路作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "临电作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "动土作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "盲板抽堵作业 /处",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "变更作业 /处",
key: "department",
type: "number",
required: true,
width: "100%",
labelWidth:"120px"
},
{
name: "是否已落实变更审批以及安全管理措施 /处",
key: "department",
type: "radio",
required: true,
width: "100%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
],
},
{
name: "生产装置基本情况",
key: "basicproduce",
children: [
{
name: "生产装置 /套",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "运行 /套",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "停产 /套",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "检修 /套",
key: "department",
type: "number",
required: true,
width: "50%",
labelWidth:"120px"
},
{
name: "是否处于试生产阶段",
key: "department",
type: "radio",
required: false,
width: "50%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "是否处于开停车阶段",
key: "department",
type: "radio",
required: false,
width: "50%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "是否开展中(扩)试",
key: "department",
type: "radio",
required: false,
width: "100%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "罐区、仓库等重大危险源是否处于安全状态",
key: "department",
type: "radio",
required: false,
width: "100%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
],
},
{
name: "是否存在重大隐患",
key: "department",
type: "radio",
required: false,
width: "100%",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
],
},
situation: {
description: "风险研判情况",
content: [
{
name: "生产装置的安全生产状态",
key: "safestatus",
children: [
{
name: "1.生产装置的温度、压力、组分、液位、流量等主要工艺参数是否处于指标范围",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "2.压力容器、压力管道等特种设备是否处于安全运行状态",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "3.各类设备设施的静动密封是否完好无泄漏",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "4.超限报警、紧急切断、联锁等各类安全设施配备是否完好投用,并可靠运行",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
],
},
{
name: "危险化学品罐区、仓库等重大危险源的安全运行状态",
key: "dangersafestatus",
children: [
{
name: "5.储罐、管道、机泵、阀门及仪表系统是否完好无泄漏",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "6.储罐的液位、温度、压力是否超限运行",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "7.内浮顶储罐运行中浮盘是否可能落底",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "8.油气储罐手动切水、切罐、装卸车时是否确保人员在岗",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "9.可燃及有毒气体报警和联锁是否处于可靠运行状态",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "10.仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
],
},
{
name: "涉及罐区,仓库等重大危险源处于安全状态",
key: "dangersourcesafestatus",
children: [
{
name: "11.装置开停车是否制定开停车方案,试生产是否制定试生产方案并经专家论证",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "12.各项特殊作业、检维修作业、承包商作业是否健全和完善相关管理制度,作业过程是否进行安全风险辨识,严格程序确认和作业许可审批,加强现场监督,危险化学品罐区动火作业是否做到升级管理等",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
{
name: "13.各项变更的审批程序是否符合规定",
key: "department",
type: "radio",
required: false,
width: "100%",
labelWidth:"600px",
datas: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
},
],
},
],
},
promise:{
description: "班组安全承诺",
key:'promise'
}
};

View File

@ -39,6 +39,15 @@ import IntegralEvent from '@/views/integral/event.component.vue'
import IntegralMall from '@/views/integral/mall.component.vue' import IntegralMall from '@/views/integral/mall.component.vue'
import IntegralExchange from '@/views/integral/exchange/exchangeFlow/exchange.component.vue' import IntegralExchange from '@/views/integral/exchange/exchangeFlow/exchange.component.vue'
import IntegralExchangeRecord from '@/views/integral/exchange/exchangeRecord/exchangeRecord.component.vue' import IntegralExchangeRecord from '@/views/integral/exchange/exchangeRecord/exchangeRecord.component.vue'
import MajorHazard from '@/views/responsibility/majorHazard/majorHazard.component.vue'
import CheckTasks from '@/views/responsibility/checkTasks/checkTasks.component.vue'
import CheckResumption from '@/views/estimate/checkResumption.component.vue'
import HiddendangerResumption from '@/views/estimate/hiddendangerResumption.component.vue'
import PublicityResumption from '@/views/estimate/publicityResumption/publicityResumption.component.vue'
import BusinessInfo from '@/views/riskAssessment/businessInfo/businessInfo.component.vue'
import MaintenanceInfo from '@/views/riskAssessment/maintenanceInfo/maintenanceInfo.component.vue'
import RiskJudgment from '@/views/riskAssessment/riskJudgment/riskJudgment.component.vue'
import SafetyNotice from '@/views/riskAssessment/safetyNotice/safetyNotice.component.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes: Array<RouteConfig> = [ const routes: Array<RouteConfig> = [
@ -234,10 +243,73 @@ const routes: Array<RouteConfig> = [
path:"exchange-record", path:"exchange-record",
component:IntegralExchangeRecord component:IntegralExchangeRecord
}, },
] ]
}] },{
path:"responsibility",
name:"responsibility",
component:BlankComponent,
redirect:"responsibility/major-hazard",
children:[{
name:"major-hazard",
path:"major-hazard",
component:MajorHazard
},{
name:"check-tasks",
path:"check-tasks",
component:CheckTasks
},{
path:"estimate",
name:"estimate",
component:BlankComponent,
redirect:"estimate/check-resumption",
children:[{
name:"check-resumption",
path:"check-resumption",
component:CheckResumption
},{
name:"hiddendanger-resumption",
path:"hiddendanger-resumption",
component:HiddendangerResumption
},{
name:"publicity-resumption",
path:"publicity-resumption",
component:PublicityResumption
},
]
},
]
},
{
path:"risk-assessment",
name:"risk-assessment",
component:BlankComponent,
redirect:"risk-assessment/business-info",
children:[{
name:"business-info",
path:"business-info",
component:BusinessInfo
},
{
name:"maintenance-info",
path:"maintenance-info",
component:MaintenanceInfo
},
{
name:"risk-judgment",
path:"risk-judgment",
component:RiskJudgment
},
{
name:"safety-otice",
path:"safety-notice",
component:SafetyNotice
},
]
}
]
}, },
{ {
path: '/index', path: '/index',

View File

@ -0,0 +1,48 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class BusinessInfoService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/company/list';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/company';
return this.deleteBatch(url,params,{},showLoading)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/company';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/company';
return this.put(url,params,{},showLoading)
}
}
//查询详情
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/company';
return this.get(url,params)
}
//获取所有企业
public getTotalCompany(params:any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/company/company';
return this.get(url,params)
}
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false)
}
}

View File

@ -0,0 +1,46 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class CheckResumptionService extends BaseService<any>{
constructor(){
super()
}
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/worktask/list';
return this.get(url,params)
}
public selectById(id):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/worktask?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+'/worktask';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/worktask';
return this.put(url,params,{},showLoading)
}
}
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention +'/worktask';
return this.deleteBatch(url,params,{},true)
}
//报表
public selectReportData(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/worktask/report';
return this.get(url,params)
}
//周期
public selectCycleData(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/worktask/cycle';
return this.get(url,params)
}
}

View File

@ -0,0 +1,68 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class checkTasksService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/dutytask/list';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/dutytask';
return this.deleteBatch(url,params,{},showLoading)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/dutytask';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/dutytask';
return this.put(url,params,{},showLoading)
}
}
//获取重大危险源列表
public selectMajorhazard(params: any,): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/dutytask/majorhazard/list';
return this.get(url,params,)
}
//获取负责人排查任务清单
public selectMajorhazardTaskList(params: any,): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/dutytask/majorhazard/detail/list';
return this.get(url,params,)
}
//查询负责人清单列表
public selectDutyDetail(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/detail';
return this.get(url,params,true)
}
//获取负责人清单列表
public selectDutyDetailList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/detail/list';
return this.get(url,params,true)
}
//添加、修改负责人清单
public addOrUpdateDutyDetail(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/detail';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/detail';
return this.put(url,params,{},showLoading)
}
}
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false)
}
}

View File

@ -0,0 +1,18 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class HiddendangerResumptionService extends BaseService<any>{
constructor(){
super()
}
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/execute/list';
return this.get(url,params)
}
//周期
public selectCycleData(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/worktask/cycle';
return this.get(url,params)
}
}

View File

@ -0,0 +1,58 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class MaintenanceInfoService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/safety/workshop/list';
return this.get(url,params,true)
}
// 获取详细信息
public selectByDetail(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/safety/workshop';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/safety/workshop';
return this.deleteBatch(url,params,{},showLoading)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/safety/workshop';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/safety/workshop';
return this.put(url,params,{},showLoading)
}
}
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false)
}
//获取企业
public selectCompany(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/company/company';
return this.get(url,params,true)
}
//获取风险点
public selectRiskGroup(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/safety/workshop/riskpoint';
return this.get(url,params,true)
}
//企业树
public getCompanyTree():Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/company/tree';
return this.get(url,null)
}
}

View File

@ -0,0 +1,35 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class MajorHazardService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/info/list';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/info';
return this.deleteBatch(url,params,{},showLoading)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/info';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/info';
return this.put(url,params,{},showLoading)
}
}
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false)
}
}

View File

@ -0,0 +1,12 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class PublicityResumptionService extends BaseService<any>{
constructor(){
super()
}
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/worktask/report';
return this.get(url,params)
}
}

View File

@ -16,11 +16,6 @@ export default class WorkFlowService extends BaseService<any>{
const url = this.prefix.bpm+'/task/candidate/set'; const url = this.prefix.bpm+'/task/candidate/set';
return this.post(url,params,{},true) return this.post(url,params,{},true)
} }
//设置候选人
public setCandidate(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.bpm+'/task/candidate/set';
return this.post(url,params,{},true)
}
//处理流程 //处理流程
public taskHandle(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{ public taskHandle(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.bpm+'/task/taskHandle'; const url = this.prefix.bpm+'/task/taskHandle';

View File

@ -39,6 +39,12 @@ export default new Vuex.Store({
prevention_risk_source:[], prevention_risk_source:[],
prevention_risk_craft:[], prevention_risk_craft:[],
prevention_risk_chemical:[], prevention_risk_chemical:[],
prevention_enterprise_nature:[],
prevention_enterprise_size:[],
prevention_regulatory_category:[],
prevention_regulatory_subcategories:[],
prevention_registration_status:[],
prevention_safety_label:[],
}, },
getters: { getters: {
dept_map:(state)=>{ dept_map:(state)=>{
@ -272,6 +278,49 @@ export default new Vuex.Store({
}) })
return map return map
}, },
prevention_enterprise_nature_map:(state)=>{
const map = {};
state.prevention_enterprise_nature.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_enterprise_size_map:(state)=>{
const map = {};
state.prevention_enterprise_size.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_regulatory_category_map:(state)=>{
const map = {};
state.prevention_regulatory_category.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_regulatory_subcategories_map:(state)=>{
const map = {};
state.prevention_regulatory_subcategories.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_registration_status_map:(state)=>{
const map = {};
state.prevention_registration_status.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
prevention_safety_label_map:(state)=>{
const map = {};
state.prevention_safety_label.forEach((item:any)=>{
map[item.value] = item.name
})
return map
},
}, },
mutations: { mutations: {
setAnalCntrol(state,data){ setAnalCntrol(state,data){
@ -377,6 +426,25 @@ export default new Vuex.Store({
set_prevention_risk_chemical(state,data){ set_prevention_risk_chemical(state,data){
state.prevention_risk_chemical = data state.prevention_risk_chemical = data
}, },
set_prevention_enterprise_nature(state,data){
state.prevention_enterprise_nature = data
},
set_prevention_enterprise_size(state,data){
state.prevention_enterprise_size = data
},
set_prevention_regulatory_category(state,data){
state.prevention_regulatory_category = data
},
set_prevention_regulatory_subcategories(state,data){
state.prevention_regulatory_subcategories = data
},
set_prevention_registration_status(state,data){
state.prevention_registration_status = data
},
set_prevention_safety_label(state,data){
state.prevention_safety_label = data
},
}, },
actions: { actions: {
}, },

View File

@ -48,6 +48,13 @@ export default class BlankComponent extends Vue {
this.systemService.getDictData("prevention_risk_source"), this.systemService.getDictData("prevention_risk_source"),
this.systemService.getDictData("prevention_risk_craft"), this.systemService.getDictData("prevention_risk_craft"),
this.systemService.getDictData("prevention_risk_chemical"), this.systemService.getDictData("prevention_risk_chemical"),
this.systemService.getDictData("prevention_enterprise_nature"),
this.systemService.getDictData("prevention_enterprise_size"),
this.systemService.getDictData("prevention_regulatory_category"),
this.systemService.getDictData("prevention_regulatory_subcategories"),
this.systemService.getDictData("prevention_registration_status"),
this.systemService.getDictData("prevention_safety_label"),
]).then(((results: any) => { ]).then(((results: any) => {
this.$store.commit("setDeptTreeList", results[0].data); this.$store.commit("setDeptTreeList", results[0].data);
@ -264,6 +271,43 @@ export default class BlankComponent extends Vue {
} }
})) }))
this.$store.commit("set_prevention_enterprise_nature", results[34].data.map(item => {
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
}))
this.$store.commit("set_prevention_enterprise_size", results[35].data.map(item => {
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
}))
this.$store.commit("set_prevention_regulatory_category", results[36].data.map(item => {
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
}))
this.$store.commit("set_prevention_regulatory_subcategories", results[37].data.map(item => {
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
}))
this.$store.commit("set_prevention_registration_status", results[38].data.map(item => {
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
}))
this.$store.commit("set_prevention_safety_label", results[39].data.map(item => {
return {
name: item.dictLabel,
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
}
}))
this.$store.commit("setDeptList", results[1].data.map((item) => { this.$store.commit("setDeptList", results[1].data.map((item) => {
return { return {
name: item.deptName, name: item.deptName,

View File

@ -0,0 +1,428 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from "./estimate.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import CheckResumptionService from '@/service/checkResumption.service';
import moment from 'moment';
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
BtnOption,
FormOption
},
})
export default class checkResumption extends BaseRecordComponent<any> {
public tableService = new CheckResumptionService();
public params = {
majorHazard: null,
time: null,
} as any;
//tab
public type = 1;
public showProtable = false;
public tableColumn = [] as any;
public showUpdate = false;
public updateParams = {} as any;
public selectData = [];
public isReadonly = false;
public hideOperate = true;
public showFile = false;
public currentUrl = null;
public showSubUpdate = false;
public isCheckTask = true;
public reportTable = {} as any;
public isPublicity = null;
public cycleList = [] as any;
public riskSourceMap = {} as any;
public dangerTypeMap = { 1: '主要负责人', 2: '技术负责人', 3: '操作负责人' }
public tabs = [{
name: "统计台账",
value: 1
}, {
name: "查看报表",
value: 2
},]
public formActions = [{
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"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [];
public buildFormOptions() {
this.formOptions = [{
name: "重大危险源名称",
key: "majorHazard",
type: "select",
datas: this.$store.state.prevention_risk_source
},
{
name: "周期",
key: "cycle",
type: "select",
datas: this.cycleList,
hide: this.type === 2
},
{
name: "周期",
key: "time",
type: "date",
subType: "week",
format: "yyyy 第 WW 周",
valueFormat: "yyyy-MM-dd",
hide: this.type === 1
},
];
}
public subActions = [{
name: "取消",
value: "cancel"
}];
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public updateOptions: FormOption<BtnOption>[] = [] as any;
created() {
//
this.getCycleListData();
this.buildFormOptions()
this.riskSourceMap = this.$store.getters.prevention_risk_source_map
}
//
public getCycleListData() {
this.tableService.selectCycleData({}).then((res: any) => {
res.data.forEach((item) => {
let itemList = {} as any;
itemList.name = item;
itemList.value = item;
this.cycleList.push(itemList)
})
})
}
public tabTableChange(type) {
this.params.pageNum = 1;
if (type === 1) {
this.buildFormOptions()
this.getTableData()
} else if (type === 2) {
this.buildFormOptions()
this.getReportTableData()
}
this.type = type
}
public change(data, item) {
//
}
public buildTable() {
this.tableColumn.push({ name: '周期', key: "cycle" });
this.tableColumn.push({
name: '重大危险源', key: "majorHazard", render: (data) => {
return this.$store.getters.prevention_risk_source_map[data.majorHazard]
}
});
this.tableColumn.push({ name: '包保责任人姓名', key: "taskChargeUserName", });
this.tableColumn.push({
name: '包保责任人类型', key: "type", render: (data) => {
return data.type ? this.dangerTypeMap[data.type] : '--'
}
});
this.tableColumn.push({ name: '排查任务数', key: "taskNumber", });
this.tableColumn.push({ name: '完成任务数', key: "completeNumber", });
this.tableColumn.push({ name: '完成率', key: "completeRate", });
}
public callback(data, type) {
if (type) {
if (this.type === 1) {
this.getTableData()
} else {
this.getReportTableData()
}
return
}
//
if (data.value === "search") {
if (this.type === 1) {
this.getTableData()
} else {
this.getReportTableData()
}
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
this.showUpdate = true
}
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
if (res.data) {
this.tableData = res.data as any;
}
})
}
//
public getReportTableData() {
if (this.params.time) {
this.params.startTime = moment(this.params.time).startOf('week').format('YYYY-MM-DD');
this.params.endTime = moment(this.params.time).endOf('week').format('YYYY-MM-DD');
}
this.tableService.selectReportData(this.params).then((res: any) => {
if (res.data) {
this.reportTable = res.data as any;
}
})
}
//
public reset() {
this.params.pageSize = 20;
this.params.pageNum = 1;
this.params.cycle = null;
this.params.majorHazard = null;
this.params.startTime = null;
this.params.endTime = null;
this.params.time = null;
}
public handleClose() {
this.showUpdate = false;
}
public selectable(row) {
//
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public subCallback(data) {
if (data.value === "cancel") {
this.showUpdate = false
}
}
public rowClass({ row, column, rowIndex, columnIndex }) {
if (row.startTime == '合计:') {
return 'fixed-row'
}
}
//
public summaryMethod(params) {
const { columns, data } = params;
const sums = [] as any;
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "合计";
return;
}
if (index === 2) {
sums[index] = this.reportTable.allTotalCompleted;
return;
}
if (index === 3) {
sums[index] = this.reportTable.allTotal;
return;
}
if (index === 4) {
sums[index] = this.reportTable.allTotalCompletionRate;
return;
}
if (index === 5) {
sums[index] = this.reportTable.allMainCompleted;
return;
}
if (index === 6) {
sums[index] = this.reportTable.allMain;
return;
}
if (index === 7) {
sums[index] = this.reportTable.allMainCompletionRate;
return;
}
if (index === 8) {
sums[index] = this.reportTable.allTechnologyCompleted;
return;
}
if (index === 9) {
sums[index] = this.reportTable.allTechnology;
return;
}
if (index === 10) {
sums[index] = this.reportTable.allTechnologyCompletionRate;
return;
}
if (index === 11) {
sums[index] = this.reportTable.allOperateCompleted;
return;
}
if (index === 12) {
sums[index] = this.reportTable.allOperate;
return;
}
if (index === 13) {
sums[index] = this.reportTable.allOperateCompletionRate;
return;
}
// if (this.reportTable.length == 0) {
// sums[index] = "";
// return;
// }
});
return sums;
}
}
</script>
<style lang="scss" scoped src="../common.component.scss"></style>
<style lang="scss" scoped>
::v-deep {
.el-table thead.is-group th.el-table__cell {
background: #fff;
}
.reportTable {
flex: 1;
height: 1px;
width: 100%;
.el-table__body {
//
.fixed-row {
display: inline-block;
position: sticky;
bottom: 0;
width: 100%;
td {
border: 1px solid #fff;
box-shadow: 2px -2px 3px 0px #ddd;
}
}
}
}
}
.reportTable {
margin-top: 20px;
}
.el-radio-button__inner {
border: none !important;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
border-bottom: 2px solid #409EFF !important;
}
</style>

View File

@ -0,0 +1,160 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="change" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<div class="full" v-if="isCheckTask">
<el-radio-group text-color="#409EFF" fill="transparent" size="medium" v-model="type"
@change="tabTableChange">
<el-radio-button :label="item.value" v-for="item in tabs"
:key="item.value">{{item.name}}</el-radio-button>
</el-radio-group>
</div>
<TableComponent v-if="type === 1 || isPublicity === false" style="flex: 1; height: 1px;"
:tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
@pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
:footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" :selectable="selectable" fixed label="全选" width="40">
</el-table-column>
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters"
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
<div slot-scope="scope" @click="" v-html="item.render(scope.row)"
style="pointer-events: none;" @click="rowCallback($event,scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :filters="item.filters"
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
<div class="reportTable" v-if="type === 2">
<el-table :data="reportTable.detail" border style="width: 100%;" height="90%" show-summary
:summary-method="summaryMethod" :row-class-name="rowClass">
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<el-table-column label="重大危险源名称">
<div slot-scope="scope">{{riskSourceMap[scope.row.majorHazardValue]}}</div>
</el-table-column>
<el-table-column label="总排查任务">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.totalCompleted}}</div>
</el-table-column>
<el-table-column label="计划任务">
<div slot-scope="scope">{{scope.row.total}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.totalCompletionRate}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="主要负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.mainCompleted ? scope.row.mainCompleted :'--'}}
</div>
</el-table-column>
<el-table-column label="计划任务">
<div slot-scope="scope">{{scope.row.main ?scope.row.main:'--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.mainCompletionRate ?
scope.row.mainCompletionRate:'--'}}
</div>
</el-table-column>
</el-table-column>
<el-table-column label="技术负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.technologyCompleted ?
scope.row.technologyCompleted:'--'}}</div>
</el-table-column>
<el-table-column label="计划任务">
<div slot-scope="scope">{{scope.row.technology ? scope.row.technology:'--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.technologyCompletionRate ?
scope.row.technologyCompletionRate :'--'}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="操作负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.operateCompleted ? scope.row.operateCompleted:'--'}}
</div>
</el-table-column>
<el-table-column label="计划任务">
<div slot-scope="scope">{{scope.row.operate ? scope.row.operate:'--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.operateCompletionRate ?
scope.row.operateCompletionRate:'--'}}</div>
</el-table-column>
</el-table-column>
</el-table>
</div>
<div class="publicReportTable" v-if="isPublicity">
<el-table :data="reportTable.detail" border style="width: 100%" height="90%" show-summary
:summary-method="publicSummaryMethod" :row-class-name="rowClass">
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<el-table-column label="重大危险源名称">
<div slot-scope="scope">{{riskSourceMap[scope.row.majorHazardValue]}}</div>
</el-table-column>
<el-table-column label="总排查任务">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.totalCompleted}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.totalCompletionRate}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="主要负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.mainCompleted? scope.row.mainCompleted : '--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.mainCompletionRate ? scope.row.mainCompletionRate:'--'}}
</div>
</el-table-column>
</el-table-column>
<el-table-column label="技术负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.technologyCompleted}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.technologyCompletionRate}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="操作负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.operateCompletionRate}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="隐患数量">
<el-table-column label="发现隐患数量">
<div slot-scope="scope">{{scope.row.dangerDiscovery}}</div>
</el-table-column>
<el-table-column label="完成整改数量">
<div slot-scope="scope">{{scope.row.dangerRemoval}}</div>
</el-table-column>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,265 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from "./estimate.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import HiddendangerResumptionService from '@/service/hiddendangerResumption.service';
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
BtnOption,
FormOption
},
})
export default class HiddendangerResumption extends BaseRecordComponent<any> {
public tableService = new HiddendangerResumptionService();
public params = {
majorHazard: null,
} as any;
public showProtable = false;
public tableColumn = [] as any;
public type = 3;
public showUpdate = false;
public updateParams = {} as any;
public selectData = [];
public isReadonly = false;
public hideOperate = true;
public showFile = false;
public currentUrl = null;
public showSubUpdate = false;
public isCheckTask = false;
public isPublicity = false;
public cycleList = [] as any;
public tabs = [{
name: "统计台账",
value: 1
}, {
name: "查看报表",
value: 2
},]
public formActions = [{
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"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [];
public buildFormOptions() {
this.formOptions = [{
name: "周期",
key: "cycle",
type: "select",
datas: this.cycleList,
},];
}
public subActions = [{
name: "取消",
value: "cancel"
}];
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public updateOptions: FormOption<BtnOption>[] = [] as any;
created() {
//
this.getCycleListData();
this.buildFormOptions()
}
//
public getCycleListData() {
this.tableService.selectCycleData({}).then((res: any) => {
res.data.forEach((item) => {
let itemList = {} as any;
itemList.name = item;
itemList.value = item;
this.cycleList.push(itemList)
})
})
}
public tabTableChange(type) {
this.params.pageNum = 1;
// if (type === 4) {
// this.tableActionWidth = "250"
// } else {
// this.tableActionWidth = "150"
// }
this.getTableData()
}
public change(data, item) {
//
}
public buildTable() {
this.tableColumn.push({ name: '周期', key: "cycle" });
this.tableColumn.push({ name: '上周应完成整改数', key: "lastReformNumber", });
this.tableColumn.push({ name: '上周完成整改隐患数', key: "lastCompleteNumber", });
this.tableColumn.push({ name: '非上周截止超期未整改数', key: "exceedReformNumber", });
this.tableColumn.push({ name: '上周完成非上周超期整改隐患数', key: "exceedCompleteNumber", });
this.tableColumn.push({
name: '整改率 /%', key: "reformRate", render: (data) => {
return data.reformRate * 100 + '%'
}
});
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
this.showUpdate = true
}
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
if (res.data) {
this.tableData = res.data as any;
}
})
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
public handleClose() {
this.showUpdate = false;
}
public selectable(row) {
//
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public subCallback(data) {
if (data.value === "cancel") {
this.showUpdate = false
}
}
}
</script>
<style lang="scss" scoped src="../common.component.scss"></style>
<style>
.el-radio-button__inner {
border: none !important;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
border-bottom: 2px solid #409EFF !important;
}
</style>

View File

@ -0,0 +1,61 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="change" btn-position="end"></FormComponent>
</div>
<div class="publicReportTable">
<el-table v-if="reportTable.detail.length" :data="reportTable.detail" border style="width: 100%" height="90%" show-summary
:summary-method="publicSummaryMethod" :row-class-name="rowClass" ref="publicReportTable">
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<el-table-column label="重大危险源名称">
<div slot-scope="scope">{{riskSourceMap[scope.row.majorHazardValue]}}</div>
</el-table-column>
<el-table-column label="总排查任务">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.totalCompleted? scope.row.totalCompleted :'--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.totalCompletionRate ? scope.row.totalCompletionRate :'--'}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="主要负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.mainCompleted? scope.row.mainCompleted : '--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.mainCompletionRate ? scope.row.mainCompletionRate:'--'}}
</div>
</el-table-column>
</el-table-column>
<el-table-column label="技术负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.technologyCompleted? scope.row.technologyCompleted :'--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.technologyCompletionRate? scope.row.technologyCompletionRate :'--'}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="操作负责人">
<el-table-column label="完成任务数">
<div slot-scope="scope">{{scope.row.operateCompleted? scope.row.operateCompleted :'--'}}</div>
</el-table-column>
<el-table-column label="完成率 /%">
<div slot-scope="scope">{{scope.row.operateCompletionRate? scope.row.operateCompletionRate :'--'}}</div>
</el-table-column>
</el-table-column>
<el-table-column label="隐患数量">
<el-table-column label="发现隐患数量">
<div slot-scope="scope">{{scope.row.dangerDiscovery? scope.row.dangerDiscovery :'--'}}</div>
</el-table-column>
<el-table-column label="完成整改数量">
<div slot-scope="scope">{{scope.row.dangerRemoval? scope.row.dangerRemoval :'--'}}</div>
</el-table-column>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,359 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from "./publicityResumption.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import PublicityResumptionService from '@/service/publicityResumption.service';
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
BtnOption,
FormOption
},
})
export default class PublicityResumption extends BaseRecordComponent<any> {
public tableService = new PublicityResumptionService();
public params = {
majorHazard: null,
time: null,
} as any;
public showProtable = false;
public type = 3;
public tableColumn = [] as any;
public showUpdate = false;
public updateParams = {} as any;
public reportTable = {
detail:[]
} as any;
public selectData = [];
public isReadonly = false;
public hideOperate = true;
public showFile = false;
public currentUrl = null;
public showSubUpdate = false;
public isCheckTask = false;
public isPublicity = true;
public riskSourceMap = this.$store.getters.prevention_risk_source_map;
public tabs = [{
name: "统计台账",
value: 1
}, {
name: "查看报表",
value: 2
},]
public formActions = [{
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"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "重大危险源名称",
key: "majorHazard",
type: "select",
datas: this.$store.state.prevention_risk_source
}, {
name: "日期",
key: "time",
type: "date",
subType: "datetimerange",
format: "yyyy-MM-dd",
}
];
public subActions = [{
name: "取消",
value: "cancel"
}];
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public updateOptions: FormOption<BtnOption>[] = [] as any;
created() {
//
}
updated() {
// this.$nextTick(() => {
// this.$refs.publicReportTable.doLayout();
// });
}
public tabTableChange(type) {
this.params.pageNum = 1;
this.getTableData()
}
public change(data, item) {
//
}
public buildTable() {
this.tableColumn.push({ name: '周期', key: "cycle" });
this.tableColumn.push({ name: '上周应完成整改数', key: "lastReformNumber", });
this.tableColumn.push({ name: '上周完成整改隐患数', key: "lastCompleteNumber", });
this.tableColumn.push({ name: '非上周截止超期未整改数', key: "exceedReformNumber", });
this.tableColumn.push({ name: '上周完成非上周超期整改隐患数', key: "exceedCompleteNumber", });
this.tableColumn.push({ name: '整改率', key: "reformRate", });
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
this.showUpdate = true
}
}
//
public getTableData() {
if (this.params.time && this.params.time.length > 0) {
this.params.startTime = this.params.time[0];
this.params.endTime = this.params.time[1]
}
this.tableService.selectByPage(this.params).then(res => {
if (res.data) {
this.reportTable = res.data as any;
}
})
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
public handleClose() {
this.showUpdate = false;
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public subCallback(data) {
if (data.value === "cancel") {
this.showUpdate = false
}
}
public rowClass({ row, column, rowIndex, columnIndex }) {
if (row.startTime == '合计:') {
return 'fixed-row'
}
}
//
public publicSummaryMethod(params) {
const { columns, data } = params;
const sums = [] as any;
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "汇总";
return;
}
if (index === 2) {
sums[index] = this.reportTable.allTotalCompleted;
return;
}
if (index === 3) {
sums[index] = this.reportTable.allTotalCompletionRate;
return;
}
if (index === 4) {
sums[index] = this.reportTable.allMainCompleted;
return;
}
if (index === 5) {
sums[index] = this.reportTable.allMainCompletionRate;
return;
}
if (index === 6) {
sums[index] = this.reportTable.allTechnologyCompleted;
return;
}
if (index === 7) {
sums[index] = this.reportTable.allTechnologyCompletionRate;
return;
}
if (index === 8) {
sums[index] = this.reportTable.allOperateCompleted;
return;
}
if (index === 9) {
sums[index] = this.reportTable.allOperateCompletionRate;
return;
}
if (index === 10) {
sums[index] = this.reportTable.allDangerDiscovery;
return;
}
if (index === 11) {
sums[index] = this.reportTable.allDangerRemoval;
return;
}
});
return sums;
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" scoped>
::v-deep {
.el-table thead.is-group th.el-table__cell {
background: #fff;
}
.publicReportTable {
flex: 1;
height: 1px;
width: 100%;
height: 1px;
margin-top: 8px;
background: #FFFFFF;
display: flex;
flex-direction: column;
border-radius: 4px;
border: 1px solid #EEEEEE;
padding: 24px 24px;
.el-table__body {
//
.fixed-row {
display: inline-block;
position: sticky;
bottom: 0;
width: 100%;
td {
border: 1px solid #fff;
box-shadow: 2px -2px 3px 0px #ddd;
}
}
}
}
}
.el-radio-button__inner {
border: none !important;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
border-bottom: 2px solid #409EFF !important;
}
</style>

View File

@ -106,6 +106,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public currentUrl: any; public currentUrl: any;
public showFile = false; public showFile = false;
public riskSource = [] as any;
public updateActions = [{ public updateActions = [{
@ -127,14 +128,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public statusMap = ["未下发", "已下发"]; public statusMap = ["未下发", "已下发"];
public reformModeMap = ["", "即查即改", "限期整改"] public reformModeMap = ["", "即查即改", "限期整改"]
created() {
this.loadAreaData()
this.loadUnitData();
}
// //
public loadAreaData() { public loadAreaData() {
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => { this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
@ -396,6 +389,15 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
showError: false, showError: false,
datas: this.$store.state.prevention_occur_step, datas: this.$store.state.prevention_occur_step,
}, {
name: "重大危险源名称",
key: "majorHazard",
format: "majorHazardName",
type: "select",
width: "calc(50% - 20px)",
require: true,
showError: false,
datas: this.riskSource
}, { }, {
name: "违反规定条款", name: "违反规定条款",
key: "violateTerm", key: "violateTerm",
@ -411,6 +413,24 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
}] }]
} }
created() {
this.loadAreaData()
this.loadUnitData();
//
this.initRiskSource()
}
//
public initRiskSource() {
this.riskSource = [] as any;
this.riskSource = JSON.parse(JSON.stringify(this.$store.state.prevention_risk_source));
this.riskSource.unshift({
name: '不涉及',
value: 0,
})
this.buildUpdateForm()
}
public buildTable() { public buildTable() {
this.tableColumn.push({ name: '整改单编号', width: "200px", key: "number" }); this.tableColumn.push({ name: '整改单编号', width: "200px", key: "number" });
this.tableColumn.push({ name: '隐患描述', key: "description", width: "300px" }); this.tableColumn.push({ name: '隐患描述', key: "description", width: "300px" });
@ -502,6 +522,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public showUpdateModel(row?, isRead?) { public showUpdateModel(row?, isRead?) {
this.initRiskSource()
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
this.fileList = []; this.fileList = [];
this.photoList = []; this.photoList = [];
@ -514,7 +535,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
inspectTime: moment().format("YYYY-MM-DD HH:mm") inspectTime: moment().format("YYYY-MM-DD HH:mm")
} }
if (!row) { if (!row) {
this.tableService.getNumber().then(res => { this.tableService.getNumber().then(res => {
this.updateParams.number = res.data; this.updateParams.number = res.data;
this.center = [118.751353, 31.969568]; this.center = [118.751353, 31.969568];
@ -539,6 +559,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
areaName: (this.areaList.find((item: any) => item.value === res.data.areaId) as any).name, areaName: (this.areaList.find((item: any) => item.value === res.data.areaId) as any).name,
type: "随手拍", type: "随手拍",
}, res.data) }, res.data)
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
// //
this.center = [res.data.locationLng, res.data.locationLat]; this.center = [res.data.locationLng, res.data.locationLat];
this.buildUpdateForm() this.buildUpdateForm()
@ -645,6 +668,10 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
this.updateParams.resourceName = this.photoList.map(item => item.name).join(",") this.updateParams.resourceName = this.photoList.map(item => item.name).join(",")
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",") this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",") this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",")
if (this.updateParams.majorHazard && this.updateParams.majorHazard !== 0) {
this.updateParams.majorHazard = this.updateParams.majorHazard.toString()
}
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
if (isSubmit) { if (isSubmit) {

View File

@ -17,7 +17,7 @@
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions"> @pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked" <el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%"> @selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
<el-table-column v-if="!isAction && !(isManager && params.type>1)" type="selection" <el-table-column v-if="!isAction && !(isManager && params.type>1)" type="selection"
:selectable="selectable" fixed label="全选" width="40"> :selectable="selectable" fixed label="全选" width="40">
</el-table-column> </el-table-column>
@ -26,12 +26,12 @@
</el-table-column> </el-table-column>
<template v-for="item in tableColumn"> <template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters" <el-table-column v-if="item.render" :label="item.name" :filters="item.filters"
:filter-method="item.filterMethod" :width="item.width" :key="item.key"> :filter-method="item.filterMethod" :width="item.width" :key="item.key" :sortable="item.sortable">
<div slot-scope="scope" @click="" v-html="item.render(scope.row)" <div slot-scope="scope" @click="" v-html="item.render(scope.row)"
style="pointer-events: none;" @click="rowCallback($event,scope.row)"></div> style="pointer-events: none;" @click="rowCallback($event,scope.row)"></div>
</el-table-column> </el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :filters="item.filters" <el-table-column v-else :prop="item.key" :label="item.name" :filters="item.filters"
:filter-method="item.filterMethod" :width="item.width" :key="item.key"> :filter-method="item.filterMethod" :width="item.width" :key="item.key" :sortable="item.sortable">
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" fixed="right" :width="tableActionWidth"> <el-table-column label="操作" fixed="right" :width="tableActionWidth">
@ -188,7 +188,7 @@
:visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close> :visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close>
<div class="sub-title" v-if="isManager || isFile">隐患信息</div> <div class="sub-title" v-if="isManager || isFile">隐患信息</div>
<FormComponent ref="form" :options="updateOptions" <FormComponent ref="form" :options="updateOptions"
:isReadonly="isReadonly || ((isManager || isFile) && updateParams.status>1)" labelWidth="110px" :isReadonly="isReadonly || ((isManager || isFile) && updateParams.status>1)" labelWidth="140px"
labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions" labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions"
:full-btn="true" @change="change" btn-position="center"></FormComponent> :full-btn="true" @change="change" btn-position="center"></FormComponent>

View File

@ -90,6 +90,9 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
public marker: any = null; public marker: any = null;
public map: any = null; public map: any = null;
public showMap = false; public showMap = false;
public riskSource = [] as any;
public executeResultList = [{ public executeResultList = [{
text: "完成", text: "完成",
value: 1 value: 1
@ -108,7 +111,8 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
}]; }];
created() { created() {
//
this.initRiskSource()
} }
public getTableData() { public getTableData() {
@ -384,7 +388,16 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
type: "textarea", type: "textarea",
width: "100%", width: "100%",
showError: false, showError: false,
}] }, {
name: "重大危险源名称",
key: "majorHazard",
format: "majorHazardName",
type: "select",
width: "calc(50% - 20px)",
require: true,
showError: false,
datas: this.riskSource
},]
this.updateOptions2 = [{ this.updateOptions2 = [{
name: "隐患确认", name: "隐患确认",
@ -652,8 +665,19 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
} }
//
public initRiskSource() {
this.riskSource = [] as any;
this.riskSource = JSON.parse(JSON.stringify(this.$store.state.prevention_risk_source));
this.riskSource.unshift({
name: '不涉及',
value: 0,
})
this.getTableCallback()
}
public showUpdateModel(row) { public showUpdateModel(row) {
this.initRiskSource()
Object.assign(this.updateParams, { Object.assign(this.updateParams, {
verifyConfirmFlagName: this.isPassMap[row.verifyConfirmFlag], verifyConfirmFlagName: this.isPassMap[row.verifyConfirmFlag],
executeConfirmFlagName: this.isAcceptMap[row.executeConfirmFlag], executeConfirmFlagName: this.isAcceptMap[row.executeConfirmFlag],
@ -669,6 +693,8 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify], professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
reformModeName: this.reformModeMap[row.reformMode], reformModeName: this.reformModeMap[row.reformMode],
}, row); }, row);
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.getTableCallback() this.getTableCallback()
// url // url

View File

@ -41,6 +41,8 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
public isFile = false; public isFile = false;
public riskSource = [] as any;
public params = { public params = {
type: 1, type: 1,
bpmSchemeCode: "prevention-yhzl" bpmSchemeCode: "prevention-yhzl"
@ -107,6 +109,11 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
public map: any = null; public map: any = null;
public showMap = false; public showMap = false;
//
public sortAttribute = {
updateTime: "update_time",
} as any;
public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "已闭环", 6: "流程中断", 7: "已作废" }; public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "已闭环", 6: "流程中断", 7: "已作废" };
public tabs = [{ public tabs = [{
name: "草稿", name: "草稿",
@ -149,7 +156,8 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
created() { created() {
// //
this.initRiskSource()
} }
public tabTableChange(type) { public tabTableChange(type) {
this.params.pageNum = 1; this.params.pageNum = 1;
@ -446,7 +454,16 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
type: "textarea", type: "textarea",
width: "100%", width: "100%",
showError: false, showError: false,
}] }, {
name: "重大危险源名称",
key: "majorHazard",
format: "majorHazardName",
type: "select",
width: "calc(50% - 20px)",
require: true,
showError: false,
datas: this.riskSource
},]
this.updateOptions2 = [{ this.updateOptions2 = [{
name: "隐患确认", name: "隐患确认",
@ -654,6 +671,18 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
}] }]
} }
//
public initRiskSource() {
this.riskSource = [] as any;
this.riskSource = JSON.parse(JSON.stringify(this.$store.state.prevention_risk_source));
this.riskSource.unshift({
name: '不涉及',
value: 0,
})
this.getTableCallback()
}
public buildTable() { public buildTable() {
this.tableColumn.push({ this.tableColumn.push({
name: '状态', render: (data) => { name: '状态', render: (data) => {
@ -669,8 +698,10 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
} }
}); });
this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.executor || "--" }); this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.executor || "--" });
this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime" }); this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' });
this.tableColumn.push({ name: '隐患来源', width: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] }); this.tableColumn.push({ name: '隐患来源', width: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] });
this.tableColumn.push({ name: '上报人', width: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" });
this.tableColumn.push({ name: '上报时间', width: "120", key: "reportTime", render: (data) => data.reportTime || "--" });
this.tableColumn.push({ this.tableColumn.push({
name: '隐患标题', width: "150", render: (data) => { name: '隐患标题', width: "150", render: (data) => {
if (this.params.type === 1 || this.params.type === 2) { if (this.params.type === 1 || this.params.type === 2) {
@ -697,24 +728,28 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
data = Object.assign({ data = Object.assign({
realConfirmUserId: this.account.userId, realConfirmUserId: this.account.userId,
realConfirmUserName: this.account.nickName, realConfirmUserName: this.account.nickName,
realConfirmTime: moment().format("YYYY-MM-DD HH:mm") realConfirmTime: moment().format("YYYY-MM-DD HH:mm"),
reformConfirmFlag: 1
}, data) }, data)
} }
if (data.status === 3) { if (data.status === 3) {
data = Object.assign({ data = Object.assign({
realExecuteUserId: this.account.userId, realExecuteUserId: this.account.userId,
realExecuteUserName: this.account.nickName, realExecuteUserName: this.account.nickName,
realExecuteTime: moment().format("YYYY-MM-DD HH:mm") realExecuteTime: moment().format("YYYY-MM-DD HH:mm"),
executeConfirmFlag: 1
}, data) }, data)
} }
if (data.status === 4) { if (data.status === 4) {
data = Object.assign({ data = Object.assign({
realVerifyUserId: this.account.userId, realVerifyUserId: this.account.userId,
realVerifyUserName: this.account.nickName, realVerifyUserName: this.account.nickName,
realVerifyTime: moment().format("YYYY-MM-DD HH:mm") realVerifyTime: moment().format("YYYY-MM-DD HH:mm"),
verifyConfirmFlag: 1
}, data) }, data)
} }
this.showUpdateModel(data) this.showUpdateModel(data)
this.getTableCallback()
} }
} }
@ -853,6 +888,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
public showUpdateModel(row?, isRead?) { public showUpdateModel(row?, isRead?) {
this.initRiskSource()
this.isReadonly = !!isRead this.isReadonly = !!isRead
this.updateParams = { status: 0, source: 9 } as any; this.updateParams = { status: 0, source: 9 } as any;
if (!row) { if (!row) {
@ -877,6 +913,8 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify], professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
reformModeName: this.reformModeMap[row.reformMode], reformModeName: this.reformModeMap[row.reformMode],
}, row); }, row);
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.getTableCallback() this.getTableCallback()
// url // url
@ -994,7 +1032,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
this.updateParams.executeResourceName = this.fileList2.map(item => item.name).join(",") this.updateParams.executeResourceName = this.fileList2.map(item => item.name).join(",")
this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",") this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",")
this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",") this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",")
if (this.updateParams.majorHazard && this.updateParams.majorHazard !== 0) {
this.updateParams.majorHazard = this.updateParams.majorHazard.toString()
}
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
this.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功"); this.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功");
if (!preStatus) { if (!preStatus) {
@ -1171,6 +1211,18 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
public handleSelectionChange(data) { public handleSelectionChange(data) {
this.selectData = data; this.selectData = data;
} }
//
public sortChange(column) {
if (column.order) {
this.params.isAsc = column.order == "descending" ? 'desc' : 'asc'
this.params.orderByColumn = this.sortAttribute[column.prop]
} else {
this.params.isAsc = null
this.params.orderByColumn = null
}
this.getTableData()
}
} }
</script> </script>
<style lang="scss" scoped src="../common.component.scss"></style> <style lang="scss" scoped src="../common.component.scss"></style>

View File

@ -101,13 +101,16 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public levelMap = ["", "一般隐患", "重大隐患"] public levelMap = ["", "一般隐患", "重大隐患"]
public reformModeMap = ["", "即查即改", "限期整改"] public reformModeMap = ["", "即查即改", "限期整改"]
public riskSource = [] as any;
public planTypeMap = { public planTypeMap = {
1: "单次计划", 1: "单次计划",
2: "长期计划" 2: "长期计划"
} }
created() { created() {
// //
this.initRiskSource()
} }
public buildTable() { public buildTable() {
@ -399,7 +402,27 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
type: "textarea", type: "textarea",
width: "100%", width: "100%",
showError: false, showError: false,
}] }, {
name: "重大危险源名称",
key: "majorHazard",
format: "majorHazardName",
type: "select",
width: "calc(50% - 20px)",
require: true,
showError: false,
datas: this.riskSource
},]
}
//
public initRiskSource() {
this.riskSource = [] as any;
this.riskSource = JSON.parse(JSON.stringify(this.$store.state.prevention_risk_source));
this.riskSource.unshift({
name: '不涉及',
value: 0,
})
this.getTableCallback()
} }
// //
@ -506,6 +529,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.updateParams.resourceName = this.photoList.map(item => item.name).join(",") this.updateParams.resourceName = this.photoList.map(item => item.name).join(",")
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",") this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",") this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",")
if (this.updateParams.majorHazard && this.updateParams.majorHazard !== 0) {
this.updateParams.majorHazard = this.updateParams.majorHazard.toString()
}
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then((res: any) => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then((res: any) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
this.handleClose(); this.handleClose();
@ -610,6 +636,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
} }
public showUpdateModel(row?, isRead?) { public showUpdateModel(row?, isRead?) {
this.initRiskSource()
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
this.fileList = []; this.fileList = [];
this.photoList = []; this.photoList = [];
@ -644,6 +671,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify], professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
reformModeName: this.reformModeMap[row.reformMode], reformModeName: this.reformModeMap[row.reformMode],
}, row) }, row)
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
// url // url
if (row.resourceId) { if (row.resourceId) {
this.updateParams.photo = row.resourceId this.updateParams.photo = row.resourceId

View File

@ -0,0 +1,191 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" fixed label="全选" width="60">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :show-overflow-tooltip="item.showTip"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
:filter-method="item.filterMethod" @click="rowCallback($event,scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip">
<!-- <el-badge is-dot class="item">{{item.name}}</el-badge> -->
<div><span class="showTip" v-if="item.syncFlag && item.tipIcon"></span>{{item.name}}</div>
</el-table-column>
</template>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
<el-button type="text" @click="showModal(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="isReadonly?'详情':updateParams.id ?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" ref="basicForm" @change="changes">
</FormComponent>
<div class="sub-title">重大危险源主要负责人隐患排查任务清单</div>
<el-table ref="multipleTable" :data="mainDuty" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%;" max-height="370">
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<el-table-column label="姓名" width="100">
<div slot-scope="scope">{{scope.row.taskChargeUserName}}</div>
</el-table-column>
<el-table-column label="联系方式" width="80">
<div slot-scope="scope">{{'--'}}</div>
</el-table-column>
<el-table-column label="包保责任制" width="300">
<div slot-scope="scope">
<span v-if="isReadonly">{{taskTypeMap[scope.row.type][scope.row.dutyContent]}}</span>
<el-select v-else v-model="scope.row.dutyContent" placeholder="请选择包保责任制" style="width: 100%;">
<el-option v-for="item in taskType[scope.row.type].children" :key="item.dictValue"
:label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</div>
</el-table-column>
<el-table-column label="排查任务">
<div slot-scope="scope">{{scope.row.taskName}}</div>
</el-table-column>
<el-table-column label="岗位" width="80">
<div slot-scope="scope">{{scope.row.taskExecutePostName}}</div>
</el-table-column>
<el-table-column label="周期" width="60">
<div slot-scope="scope">{{scope.row.taskReviewCycleValue}}</div>
</el-table-column>
<el-table-column label="单位" width="60">
<div slot-scope="scope">{{unitMap[scope.row.taskReviewCycleUnit]}}</div>
</el-table-column>
</el-table>
<div class="sub-title">重大危险源技术负责人隐患排查任务清单</div>
<el-table ref="multipleTable" :data="techDuty" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%;" max-height="370">
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<el-table-column label="姓名" width="100">
<div slot-scope="scope">{{scope.row.taskChargeUserName}}</div>
</el-table-column>
<el-table-column label="联系方式" width="80">
<div slot-scope="scope">{{'--'}}</div>
</el-table-column>
<el-table-column label="包保责任制" width="300">
<div slot-scope="scope">
<span v-if="isReadonly">{{taskTypeMap[scope.row.type][scope.row.dutyContent]}}</span>
<el-select v-else v-model="scope.row.dutyContent" placeholder="请选择包保责任制" style="width: 100%;">
<el-option v-for="item in taskType[scope.row.type].children" :key="item.dictValue"
:label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</div>
</el-table-column>
<el-table-column label="排查任务">
<div slot-scope="scope">{{scope.row.taskName}}</div>
</el-table-column>
<el-table-column label="岗位" width="80">
<div slot-scope="scope">{{scope.row.taskExecutePostName}}</div>
</el-table-column>
<el-table-column label="周期" width="60">
<div slot-scope="scope">{{scope.row.taskReviewCycleValue}}</div>
</el-table-column>
<el-table-column label="单位" width="60">
<div slot-scope="scope">{{unitMap[scope.row.taskReviewCycleUnit]}}</div>
</el-table-column>
</el-table>
<div class="sub-title">重大危险源操作负责人隐患排查任务清单</div>
<el-table ref="multipleTable" :data="operateDuty" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%;margin-bottom: 20px;" max-height="370">
<el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div>
</el-table-column>
<el-table-column label="姓名" width="100">
<div slot-scope="scope">{{scope.row.taskChargeUserName}}</div>
</el-table-column>
<el-table-column label="联系方式" width="80">
<div slot-scope="scope">{{'--'}}</div>
</el-table-column>
<el-table-column label="包保责任制" width="300">
<div slot-scope="scope">
<span v-if="isReadonly">{{taskTypeMap[scope.row.type][scope.row.dutyContent]}}</span>
<el-select v-else v-model="scope.row.dutyContent" placeholder="请选择包保责任制" style="width: 100%;">
<el-option v-for="item in taskType[scope.row.type].children" :key="item.dictValue"
:label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
</div>
</el-table-column>
<el-table-column label="排查任务">
<div slot-scope="scope">{{scope.row.taskName}}</div>
</el-table-column>
<el-table-column label="岗位" width="80">
<div slot-scope="scope">{{scope.row.taskExecutePostName}}</div>
</el-table-column>
<el-table-column label="周期" width="60">
<div slot-scope="scope">{{scope.row.taskReviewCycleValue}}</div>
</el-table-column>
<el-table-column label="单位" width="60">
<div slot-scope="scope">{{unitMap[scope.row.taskReviewCycleUnit]}}</div>
</el-table-column>
</el-table>
<ButtonListComponent :actions="!isReadonly ? updateActions :[]" @callback="subCallback" btn-position="center"
:full-btn="true">
</ButtonListComponent>
</el-dialog>
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
width="680px">
<img :src="currentUrl" style="width: 100%;" alt="">
</el-dialog>
<!-- 查看清单 -->
<el-dialog :close-on-click-modal="false" title="排查任务清单" :visible.sync="showProtable" width="1080px">
<TableComponent :tableData="tasksListData" :tableColumn="subTableColumn" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="tasksListData" tooltip-effect="dark" max-height="700" border
style="width: 100%">
<template v-for="item in subTableColumn">
<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>
</el-dialog>
</div>

View File

@ -0,0 +1,782 @@
<script lang="ts">
import { Component, Watch } from 'vue-property-decorator';
import template from './checkTasks.component.html'
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
import FormComponent from "hbt-common/components/common/form.component.vue";
import TableComponent from "hbt-common/components/common/table.component.vue";
import checkTasksService from "@/service/checkTasks.service";
import FormOption from "hbt-common/models/formOptions";
import BtnOption from "hbt-common/models/btnOptions";
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
@Component({
template,
components: {
FormComponent,
TableComponent,
ButtonListComponent
},
})
export default class MajorHazard extends BaseRecordComponent<any> {
public tableService = new checkTasksService();
public params = {
majorHazard: null,
} as any;
public tableColumn = [] as any;
public subTableColumn = [] as any;
public updateParams = {} as any;
public selectData = [];
public isReadonly = false;
public fileList = [] as any;
public showFile = false;
public currentUrl = null;
public showUpdate = false;
public setpsOptions = [] as any;
public showFileList = [] as any;
public labelWidth = '130px';
//
public mainDuty = [] as any;
//
public techDuty = [] as any;
//
public operateDuty = [] as any;
public taskType = {} as any;
public taskTypeMap = {} as any;
public unitMap = {} as any;
public tasksListData = [] as any;
public showProtable = false;
public formActions = [{
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "重大危险源",
key: "majorHazard",
type: "select",
datas: this.$store.state.prevention_risk_source,
},];
public subActions = [{
name: "取消",
value: "cancel"
}];
//
public majorHazard = [] as any;
public updateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public updateStepsOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() {
this.updateOptions = [{
name: "企业名称",
type: "text",
key: "companyName",
format: "companyName",
require: true,
width: "100%",
showError: false,
datas: [],
},
{
name: "重大危险源名称",
type: "select",
key: "majorHazard",
format: "majorHazardName",
require: true,
width: "100%",
showError: false,
datas: this.majorHazard,
disable: !!this.updateParams.id,
},
{
name: "主要负责人",
type: "select",
key: "mainUserId",
format: "mainUserName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "mainUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
]
},
{
name: "技术负责人",
type: "select",
key: "techUserId",
format: "techUserName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "techUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
]
},
{
name: "操作负责人",
type: "select",
key: "operateUserId",
format: "operateUserName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "operateUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
]
},
{
name: "附件",
key: "resourceId",
ref: "file",
type: "upload",
width: "100%",
showError: false,
onSucess: this.onSuccess,
onMove: this.onRemove,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
fileList: this.fileList,
btn: [{
name: "上传附件",
value: "upload",
hide: this.isReadonly,
size: "small",
type: "primary"
}]
},
];
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() {
//
//
this.initSelectList()
}
public changes(data, item) {
//
if (item.key === "majorHazard") {
this.majorhazardDutyTaskList(data)
}
}
//
public majorhazardDutyTaskList(majorHazardValue) {
this.tableService.selectMajorhazardTaskList({ majorHazardValue }).then((res: any) => {
this.mainDuty = res.data[1] ? res.data[1] : []
this.mainDuty.forEach((item: any) => {
item.type = 1
})
this.techDuty = res.data[2] ? res.data[2] : []
this.techDuty.forEach((item: any) => {
item.type = 2
})
this.operateDuty = res.data[3] ? res.data[3] : []
this.operateDuty.forEach((item: any) => {
item.type = 3
})
})
}
public buildTable() {
this.tableColumn.push({ name: '企业名称', key: "companyName", tipIcon: true });
this.tableColumn.push({
name: '重大危险源名称', key: "majorHazard", render: (data) => {
let majorHazard = parseInt(data.majorHazard)
return this.$store.getters.prevention_risk_source_map[majorHazard]
}
});
this.tableColumn.push({
name: '主要责任人排查清单', key: "mainTaskNumber", render: (data) => {
return "<span class='link mainDuty'>" + (data.mainTaskNumber ? data.mainTaskNumber : 0) + "</span>"
}
});
this.tableColumn.push({
name: '技术负责人排查清单', key: "techTaskNumber", render: (data) => {
return "<span class='link techDuty'>" + (data.techTaskNumber ? data.techTaskNumber : 0) + "</span>"
}
});
this.tableColumn.push({
name: '操作负责人排查清单', key: "operateTaskNumber", render: (data) => {
return "<span class='link operateDuty'>" + (data.operateTaskNumber ? data.operateTaskNumber : 0) + "</span>"
}
});
this.subTableColumn.push({ name: '序号', key: "index", width: "60px" });
this.subTableColumn.push({ name: '姓名', key: "taskChargeUserName", });
this.subTableColumn.push({
name: '联系方式', key: "phone", render: (data) => {
return '--'
}
});
this.subTableColumn.push({
name: '包保责任制', key: "dutyContent", width: "300px", render: (data) => {
return this.taskTypeMap[data.type][data.dutyContent]
}
});
this.subTableColumn.push({ name: '排查任务', key: "taskName", width: "200px" });
this.subTableColumn.push({ name: '岗位', key: "taskExecutePostName", });
this.subTableColumn.push({ name: '周期', key: "taskReviewCycleValue", width: "80px" });
this.subTableColumn.push({
name: '单位', key: "taskReviewCycleUnit", render: (data) => {
return this.$store.getters.prevention_cycle_unit_map[data.taskReviewCycleUnit]
}
});
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
this.updateParams = {} as any;
this.isReadonly = false;
this.fileList = [] as any;
this.taskType = this.$store.state.prevention_task_type;
this.unitMap = this.$store.getters.prevention_cycle_unit_map;
//
this.initData();
this.buildUpdateForm()
//
this.getMajorhazardList()
this.showUpdate = true;
}
}
//
public getMajorhazardList() {
this.tableService.selectMajorhazard({}).then((res: any) => {
if (res.code === 200) {
res.data.forEach((item: any) => {
item.name = item.label
return item
});
this.majorHazard = res.data;
this.buildUpdateForm()
}
})
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any;
})
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
public handleClose() {
this.showUpdate = false;
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public onSuccess(res, file, fileList) {
if (res.code === 200) {
this.fileList.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
} else {
this.$message.error(res.msg);
}
}
public onRemove(file, fileList) {
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
}
public onPreview(file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url;
this.showFile = true;
} else {
window.open(file.url, "_blank")
}
}
public subCallback(data) {
if (data.value === "cancel") {
this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
}
}
//
public handleDataMethod() {
if (this.fileList.length > 0) {
let resourceId = this.fileList.map((item) => {
return item.id;
});
let resourceName = this.fileList.map((item) => {
return item.name;
});
this.updateParams.resourceId = resourceId.join(",");
this.updateParams.resourceName = resourceName.join(",");
}
this.updateParams.techUserName = this.$store.getters.user_map[this.updateParams.techUserId];
this.updateParams.operateUserName = this.$store.getters.user_map[this.updateParams.operateUserId];
this.updateParams.mainUserName = this.$store.getters.user_map[this.updateParams.mainUserId];
}
//
public doSave(goOn?) {
let vaildStatus = true;
if (!(this.$refs.basicForm as any).vaildParams()) {
vaildStatus = false
}
if (vaildStatus === true) {
//
//
this.handleDataMethod();
const dutyDetail = this.mainDuty.concat(this.techDuty).concat(this.operateDuty);
let dutyContent: any = true;
dutyDetail.forEach((item: any) => {
if (!item.dutyContent) {
dutyContent = false
}
})
if (dutyContent === false) {
this.$message.error("请选择包保责任制!")
return
}
this.updateParams.details = dutyDetail;
this.updateParams.mainTaskNumber = this.mainDuty.length;
this.updateParams.techTaskNumber = this.techDuty.length;
this.updateParams.operateTaskNumber = this.operateDuty.length;
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.updateParams = {} as any
this.showUpdate = !!goOn;
//
this.initData();
if (!!goOn === true) {
//
this.getMajorhazardList()
this.buildUpdateForm()
}
this.getTableData();
})
}
}
public initData() {
this.mainDuty = [];
this.techDuty = [];
this.operateDuty = [];
}
public showModal(row, isReadonly) {
if (isReadonly) {
this.isReadonly = true
} else {
this.isReadonly = false
}
if (!this.taskTypeMap[row.type]) {
this.initSelectList()
}
this.taskType = this.$store.state.prevention_task_type;
this.unitMap = this.$store.getters.prevention_cycle_unit_map;
this.updateParams = row;
this.majorHazard = this.$store.state.prevention_risk_source;
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard);
this.updateParams.majorHazardName = this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
if (row.resourceId) {
this.tableService.getFileUrls({ ids: row.resourceId.split(",") }).then((files: any) => {
this.fileList = files.data.map(item => {
return {
name: item.originalName,
url: item.url,
type: item.type,
id: item.id
}
})
this.updateParams.resourceId = ''
this.buildUpdateForm()
})
}
this.tableService.selectDutyDetailList({ taskId: row.id }).then((res: any) => {
if (res.code === 200) {
this.mainDuty = res.data[1]
this.mainDuty.forEach((item: any) => {
item.type = 1;
if (!isReadonly) {
item.dutyContent = item.dutyContent.toString();
}
})
this.techDuty = res.data[2]
this.techDuty.forEach((item: any) => {
item.type = 2;
if (!isReadonly) {
item.dutyContent = item.dutyContent.toString();
}
})
this.operateDuty = res.data[3]
this.operateDuty.forEach((item: any) => {
item.type = 3;
if (!isReadonly) {
item.dutyContent = item.dutyContent.toString();
}
})
}
})
this.buildUpdateForm()
this.showUpdate = true
}
public rowCallback(el, data) {
let type: any;
if (el.target.classList.contains("mainDuty")) {
type = 1
} else if (el.target.classList.contains("techDuty")) {
type = 2
} else if (el.target.classList.contains("operateDuty")) {
type = 3
}
if (type) {
if (!this.taskTypeMap[type]) {
this.initSelectList()
}
this.tableService.selectDutyDetailList({ taskId: data.id, type: type }).then((res: any) => {
if (res.code === 200) {
this.tasksListData = res.data[type];
this.tasksListData.forEach((item, index) => {
item.index = index + 1;
item.dutyContent = item.dutyContent.toString();
})
}
})
this.showProtable = true
}
}
public initSelectList() {
this.$store.state.prevention_task_type.forEach((item, index) => {
if (index !== 0) {
if (!this.taskTypeMap[index]) {
this.taskTypeMap[index] = {}
}
item.children.forEach((children) => {
this.taskTypeMap[index][children.dictValue] = children.dictLabel
})
}
})
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" scoped >
::v-deep {
.duty-form {
max-height: 780px;
overflow: hidden;
overflow-y: auto;
.el-form-item__content {
margin-left: 0px !important;
display: flex;
align-items: center;
margin-bottom: 20px;
.form-group-name {
width: calc(100% - 80px);
display: inline-flex;
margin-right: 20px;
.form-label {
width: 110px;
text-align: right;
white-space: nowrap;
flex: none;
height: 40px;
align-self: flex-start;
line-height: 40px;
margin-right: 15px
}
.form-content {
position: relative;
flex: 1;
display: flex;
align-items: center;
}
}
.el-textarea {
position: relative;
vertical-align: bottom;
font-size: 14px;
padding-right: 10px;
}
.form-group-img {
display: flex;
flex-direction: column;
justify-content: center;
width: 44px;
}
.icon {
width: calc(50% - 20px);
}
.el-icon-error {
color: #F56C6C;
float: right;
margin-right: 20px;
font-size: 24px;
margin-top: 8px;
}
.el-icon-error:hover {
color: #fd8080;
font-size: 24px;
}
.el-icon-circle-plus {
color: #409EFF;
float: right;
margin-right: 5px;
font-size: 24px;
}
.el-icon-circle-plus:hover {
color: #66b1ff;
font-size: 24px;
}
.form-group-step {
width: calc(100% - 20px);
display: inline-flex;
margin-right: 20px;
margin-bottom: 20px;
.form-label {
width: 110px;
text-align: right;
white-space: nowrap;
flex: none;
height: 40px;
align-self: flex-start;
line-height: 40px;
margin-right: 15px
}
.form-content {
position: relative;
flex: 1;
display: flex;
align-items: center;
}
}
}
.form-group {
display: inline-flex;
margin-right: 20px;
margin-bottom: 20px;
width: calc(100% - 20px);
.form-label {
width: 110px;
text-align: right;
white-space: nowrap;
flex: none;
height: 40px;
align-self: flex-start;
line-height: 40px;
margin-right: 15px
}
.form-content {
position: relative;
flex: 1;
display: flex;
align-items: center
}
}
}
}
.item {
margin-top: 10px;
margin-right: 40px;
}
.showTip {
background-color: #f56c6c;
border-radius: 10px;
color: #fff;
display: inline-block;
font-size: 12px;
height: 8px;
width: 8px;
padding: 0;
margin-right: 3px;
text-align: center;
white-space: nowrap;
border: 1px solid #fff;
}
</style>

View File

@ -0,0 +1,93 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" fixed label="全选" width="60">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :show-overflow-tooltip="item.showTip"
:width="item.width" :key="item.key">
<div :class="item.showTip ?'column-cell-render' :''" slot-scope="scope"
v-html="item.render(scope.row)" :filters="item.filters"
:filter-method="item.filterMethod" @click="rowCallback($event,scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip">
</el-table-column>
</template>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
<el-button type="text" @click="showModal(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="isReadonly?'详情':updateParams.id ?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" ref="basicForm">
</FormComponent>
<div class="sub-title">重大危险源主要负责人安全职责</div>
<el-form :model="secureDutyForm" ref="secureDutyForm" label-width="100px" class="duty-form">
<el-form-item v-for="(domain, index) in secureDutyForm.mainDuty" :label="domain.label" :key="domain.key"
:prop="'mainDuty.' + index + '.dutyValue'"
:rules="{required: true, message: '主要负责人安全职责不能为空', trigger: 'blur'}">
<el-input :disabled="isReadonly" type="textarea" row="2" v-model="domain.dutyValue" placeholder="请输入职责"></el-input>
<div class="form-group-img" v-if="!isReadonly">
<i class="el-icon-circle-plus" @click="dutyOperate(domain,'mainDuty','add')"></i>
<i class="el-icon-error" v-if="index !==0" @click="dutyOperate(domain,'mainDuty','delete')"></i>
</div>
</el-form-item>
<div class="sub-title">重大危险源技术负责人安全职责</div>
<el-form-item v-for="(domain, index) in secureDutyForm.techDuty" :label="domain.label" :key="domain.key"
:prop="'techDuty.' + index + '.dutyValue'"
:rules="{required: true, message: '主要负责人安全职责不能为空', trigger: 'blur'}">
<el-input :disabled="isReadonly" type="textarea" row="2" v-model="domain.dutyValue" placeholder="请输入职责"></el-input>
<div class="form-group-img" v-if="!isReadonly">
<i class="el-icon-circle-plus" @click="dutyOperate(domain,'techDuty','add')"></i>
<i class="el-icon-error" v-if="index !==0" @click="dutyOperate(domain,'techDuty','delete')"></i>
</div>
</el-form-item>
<div class="sub-title">重大危险源操作负责人安全职责</div>
<el-form-item v-for="(domain, index) in secureDutyForm.operateDuty" :label="domain.label" :key="domain.key"
:prop="'operateDuty.' + index + '.dutyValue'"
:rules="{required: true, message: '主要负责人安全职责不能为空', trigger: 'blur'}">
<el-input :disabled="isReadonly" type="textarea" row="2" v-model="domain.dutyValue" placeholder="请输入职责"></el-input>
<div class="form-group-img" v-if="!isReadonly">
<i class="el-icon-circle-plus" @click="dutyOperate(domain,'operateDuty','add')"></i>
<i class="el-icon-error" v-if="index !==0" @click="dutyOperate(domain,'operateDuty','delete')"></i>
</div>
</el-form-item>
</el-form>
<ButtonListComponent :actions="!isReadonly ? updateActions :[]" @callback="subCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
width="680px">
<img :src="currentUrl" style="width: 100%;" alt="">
</el-dialog>
</div>

View File

@ -0,0 +1,705 @@
<script lang="ts">
import { Component, Watch } from 'vue-property-decorator';
import template from './majorHazard.component.html'
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
import FormComponent from "hbt-common/components/common/form.component.vue";
import TableComponent from "hbt-common/components/common/table.component.vue";
import majorHazardService from "@/service/majorHazard.service";
import FormOption from "hbt-common/models/formOptions";
import BtnOption from "hbt-common/models/btnOptions";
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import maintenanceInfoService from "@/service/maintenanceInfo.service"
@Component({
template,
components: {
FormComponent,
TableComponent,
ButtonListComponent
},
})
export default class MajorHazard extends BaseRecordComponent<any> {
public tableService = new majorHazardService();
public MaintenanceInfoService = new maintenanceInfoService()
public params = {
majorHazard: null,
} as any;
public tableColumn = [] as any;
public updateParams = {} as any;
public selectData = [];
public isReadonly = false;
public fileList = [] as any;
public showFile = false;
public currentUrl = null;
public showUpdate = false;
public setpsOptions = [] as any;
public showFileList = [] as any;
public companyList = [] as any;
public companyListMap = {} as any;
public labelWidth = '130px'
public formActions = [{
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "重大危险源",
key: "majorHazard",
type: "select",
datas: this.$store.state.prevention_risk_source,
},];
public subActions = [{
name: "取消",
value: "cancel"
}];
public majorHazardLevel = [{
name: '一级重大危险源',
value: 1,
}, {
name: '二级重大危险源',
value: 2,
}, {
name: '三级重大危险源',
value: 3,
}, {
name: '四级重大危险源',
value: 4,
}];
public majorHazardLevelMap = ['', '一级重大危险源', '二级重大危险源', '三级重大危险源', '四级重大危险源']
public updateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public updateStepsOptions: FormOption<BtnOption>[] = [] as any;
//
public secureDutyForm = {
mainDuty: [{ label: '(一)', key: 1, index: 1, dutyValue: "" }],//
techDuty: [{ label: '(一)', key: 2, index: 1, dutyValue: "" }],//
operateDuty: [{ label: '(一)', key: 3, index: 1, dutyValue: "" }],//
};
public buildUpdateForm() {
this.updateOptions = [{
name: "企业名称",
type: "select",
key: "companyId",
format: "companyName",
require: true,
width: "100%",
showError: false,
datas: this.companyList,
},
{
name: "重大危险源名称",
type: "select",
key: "majorHazard",
format: "majorHazardName",
require: true,
width: "100%",
showError: false,
datas: this.$store.state.prevention_risk_source,
},
{
name: "重大危险源等级",
type: "select",
key: "majorHazardLevel",
format: "majorHazardLevelName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.majorHazardLevel,
},
{
name: "R值",
type: "number",
key: "majorHazardRValue",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "主要负责人",
type: "select",
key: "mainUserId",
format: "mainUserName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "mainUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
]
},
{
name: "技术负责人",
type: "select",
key: "techUserId",
format: "techUserName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "techUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
]
},
{
name: "操作负责人",
type: "select",
key: "operateUserId",
format: "operateUserName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "operateUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
]
},
{
name: "附件",
key: "resourceId",
ref: "file",
type: "upload",
width: "100%",
showError: false,
onSucess: this.onSuccess,
onMove: this.onRemove,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
fileList: this.fileList,
btn: [{
name: "上传附件",
value: "upload",
hide: this.isReadonly,
size: "small",
type: "primary"
}]
},
];
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() {
//
this.getCompanyList()
}
public getCompanyList() {
this.MaintenanceInfoService.selectCompany({}).then((res: any) => {
console.log('res', res);
res.data.forEach((item) => {
this.companyListMap[item.id] = item.name
let tmpData = {} as any;
tmpData.name = item.name;
tmpData.value = item.id;
this.companyList.push(tmpData)
})
})
}
public changes(data, item) {
//
}
public buildTable() {
this.tableColumn.push({ name: '企业名称', key: "companyName", });
this.tableColumn.push({
name: '重大危险源名称', key: "majorHazard", render: (data) => {
let majorHazard = parseInt(data.majorHazard)
return this.$store.getters.prevention_risk_source_map[majorHazard]
}
});
this.tableColumn.push({
name: '重大危险源等级', key: "majorHazardLevel", render: (data) => {
return this.majorHazardLevelMap[data.majorHazardLevel]
}
});
this.tableColumn.push({ name: 'R值', key: "majorHazardRValue", });
this.tableColumn.push({ name: '主要负责人', key: "mainUserName", width: "150px", });
this.tableColumn.push({ name: '技术负责人', key: "techUserName", });
this.tableColumn.push({ name: '操作负责人', key: "operateUserName", });
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
this.updateParams = {} as any;
this.isReadonly = false;
this.fileList = [] as any;
this.buildUpdateForm()
//
this.initDutyMethod()
this.showUpdate = true;
}
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any;
})
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
public handleClose() {
this.showUpdate = false;
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public onSuccess(res, file, fileList) {
if (res.code === 200) {
this.fileList.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
} else {
this.$message.error(res.msg);
}
}
public onRemove(file, fileList) {
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
}
public onPreview(file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url;
this.showFile = true;
} else {
window.open(file.url, "_blank")
}
}
public subCallback(data) {
if (data.value === "cancel") {
this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
}
}
//
public handleDataMethod() {
if (this.fileList.length > 0) {
let resourceId = this.fileList.map((item) => {
return item.id;
});
let resourceName = this.fileList.map((item) => {
return item.name;
});
this.updateParams.resourceId = resourceId.join(",");
this.updateParams.resourceName = resourceName.join(",");
}
this.updateParams.companyName = this.companyListMap[this.updateParams.companyId]
this.updateParams.techUserName = this.$store.getters.user_map[this.updateParams.techUserId];
this.updateParams.operateUserName = this.$store.getters.user_map[this.updateParams.operateUserId];
this.updateParams.mainUserName = this.$store.getters.user_map[this.updateParams.mainUserId];
this.updateParams.operateDuty = JSON.stringify(this.secureDutyForm.operateDuty);
this.updateParams.mainDuty = JSON.stringify(this.secureDutyForm.mainDuty);
this.updateParams.techDuty = JSON.stringify(this.secureDutyForm.techDuty);
}
//
public doSave(goOn?) {
let vaildStatus = true;
if (!(this.$refs.basicForm as any).vaildParams()) {
vaildStatus = false
}
(this.$refs.secureDutyForm as any).validate((valid) => {
if (!valid) {
vaildStatus = false;
}
});
if (vaildStatus === true) {
//
//
this.handleDataMethod();
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.updateParams = {} as any
this.showUpdate = !!goOn;
this.getTableData();
this.initDutyMethod();
})
}
}
//
public initDutyMethod() {
this.secureDutyForm = {
mainDuty: [{ label: '(一)', key: 1, index: 1, dutyValue: "" }],
techDuty: [{ label: '(一)', key: 2, index: 1, dutyValue: "" }],
operateDuty: [{ label: '(一)', key: 3, index: 1, dutyValue: "" }],
};
}
public showModal(row, isReadonly) {
if (isReadonly) {
this.isReadonly = true
} else {
this.isReadonly = false
}
this.updateParams = row;
this.secureDutyForm.mainDuty = JSON.parse(row.mainDuty);
this.secureDutyForm.techDuty = JSON.parse(row.techDuty);
this.secureDutyForm.operateDuty = JSON.parse(row.operateDuty);
this.updateParams.majorHazardLevelName = this.majorHazardLevelMap[this.updateParams.majorHazardLevel];
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
this.updateParams.majorHazardName = this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
if (row.resourceId) {
this.tableService.getFileUrls({ ids: row.resourceId.split(",") }).then((files: any) => {
this.fileList = files.data.map(item => {
return {
name: item.originalName,
url: item.url,
type: item.type,
id: item.id
}
})
this.updateParams.resourceId = ''
this.buildUpdateForm()
})
}
this.buildUpdateForm()
this.showUpdate = true
}
//
public dutyOperate(row, type, operate) {
if (operate === 'add') {
let tmpDuty = {} as any;
tmpDuty.key = Math.random().toString().split(".")[1];
tmpDuty.index = this.secureDutyForm[type].length + 1
tmpDuty.label = '' + this.arabicToChinese(tmpDuty.index) + ''
this.secureDutyForm[type].push(tmpDuty)
} else if (operate === 'delete') {
this.secureDutyForm[type].splice(this.secureDutyForm[type].findIndex((item: any) => item.key === row.key), 1)
this.secureDutyForm[type].forEach((item, index) => {
item.key = Math.random().toString().split(".")[1]
item.index = index + 1
item.label = '' + this.arabicToChinese(item.index) + ''
})
}
}
//
public arabicToChinese(num) {
let digit = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
let unit = ['', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千', '万', '十', '百', '千', '亿'];//
if (!num || isNaN(num)) {
return "零";
}
let english = num.toString().split("")
let result = "";
for (let i = 0; i < english.length; i++) {
let des_i = english.length - 1 - i;//
result = unit[i] + result;
let digit_index = english[des_i];
result = digit[digit_index] + result;
}
//
result = result.replace(/零(千|百|十)/g, '零').replace(/十零/g, '十');
//
result = result.replace(/零+/g, '零');
//亿亿
result = result.replace(/零亿/g, '亿').replace(/零万/g, '万');
//亿亿
result = result.replace(/亿万/g, '亿');
//
result = result.replace(/零+$/, '')
//
//result = result.replace(//g, '');//
//
result = result.replace(/^一十/g, '十');
return result;
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" scoped >
::v-deep {
.duty-form {
max-height: 780px;
overflow: hidden;
overflow-y: auto;
.el-form-item__content {
margin-left: 0px !important;
display: flex;
align-items: center;
margin-bottom: 20px;
.form-group-name {
width: calc(100% - 80px);
display: inline-flex;
margin-right: 20px;
.form-label {
width: 110px;
text-align: right;
white-space: nowrap;
flex: none;
height: 40px;
align-self: flex-start;
line-height: 40px;
margin-right: 15px
}
.form-content {
position: relative;
flex: 1;
display: flex;
align-items: center;
}
}
.el-textarea {
position: relative;
vertical-align: bottom;
font-size: 14px;
padding-right: 10px;
}
.form-group-img {
display: flex;
flex-direction: column;
justify-content: center;
width: 44px;
}
.icon {
width: calc(50% - 20px);
}
.el-icon-error {
color: #F56C6C;
float: right;
margin-right: 20px;
font-size: 24px;
margin-top: 8px;
}
.el-icon-error:hover {
color: #fd8080;
font-size: 24px;
}
.el-icon-circle-plus {
color: #409EFF;
float: right;
margin-right: 5px;
font-size: 24px;
}
.el-icon-circle-plus:hover {
color: #66b1ff;
font-size: 24px;
}
.form-group-step {
width: calc(100% - 20px);
display: inline-flex;
margin-right: 20px;
margin-bottom: 20px;
.form-label {
width: 110px;
text-align: right;
white-space: nowrap;
flex: none;
height: 40px;
align-self: flex-start;
line-height: 40px;
margin-right: 15px
}
.form-content {
position: relative;
flex: 1;
display: flex;
align-items: center;
}
}
}
.form-group {
display: inline-flex;
margin-right: 20px;
margin-bottom: 20px;
width: calc(100% - 20px);
.form-label {
width: 110px;
text-align: right;
white-space: nowrap;
flex: none;
height: 40px;
align-self: flex-start;
line-height: 40px;
margin-right: 15px
}
.form-content {
position: relative;
flex: 1;
display: flex;
align-items: center
}
}
}
}
</style>

View File

@ -257,6 +257,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
labelWidth: "140px", labelWidth: "140px",
require: true, require: true,
showError: false, showError: false,
disable: this.updateParams.id && this.updateParams.status !== 1,
datas: [{ datas: [{
name: "不涉及", name: "不涉及",
disable: false, disable: false,
@ -858,6 +859,16 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
// //
public doSave(goOn?) { public doSave(goOn?) {
let judgmentStatus = false as any;
this.updateParams.items.forEach((item) => {
if (!item.status) {
judgmentStatus = true
}
})
if (judgmentStatus === true) {
this.$message.error("您有评价项未评价,请您先完成评价!");
return
}
// //
//\ //\
if ((this.$refs.basicForm as any).vaildParams()) { if ((this.$refs.basicForm as any).vaildParams()) {
@ -866,6 +877,14 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id || this.updateParams.status === 1 ? true : false).then((res) => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id || this.updateParams.status === 1 ? true : false).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.updateParams = {
majorSign: [],
items: [],
evaluateTime: moment().format('YYYY-MM-DD'),
evaluateUserId: this.account.userId,
evaluateUserName: this.account.nickName,
} as any;
this.buildUpdateForm();
this.getTableData(); this.getTableData();
}) })
} }
@ -881,6 +900,14 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => { this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.showUpdate = false; this.showUpdate = false;
this.updateParams = {
majorSign: [],
items: [],
evaluateTime: moment().format('YYYY-MM-DD'),
evaluateUserId: this.account.userId,
evaluateUserName: this.account.nickName,
} as any;
this.buildUpdateForm();
this.getTableData(); this.getTableData();
}) })
} }

View File

@ -129,24 +129,4 @@
<span class="end-title">结束</span> <span class="end-title">结束</span>
</el-steps> </el-steps>
</el-dialog> </el-dialog>
<!-- <el-dialog :close-on-click-modal="false" title="作业步骤" :show-close="false" :visible.sync="showProtable"
width="940px">
<FormComponent labelWidth="110px" labelAlign="right" :actions="proActions" @actionCallback="proCallback"
:full-btn="true" btnPosition="center">
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" max-height="500"
border style="width: 100%">
<template v-for="item in proTableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
</el-table>
</TableComponent>
</FormComponent>
</el-dialog> -->
</div> </div>

View File

@ -162,6 +162,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
public riskLevelMap = {} as any; public riskLevelMap = {} as any;
public buildUpdateForm() { public buildUpdateForm() {
console.log(this.updateParams.id && this.updateParams.status !== 1,);
this.updateOptions = [{ this.updateOptions = [{
name: "区域名称", name: "区域名称",
key: "areaId", key: "areaId",
@ -259,9 +261,11 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
width: "calc(100% - 20px)", width: "calc(100% - 20px)",
require: true, require: true,
showError: false, showError: false,
disable: this.updateParams.id && this.updateParams.status !== 1,
datas: [{ datas: [{
name: "不涉及", name: "不涉及",
value: 0 value: 0,
}, { }, {
name: "重大危险源", name: "重大危险源",
disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0), disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0),
@ -848,8 +852,13 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
// //
public getAreaRiskLevel(res: any) { public getAreaRiskLevel(res: any) {
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel']; if (this.areaList.length > 0) {
this.updateParams.analRiskLevel = areaAnalRiskLevel; let tmpAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId);
if (tmpAnalRiskLevel.length > 0) {
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'];
this.updateParams.analRiskLevel = areaAnalRiskLevel;
}
}
} }
public handleClose() { public handleClose() {
@ -866,14 +875,33 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
// //
public doSave(goOn?) { public doSave(goOn?) {
let judgmentStatus = false as any;
this.updateParams.steps.forEach((item) => {
if (!item.status) {
judgmentStatus = true
}
})
if (judgmentStatus === true) {
this.$message.error("您有评价项未评价,请您先完成评价!");
return
}
// //
// //
if ((this.$refs.basicForm as any).vaildParams()) { if ((this.$refs.basicForm as any).vaildParams()) {
if ((this.$refs.riskForm as any).vaildParams()) { if ((this.$refs.riskForm as any).vaildParams()) {
this.saveTransformData(); this.saveTransformData();
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id || this.updateParams.status === 1 ? true : false).then((res) => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id || this.updateParams.status === 1 ? true : false).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.updateParams = {
majorSign: [],
steps: [],
evaluateTime: moment().format('YYYY-MM-DD'),
evaluateUserId: this.account.userId,
evaluateUserName: this.account.nickName,
} as any;
this.buildUpdateForm();
this.getTableData(); this.getTableData();
}) })
} }
@ -889,6 +917,14 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => { this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.showUpdate = false; this.showUpdate = false;
this.updateParams = {
majorSign: [],
steps: [],
evaluateTime: moment().format('YYYY-MM-DD'),
evaluateUserId: this.account.userId,
evaluateUserName: this.account.nickName,
} as any;
this.buildUpdateForm();
this.getTableData(); this.getTableData();
}) })
} }

View File

@ -83,7 +83,8 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
public currentUrl = null; public currentUrl = null;
// //
public sortAttribute = { public sortAttribute = {
submitTime: "submit_time" taskStartTime: "task_start_time",
taskEndTime: "task_end_time",
} as any; } as any;
public account = JSON.parse(localStorage.getItem("account") as any); public account = JSON.parse(localStorage.getItem("account") as any);
@ -266,7 +267,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
this.tableColumn.push({ name: '排查时间', key: "endTime" }); this.tableColumn.push({ name: '排查时间', key: "endTime" });
this.tableColumn.push({ name: '责任人', key: "taskChargeUserName" }); this.tableColumn.push({ name: '责任人', key: "taskChargeUserName" });
this.tableColumn.push({ name: '开始时间', key: "taskStartTime", sortable: 'custom' }); this.tableColumn.push({ name: '开始时间', key: "taskStartTime", sortable: 'custom' });
this.tableColumn.push({ name: '截止时间', key: "taskEndTime", }); this.tableColumn.push({ name: '截止时间', key: "taskEndTime", sortable: 'custom' });
this.tableColumn.push({ this.tableColumn.push({
name: '任务状态', width: "110px", key: "status", render: (data) => { name: '任务状态', width: "110px", key: "status", render: (data) => {
if (data.status == 2) { if (data.status == 2) {

View File

@ -12,7 +12,7 @@
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')" @actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions"> @pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked" <el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%" highlight-current-row> style="width: 100%" highlight-current-row @selection-change="handleSelectionChange">
<el-table-column type="selection" fixed label="全选" width="60"> <el-table-column type="selection" fixed label="全选" width="60">
</el-table-column> </el-table-column>
<el-table-column label="序号" width="60"> <el-table-column label="序号" width="60">
@ -22,12 +22,12 @@
</el-table-column> </el-table-column>
<template v-for="item in tableColumn"> <template v-for="item in tableColumn">
<el-table-column class="cursor td-content" v-if="item.render" :label="item.name" <el-table-column class="cursor td-content" v-if="item.render" :label="item.name"
:width="item.width" :key="item.key" :filters="item.filters" :filter-multiple="false" :width="item.width" :key="item.key" :filters="item.filters"
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"> :filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip">
<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>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key" <el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod" :filter-multiple="false" :filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip" class="cursor td-content"> :show-overflow-tooltip="item.showTip" class="cursor td-content">
</el-table-column> </el-table-column>
</template> </template>
@ -44,7 +44,8 @@
</div> </div>
<!-- 查看执行记录 --> <!-- 查看执行记录 -->
<el-dialog :close-on-click-modal="false" :show-close="false" :visible.sync="showProtable" width="940px" destroy-on-close> <el-dialog :close-on-click-modal="false" :show-close="false" :visible.sync="showProtable" width="940px"
destroy-on-close>
<TableComponent :tableData="currentProTableData.datas" :tableColumn="proTableColumn" :showFooter="false" <TableComponent :tableData="currentProTableData.datas" :tableColumn="proTableColumn" :showFooter="false"
style="margin-bottom: 20px;"> style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border <el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border

View File

@ -350,6 +350,8 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
} }
//-- //--
public doUpdate() { public doUpdate() {
console.log('selectData',this.selectData);
if (this.selectData && this.selectData.length > 0) { if (this.selectData && this.selectData.length > 0) {
this.filterStatusData = this.selectData[0]['status'] this.filterStatusData = this.selectData[0]['status']
const tmpSelectData = this.selectData.filter((item) => item.status !== this.filterStatusData) const tmpSelectData = this.selectData.filter((item) => item.status !== this.filterStatusData)
@ -416,6 +418,8 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
} }
public handleSelectionChange(data) { public handleSelectionChange(data) {
console.log('data',data);
this.selectData = data; this.selectData = data;
} }

View File

@ -0,0 +1,67 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" fixed label="全选" width="60">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div :class="item.showTip ?'column-cell-render' :''" slot-scope="scope"
v-html="item.render(scope.row)" :filters="item.filters"
:filter-method="item.filterMethod" @click="showDetails($event,scope.row)"></div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip">
</el-table-column>
</template>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
<el-button type="text" @click="showModal(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="isReadonly?'详情':updateParams.id?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
:full-btn="true" btnPosition="center">
</FormComponent>
</el-dialog>
<el-dialog v-if="showMap" :close-on-click-modal="false" destroy-on-close title="地图定位" :visible.sync="showMap"
width="980px" :before-close="handleClose" destroy-on-close>
<MapComponent @onLoad="getMap"></MapComponent>
<div class="full" style="margin-top: 20px; text-align: center;">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="onDragEnd">确定</el-button>
</div>
</el-dialog>
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
width="680px">
<img :src="currentUrl" style="width: 100%;" alt="">
</el-dialog>
</div>

View File

@ -0,0 +1,932 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from './businessInfo.component.html';
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
import FormComponent from "hbt-common/components/common/form.component.vue";
import TableComponent from "hbt-common/components/common/table.component.vue";
import BusinessInfoService from "@/service/businessInfo.service";
import FormOption from "hbt-common/models/formOptions";
import BtnOption from "hbt-common/models/btnOptions";
import { Base64 } from 'js-base64';
import mapboxgl from "mapbox-gl";
import MapComponent from "@/components/map.component.vue"
@Component({
template,
components: {
FormComponent,
TableComponent,
MapComponent
},
})
export default class BusinessInfo extends BaseRecordComponent<any> {
public tableService = new BusinessInfoService();
public params = {
name: null,
} as any;
public showProtable = false;
public tableColumn = [] as any;
public showUpdate = false;
public updateParams = {
majorSign: [],
} as any;
public subUpdateParams = {} as any;
public selectData = [];
public subSelectData = [];
public isReadonly = false;
public subIsReadonly = false;
public fileList1 = [] as any;
public fileList2 = [] as any;
public showFile = false;
public currentUrl = null;
public subShowUpdate = false;
public subTitle = '成员信息'
public currentDetailsTableData = { datas: [] } as any;
public showDetailsTable = false;
public showFileModal = false;
public showFileList = [] as any;
public showMap = false;
public center = [118.751353, 31.969568];
public marker: any;
public map: any;
public formActions = [{
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "企业名称",
key: "name",
type: "text",
},];
public subActions = [{
name: "取消",
value: "cancel"
}];
public updateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() {
this.updateOptions = [{
name: "企业名称",
type: "text",
key: "name",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "上级单位",
type: "text",
key: "parentId",
require: false,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "统一社会信用代码",
type: "text",
key: "socialCode",
require: true,
width: "100%",
showError: false,
},
{
name: "法定代表人",
type: "select",
key: "legalLeaderId",
format: 'legalLeaderName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "成立日期",
type: "date",
key: "establishDate",
require: true,
width: "calc(50% - 20px)",
showError: false,
format: "yyyy-MM-dd"
},
{
name: "企业性质",
type: "select",
key: "nature",
format: 'natureName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.prevention_enterprise_nature,
},
{
name: "企业规模",
type: "select",
key: "scale",
format: 'scaleName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.prevention_enterprise_size,
},
{
name: "员工总数",
key: "staffNum",
type: "number",
width: "calc(50% - 20px)",
require: true,
showError: false,
},
{
name: "主要负责人",
type: "select",
key: "chargeUserId",
format: 'chargeUserName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "监管行业大类",
type: "select",
key: "superviseClassify",
format: 'superviseClassifyName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.prevention_regulatory_category,
},
{
name: "监管小类",
type: "select",
key: "superviseSubClassify",
format: 'superviseSubClassifyName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.prevention_regulatory_subcategories,
},
{
name: "行政区划",
type: "text",
key: "regionDivision",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "地理位置",
key: "geoJson",
type: "btn",
// width: "calc(0% + 20px)",
require: true,
showError: false,
unit: {
type: "btn",
name: this.isReadonly ? "查看定位" : "点击定位",
value: "fixed",
btnType: "primary"
}
},
{
name: "登记机关",
type: "text",
key: "registrationAuthority",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "登记状态",
type: "select",
key: "registrationStatus",
format: "registrationStatusName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.prevention_registration_status,
},
{
name: "核准日期",
key: "approvalDate",
type: "date",
format: "yyyy-MM-dd",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "营业期限至",
key: "termDate",
type: "date",
format: "yyyy-MM-dd",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "企业联系人",
type: "select",
key: "contactUserId",
format: 'contactUserName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "contactUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "注册资本(万元)",
type: "number",
key: "registerCapital",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "占地面积(㎡)",
type: "number",
key: "coverArea",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "经营范围",
type: "textarea",
key: "businessScope",
require: true,
width: "100%",
showError: false,
},
{
name: "安全管理机构设置",
type: "select",
key: "securityManagementFlag",
format: "securityManagementFlagName",
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: [{
name: '已设置',
value: 1,
}, {
name: '未设置',
value: 0,
}]
},
{
name: "安全管理从业数量",
type: "number",
key: "securityManagementNum",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "安全管理负责人",
type: "select",
key: "securityUserId",
format: 'securityUserName',
require: true,
width: "calc(50% - 20px)",
showError: false,
datas: this.$store.state.userList,
},
{
name: "联系方式",
type: "text",
key: "securityUserPhone",
require: true,
width: "calc(50% - 20px)",
showError: false,
},
{
name: "安标创建情况",
type: "select",
key: "safetyLabelStatus",
format: 'safetyLabelStatusName',
require: true,
width: "100%",
showError: false,
datas: this.$store.state.prevention_safety_label,
},
{
name: "两大一重情况",
key: "majorSign",
format: "majorSignName",
type: "checkbox",
width: "calc(100% - 20px)",
labelWidth: "140px",
require: true,
showError: false,
datas: [{
name: "不涉及",
disable: false,
value: 0
}, {
name: "重大危险源",
disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0),
value: 1
}, {
name: "重大监管化工工艺",
disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0),
value: 2
}, {
name: "重点监管危化品",
disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0),
value: 3
}],
},
{
name: "企业平面图",
key: "file1",
ref: "file",
type: "upload",
width: "calc(50% - 20px)",
showError: false,
onSucess: this.onSuccess1,
onMove: this.onRemove1,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
fileList: this.fileList1,
btn: [{
name: "上传附件",
value: "upload",
hide: this.isReadonly,
size: "small",
type: "primary"
}]
},
{
name: "企业组织机构",
key: "file2",
ref: "file",
type: "upload",
width: "calc(50% - 20px)",
showError: false,
onSucess: this.onSuccess2,
onMove: this.onRemove2,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
fileList: this.fileList2,
btn: [{
name: "上传附件",
value: "upload",
hide: this.isReadonly,
size: "small",
type: "primary"
}]
},
];
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() {
//
}
public buildTable() {
this.tableColumn.push({ name: '企业名称', key: "name", });
this.tableColumn.push({ name: '企业负责人', key: "contactUserName", });
this.tableColumn.push({
name: '企业性质', key: "nature", render: (data) => {
return this.$store.getters.prevention_enterprise_nature_map[data.nature]
}
});
this.tableColumn.push({ name: '安全负责人', key: "securityUserName", });
this.tableColumn.push({ name: '所在行政区划', key: "regionDivision", });
this.tableColumn.push({
name: '状态', key: "registrationStatus", render: (data) => {
return this.$store.getters.prevention_registration_status_map[data.registrationStatus]
}
});
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
// this.buildUpdateForm()
this.isReadonly = false
this.subIsReadonly = false
this.updateParams = {
majorSign: [],
geoJson: JSON.stringify(this.center)
} as any;
this.fileList1 = [] as any;
this.fileList2 = [] as any;
this.buildUpdateForm();
this.showUpdate = true
}
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any;
})
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
public getMap(map) {
this.map = map;
this.addMarker();
}
public addMarker() {
this.marker = new mapboxgl.Marker({ draggable: !this.isReadonly })
.setLngLat(this.center)
.addTo(this.map);
this.map.flyTo({ center: this.center })
}
public onDragEnd() {
const lngLat = this.marker.getLngLat();
this.updateParams.locationLng = lngLat.lng;
this.updateParams.locationLat = lngLat.lat;
this.center = [lngLat.lng, lngLat.lat];
this.updateParams.geoJson = JSON.stringify(this.center)
// this.updateParams.locationName = lngLat.lng+","+lngLat.lat;
this.handleClose()
}
public doSave(goOn?) {
//
if (this.fileList1.length > 0) {
let resourceId = this.fileList1.map((item) => {
return item.id
})
let resourceName = this.fileList1.map((item) => {
return item.name
})
this.updateParams.planViewResourceId = resourceId.join(",")
this.updateParams.planViewResourceName = resourceName.join(",")
}
if (this.fileList2.length > 0) {
let resourceId = this.fileList2.map((item) => {
return item.id
})
let resourceName = this.fileList2.map((item) => {
return item.name
})
this.updateParams.orgResourceId = resourceId.join(",")
this.updateParams.orgResourceName = resourceName.join(",")
}
//
this.updateParams.chargeUserName = this.$store.getters.user_map[this.updateParams.chargeUserId];
this.updateParams.contactUserName = this.$store.getters.user_map[this.updateParams.contactUserId];
this.updateParams.legalLeaderName = this.$store.getters.user_map[this.updateParams.legalLeaderId];
this.updateParams.securityUserName = this.$store.getters.user_map[this.updateParams.securityUserId];
this.updateParams.majorSign = this.updateParams.majorSign.join(",");
this.updateParams.geoJson = JSON.stringify(this.center)
// this.updateParams.memberNumber = this.updateParams.members.length
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.updateParams = {
majorSign: [],
} as any
this.showUpdate = !!goOn;
this.getTableData();
})
}
public showUpdateModel(id) {
this.showUpdate = true
}
public handleClose() {
if (this.showMap) {
this.showMap = false;
this.marker.remove();
this.marker = null;
return
}
if (this.showUpdate) {
this.showUpdate = false;
this.updateParams = {
majorHazard: [],
majorSign:[],
} as any;
return
}
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public handleSubSelectionChange(data) {
this.subSelectData = data;
}
public onPreview(file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url;
this.showFile = true;
} else {
window.open(file.url, "_blank")
}
}
public onSuccess1(res, file, fileList) {
if (res.code === 200) {
this.fileList1.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
} else {
this.$message.error(res.msg);
}
}
public onRemove1(file, fileList) {
this.fileList1.splice(this.fileList1.findIndex(item => item.id === file.response.data.id), 1)
}
public onSuccess2(res, file, fileList) {
if (res.code === 200) {
this.fileList2.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
} else {
this.$message.error(res.msg);
}
}
public onRemove2(file, fileList) {
this.fileList2.splice(this.fileList2.findIndex(item => item.id === file.response.data.id), 1)
}
public showModal(rowData, isReadonly) {
let row = JSON.parse(JSON.stringify(rowData))
if (isReadonly) {
this.isReadonly = true;
this.updateParams = Object.assign({
natureName: this.$store.getters.prevention_enterprise_nature_map[row.nature],
scaleName: this.$store.getters.prevention_enterprise_size_map[row.scale],
superviseClassifyName: this.$store.getters.prevention_regulatory_category_map[row.superviseClassify],
superviseSubClassifyName: this.$store.getters.prevention_regulatory_subcategories_map[row.superviseSubClassify],
registrationStatusName: this.$store.getters.prevention_registration_status_map[row.registrationStatus],
safetyLabelStatusName: this.$store.getters.prevention_safety_label_map[row.safetyLabelStatus],
majorSignName: !row.majorSign ? null : row.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","),
securityManagementFlagName: row.securityManagementFlag === 1 ? '已设置' : '未设置'
}, row)
} else {
this.isReadonly = false;
this.updateParams = row;
this.updateParams.majorSign = this.updateParams.majorSign.split(',').map((item) => parseInt(item))
}
//
if (row.planViewResourceId) {
this.tableService.getFileUrls({ ids: row.planViewResourceId.split(",") }).then((files: any) => {
this.fileList1 = files.data.map(item => {
return {
name: item.originalName,
url: item.url,
type: item.type,
id: item.id
}
})
this.buildUpdateForm()
})
}
//
if (row.orgResourceId) {
this.tableService.getFileUrls({ ids: row.orgResourceId.split(",") }).then((files: any) => {
this.fileList2 = files.data.map(item => {
return {
name: item.originalName,
url: item.url,
type: item.type,
id: item.id
}
})
this.buildUpdateForm()
})
}
this.buildUpdateForm()
this.showUpdate = true
}
public showDetails(el, row) {
const isTarget = el.target.classList.contains("memberNumber");
const isTargetResourceName = el.target.classList.contains("resourceName");
if (isTarget) {
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) {
this.currentDetailsTableData.datas = res.data.members
this.currentDetailsTableData.datas.forEach((item, index) => {
item.index = index + 1;
});
this.showDetailsTable = true
} else {
this.$message.error(res.msg);
}
})
}
if (isTargetResourceName) {
if (row.resourceId) {
this.tableService.getFileUrls({ ids: row.resourceId.split(",") }).then((files: any) => {
this.showFileList = files.data.map(item => {
return {
name: item.originalName,
url: item.url,
type: item.type,
id: item.id
}
})
this.showFileModal = true
})
}
}
}
public handleTableClose() {
this.showDetailsTable = false
}
public subCallback(data) {
if (data.value === "add") {
// this.buildSubForm()
this.subUpdateParams = {} as any;
this.subShowUpdate = true
} else if (data.value === "cancel") {
this.showUpdate = false
} else if (data.value === "fixed") {
this.showMap = true
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
}
}
//
public showSubModal(row, isReadonly) {
if (isReadonly) {
this.subIsReadonly = true
this.subUpdateParams = row
} else {
this.subIsReadonly = false
this.subUpdateParams = row
}
this.subShowUpdate = true
// this.buildSubForm()
}
//
public deleteSubData(indexs) {
this.$confirm('确认删除所选数据', '确认数据', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
for (let i = this.updateParams.members.length - 1; i >= 0; i--) {
if (indexs.includes(i)) {
this.updateParams.members.splice(i, 1)
}
}
this.updateParams.members.forEach((item, index) => {
item.index = index + 1;
});
}).catch(() => {
//
});
}
public changes(data, item) {
//
//
if (item && item.key === 'majorSign') {
if (!data) {
data = []
}
if (this.updateParams.majorSign.includes(0)) {
this.updateParams.majorSign = this.updateParams.majorSign.filter(item => item === 0)
data = this.updateParams.majorSign.filter(item => item === 0)
}
}
this.buildUpdateForm()
}
//
public previewFile(url, file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url;
this.showFile = true;
} else {
window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank")
}
}
//
public downLoadFile(url, file) {
let DownUrl = url;
fetch(DownUrl)
.then((response) => response.blob())
.then((res) => {
//
var index = DownUrl.lastIndexOf(".");
//
var fileType = DownUrl.substr(index + 1);
let blob = new Blob([res]);
const href = window.URL.createObjectURL(blob); //
const downloadElement = document.createElement("a");
downloadElement.href = href;
downloadElement.target = "_blank";
downloadElement.download = file.name;
document.body.appendChild(downloadElement);
downloadElement.click(); //
document.body.removeChild(downloadElement); //
window.URL.revokeObjectURL(href); // blob
});
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" >
.el-tooltip__popper {
max-width: 400px;
letter-spacing: 2px;
border-radius: 4px;
}
.el-tooltip__popper.is-dark {
background: #000000;
opacity: 0.8;
font-size: 12px;
font-weight: 400;
padding: 10px;
}
</style>
<style lang="scss" scoped>
.file-common-list {
width: 100%;
padding-bottom: 10px;
cursor: pointer;
display: flex;
align-items: center;
}
.column-cell-render {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.file-common-list:hover {
.el-icon-document {
color: #409eff
}
.file-list-name {
color: #409eff
}
}
</style>

View File

@ -0,0 +1,152 @@
<div class="common-box dis-flex ">
<div class="common-tree-box">
<CompanyTreeComponent @callback="handleNodeClick"></CompanyTreeComponent>
</div>
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" fixed label="全选" width="60">
</el-table-column>
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in tableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip">
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip">
</el-table-column>
</template>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</div>
</div>
<!-- 车间信息 -->
<el-dialog :close-on-click-modal="false" :title="isReadonly ?'详情':updateParams.id?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
:full-btn="true" btnPosition="center">
<div class="sub-title">班组信息</div>
<TableComponent :tableData="updateParams.teams" :tableColumn="subTableColumn"
@actionCallback="subCallback($event)" :actions="isReadonly ? groupTableActionsView:groupTableActions"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="updateParams.teams" tooltip-effect="dark" max-height="500" border
row-key="checked" style="width: 100%" @selection-change="handleSelectionTeamsChange">
<el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40">
</el-table-column>
<template v-for="item in subTableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
:label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="showSubModal(scope.row,true)">查看</el-button>
<el-button v-if="!isReadonly" type="text" @click="showSubModal(scope.row)">修改</el-button>
<el-button v-if="!isReadonly" type="text"
@click="deleteSubData([scope.row.index - 1])">删除</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
</el-dialog>
<!-- 班组信息 -->
<el-dialog :close-on-click-modal="false" :title="subIsReadonly?'详情':updateParams.id?'编辑': '新增'"
:visible.sync="subShowUpdate" width="952px" :before-close="subHandleClose" destroy-on-close>
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
:isReadonly="subIsReadonly" @actionCallback="triCallback" @change="changes" :actions="subUpdateActions"
:full-btn="true" btnPosition="center">
</FormComponent>
</el-dialog>
<!-- 风险点 -->
<el-dialog :close-on-click-modal="false" :title="'绑定风险点'" :visible.sync="showBindRisk" width="952px"
:before-close="subHandleRisksClose" destroy-on-close>
<div class="bind-risk">
<div class="risk-group">
<template v-for="(item,index) in updateParams.teams">
<div :class="(selected === index) ? 'click-risk-group-item': 'risk-group-item'"
@click="selectTeamGroups(index)">{{item.teamName}}</div>
</template>
</div>
<div class="bind-risk-content" v-if="updateParams.teams && updateParams.teams[selected]">
<div class="bind-risk-content-title" v-if="updateParams.teams[selected]['risks']">
已绑定 {{updateParams.teams[selected]['risks'].length}} 个风险点
</div>
<!-- 搜索-->
<template>
<el-input placeholder="请输入风险点" v-model="inputRisk" class="input-with-select"
@input="dataChange($event)" suffix-icon="el-icon-search">
</el-input>
</template>
<!-- 风险点展示 -->
<el-checkbox-group v-model="updateParams.teams[selected]['risks']">
<el-checkbox v-for="(item,index) in bindRiskGroup"
:disabled="isReadonly ? isReadonly: filterSelectedData(item,selected)" :label="item"
:key="index">{{item}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
<ButtonListComponent :actions="!isReadonly ? bindRiskActions :[]" @callback="bindRiskCallback"
btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
<!-- 显示风险点信息 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showProtable" width="940px"
destroy-on-close>
<el-table ref="multipleTable" :data="proTableData" height="100%" border row-key="checked" style="width: 100%">
</el-table-column>
<el-table-column label="序号" width="100">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<template v-for="item in proTableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip">
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
:filters="item.filters" :filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip">
</el-table-column>
</template>
</el-table>
</el-dialog>
</div>

View File

@ -0,0 +1,792 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from "./maintenanceInfo.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import MaintenanceInfoService from "@/service/maintenanceInfo.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 CompanyTreeComponent from '@/components/companyTree.component.vue';
import moment from 'moment';
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
ButtonListComponent,
CompanyTreeComponent,
},
})
export default class MaintenanceInfo extends BaseRecordComponent<any> {
public tableService = new MaintenanceInfoService();
public params = {
companyId: null,
workshopName: null,
teamName: null,
} as any;
public isReadonly = false;
//
public subIsReadonly = false;
public fileList = [] as any;
public subTableColumn = [] as any;
//
public selected = 0;
public subUpdateParams = {
risks: []
} as any;
public subShowUpdate = false;
public account = JSON.parse(localStorage.getItem("account") as any);
public companyList = [] as any;
public companyListMap = {} as any;
//
public subSelectData = [];
public showBindRisk = false;
//
public bindRiskGroup = [] as any;
//
public storageBindRiskGroup = [] as any;
//
public selectGroupRisk = [] as any;
//
public selectedRistList = [] as any;
public checkedCities = []
public selectData = [];
public showUpdate = false;
public updateParams = {
teams: []
} as any;
//
public tmpUpdateParams = {} as any;
//
public inputRisk = '';
public showProtable = false;
public proTableData = [] as any;
public proTableColumn = [] as any;
public formActions = [{
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public groupTableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}, {
name: "绑定风险点",
value: "bindRisk",
plain: true,
icon: "el-icon-tickets",
type: "primary"
}];
public groupTableActionsView = [{
name: "查看绑定风险点",
value: "bindRisk",
plain: true,
icon: "el-icon-tickets",
type: "primary"
}];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "车间",
key: "workshopName",
type: "text",
}, {
name: "班组",
key: "teamName",
type: "text",
}];
public subActions = [{
name: "取消",
value: "cancel"
}];
public bindRiskActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public updateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() {
this.updateOptions = [{
name: "企业名称",
key: "companyId",
format: "companyName",
type: "select",
require: true,
width: "100%",
datas: this.companyList,
showError: false,
},
{
name: "车间名称",
key: "workshopName",
type: "text",
require: true,
showError: false,
width: "calc(50% - 20px)",
},
{
name: "车间负责人",
key: "chargeUserId",
format: "chargeUserName",
type: "select",
showError: false,
require: true,
width: "calc(50% - 20px)",
datas: this.$store.state.userList,
},
{
name: "录入人",
key: "submitUserId",
format: "submitUserName",
type: "select",
showError: false,
require: true,
width: "calc(50% - 20px)",
datas: this.$store.state.userList,
},
{
name: "录入时间",
key: "submitTime",
type: "date",
subType: "date",
width: "calc(50% - 20px)",
require: true,
showError: false,
format: "yyyy-MM-dd"
},];
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
public subUpdateActions = [] as any;
public buildSubForm() {
this.subUpdateOptions = [{
name: "班组名称",
key: "teamName",
type: "text",
require: true,
width: "100%",
},
{
name: "班组负责人",
key: "chargeUserId",
format: "chargeUserName",
type: "select",
require: true,
width: "100%",
datas: this.$store.state.userList
},]
this.subUpdateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.subUpdateParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() {
//
this.getCompanyList()
this.buildUpdateForm()
//
this.getRiskGroupList()
}
//
public getCompanyList() {
this.tableService.selectCompany({}).then((res: any) => {
console.log('res', res);
res.data.forEach((item) => {
this.companyListMap[item.id] = item.name
let tmpData = {} as any;
tmpData.name = item.name;
tmpData.value = item.id;
this.companyList.push(tmpData)
})
})
}
//
public getRiskGroupList() {
this.tableService.selectRiskGroup({}).then((res: any) => {
console.log('res', res);
// let tmpBindRiskGroup = [] as any;
res.data.forEach((item) => {
if (item) {
return item
}
})
this.storageBindRiskGroup = JSON.parse(JSON.stringify(res.data.filter((item) => item)));
this.bindRiskGroup = JSON.parse(JSON.stringify(res.data.filter((item) => item)));
console.log(' this.bindRiskGroup ', this.bindRiskGroup);
// this.showBindRisk = true
})
}
//
public handleNodeClick(data) {
console.log('data', data);
this.params.companyId = "";
this.params.workshopName = "";
this.params.teamName = "";
if (data.type === 1) {
this.params.companyId = data.id
} else if (data.type === 2) {
this.params.workshopName = data.name
} else if (data.type === 3) {
this.params.teamName = data.name;
// this.params.teamId = data.id
}
this.getTableData()
}
public buildTable() {
this.tableColumn.push({ name: '车间名称', key: "workshopName", });
this.tableColumn.push({ name: '车间负责人', key: "chargeUserName", });
this.tableColumn.push({
name: '企业名称', key: "companyName", render: (data) => {
return this.companyListMap[data.companyId]
}
});
this.tableColumn.push({
name: '下属班组', key: "teamNum", render: (data) => {
return "<span class='link teamNum'>" + (data.teamNum ? data.teamNum : 0) + "</span>"
}
});
this.tableColumn.push({
name: '风险点合计', key: "riskNumber", render: (data) => {
return "<span class='link riskNumber'>" + (data.riskNumber ? data.riskNumber : 0) + "</span>"
}
});
this.tableColumn.push({ name: '录入人', key: "submitUserName" });
this.tableColumn.push({ name: '录入时间', key: "submitTime", });
this.subTableColumn.push({ name: "序号", key: "index" });
this.subTableColumn.push({ name: "班组名称", key: "teamName" });
this.subTableColumn.push({ name: "班组负责人", key: "chargeUserName" });
this.subTableColumn.push({ name: "风险点", key: "riskNumber" });
}
public changes(data, item) {
//
}
public callback(data, type) {
console.log('data', data);
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
// this.buildUpdateForm()
this.isReadonly = false
this.subIsReadonly = false
this.updateParams = {
submitTime: moment().format('YYYY-MM-DD'),
submitUserId: this.account.userId,
teams: []
} as any;
this.fileList = [] as any;
this.buildUpdateForm();
this.showUpdate = true
}
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any;
})
}
//
public showUpdateModel(row, isReadonly) {
if (isReadonly) {
this.isReadonly = true
} else {
this.isReadonly = false
}
this.tableService.selectByDetail({ id: row.id }).then((res: any) => {
this.updateParams = res.data;
this.updateParams.companyName = this.companyListMap[this.updateParams.companyId]
this.updateParams.teams.forEach((item, index) => {
item.index = index + 1
let tmpRisks = [] as any;
item.risks.forEach((items: any) => {
tmpRisks.push(items.riskName)
})
item.risks = tmpRisks
})
this.buildUpdateForm();
this.showUpdate = true;
})
}
public handleClose() {
this.showUpdate = false;
this.buildUpdateForm()
}
public subHandleClose() {
this.subShowUpdate = false;
this.buildSubForm()
}
public subHandleRisksClose() {
this.showBindRisk = false;
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
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) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
//
public handleSelectionTeamsChange(data) {
this.subSelectData = data
}
//
public subCallback(data) {
console.log('data', data);
if (data.value === "add") {
this.subUpdateParams = {
risks: []
} as any;
this.buildSubForm()
this.subShowUpdate = true;
} else if (data.value === "cancel") {
this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
} else if (data && data.value === 'delete') {
//
this.deleteSubData(this.subSelectData.map((itm: any) => itm.index - 1))
} else if (data.value === "bindRisk") {
console.log(this.updateParams);
//
this.tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams))
if (this.updateParams.teams.length === 0) {
this.$message.error('请添加班组信息');
return
}
//
this.selected = 0;
this.showBindRisk = true;
this.selectTeamGroups(0);
}
}
//
public doSave(goOn?) {
if (this.updateParams.teams.length === 0) {
this.$message.error('请添加班组信息');
return
}
//
this.updateParams.chargeUserName = this.$store.getters.user_map[this.updateParams.chargeUserId];
this.updateParams.submitUserName = this.$store.getters.user_map[this.updateParams.submitUserId];
//
let riskNumber = 0
this.updateParams.teams.forEach((item, index) => {
riskNumber = item.riskNumber + riskNumber;
//
let tmpRisks = [] as any;
item.risks.forEach((element) => {
let tmpRisksItem = {} as any;
tmpRisksItem.riskName = element
tmpRisks.push(tmpRisksItem)
});
item.risks = tmpRisks
})
this.updateParams.riskNumber = riskNumber;
//
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
this.updateParams = {
teams: [],
} as any
this.showUpdate = !!goOn;
this.getTableData();
})
}
// -- --
public triCallback(data) {
console.log('data', data);
if (data.value === "cancel") {
this.subShowUpdate = false;
this.subIsReadonly = false;
} else if (data.value === "add") {
let index = this.subUpdateParams.risks.length
this.subUpdateParams.risks.push({
index: index + 1
})
} else if (data && data.value.indexOf("save") >= 0) {
this.doSaveRisks(data.value !== "save")
}
}
// ---
public showSubModal(row, isreadonly) {
//
this.subUpdateParams = JSON.parse(JSON.stringify(row));
if (isreadonly) {
this.subIsReadonly = true;
} else {
this.subIsReadonly = false;
}
this.buildSubForm();
this.subShowUpdate = true;
}
// --
public deleteSubData(ids) {
//
for (let i = this.updateParams.teams.length - 1; i >= 0; i--) {
if (ids.includes(i)) {
if (this.updateParams.teams[i].id) {
if (!this.updateParams.deleteTeams) {
this.updateParams.deleteTeams = []
}
this.updateParams.deleteTeams.push(this.updateParams.teams[i].id)
}
this.updateParams.teams.splice(i, 1)
}
}
this.updateParams.teams.forEach((item, index) => {
item.index = index + 1;
});
}
//
public doSaveRisks(goOn?) {
console.log(this.subUpdateParams);
this.subUpdateParams.chargeUserName = this.$store.getters.user_map[this.subUpdateParams.chargeUserId];
this.subUpdateParams.riskNumber = this.subUpdateParams.risks.length
if (this.subUpdateParams.index) {
this.updateParams.teams.splice(this.updateParams.teams.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
} else {
this.updateParams.teams.push(this.subUpdateParams);
}
this.updateParams.teams.forEach((item, index) => {
item.index = index + 1
})
this.subShowUpdate = !!goOn;
this.subUpdateParams = {
risks: []
} as any;
}
//
public selectTeamGroups(index) {
this.selected = index
this.mergeSelectedData(index)
}
//
public mergeSelectedData(index) {
let selectedRistList = [] as any;
this.updateParams.teams.forEach((item, idx) => {
if (idx != index) {
selectedRistList = selectedRistList.concat(item['risks'])
}
})
this.selectedRistList = selectedRistList;
}
//
public filterSelectedData(item, selected) {
const selectedRistList = this.selectedRistList;
if (selectedRistList.indexOf(item) !== -1) {
return true
} else {
return false
}
}
//
public bindRiskCallback(data) {
console.log('datadata', data);
if (data.value === "cancel") {
//
this.updateParams = this.tmpUpdateParams;
this.showBindRisk = false
} else if (data && data.value.indexOf("save") >= 0) {
//
this.updateParams.teams.forEach((item) => {
item.riskNumber = item.risks.length
})
this.tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams));
this.updateParams = this.tmpUpdateParams;
this.showBindRisk = false
console.log(this.updateParams);
}
}
//
public dataChange(data) {
if (data) {
let tmpBindRiskGroup = [] as any;
this.storageBindRiskGroup.forEach((item) => {
console.log('item', item);
if (item.includes(data)) {
tmpBindRiskGroup.push(item)
}
})
this.bindRiskGroup = JSON.parse(JSON.stringify(tmpBindRiskGroup))
} else {
this.bindRiskGroup = JSON.parse(JSON.stringify(this.storageBindRiskGroup));
}
}
//
//
public showPros(el, data) {
this.proTableColumn = [] as any;
//
if (el.target.classList.contains("riskNumber")) {
this.tableService.selectByDetail({ id: data.id }).then((res: any) => {
console.log('res', res);
this.proTableData = [] as any;
res.data.teams.forEach((item: any) => {
this.proTableData = this.proTableData.concat(item.risks)
})
// console.log('this.proTableData', this.proTableData);
this.proTableColumn.push({ name: '风险点', key: "riskName", });
this.showProtable = true
})
}
//
if (el.target.classList.contains("teamNum")) {
this.tableService.selectByDetail({ id: data.id }).then((res: any) => {
console.log('res', res);
this.proTableData = [] as any;
res.data.teams.forEach((item: any) => {
this.proTableData = this.proTableData.concat(item)
})
// console.log('this.proTableData', this.proTableData);
this.proTableColumn.push({ name: '班组名称', key: "teamName", });
this.proTableColumn.push({ name: '班组负责人', key: "chargeUserName", });
this.showProtable = true
})
}
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" scoped>
.bind-risk {
width: 100%;
display: flex;
height: 600px;
}
.risk-group {
width: 20%;
height: 100%;
border-radius: 2px;
border: 1px solid #D1DBE5;
padding: 8px;
.risk-group-item {
width: 100%;
padding: 5px;
border-radius: 2px;
border: 1px solid #E3F1FF;
margin-bottom: 10px;
// opacity: 0.5;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.6);
}
.risk-group-item:hover {
background-color: #409EFF;
color: white;
}
.click-risk-group-item {
width: 100%;
padding: 5px;
border-radius: 2px;
border: 1px solid #E3F1FF;
margin-bottom: 10px;
// opacity: 0.5;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.6);
background: #409EFF;
color: #fff;
}
}
.bind-risk-content {
width: 70%;
margin-left: 20px;
.el-checkbox-group {
width: 100%;
.el-checkbox {
width: 45%;
padding: 10px 0px;
.el-checkbox__label {
color: rgba(0, 0, 0, 0.6);
}
}
}
.bind-risk-content-title {
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 0.8);
}
.input-with-select {
padding: 20px 0px;
}
}
</style>

View File

@ -0,0 +1,214 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<div class="full">
<el-radio-group text-color="#409EFF" fill="transparent" size="medium" v-model="params.type"
@change="tabTableChange">
<el-radio-button :label="item.value" v-for="item in tabs"
:key="item.value">{{item.name}}</el-radio-button>
</el-radio-group>
</div>
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="[]">
<!-- 班组风险研判 -->
<el-table v-if="params.type === 1" ref="multipleTable" :data="tableData.datas" height="100%" border
row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column label="状态">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="班组名称">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="班组负责人">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="已研判风险点">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="未研判风险点">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="是否已落实管控措施">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="研判时间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">研判</el-button>
</template>
</el-table-column>
</el-table>
<!-- 车间风险研判 -->
<el-table v-else-if="params.type === 2" ref="multipleTable" :data="tableData.datas" height="100%" border
row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column label="状态">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="车间名称">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="车间负责人">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="已研判班组">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="未研判班组">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="风险点">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="是否已落实管控措施">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="研判时间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">研判</el-button>
</template>
</el-table-column>
</el-table>
<!-- 企业风险研判 -->
<el-table v-else-if="params.type === 3" ref="multipleTable" :data="tableData.datas" height="100%" border
row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column label="状态">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="企业名称">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="企业负责人">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="已研判车间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="未研判车间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="风险点">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="是否已落实管控措施">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="研判时间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">研判</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</div>
</div>
<!-- 研判 -->
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':updateParams.id?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="140px" labelAlign="right" :data.sync="subUpdateParams"
:isReadonly="isReadonly" @actionCallback="callback" @change="changes" :actions="updateActions"
:full-btn="true" btnPosition="center">
<div class="sub-title">{{subTableTitle}}</div>
<TableComponent :tableData="subUpdateParams.risk" :tableColumn="subTableColumn"
@actionCallback="callback($event)" :actions="(isReadonly || params.type !== 1) ? []:subTableActions"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="subUpdateParams.risk" tooltip-effect="dark" max-height="300" border
row-key="checked" style="width: 100%">
<template v-for="item in subTableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)">
</div>
</el-table-column>
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
:label="item.name" :width="item.width" :key="item.key">
</el-table-column>
</template>
<el-table-column v-if="params.type === 1" label="操作" fixed="right" width="120">
<div slot-scope="scope">
<el-button type="text" @click="showJudgmentModal(scope.row,true)">查看</el-button>
<el-button type="text" @click="showJudgmentModal(scope.row)">研判</el-button>
</div>
</el-table-column>
</el-table>
</TableComponent>
</FormComponent>
</el-dialog>
<!-- 研判表 -->
<el-dialog :close-on-click-modal="false" :title="'风险点名称'" :visible.sync="subShowUpdate" width="952px"
destroy-on-close>
<el-table ref="multipleTable" :data="judgmentData" tooltip-effect="dark" max-height="600" border
row-key="checked" style="width: 100%" :span-method="objectSpanMethod">
<el-table-column label="风险研判内容">
<el-table-column prop="title" label="风险研判内容">
<div slot-scope="scope">
<span>{{scope.row.title}}</span>
</div>
</el-table-column>
<el-table-column prop="content" label="风险研判内容">
<div slot-scope="scope">
<span>{{scope.row.content}}</span>
</div>
</el-table-column>
</el-table-column>
<el-table-column prop="result" label="风险研判结果">
<div slot-scope="scope">
<span v-if="isReadonly">{{scope.row.result}}</span>
<el-input v-else type="textarea" v-model="scope.row.result"></el-input>
<!-- <span >{{scope.row.result}}</span> -->
</div>
</el-table-column>
<el-table-column prop="measure" label="管控措施">
<div slot-scope="scope">
<span v-if="isReadonly">{{scope.row.measure}}</span>
<el-input v-else type="textarea" v-model="scope.row.measure"></el-input>
<!-- <span >{{scope.row.measure}}</span> -->
</div>
</el-table-column>
</el-table>
<FormComponent :options="resultOptions" labelWidth="140px" labelAlign="right" :data.sync="subUpdateParams"
:isReadonly="isReadonly" @actionCallback="triCallback" @change="changes" :actions="judgmentFooterActions"
:full-btn="true" btnPosition="center">
</FormComponent>
</el-dialog>
</div>

View File

@ -0,0 +1,457 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from "./riskJudgment.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import MaintenanceInfoService from "@/service/maintenanceInfo.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';
import judgment from "@/mock/judgment";
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
ButtonListComponent,
UnitTreeComponent,
},
})
export default class RiskJudgment extends BaseRecordComponent<any> {
public tableService = new MaintenanceInfoService();
public params = {
type: 1
} as any;
public isReadonly = false;
//
public subIsReadonly = false;
public fileList = [] as any;
public subTableColumn = [] as any;
public subUpdateParams = {
risk: [{ index: 0, key: 0, }]
} as any;
public subShowUpdate = false;
public judgmentData = judgment;
public subTableTitle = '风险研判';
public tabs = [{
name: "班组风险研判",
value: 1
}, {
name: "车间风险研判",
value: 2
}, {
name: "企业风险研判",
value: 3
},]
public showUpdate = false;
public formActions = [{
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public subTableActions = [{
name: "批量研判",
value: "batchAdd",
icon: "el-icon-plus",
type: "primary"
},];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "车间",
key: "controlName",
type: "text",
}, {
name: "班组",
key: "analName",
type: "text",
}];
public subActions = [{
name: "取消",
value: "cancel"
}];
public judgmentFooterActions = [{
name: "取消",
value: "cancel"
}, {
name: "下一条",
value: "next",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}] as any;
public updateParams = {} as any;
public selectData = [];
public updateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() {
this.updateOptions = [{
name: "班组名称",
key: "controlName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
hide: this.params.type !== 1
},
{
name: "班组负责人",
key: "analName",
type: "text",
require: true,
width: "calc(50% - 20px)",
hide: this.params.type !== 1
},
{
name: "车间名称",
key: "controlName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
hide: this.params.type !== 2
},
{
name: "车间负责人",
key: "analName",
type: "text",
require: true,
width: "calc(50% - 20px)",
hide: this.params.type !== 2
},
{
name: "企业名称",
key: "controlName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
hide: this.params.type !== 3
},
{
name: "企业负责人",
key: "analName",
type: "text",
require: true,
width: "calc(50% - 20px)",
hide: this.params.type !== 3
},
{
name: "研判时间",
key: "seriousResult",
format: "seriousResultName",
type: "select",
require: true,
multiple: true,
width: "calc(50% - 20px)",
datas: this.$store.state.userList,
},
{
name: "负责人签名",
key: "file1",
ref: "file",
type: "upload",
width: "calc(50% - 20px)",
showError: false,
require: true,
onSucess: this.onSuccess,
onMove: this.onRemove,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
fileList: this.fileList,
btn: [{
name: "上传附件",
value: "upload",
hide: this.isReadonly,
size: "small",
type: "primary"
}]
}, {
name: "是否已落实管控措施",
key: "seriousResult",
format: "seriousResultName",
type: "radio",
require: true,
labelWidth: "140px",
width: "calc(50% - 20px)",
datas: [{
name: "是",
value: 1,
}, {
name: "否",
value: 0,
}],
},];
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
public resultOptions: FormOption<BtnOption>[] = [
{
name: "研判状态",
key: "controlName",
type: "radio",
require: true,
width: "calc(50% - 20px)",
datas: [{
name: "已研判",
value: 1
},]
},
] as any;
created() {
//
this.buildSubTable()
}
public buildTable() {
this.tableColumn.push({ name: '车间名称', key: "controlName", });
this.tableColumn.push({ name: '车间负责人', key: "analName", });
this.tableColumn.push({ name: '企业名称', key: "riskSource", });
this.tableColumn.push({ name: '下属班组', key: "seriousResult", });
this.tableColumn.push({ name: '风险点合计', key: "riskLevel", });
this.tableColumn.push({ name: '录入人', key: "appraiser" });
this.tableColumn.push({ name: '录入时间', key: "appraiseTime", });
}
// -- table
public buildSubTable() {
this.subTableColumn = [] as any;
if (this.params.type === 1) {
this.subTableColumn.push({ name: "序号", key: "index" });
this.subTableColumn.push({ name: "风险点名称", key: "index" });
this.subTableColumn.push({ name: "风险等级", key: "index" });
this.subTableColumn.push({ name: "研判状态", key: "index" });
} else if (this.params.type === 2) {
this.subTableColumn.push({ name: "序号", key: "index" });
this.subTableColumn.push({ name: "班组名称", key: "index" });
this.subTableColumn.push({ name: "班组负责人", key: "index" });
this.subTableColumn.push({ name: "风险点", key: "index" });
this.subTableColumn.push({ name: "重大风险", key: "index" });
this.subTableColumn.push({ name: "较大风险", key: "index" });
this.subTableColumn.push({ name: "一般风险", key: "index" });
this.subTableColumn.push({ name: "低风险", key: "index" });
this.subTableColumn.push({ name: "研判状态", key: "index" });
} else if (this.params.type === 3) {
this.subTableColumn.push({ name: "序号", key: "index" });
this.subTableColumn.push({ name: "车间名称", key: "index" });
this.subTableColumn.push({ name: "车间负责人", key: "index" });
this.subTableColumn.push({ name: "风险点", key: "index" });
this.subTableColumn.push({ name: "重大风险", key: "index" });
this.subTableColumn.push({ name: "较大风险", key: "index" });
this.subTableColumn.push({ name: "一般风险", key: "index" });
this.subTableColumn.push({ name: "低风险", key: "index" });
this.subTableColumn.push({ name: "研判状态", key: "index" });
}
}
public changes(data, item) {
//
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "cancel") {
this.showUpdate = false
} else if (data.value === 'batchAdd') {
// this.buildUpdateForm()
console.log('1111');
this.$confirm('批量研判会统一修改研判状态为“已研判”,并写入默认数据。请在此确认是否操作?', '确认数据', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
}).catch(() => {
//
});
}
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any;
})
}
public handleClose() {
this.showUpdate = false;
this.buildUpdateForm()
}
public onPreview(file) {
// if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
// this.currentUrl = file.url;
// this.showFile = true;
// } else {
// window.open(file.url, "_blank")
// }
}
public onSuccess(res, file, fileList) {
if (res.code === 200) {
this.fileList.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
} else {
this.$message.error(res.msg);
}
}
public onRemove(file, fileList) {
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
}
//
public tabTableChange(type) {
console.log('type', type);
console.log('1111111111');
this.params.pageNum = 1;
this.buildSubTable()
if (type === 1) {
// this.buildFormOptions()
// this.getTableData()
this.subTableTitle = '风险研判'
} else if (type === 2) {
// this.buildFormOptions()
// this.getReportTableData()
this.subTableTitle = '班组研判信息'
} else if (type === 3) {
//
this.subTableTitle = '企业研判信息'
}
console.log(this.params);
}
public triCallback(data) {
console.log('data', data);
if (data && data.value === "cancel") {
this.subShowUpdate = false
} else if (data.value === 'save') {
//
} else if (data.value === 'next') {
//
}
}
// --
public showUpdateModel(row, isreadonly) {
this.showUpdate = true;
this.buildUpdateForm()
}
//
public showJudgmentModal(row, isreadonly) {
this.subShowUpdate = true
}
//
public objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// 0
if (columnIndex === 0) {
if (rowIndex === 0) {
return {
rowspan: 4,
colspan: 1
};
} else if (rowIndex === 4) {
return {
rowspan: 6,
colspan: 1
};
} else if (rowIndex === 10) {
return {
rowspan: 3,
colspan: 1
};
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" scoped >
.common-table-box {
margin-top: 15px
}
</style>

View File

@ -0,0 +1,127 @@
<div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<div class="full">
<el-radio-group text-color="#409EFF" fill="transparent" size="medium" v-model="params.type"
@change="tabTableChange">
<el-radio-button :label="item.value" v-for="item in tabs"
:key="item.value">{{item.name}}</el-radio-button>
</el-radio-group>
</div>
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="[]">
<!-- 班组风险研判 -->
<el-table v-if="params.type === 1" ref="multipleTable" :data="tableData.datas" height="100%" border
row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column label="状态">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="班组名称">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="班组负责人">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="公告时间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="风险点个数">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- 车间风险研判 -->
<el-table v-else-if="params.type === 2" ref="multipleTable" :data="tableData.datas" height="100%" border
row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column label="状态">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="车间名称">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="车间负责人">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="班组公告情况">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="公告时间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="风险点个数">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- 企业风险研判 -->
<el-table v-else-if="params.type === 3" ref="multipleTable" :data="tableData.datas" height="100%" border
row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column label="状态">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="企业名称">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="企业负责人">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="车间公告情况">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="公告时间">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="风险点个数">
<div slot-scope="scope">{{scope.row.operateCompleted}}</div>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</TableComponent>
</div>
</div>
<!-- 承诺书 -->
<el-dialog :close-on-click-modal="false" :title="'风险点名称'" :visible.sync="showUpdate" width="1080px"
destroy-on-close>
<NoticeComponent></NoticeComponent>
</el-dialog>
</div>

View File

@ -0,0 +1,351 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import template from "./safetyNotice.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
import MaintenanceInfoService from "@/service/maintenanceInfo.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';
import NoticeComponent from '@/components/notice.component.vue'
@Component({
template,
components: {
FormComponent,
TableComponent,
DrawComponent,
ButtonListComponent,
UnitTreeComponent,
NoticeComponent
},
})
export default class SafetyNotice extends BaseRecordComponent<any> {
public tableService = new MaintenanceInfoService();
public params = {
type: 1
} as any;
public isReadonly = false;
//
public subIsReadonly = false;
public fileList = [] as any;
public subTableColumn = [] as any;
public subUpdateParams = {
risk: [{ index: 0, key: 0, }]
} as any;
public subShowUpdate = false;
public tabs = [{
name: "班组风险研判",
value: 1
}, {
name: "车间风险研判",
value: 2
}, {
name: "企业风险研判",
value: 3
},]
public showUpdate = true;
public formActions = [{
name: "查询",
value: "search",
icon: "el-icon-search",
type: "primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}];
public tableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
icon: "el-icon-delete",
type: "danger"
}];
public triTableActions = [{
name: "添加",
value: "add",
icon: "el-icon-plus",
type: "primary"
},];
public footerActions = [{
name: "选择全部",
value: "selectAll",
type: "primary"
}, {
name: "反向选择",
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "车间",
key: "controlName",
type: "text",
}, {
name: "班组",
key: "analName",
type: "text",
}];
public subActions = [{
name: "取消",
value: "cancel"
}];
public updateParams = {} as any;
public selectData = [];
public updateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() {
this.updateOptions = [{
name: "班组名称",
key: "controlName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
},
{
name: "班组负责人",
key: "analName",
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.userList,
},
{
name: "负责人签名",
key: "file1",
ref: "file",
type: "upload",
width: "calc(50% - 20px)",
showError: false,
onSucess: this.onSuccess,
onMove: this.onRemove,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
fileList: this.fileList,
btn: [{
name: "上传附件",
value: "upload",
hide: this.isReadonly,
size: "small",
type: "primary"
}]
}, {
name: "是否已落实管控措施",
key: "seriousResult",
format: "seriousResultName",
type: "radio",
require: true,
labelWidth: "140px",
width: "calc(50% - 20px)",
datas: [{
name: "是",
value: 1,
}, {
name: "否",
value: 0,
}],
},];
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() {
//
}
public buildTable() {
this.tableColumn.push({ name: '状态', key: "controlName", });
this.tableColumn.push({ name: '班组名称', key: "analName", });
this.tableColumn.push({ name: '班组负责人', key: "riskSource", });
this.tableColumn.push({ name: '公告时间', key: "seriousResult", });
this.tableColumn.push({ name: '风险点个数', key: "riskLevel", });
}
public changes(data, item) {
//
}
public callback(data, type) {
if (type) {
this.params[type] = data;
this.getTableData();
return
}
//
if (data.value === "search") {
this.getTableData()
//
} else if (data.value === "reset") {
this.reset()
//
} else if (data.value === "reverse") {
this.toggleAll()
//
} else if (data.value === "selectAll") {
this.selectAll()
} else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') {
// this.buildUpdateForm()
this.isReadonly = false
this.subIsReadonly = false
this.updateParams = {} as any;
this.fileList = [] as any;
this.buildUpdateForm();
this.showUpdate = true
}
}
//
public reset() {
this.params = {
pageNum: 1,
pageSize: 20,
} as any;
}
//
public getTableData() {
this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any;
})
}
public handleClose() {
this.showUpdate = false;
this.buildUpdateForm()
}
public toggleAll() {
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
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) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
public handleSelectionChange(data) {
this.selectData = data;
}
public onPreview(file) {
// if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
// this.currentUrl = file.url;
// this.showFile = true;
// } else {
// window.open(file.url, "_blank")
// }
}
public onSuccess(res, file, fileList) {
if (res.code === 200) {
this.fileList.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
} else {
this.$message.error(res.msg);
}
}
public onRemove(file, fileList) {
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
}
//
public tabTableChange(type) {
this.params.pageNum = 1;
console.log('type',type);
if (type === 1) {
// this.buildFormOptions()
// this.getTableData()
} else if (type === 2) {
// this.buildFormOptions()
// this.getReportTableData()
} else if (type === 3) {
//
}
}
public triCallback() {
//
}
public showUpdateModel(row,isReadonly){
// this.
}
}
</script>
<style lang="scss" scoped src="../../common.component.scss"></style>
<style lang="scss" scoped >
.common-table-box {
margin-top: 15px
}
</style>

View File

@ -282,6 +282,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
created() { created() {
//
} }