forked from xxhjsb/hbt-prevention-ui
feat:页面bug优化,包保责任制和安全研判
parent
88350e30c9
commit
16f8e29e7c
|
|
@ -85,7 +85,7 @@
|
|||
<el-dialog :close-on-click-modal="false" :title="'管控措施制定'" :visible.sync="subUpdate" width="952px"
|
||||
:before-close="handleMeasureClose">
|
||||
<MeasureComponent @actionCallback="dataCallback" :data.sync="measuresData" :show.sync="subUpdate"
|
||||
:tabledata.sync="analysisUpdateParams" :isReadonly="measureIsReadonly">
|
||||
:tabledata.sync="analysisUpdateParams" :isReadonly="measureIsReadonly" :outermostData="outermostData">
|
||||
</MeasureComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
|
@ -206,6 +206,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
@PropSync("tabledata", {
|
||||
required: true,
|
||||
})
|
||||
public outermostData!:any
|
||||
public updateParams: any;
|
||||
|
||||
@Prop()
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -121,7 +121,7 @@ export default class MeasureComponent extends Vue {
|
|||
width: "25%",
|
||||
datas: this.secondTypeItem
|
||||
}, {
|
||||
name:"",
|
||||
name: "",
|
||||
key: "thirdType",
|
||||
type: "text",
|
||||
require: true,
|
||||
|
|
@ -164,7 +164,8 @@ export default class MeasureComponent extends Vue {
|
|||
width: "100%",
|
||||
labelWidth: '210px',
|
||||
require: true,
|
||||
showError:false,
|
||||
showError: false,
|
||||
disable: this.outermostData.majorSign && this.outermostData.majorSign.includes(0),
|
||||
datas: [
|
||||
{
|
||||
name: "否",
|
||||
|
|
@ -185,7 +186,7 @@ export default class MeasureComponent extends Vue {
|
|||
datas: this.taskType,
|
||||
expandLevel: Infinity,
|
||||
disable: !(this.taskUpdataParams.insuranceDutyFlag === 1),
|
||||
showError:false,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "包保任务对应项",
|
||||
key: "taskItem",
|
||||
|
|
@ -203,7 +204,7 @@ export default class MeasureComponent extends Vue {
|
|||
type: "textarea",
|
||||
width: "100%",
|
||||
require: true,
|
||||
showError:false,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "执行岗位",
|
||||
key: "executePostCode",
|
||||
|
|
@ -212,7 +213,7 @@ export default class MeasureComponent extends Vue {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.$store.state.postList,
|
||||
showError:false,
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "责任人",
|
||||
|
|
@ -222,14 +223,14 @@ export default class MeasureComponent extends Vue {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.$store.state.userList,
|
||||
showError:false,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "排查周期 每隔",
|
||||
key: "reviewCycleValue",
|
||||
type: "number",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError:false,
|
||||
showError: false,
|
||||
// labelWidth:"130px"
|
||||
}, {
|
||||
key: "reviewCycleUnit",
|
||||
|
|
@ -238,14 +239,14 @@ export default class MeasureComponent extends Vue {
|
|||
format: 'reviewCycleValueName',
|
||||
datas: this.$store.state.prevention_cycle_unit,
|
||||
width: "calc(30% - 20px)",
|
||||
showError:false,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "1次",
|
||||
key: "times",
|
||||
type: 'null',
|
||||
width: "30px",
|
||||
labelWidth: "50px",
|
||||
showError:false,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "工作开始时间",
|
||||
key: "startTime",
|
||||
|
|
@ -253,7 +254,7 @@ export default class MeasureComponent extends Vue {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
|
||||
showError:false,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "工作结束时间",
|
||||
key: "endTime",
|
||||
|
|
@ -261,16 +262,16 @@ export default class MeasureComponent extends Vue {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
hide: !(this.taskUpdataParams.reviewCycleUnit === 7),
|
||||
showError:false,
|
||||
},{
|
||||
showError: false,
|
||||
}, {
|
||||
name: "开始执行时间",
|
||||
key: "executeStartTime",
|
||||
format: "yyyy-MM-dd HH:mm",
|
||||
type: "date",
|
||||
subType:'datetime',
|
||||
subType: 'datetime',
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError:false,
|
||||
showError: false,
|
||||
},]
|
||||
}
|
||||
|
||||
|
|
@ -296,6 +297,9 @@ export default class MeasureComponent extends Vue {
|
|||
@Prop()
|
||||
public isReadonly: boolean;
|
||||
|
||||
@Prop()
|
||||
public outermostData!: any
|
||||
|
||||
@PropSync("show", {
|
||||
required: true,
|
||||
default: true
|
||||
|
|
@ -329,10 +333,11 @@ export default class MeasureComponent extends Vue {
|
|||
@PropSync("tabledata", {
|
||||
required: true,
|
||||
})
|
||||
public tableData!: any;
|
||||
|
||||
public measureData!: any;
|
||||
|
||||
created() {
|
||||
|
||||
this.buildTable()
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +402,7 @@ export default class MeasureComponent extends Vue {
|
|||
|
||||
//排查任务
|
||||
public showTaskModel(row, isReadonly) {
|
||||
this.taskType = this.taskItemSelect()
|
||||
this.taskType = this.taskItemSelect();
|
||||
if (isReadonly) {
|
||||
this.taskIsReadonly = true
|
||||
this.taskUpdataParams = JSON.parse(JSON.stringify(row))
|
||||
|
|
@ -486,7 +491,16 @@ export default class MeasureComponent extends Vue {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
@ -512,7 +526,6 @@ export default class MeasureComponent extends Vue {
|
|||
|
||||
//排查任务 -- 下拉选择
|
||||
public taskSelectChange(data, item) {
|
||||
|
||||
if (data !== null && data !== undefined) {
|
||||
if (item && item.key === 'insuranceDutyFlag') {
|
||||
this.taskType = this.taskItemSelect()
|
||||
|
|
@ -555,13 +568,13 @@ export default class MeasureComponent extends Vue {
|
|||
this.taskUpdataParams.taskItemName = map[data]
|
||||
}
|
||||
//开始执行时间
|
||||
if(item && item.key === 'executeStartTime'){
|
||||
if (item && item.key === 'executeStartTime') {
|
||||
const now = moment().format("YYYY-MM-DD HH:mm");
|
||||
if (now > data) {
|
||||
this.$message.error("开始执行时间不能早于当前时间")
|
||||
this.taskUpdataParams.executeStartTime = null;
|
||||
return
|
||||
}
|
||||
if (now > data) {
|
||||
this.$message.error("开始执行时间不能早于当前时间")
|
||||
this.taskUpdataParams.executeStartTime = null;
|
||||
return
|
||||
}
|
||||
}
|
||||
this.taskUpdateForm()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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:'无',
|
||||
},]
|
||||
|
|
@ -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'
|
||||
}
|
||||
};
|
||||
|
|
@ -39,6 +39,15 @@ import IntegralEvent from '@/views/integral/event.component.vue'
|
|||
import IntegralMall from '@/views/integral/mall.component.vue'
|
||||
import IntegralExchange from '@/views/integral/exchange/exchangeFlow/exchange.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)
|
||||
const routes: Array<RouteConfig> = [
|
||||
|
|
@ -234,10 +243,73 @@ const routes: Array<RouteConfig> = [
|
|||
path:"exchange-record",
|
||||
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',
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -16,11 +16,6 @@ export default class WorkFlowService extends BaseService<any>{
|
|||
const url = this.prefix.bpm+'/task/candidate/set';
|
||||
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>>>{
|
||||
const url = this.prefix.bpm+'/task/taskHandle';
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ export default new Vuex.Store({
|
|||
prevention_risk_source:[],
|
||||
prevention_risk_craft:[],
|
||||
prevention_risk_chemical:[],
|
||||
prevention_enterprise_nature:[],
|
||||
prevention_enterprise_size:[],
|
||||
prevention_regulatory_category:[],
|
||||
prevention_regulatory_subcategories:[],
|
||||
prevention_registration_status:[],
|
||||
prevention_safety_label:[],
|
||||
},
|
||||
getters: {
|
||||
dept_map:(state)=>{
|
||||
|
|
@ -272,6 +278,49 @@ export default new Vuex.Store({
|
|||
})
|
||||
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: {
|
||||
setAnalCntrol(state,data){
|
||||
|
|
@ -377,6 +426,25 @@ export default new Vuex.Store({
|
|||
set_prevention_risk_chemical(state,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: {
|
||||
},
|
||||
|
|
|
|||
|
|
@ -48,6 +48,13 @@ export default class BlankComponent extends Vue {
|
|||
this.systemService.getDictData("prevention_risk_source"),
|
||||
this.systemService.getDictData("prevention_risk_craft"),
|
||||
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) => {
|
||||
|
||||
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) => {
|
||||
return {
|
||||
name: item.deptName,
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -106,6 +106,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
public currentUrl: any;
|
||||
public showFile = false;
|
||||
|
||||
public riskSource = [] as any;
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
|
|
@ -127,14 +128,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
public statusMap = ["未下发", "已下发"];
|
||||
public reformModeMap = ["", "即查即改", "限期整改"]
|
||||
|
||||
|
||||
created() {
|
||||
this.loadAreaData()
|
||||
this.loadUnitData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
|
|
@ -396,6 +389,15 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
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: "违反规定条款",
|
||||
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() {
|
||||
this.tableColumn.push({ name: '整改单编号', width: "200px", key: "number" });
|
||||
this.tableColumn.push({ name: '隐患描述', key: "description", width: "300px" });
|
||||
|
|
@ -502,6 +522,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
|
||||
|
||||
public showUpdateModel(row?, isRead?) {
|
||||
this.initRiskSource()
|
||||
this.isReadonly = !!isRead;
|
||||
this.fileList = [];
|
||||
this.photoList = [];
|
||||
|
|
@ -514,7 +535,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
inspectTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
if (!row) {
|
||||
|
||||
this.tableService.getNumber().then(res => {
|
||||
this.updateParams.number = res.data;
|
||||
this.center = [118.751353, 31.969568];
|
||||
|
|
@ -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,
|
||||
type: "随手拍",
|
||||
}, 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.buildUpdateForm()
|
||||
|
|
@ -645,6 +668,10 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
this.updateParams.resourceName = this.photoList.map(item => item.name).join(",")
|
||||
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
|
||||
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",")
|
||||
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.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
|
||||
if (isSubmit) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
@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%">
|
||||
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
||||
<el-table-column v-if="!isAction && !(isManager && params.type>1)" type="selection"
|
||||
:selectable="selectable" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
|
|
@ -26,12 +26,12 @@
|
|||
</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">
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key" :sortable="item.sortable">
|
||||
<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">
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key" :sortable="item.sortable">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
:visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close>
|
||||
<div class="sub-title" v-if="isManager || isFile">隐患信息</div>
|
||||
<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"
|
||||
:full-btn="true" @change="change" btn-position="center"></FormComponent>
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
public marker: any = null;
|
||||
public map: any = null;
|
||||
public showMap = false;
|
||||
|
||||
public riskSource = [] as any;
|
||||
|
||||
public executeResultList = [{
|
||||
text: "完成",
|
||||
value: 1
|
||||
|
|
@ -108,7 +111,8 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
}];
|
||||
|
||||
created() {
|
||||
|
||||
//重大危险源
|
||||
this.initRiskSource()
|
||||
}
|
||||
|
||||
public getTableData() {
|
||||
|
|
@ -384,7 +388,16 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
type: "textarea",
|
||||
width: "100%",
|
||||
showError: false,
|
||||
}]
|
||||
}, {
|
||||
name: "重大危险源名称",
|
||||
key: "majorHazard",
|
||||
format: "majorHazardName",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.riskSource
|
||||
},]
|
||||
|
||||
this.updateOptions2 = [{
|
||||
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) {
|
||||
this.initRiskSource()
|
||||
Object.assign(this.updateParams, {
|
||||
verifyConfirmFlagName: this.isPassMap[row.verifyConfirmFlag],
|
||||
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],
|
||||
reformModeName: this.reformModeMap[row.reformMode],
|
||||
}, 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()
|
||||
// 获取url
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
|
||||
public isFile = false;
|
||||
|
||||
public riskSource = [] as any;
|
||||
|
||||
public params = {
|
||||
type: 1,
|
||||
bpmSchemeCode: "prevention-yhzl"
|
||||
|
|
@ -107,6 +109,11 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
public map: any = null;
|
||||
public showMap = false;
|
||||
|
||||
//排序属性转换
|
||||
public sortAttribute = {
|
||||
updateTime: "update_time",
|
||||
} as any;
|
||||
|
||||
public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "已闭环", 6: "流程中断", 7: "已作废" };
|
||||
public tabs = [{
|
||||
name: "草稿",
|
||||
|
|
@ -149,7 +156,8 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
|
||||
|
||||
created() {
|
||||
//
|
||||
//重大危险源
|
||||
this.initRiskSource()
|
||||
}
|
||||
public tabTableChange(type) {
|
||||
this.params.pageNum = 1;
|
||||
|
|
@ -446,7 +454,16 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
type: "textarea",
|
||||
width: "100%",
|
||||
showError: false,
|
||||
}]
|
||||
}, {
|
||||
name: "重大危险源名称",
|
||||
key: "majorHazard",
|
||||
format: "majorHazardName",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.riskSource
|
||||
},]
|
||||
|
||||
this.updateOptions2 = [{
|
||||
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() {
|
||||
this.tableColumn.push({
|
||||
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: "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: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" });
|
||||
this.tableColumn.push({ name: '上报时间', width: "120", key: "reportTime", render: (data) => data.reportTime || "--" });
|
||||
this.tableColumn.push({
|
||||
name: '隐患标题', width: "150", render: (data) => {
|
||||
if (this.params.type === 1 || this.params.type === 2) {
|
||||
|
|
@ -697,24 +728,28 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
data = Object.assign({
|
||||
realConfirmUserId: this.account.userId,
|
||||
realConfirmUserName: this.account.nickName,
|
||||
realConfirmTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
realConfirmTime: moment().format("YYYY-MM-DD HH:mm"),
|
||||
reformConfirmFlag: 1
|
||||
}, data)
|
||||
}
|
||||
if (data.status === 3) {
|
||||
data = Object.assign({
|
||||
realExecuteUserId: this.account.userId,
|
||||
realExecuteUserName: this.account.nickName,
|
||||
realExecuteTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
realExecuteTime: moment().format("YYYY-MM-DD HH:mm"),
|
||||
executeConfirmFlag: 1
|
||||
}, data)
|
||||
}
|
||||
if (data.status === 4) {
|
||||
data = Object.assign({
|
||||
realVerifyUserId: this.account.userId,
|
||||
realVerifyUserName: this.account.nickName,
|
||||
realVerifyTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
realVerifyTime: moment().format("YYYY-MM-DD HH:mm"),
|
||||
verifyConfirmFlag: 1
|
||||
}, data)
|
||||
}
|
||||
this.showUpdateModel(data)
|
||||
this.getTableCallback()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -853,6 +888,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
|
||||
|
||||
public showUpdateModel(row?, isRead?) {
|
||||
this.initRiskSource()
|
||||
this.isReadonly = !!isRead
|
||||
this.updateParams = { status: 0, source: 9 } as any;
|
||||
if (!row) {
|
||||
|
|
@ -877,6 +913,8 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||
reformModeName: this.reformModeMap[row.reformMode],
|
||||
}, 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()
|
||||
// 获取url
|
||||
|
|
@ -994,7 +1032,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
this.updateParams.executeResourceName = this.fileList2.map(item => item.name).join(",")
|
||||
this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).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.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功");
|
||||
if (!preStatus) {
|
||||
|
|
@ -1171,6 +1211,18 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
public handleSelectionChange(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>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -101,13 +101,16 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
public levelMap = ["", "一般隐患", "重大隐患"]
|
||||
public reformModeMap = ["", "即查即改", "限期整改"]
|
||||
|
||||
public riskSource = [] as any;
|
||||
|
||||
public planTypeMap = {
|
||||
1: "单次计划",
|
||||
2: "长期计划"
|
||||
}
|
||||
|
||||
created() {
|
||||
//
|
||||
//重大危险源
|
||||
this.initRiskSource()
|
||||
}
|
||||
|
||||
public buildTable() {
|
||||
|
|
@ -399,7 +402,27 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
type: "textarea",
|
||||
width: "100%",
|
||||
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.resourceOtherId = this.fileList.map(item => item.id).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.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
|
||||
this.handleClose();
|
||||
|
|
@ -610,6 +636,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public showUpdateModel(row?, isRead?) {
|
||||
this.initRiskSource()
|
||||
this.isReadonly = !!isRead;
|
||||
this.fileList = [];
|
||||
this.photoList = [];
|
||||
|
|
@ -644,6 +671,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||
reformModeName: this.reformModeMap[row.reformMode],
|
||||
}, 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
|
||||
if (row.resourceId) {
|
||||
this.updateParams.photo = row.resourceId
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -257,6 +257,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
labelWidth: "140px",
|
||||
require: true,
|
||||
showError: false,
|
||||
disable: this.updateParams.id && this.updateParams.status !== 1,
|
||||
datas: [{
|
||||
name: "不涉及",
|
||||
disable: false,
|
||||
|
|
@ -858,6 +859,16 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
|
||||
//保存 更新
|
||||
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()) {
|
||||
|
|
@ -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.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
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();
|
||||
})
|
||||
}
|
||||
|
|
@ -881,6 +900,14 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
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();
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,24 +129,4 @@
|
|||
<span class="end-title">结束</span>
|
||||
</el-steps>
|
||||
</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>
|
||||
|
|
@ -162,6 +162,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
public riskLevelMap = {} as any;
|
||||
|
||||
public buildUpdateForm() {
|
||||
console.log(this.updateParams.id && this.updateParams.status !== 1,);
|
||||
|
||||
this.updateOptions = [{
|
||||
name: "区域名称",
|
||||
key: "areaId",
|
||||
|
|
@ -259,9 +261,11 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
disable: this.updateParams.id && this.updateParams.status !== 1,
|
||||
datas: [{
|
||||
name: "不涉及",
|
||||
value: 0
|
||||
value: 0,
|
||||
|
||||
}, {
|
||||
name: "重大危险源",
|
||||
disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0),
|
||||
|
|
@ -848,8 +852,13 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
//获取区域固有风险等级
|
||||
public getAreaRiskLevel(res: any) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'];
|
||||
this.updateParams.analRiskLevel = areaAnalRiskLevel;
|
||||
if (this.areaList.length > 0) {
|
||||
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() {
|
||||
|
|
@ -866,14 +875,33 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
//保存 更新
|
||||
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.riskForm as any).vaildParams()) {
|
||||
this.saveTransformData();
|
||||
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id || this.updateParams.status === 1 ? true : false).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
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();
|
||||
})
|
||||
}
|
||||
|
|
@ -889,6 +917,14 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
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();
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
public currentUrl = null;
|
||||
//排序属性转换
|
||||
public sortAttribute = {
|
||||
submitTime: "submit_time"
|
||||
taskStartTime: "task_start_time",
|
||||
taskEndTime: "task_end_time",
|
||||
} 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: "taskChargeUserName" });
|
||||
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({
|
||||
name: '任务状态', width: "110px", key: "status", render: (data) => {
|
||||
if (data.status == 2) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
@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%" highlight-current-row>
|
||||
style="width: 100%" highlight-current-row @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<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">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
: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">
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
|
@ -44,7 +44,8 @@
|
|||
</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"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
|
|||
})
|
||||
return taskItemName[data.taskItem]
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", width: "250px" });
|
||||
this.tableColumn.push({ name: '责任人', key: "taskChargeUserName", width: "100px" });
|
||||
|
|
@ -350,6 +350,8 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
|
|||
}
|
||||
//发布--终止
|
||||
public doUpdate() {
|
||||
console.log('selectData',this.selectData);
|
||||
|
||||
if (this.selectData && this.selectData.length > 0) {
|
||||
this.filterStatusData = this.selectData[0]['status']
|
||||
const tmpSelectData = this.selectData.filter((item) => item.status !== this.filterStatusData)
|
||||
|
|
@ -416,6 +418,8 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
|
|||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
console.log('data',data);
|
||||
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -282,6 +282,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
created() {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue