forked from xxhjsb/hbt-prevention-ui
feat:积分管理库存不显示,代码重构
parent
f59a246700
commit
9db238dfe3
|
@ -36,6 +36,9 @@ export default new Vuex.Store({
|
|||
prevention_training_level:[],
|
||||
prevention_integral_eventtype:[],
|
||||
prevention_integral_type:[],
|
||||
prevention_risk_source:[],
|
||||
prevention_risk_craft:[],
|
||||
prevention_risk_chemical:[],
|
||||
},
|
||||
getters: {
|
||||
dept_map:(state)=>{
|
||||
|
@ -248,6 +251,27 @@ export default new Vuex.Store({
|
|||
})
|
||||
return map
|
||||
},
|
||||
prevention_risk_source_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_risk_source.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_risk_craft_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_risk_craft.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_risk_chemical_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_risk_chemical.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
setAnalCntrol(state,data){
|
||||
|
@ -344,6 +368,15 @@ export default new Vuex.Store({
|
|||
set_prevention_integral_type(state,data){
|
||||
state.prevention_integral_type = data
|
||||
},
|
||||
set_prevention_risk_source(state,data){
|
||||
state.prevention_risk_source = data
|
||||
},
|
||||
set_prevention_risk_craft(state,data){
|
||||
state.prevention_risk_craft = data
|
||||
},
|
||||
set_prevention_risk_chemical(state,data){
|
||||
state.prevention_risk_chemical = data
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
|
|
|
@ -45,6 +45,9 @@ export default class BlankComponent extends Vue {
|
|||
|
||||
this.systemService.getDictData("prevention_integral_eventtype"),
|
||||
this.systemService.getDictData("prevention_integral_type"),
|
||||
this.systemService.getDictData("prevention_risk_source"),
|
||||
this.systemService.getDictData("prevention_risk_craft"),
|
||||
this.systemService.getDictData("prevention_risk_chemical"),
|
||||
]).then(((results: any) => {
|
||||
|
||||
this.$store.commit("setDeptTreeList", results[0].data);
|
||||
|
@ -239,6 +242,28 @@ export default class BlankComponent extends Vue {
|
|||
}
|
||||
}))
|
||||
|
||||
|
||||
this.$store.commit("set_prevention_risk_source", results[31].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("set_prevention_risk_craft", results[32].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("set_prevention_risk_chemical", results[33].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,
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
.color_level_1{
|
||||
color: #fff;
|
||||
background-color:#3E70EB;
|
||||
background-color:#116FF5;
|
||||
padding: 5px 21px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
.color_level_2{
|
||||
color: #fff;
|
||||
background-color:#E0AF46;
|
||||
background-color:#FFC019;
|
||||
padding: 5px 15px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
.color_level_3{
|
||||
color: #fff;
|
||||
background-color:#EC7B45;
|
||||
background-color:#FF7802;
|
||||
padding: 5px 15px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
.color_level_4{
|
||||
color: #fff;
|
||||
background-color:#E13030;
|
||||
background-color:#E31C21;
|
||||
padding: 5px 15px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
|
|
|
@ -39,8 +39,11 @@
|
|||
<el-button type="text" v-if="isBase || isFile || isManager"
|
||||
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
|
||||
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || scope.row.planType === 2 && scope.row.state===1)"
|
||||
@click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" v-if="isBase"
|
||||
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || scope.row.planType === 2 && scope.row.state===1)"
|
||||
@click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" v-if="isPlan && !scope.row.status"
|
||||
:disabled="scope.row.planType===2 && scope.row.state===0"
|
||||
@click="openSendModel(scope.row)">下发</el-button>
|
||||
|
@ -70,7 +73,7 @@
|
|||
|
||||
<!-- 检查表记录 -->
|
||||
<el-dialog v-if="isPlan || isAction" :close-on-click-modal="false" :title="isPlan?'检查表记录':'检查表'"
|
||||
:visible.sync="showRecord" width="980px" :before-close="handleClose" destroy-on-close>
|
||||
:visible.sync="showRecord" width="980px" :before-close="handleClose" destroy-on-close>
|
||||
<div class="full">
|
||||
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
|
||||
<el-radio-button :label="item.id" v-for="item in tableTabs"
|
||||
|
@ -144,6 +147,13 @@
|
|||
<el-table-column label="隐患描述" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" style="display: flex; align-items: center;">
|
||||
{{scope.row.description}}
|
||||
<!-- <el-image style="width: 60px; margin-left: 10px;" :src="scope.row.urls[0]"
|
||||
:preview-src-list="scope.row.urls">
|
||||
</el-image> -->
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="隐患照片" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" style="display: flex; align-items: center;">
|
||||
<el-image style="width: 60px; margin-left: 10px;" :src="scope.row.urls[0]"
|
||||
:preview-src-list="scope.row.urls">
|
||||
</el-image>
|
||||
|
@ -170,7 +180,7 @@
|
|||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'"
|
||||
:visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close>
|
||||
:visible.sync="showUpdate" width="980px" :before-close="handleClose" destroy-on-close>
|
||||
<div class="sub-title" v-if="isManager || isFile">隐患信息</div>
|
||||
<FormComponent ref="form" :options="updateOptions"
|
||||
:isReadonly="isReadonly || ((isManager || isFile) && updateParams.status>1)" labelWidth="110px"
|
||||
|
@ -219,7 +229,7 @@
|
|||
|
||||
<!-- 下发 -->
|
||||
<el-dialog v-if="isPlan" :close-on-click-modal="false" title="下发" :visible.sync="showSend" width="980px"
|
||||
:before-close="handleClose" destroy-on-close>
|
||||
:before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="sendOptions" :data.sync="sendParams" @change="change" :fullBtn="true"
|
||||
btn-position="center" @actionCallback="sendCallback" :actions="updateActions">
|
||||
<div class="full" style="margin-bottom: 20px;">
|
||||
|
@ -271,7 +281,7 @@
|
|||
|
||||
|
||||
<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>
|
||||
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>
|
||||
|
|
|
@ -752,6 +752,13 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
this.updateParams.executeDeadline = null;
|
||||
return
|
||||
}
|
||||
|
||||
const reform = this.updateParams.reformDeadline
|
||||
if (data > reform) {
|
||||
this.$message.error("治理时限不能超过整改时限")
|
||||
this.updateParams.executeDeadline = null;
|
||||
return
|
||||
}
|
||||
}
|
||||
if (item && item.key === "realConfirmTime") {
|
||||
const now = this.updateParams.createTime;
|
||||
|
|
|
@ -112,7 +112,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '检查对象', key: "analControlNames" });
|
||||
this.tableColumn.push({ name: '检查时间', key: "checkTime" });
|
||||
this.tableColumn.push({ name: '检查执行时间', key: "checkTime" });
|
||||
this.tableColumn.push({ name: '检查负责人', key: "chargeUserName" });
|
||||
this.tableColumn.push({
|
||||
name: '检查表', key: "tableNum", render: (data) => {
|
||||
|
|
|
@ -263,7 +263,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
require: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "检查时间",
|
||||
name: "计划检查时间",
|
||||
key: "time",
|
||||
type: "date",
|
||||
subType: "datetimerange",
|
||||
|
@ -359,7 +359,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '检查时间', width: "270px", render: (data) => {
|
||||
name: '计划检查时间', width: "270px", render: (data) => {
|
||||
return data.startTime + (data.endTime ? '~' + data.endTime : "")
|
||||
}
|
||||
});
|
||||
|
|
|
@ -130,19 +130,23 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
value: "save",
|
||||
type: "primary"
|
||||
}]
|
||||
public subUpdateActions = [] as any;
|
||||
public buildSubForm() {
|
||||
this.subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.index
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
public subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
public tabs = [{
|
||||
name: "待办",
|
||||
|
@ -298,6 +302,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
hide:this.subIsReadonly,
|
||||
}, {
|
||||
name: "单价/积分",
|
||||
type: "number",
|
||||
|
@ -395,7 +400,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", });
|
||||
this.subTableColumn.push({ name: '商品名称', key: "name", });
|
||||
this.subTableColumn.push({ name: '库存', key: "stockNumber", });
|
||||
// this.subTableColumn.push({ name: '库存', key: "stockNumber", });
|
||||
this.subTableColumn.push({ name: '单位', key: "goodsUnit", });
|
||||
this.subTableColumn.push({ name: '单价', key: "goodsPrice", });
|
||||
this.subTableColumn.push({ name: '兑换数量', key: "exchangeNumber", });
|
||||
|
@ -541,6 +546,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
this.buildSubUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
this.subIsReadonly = false
|
||||
this.buildSubForm()
|
||||
} else if (data.value === "save") {
|
||||
if (this.updateParams.pointExchangeDetails.length === 0) {
|
||||
this.$message.error("请您添加兑换清单");
|
||||
|
@ -678,6 +684,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public doSubSave(goOn) {
|
||||
|
||||
// 如果是新增步骤
|
||||
if (this.subShowUpdate) {
|
||||
if (!this.subUpdateParams.exchangeNumber) {
|
||||
|
@ -695,6 +702,13 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
this.countIntegral()
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = !!goOn;
|
||||
if (goOn) {
|
||||
this.goodsList = JSON.parse(JSON.stringify(this.totalGoodsList))
|
||||
this.updateParams.pointExchangeDetails.forEach((item) => {
|
||||
this.goodsList.splice(this.goodsList.findIndex(goodsItem => goodsItem.value === item.goodsId), 1)
|
||||
})
|
||||
this.buildSubUpdateForm()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -713,6 +727,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
})
|
||||
this.subIsReadonly = false
|
||||
this.subUpdateParams = JSON.parse(JSON.stringify(row))
|
||||
this.buildSubForm()
|
||||
}
|
||||
this.subShowUpdate = true
|
||||
this.buildSubUpdateForm()
|
||||
|
@ -748,6 +763,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
let residuePoints = this.updateParams.originalPoints - consumePoint;
|
||||
this.updateParams.consumePoints = consumePoint;
|
||||
this.updateParams.residuePoints = residuePoints;
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
//处理任务
|
||||
|
@ -796,6 +812,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
|||
})
|
||||
this.showProtable = true
|
||||
}
|
||||
this.getIntegralGoods({})
|
||||
}
|
||||
|
||||
//操作
|
||||
|
|
|
@ -227,13 +227,6 @@ export default class IntegralExchangeRecord extends BaseRecordComponent<any> {
|
|||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "库存",
|
||||
type: "number",
|
||||
key: "stockNumber",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "单价/积分",
|
||||
type: "number",
|
||||
key: "goodsPrice",
|
||||
|
@ -285,7 +278,6 @@ export default class IntegralExchangeRecord extends BaseRecordComponent<any> {
|
|||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", });
|
||||
this.subTableColumn.push({ name: '商品名称', key: "name", });
|
||||
this.subTableColumn.push({ name: '库存', key: "stockNumber", });
|
||||
this.subTableColumn.push({ name: '单位', key: "goodsUnit", });
|
||||
this.subTableColumn.push({ name: '单价', key: "goodsPrice", });
|
||||
this.subTableColumn.push({ name: '兑换数量', key: "exchangeNumber", });
|
||||
|
|
|
@ -407,16 +407,17 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public levelName(type) {
|
||||
if (type === 1) {
|
||||
return "一级"
|
||||
} else if (type === 2) {
|
||||
return "二级"
|
||||
} else if (type === 3) {
|
||||
return "三级"
|
||||
} else if (type === 4) {
|
||||
return "四级"
|
||||
} else if (type === 5) {
|
||||
return "不涉及级"
|
||||
switch (type) {
|
||||
case 1:
|
||||
return "一级"
|
||||
case 2:
|
||||
return "二级"
|
||||
case 3:
|
||||
return "三级"
|
||||
case 4:
|
||||
return "四级"
|
||||
case 5:
|
||||
return "不涉及级"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,11 +429,11 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
|
@ -450,9 +451,6 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
||||
mounted() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
|
@ -132,8 +132,8 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public showUpdateModel(id){
|
||||
if(id!==-1){
|
||||
}
|
||||
// if(id!==-1){
|
||||
// }
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
public buildTable() {
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName", width: "200px" });
|
||||
this.tableColumn.push({ name: '风险分析单元', key: "unitName", width: "200px" });
|
||||
this.tableColumn.push({ name: '设备名称', key: "name",width:"250px",showTip: true, });
|
||||
this.tableColumn.push({ name: '设备名称', key: "name", width: "250px", showTip: true, });
|
||||
this.tableColumn.push({
|
||||
name: '设备类别', key: "type", render: (data) => {
|
||||
if (data.type) {
|
||||
|
@ -458,8 +458,8 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="!updateParams.id?'新增':isReadonly?'详情':'编辑'"
|
||||
:visible.sync="showUpdate" width="1080px" :before-close="handleClose" destroy-on-close>
|
||||
:visible.sync="showUpdate" width="1080px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :labelWidth="labelWidth" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="callback" @change="changes">
|
||||
<div class="sub-title">安全检查表分析法</div>
|
||||
|
@ -89,7 +89,7 @@
|
|||
</el-dialog>
|
||||
<!-- 评价 -->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showSubUpdate" width="952px"
|
||||
:before-close="handleAnalyClose" destroy-on-close>
|
||||
:before-close="handleAnalyClose" >
|
||||
<AnalEvaluationComponent :isReadonly="analyIsReadonly" :data.sync="analysisUpdateParams"
|
||||
:show.sync="showSubUpdate" :tabledata.sync="updateParams"
|
||||
:areaList="areaList" :type="'device'" :checkRiskType="checkRiskType" ></AnalEvaluationComponent>
|
||||
|
|
|
@ -71,21 +71,6 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
}];
|
||||
|
||||
public labelWidth = '140px';
|
||||
|
||||
//数据字典
|
||||
public dictData = {
|
||||
source: [],
|
||||
craft: [],
|
||||
chemical: [],
|
||||
mainPerson: [],
|
||||
craftPerson: [],
|
||||
operatePerson: [],
|
||||
measuresSort: [],
|
||||
riskControlLevel: [],
|
||||
seriousResult: [],
|
||||
identifier: [],
|
||||
majorsign: [],
|
||||
} as any;
|
||||
//评估矩阵
|
||||
public showMatrixModal = false;
|
||||
//评价
|
||||
|
@ -293,7 +278,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
format: "majorHazardName",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.dictData.source
|
||||
datas: this.$store.state.prevention_risk_source
|
||||
|
||||
}, {
|
||||
name: "重点监管工艺",
|
||||
|
@ -303,7 +288,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
datas: this.dictData.craft,
|
||||
datas: this.$store.state.prevention_risk_craft,
|
||||
}, {
|
||||
name: "重点监管化学品",
|
||||
key: "regulatoryChemical",
|
||||
|
@ -313,7 +298,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
labelWidth: "130px",
|
||||
datas: this.dictData.chemical,
|
||||
datas: this.$store.state.prevention_risk_chemical
|
||||
}];
|
||||
|
||||
this.subTableActions = [{
|
||||
|
@ -381,36 +366,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
}
|
||||
|
||||
created() {
|
||||
Promise.all([
|
||||
this.systemService.getDictData("prevention_risk_source"),
|
||||
this.systemService.getDictData("prevention_risk_craft"),
|
||||
this.systemService.getDictData("prevention_risk_chemical"),
|
||||
]).then(((results: any) => {
|
||||
this.dictData.source = results[0].data.map((item) => {
|
||||
this.sourceMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.craft = results[1].data.map((item) => {
|
||||
this.craftMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.chemical = results[2].data.map((item) => {
|
||||
this.chemicaltMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.buildUpdateForm()
|
||||
}));
|
||||
//
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
|
@ -530,7 +486,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({ name: '检查项目', key: "itemName" });
|
||||
this.subTableColumn.push({ name: '检查项目', key: "itemName" ,showTip: true,});
|
||||
this.subTableColumn.push({ name: '检查标准', key: "itemStandard", showTip: true, width: "100px" });
|
||||
this.subTableColumn.push({ name: '风险源', key: "riskSource" });
|
||||
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis" });
|
||||
|
@ -584,13 +540,13 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
});
|
||||
this.proTableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
},
|
||||
});
|
||||
this.proTableColumn.push({
|
||||
name: '残余风险等级', key: "remainLevel", width: "150px", render: (data) => {
|
||||
if (data.remainLevel) {
|
||||
return "<span class='color_" + data.remainLevel + "'>" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "</span>"
|
||||
return "<span class='color_level_" + data.remainLevel + "'>" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "</span>"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -643,7 +599,6 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
this.isReadonly = false;
|
||||
} else if (data && data.value === "subDelete") {
|
||||
if (this.subSelectData.length > 0) {
|
||||
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
@ -656,10 +611,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
this.updateParams.deleteIds.push(itemData.id)
|
||||
this.updateParams.items.splice(this.updateParams.items.findIndex(item => item.index === itemData.index), 1)
|
||||
})
|
||||
this.updateParams.items.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
//添加序号
|
||||
this.addCheckTableIndex()
|
||||
this.updateParams.itemNum = this.updateParams.items.length
|
||||
}).catch(() => {
|
||||
//
|
||||
|
@ -691,59 +644,31 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
this.updateParams.unitId = null;
|
||||
}
|
||||
const areaData = this.areaList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
|
||||
this.updateParams.chargeDeptName = null;
|
||||
this.updateParams.chargeUserId = null;
|
||||
this.updateParams.chargeUserName = null;
|
||||
this.updateParams.chargeDeptId = null;
|
||||
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.deviceName = null;
|
||||
this.updateParams.deviceInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
//区域数据
|
||||
this.initAreaParamMethod(areaData);
|
||||
//区域关联数据初始化
|
||||
this.initParamMethod();
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
//单元
|
||||
if (item && item.key === 'unitId') {
|
||||
const unitData = this.unitList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.chargeDeptName = unitData.deptName;
|
||||
this.updateParams.chargeUserId = unitData.userId;
|
||||
this.updateParams.chargeUserName = unitData.userName;
|
||||
this.updateParams.chargeDeptId = unitData.deptId;
|
||||
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.deviceName = null;
|
||||
this.updateParams.deviceInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
//单元数据
|
||||
this.initUnitParamMethod(unitData);
|
||||
//单元关联数据初始化
|
||||
this.initParamMethod();
|
||||
//加载设备设施清单列表
|
||||
this.loadJobData(data)
|
||||
|
||||
}
|
||||
//设备
|
||||
if (item && item.key === 'deviceInventoryId') {
|
||||
const diviceData = this.diviceList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.type = diviceData.type;
|
||||
this.updateParams.postName = diviceData.postName;
|
||||
this.updateParams.postCode = diviceData.postCode;
|
||||
this.updateParams.deviceName = diviceData.name;
|
||||
this.updateParams.name = diviceData.name;
|
||||
this.updateParams.items = diviceData.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
item.itemName = item.name;
|
||||
item.itemStandard = item.standard;
|
||||
return item
|
||||
})
|
||||
this.updateParams.itemNum = diviceData.items.length;
|
||||
//设备
|
||||
this.initDeviceParamMethod(diviceData);
|
||||
}
|
||||
//是否为两大一重
|
||||
//多选 选中不涉及时,其他三项不可选中
|
||||
if (item && item.key === 'majorSign') {
|
||||
if (!data) {
|
||||
data = []
|
||||
|
@ -755,6 +680,54 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
}
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
|
||||
//区域数据
|
||||
public initAreaParamMethod(areaData: any) {
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel;
|
||||
this.updateParams.chargeDeptName = null;
|
||||
this.updateParams.chargeUserId = null;
|
||||
this.updateParams.chargeUserName = null;
|
||||
this.updateParams.chargeDeptId = null;
|
||||
}
|
||||
|
||||
//单元数据
|
||||
public initUnitParamMethod(unitData: any) {
|
||||
this.updateParams.chargeDeptName = unitData.deptName;
|
||||
this.updateParams.chargeUserId = unitData.userId;
|
||||
this.updateParams.chargeUserName = unitData.userName;
|
||||
this.updateParams.chargeDeptId = unitData.deptId;
|
||||
}
|
||||
|
||||
//区域单元切换,数据初始化
|
||||
public initParamMethod() {
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.deviceName = null;
|
||||
this.updateParams.deviceInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
}
|
||||
|
||||
|
||||
//设备数据
|
||||
public initDeviceParamMethod(diviceData: any) {
|
||||
this.updateParams.type = diviceData.type;
|
||||
this.updateParams.postName = diviceData.postName;
|
||||
this.updateParams.postCode = diviceData.postCode;
|
||||
this.updateParams.deviceName = diviceData.name;
|
||||
this.updateParams.name = diviceData.name;
|
||||
this.updateParams.items = diviceData.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
item.itemName = item.name;
|
||||
item.itemStandard = item.standard;
|
||||
return item;
|
||||
});
|
||||
this.updateParams.itemNum = diviceData.items.length;
|
||||
}
|
||||
|
||||
//加载设备设施清单列表
|
||||
public loadJobData(unitId) {
|
||||
this.tableService.selectDeviceByUnit({ unitId: unitId, id: this.updateParams.id ? this.updateParams.id : null }).then((res: any) => {
|
||||
|
@ -809,45 +782,23 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId).then((res: any) => {
|
||||
if (isReadonly) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel']
|
||||
const majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null
|
||||
const regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null
|
||||
const regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null
|
||||
|
||||
this.updateParams = Object.assign({
|
||||
majorHazardName: majorHazard || majorHazard === 0 ? this.sourceMap[majorHazard] : null,
|
||||
regulatoryProcessName: regulatoryProcess || regulatoryProcess === 0 ? this.craftMap[regulatoryProcess] : null,
|
||||
regulatoryChemicalName: regulatoryChemical || regulatoryChemical === 0 ? this.chemicaltMap[regulatoryChemical] : null,
|
||||
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type],
|
||||
analRiskLevelName: this.$store.getters.prevention_risk_level_map[areaAnalRiskLevel]
|
||||
}, res.data)
|
||||
this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : null
|
||||
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
|
||||
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
|
||||
this.updateParams.items = this.updateParams.items.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
//select项翻译
|
||||
this.readonlyParamTransform(res);
|
||||
//添加序号
|
||||
this.addCheckTableIndex()
|
||||
this.isReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.isModifyonly = true
|
||||
this.updateParams = res.data;
|
||||
this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : []
|
||||
this.updateParams.majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null
|
||||
this.updateParams.regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null
|
||||
this.updateParams.regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel']
|
||||
this.updateParams.analRiskLevel = areaAnalRiskLevel
|
||||
//对select进行转换
|
||||
this.updateParamTransform(res);
|
||||
//获取区域固有风险等级
|
||||
this.getAreaRiskLevel(res);
|
||||
this.loadUnitData(res.data.areaId)
|
||||
this.loadJobData(res.data.unitId)
|
||||
this.updateParams.items.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
//添加序号
|
||||
this.addCheckTableIndex()
|
||||
}
|
||||
|
||||
this.buildUpdateForm()
|
||||
|
@ -857,6 +808,38 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
}
|
||||
}
|
||||
|
||||
//查看,select项翻译
|
||||
public readonlyParamTransform(res: any) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'];
|
||||
const majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null;
|
||||
const regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null;
|
||||
const regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null;
|
||||
|
||||
this.updateParams = Object.assign({
|
||||
majorHazardName: majorHazard || majorHazard === 0 ? this.$store.getters.prevention_risk_source_map[majorHazard] : null,
|
||||
regulatoryProcessName: regulatoryProcess || regulatoryProcess === 0 ? this.$store.getters.prevention_risk_craft_map[regulatoryProcess] : null,
|
||||
regulatoryChemicalName: regulatoryChemical || regulatoryChemical === 0 ? this.$store.getters.prevention_risk_chemical_map[regulatoryChemical] : null,
|
||||
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type],
|
||||
analRiskLevelName: this.$store.getters.prevention_risk_level_map[areaAnalRiskLevel]
|
||||
}, res.data);
|
||||
}
|
||||
|
||||
//编辑对select进行转换
|
||||
public updateParamTransform(res: any) {
|
||||
this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : [];
|
||||
this.updateParams.majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null;
|
||||
this.updateParams.regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null;
|
||||
this.updateParams.regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null;
|
||||
}
|
||||
//获取区域固有风险等级
|
||||
public getAreaRiskLevel(res: any) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'];
|
||||
this.updateParams.analRiskLevel = areaAnalRiskLevel;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
@ -864,45 +847,44 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
//保存 更新
|
||||
public doSave(goOn?) {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
if (!this.updateParams.id) {
|
||||
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
|
||||
this.updateParams.items = this.updateParams.steps
|
||||
this.updateParams.itemNum = this.updateParams.steps.length
|
||||
} else {
|
||||
this.updateParams.itemNum = this.updateParams.items.length
|
||||
}
|
||||
}
|
||||
//对数据进行处理
|
||||
this.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.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//存草稿
|
||||
public doSaveDraft() {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
|
||||
this.updateParams.items = this.updateParams.steps
|
||||
this.updateParams.itemNum = this.updateParams.steps.length
|
||||
} else {
|
||||
this.updateParams.itemNum = this.updateParams.items.length
|
||||
}
|
||||
//对数据进行处理
|
||||
this.saveTransformData();
|
||||
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.showUpdate = false;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
//保存 存草稿 对数据进行处理
|
||||
public saveTransformData() {
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign);
|
||||
this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess);
|
||||
this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical);
|
||||
this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard);
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor);
|
||||
if (!this.updateParams.id) {
|
||||
if (this.updateParams.steps && this.updateParams.steps.length > 0) {
|
||||
this.updateParams.items = this.updateParams.steps;
|
||||
this.updateParams.itemNum = this.updateParams.steps.length;
|
||||
} else {
|
||||
this.updateParams.itemNum = this.updateParams.items.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
|
@ -940,43 +922,61 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
if (row) {
|
||||
if (isReadonly) {
|
||||
this.analyIsReadonly = true;
|
||||
this.analysisUpdateParams = Object.assign({
|
||||
seriousResultName: !row.seriousResult ? null : row.seriousResult.split(",").map(item => this.$store.getters.prevention_serious_result_map[item]).join(","),
|
||||
safetySignName: !row.safetySign ? null : row.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
|
||||
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
|
||||
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[row.deviceType]
|
||||
}, row)
|
||||
//select 翻译
|
||||
this.analysisTransformParam(row);
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
this.analysisUpdateParams.measures.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
//管控措施
|
||||
this.initAnalysisMeasure();
|
||||
} else {
|
||||
this.analyIsReadonly = false
|
||||
// 暂存数据 用于取消修改
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult)
|
||||
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign)
|
||||
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(",") : []
|
||||
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(",") : []
|
||||
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName
|
||||
this.analysisUpdateParams.deviceName = this.updateParams.name
|
||||
this.analysisUpdateParams.deviceType = this.updateParams.type
|
||||
this.checkRiskType.risk = this.analysisUpdateParams.riskChoose
|
||||
this.checkRiskType.remain = this.analysisUpdateParams.remainChoose
|
||||
|
||||
this.analysisUpdateParams.measures.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
//编辑 参数处理
|
||||
this.updateAnalysisParam(row);
|
||||
//管控措施
|
||||
this.initAnalysisMeasure();
|
||||
|
||||
}
|
||||
}
|
||||
this.showSubUpdate = true
|
||||
}
|
||||
|
||||
//安全检查分析法 查看翻译
|
||||
public analysisTransformParam(row: any) {
|
||||
this.analysisUpdateParams = Object.assign({
|
||||
seriousResultName: !row.seriousResult ? null : row.seriousResult.split(",").map(item => this.$store.getters.prevention_serious_result_map[item]).join(","),
|
||||
safetySignName: !row.safetySign ? null : row.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
|
||||
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
|
||||
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[row.deviceType]
|
||||
}, row);
|
||||
}
|
||||
|
||||
//安全检查 编辑 数据处理
|
||||
public updateAnalysisParam(row: any) {
|
||||
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult);
|
||||
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign);
|
||||
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(",") : [];
|
||||
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(",") : [];
|
||||
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName;
|
||||
this.analysisUpdateParams.deviceName = this.updateParams.name;
|
||||
this.analysisUpdateParams.deviceType = this.updateParams.type;
|
||||
this.checkRiskType.risk = this.analysisUpdateParams.riskChoose;
|
||||
this.checkRiskType.remain = this.analysisUpdateParams.remainChoose;
|
||||
}
|
||||
|
||||
//管控措施初始化
|
||||
public initAnalysisMeasure() {
|
||||
if (!this.analysisUpdateParams.measures) {
|
||||
this.analysisUpdateParams.measures = [];
|
||||
}
|
||||
this.analysisUpdateParams.measures.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
//数组转字符串
|
||||
public arrayChangeString(data) {
|
||||
if (data && data.length > 0) {
|
||||
|
@ -1005,6 +1005,13 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
|||
return null
|
||||
}
|
||||
}
|
||||
//安全检查法 add 序号
|
||||
public addCheckTableIndex() {
|
||||
this.updateParams.items.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -348,6 +348,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
this.subTableColumn.push({ name: '作业人', key: "workerName" });
|
||||
}
|
||||
|
||||
//作业步骤
|
||||
public showSteps(el, data) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if (isTarget) {
|
||||
|
@ -514,7 +515,8 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
this.isReadonly = !!isRead;
|
||||
if (!row) {
|
||||
this.updateParams = {
|
||||
steps: [], identifyTime: moment().format('YYYY-MM-DD'),
|
||||
steps: [],
|
||||
identifyTime: moment().format('YYYY-MM-DD'),
|
||||
identifyUserId: this.account.userId,
|
||||
} as any;
|
||||
} else {
|
||||
|
|
|
@ -52,7 +52,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
public subTableColumn = [] as any;
|
||||
public currentId = -1;
|
||||
|
||||
public sourceMap = {} as any;
|
||||
public craftMap = {} as any;
|
||||
public chemicaltMap = {} as any
|
||||
public majorsignMap = {} as any;
|
||||
|
@ -71,20 +70,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
value: "cancel"
|
||||
}];
|
||||
|
||||
//数据字典
|
||||
public dictData = {
|
||||
source: [],
|
||||
craft: [],
|
||||
chemical: [],
|
||||
mainPerson: [],
|
||||
craftPerson: [],
|
||||
operatePerson: [],
|
||||
measuresSort: [],
|
||||
riskControlLevel: [],
|
||||
seriousResult: [],
|
||||
identifier: [],
|
||||
majorsign: [],
|
||||
} as any;
|
||||
//评估矩阵
|
||||
public showMatrixModal = false;
|
||||
//评价
|
||||
|
@ -292,7 +277,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
// multiple: true,
|
||||
datas: this.dictData.source,
|
||||
datas: this.$store.state.prevention_risk_source,
|
||||
showError: false,
|
||||
|
||||
}, {
|
||||
|
@ -304,7 +289,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
// multiple: true,
|
||||
datas: this.dictData.craft,
|
||||
datas: this.$store.state.prevention_risk_craft,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "重点监管化学品",
|
||||
|
@ -315,7 +300,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
// multiple: true,
|
||||
datas: this.dictData.chemical,
|
||||
datas: this.$store.state.prevention_risk_chemical,
|
||||
showError: false,
|
||||
}];
|
||||
|
||||
|
@ -386,36 +371,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
created() {
|
||||
Promise.all([
|
||||
this.systemService.getDictData("prevention_risk_source"),
|
||||
this.systemService.getDictData("prevention_risk_craft"),
|
||||
this.systemService.getDictData("prevention_risk_chemical"),
|
||||
]).then(((results: any) => {
|
||||
this.dictData.source = results[0].data.map((item) => {
|
||||
this.sourceMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.craft = results[1].data.map((item) => {
|
||||
this.craftMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
this.dictData.chemical = results[2].data.map((item) => {
|
||||
this.chemicaltMap[item.dictValue] = item.dictLabel;
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.buildUpdateForm()
|
||||
}));
|
||||
//
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
|
@ -635,14 +591,18 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.buildActionsForm()
|
||||
} else if (data.value === "cancel") {
|
||||
this.handleClose()
|
||||
//评估矩阵
|
||||
} else if (data.value === "estimateMatrix") {
|
||||
this.showMatrixModal = true
|
||||
//保存
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
this.isReadonly = false;
|
||||
//存草稿
|
||||
} else if (data && data.value === 'addDraft') {
|
||||
this.doSaveDraft()
|
||||
this.isReadonly = false;
|
||||
//工作危害分析的删除
|
||||
} else if (data && data.value === "subDelete") {
|
||||
if (this.subSelectData.length > 0) {
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
|
@ -657,10 +617,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.updateParams.deleteIds.push(itemData.id)
|
||||
this.updateParams.steps.splice(this.updateParams.steps.findIndex(item => item.index === itemData.index), 1)
|
||||
})
|
||||
this.updateParams.steps.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
//分析步骤添加序号
|
||||
this.addStepsIndex()
|
||||
this.updateParams.stepNum = this.updateParams.steps.length
|
||||
}).catch(() => {
|
||||
//
|
||||
|
@ -692,57 +650,32 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.updateParams.unitId = null;
|
||||
}
|
||||
const areaData = this.areaList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
|
||||
// this.updateParams.analRiskLevel = areaData.analRiskLevel
|
||||
this.updateParams.chargeDeptName = null;
|
||||
this.updateParams.chargeUserId = null;
|
||||
this.updateParams.chargeUserName = null;
|
||||
this.updateParams.chargeDeptId = null;
|
||||
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.jobInventoryName = null;
|
||||
this.updateParams.jobInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
//区域数据
|
||||
this.initAreaParamMethod(areaData);
|
||||
//区域关联数据初始化
|
||||
this.initParamMethod();
|
||||
//关联单元
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
//单元
|
||||
if (item && item.key === 'unitId') {
|
||||
const unitData = this.unitList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.chargeDeptName = unitData.deptName;
|
||||
this.updateParams.chargeUserId = unitData.userId;
|
||||
this.updateParams.chargeUserName = unitData.userName;
|
||||
this.updateParams.chargeDeptId = unitData.deptId;
|
||||
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.jobInventoryName = null;
|
||||
this.updateParams.jobInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
//单元数据
|
||||
this.initUnitParamMethod(unitData);
|
||||
//单元关联数据初始化
|
||||
this.initParamMethod();
|
||||
//关联作业活动
|
||||
this.loadJobData(data)
|
||||
|
||||
}
|
||||
//作业清单
|
||||
if (item && item.key === 'jobInventoryId') {
|
||||
const jobData = this.jobList.find((itm: any) => itm.value === data) as any;
|
||||
this.updateParams.location = jobData.location;
|
||||
this.updateParams.postCode = jobData.postCode;
|
||||
this.updateParams.postName = jobData.postName;
|
||||
this.updateParams.steps = jobData.steps;
|
||||
this.updateParams.jobInventoryName = jobData.name;
|
||||
this.updateParams.stepNum = jobData.steps.length;
|
||||
this.updateParams.steps.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
//作业活动
|
||||
this.initJobParamMethod(jobData)
|
||||
}
|
||||
//是否为两大一重
|
||||
//多选 选中不涉及时,其他三项不可选中
|
||||
if (item && item.key === 'majorSign') {
|
||||
if (!data) {
|
||||
data = []
|
||||
|
@ -772,6 +705,47 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
//区域数据
|
||||
public initAreaParamMethod(areaData: any) {
|
||||
this.updateParams.analRiskLevel = areaData.analRiskLevel;
|
||||
this.updateParams.chargeDeptName = null;
|
||||
this.updateParams.chargeUserId = null;
|
||||
this.updateParams.chargeUserName = null;
|
||||
this.updateParams.chargeDeptId = null;
|
||||
}
|
||||
|
||||
//单元数据
|
||||
public initUnitParamMethod(unitData: any) {
|
||||
this.updateParams.chargeDeptName = unitData.deptName;
|
||||
this.updateParams.chargeUserId = unitData.userId;
|
||||
this.updateParams.chargeUserName = unitData.userName;
|
||||
this.updateParams.chargeDeptId = unitData.deptId;
|
||||
}
|
||||
|
||||
//作业活动数据
|
||||
public initJobParamMethod(jobData: any) {
|
||||
this.updateParams.location = jobData.location;
|
||||
this.updateParams.postCode = jobData.postCode;
|
||||
this.updateParams.postName = jobData.postName;
|
||||
this.updateParams.steps = jobData.steps;
|
||||
this.updateParams.jobInventoryName = jobData.name;
|
||||
this.updateParams.stepNum = jobData.steps.length;
|
||||
this.updateParams.steps.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
}
|
||||
//区域单元切换,数据初始化
|
||||
public initParamMethod() {
|
||||
this.updateParams.type = null;
|
||||
this.updateParams.postName = null;
|
||||
this.updateParams.postCode = null;
|
||||
this.updateParams.jobInventoryName = null;
|
||||
this.updateParams.jobInventoryId = null;
|
||||
this.updateParams.name = null;
|
||||
this.updateParams.location = null;
|
||||
this.updateParams.steps = [];
|
||||
this.updateParams.stepNum = 0;
|
||||
}
|
||||
//作业步骤
|
||||
public showPros(el, data) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
|
@ -798,45 +772,26 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId).then((res: any) => {
|
||||
if (isReadonly) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel']
|
||||
const majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null
|
||||
const regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null
|
||||
const regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null
|
||||
this.updateParams = Object.assign({
|
||||
majorHazardName: majorHazard || majorHazard === 0 ? this.sourceMap[majorHazard] : null,
|
||||
regulatoryProcessName: regulatoryProcess || regulatoryProcess === 0 ? this.craftMap[regulatoryProcess] : null,
|
||||
regulatoryChemicalName: regulatoryChemical || regulatoryChemical === 0 ? this.chemicaltMap[regulatoryChemical] : null,
|
||||
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type],
|
||||
analRiskLevelName: this.$store.getters.prevention_risk_level_map[areaAnalRiskLevel]
|
||||
}, res.data)
|
||||
this.updateParams.majorSign = this.stringChangeArray(res.data.majorSign)
|
||||
this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard)
|
||||
this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical)
|
||||
this.updateParams.steps = this.updateParams.steps.map((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item
|
||||
})
|
||||
//select项翻译
|
||||
this.readonlyParamTransform(res);
|
||||
//分析步骤添加序号
|
||||
this.addStepsIndex()
|
||||
this.isReadonly = true;
|
||||
this.isModifyonly = false
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.isModifyonly = true
|
||||
this.updateParams = res.data;
|
||||
this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : []
|
||||
this.updateParams.majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null
|
||||
this.updateParams.regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null
|
||||
this.updateParams.regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel']
|
||||
this.updateParams.analRiskLevel = areaAnalRiskLevel
|
||||
//对select进行转换
|
||||
this.updateParamTransform(res);
|
||||
//获取区域固有风险等级
|
||||
this.getAreaRiskLevel(res);
|
||||
//加载区域
|
||||
this.loadUnitData(res.data.areaId)
|
||||
//加载单元
|
||||
this.loadJobData(res.data.unitId)
|
||||
this.updateParams.steps.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
//分析步骤添加序号
|
||||
this.addStepsIndex()
|
||||
}
|
||||
|
||||
this.buildUpdateForm();
|
||||
|
@ -846,6 +801,40 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//查看,select项翻译
|
||||
public readonlyParamTransform(res: any) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'];
|
||||
const majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null;
|
||||
const regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null;
|
||||
const regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null;
|
||||
this.updateParams = Object.assign({
|
||||
majorHazardName: majorHazard || majorHazard === 0 ? this.$store.getters.prevention_risk_source_map[majorHazard] : null,
|
||||
regulatoryProcessName: regulatoryProcess || regulatoryProcess === 0 ? this.$store.getters.prevention_risk_craft_map[regulatoryProcess] : null,
|
||||
regulatoryChemicalName: regulatoryChemical || regulatoryChemical === 0 ? this.$store.getters.prevention_risk_chemical_map[regulatoryChemical] : null,
|
||||
majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel],
|
||||
typeName: this.$store.getters.prevention_device_type_map[res.data.type],
|
||||
analRiskLevelName: this.$store.getters.prevention_risk_level_map[areaAnalRiskLevel]
|
||||
}, res.data);
|
||||
}
|
||||
|
||||
//编辑对select进行转换
|
||||
public updateParamTransform(res: any) {
|
||||
this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : [];
|
||||
this.updateParams.majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null;
|
||||
this.updateParams.regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null;
|
||||
this.updateParams.regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null;
|
||||
}
|
||||
|
||||
//获取区域固有风险等级
|
||||
public getAreaRiskLevel(res: any) {
|
||||
const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'];
|
||||
this.updateParams.analRiskLevel = areaAnalRiskLevel;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
@ -857,33 +846,37 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
//保存 更新
|
||||
public doSave(goOn?) {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
//对数据进行处理
|
||||
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.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//存草稿
|
||||
public doSaveDraft() {
|
||||
// 如果是新增工作危害分析清单
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign)
|
||||
this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess)
|
||||
this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical)
|
||||
this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard)
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor)
|
||||
//对数据进行处理
|
||||
this.saveTransformData();
|
||||
this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.showUpdate = false;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
public toggleAll() {
|
||||
//保存处理数据
|
||||
public saveTransformData() {
|
||||
this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign);
|
||||
this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess);
|
||||
this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical);
|
||||
this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard);
|
||||
this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor);
|
||||
}
|
||||
|
||||
public toggleAll() {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
|
@ -917,45 +910,56 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
if (row) {
|
||||
if (isReadonly) {
|
||||
this.analyIsReadonly = true;
|
||||
this.analysisUpdateParams = Object.assign({
|
||||
seriousResultName: row.seriousResult.split(",").map(item => this.$store.getters.prevention_serious_result_map[item]).join(","),
|
||||
safetySignName: row.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
|
||||
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
|
||||
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
|
||||
}, row)
|
||||
//select 翻译
|
||||
this.analysisTransformParam(row);
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
if (!this.analysisUpdateParams.measures) {
|
||||
this.analysisUpdateParams.measures = []
|
||||
}
|
||||
this.analysisUpdateParams.measures.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
//管控措施
|
||||
this.initAnalysisMeasure();
|
||||
} else {
|
||||
this.analyIsReadonly = false
|
||||
// 暂存数据 用于取消修改
|
||||
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
|
||||
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult)
|
||||
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign)
|
||||
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(",") : []
|
||||
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(",") : []
|
||||
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName
|
||||
this.checkRiskType.risk = this.analysisUpdateParams.riskChoose
|
||||
this.checkRiskType.remain = this.analysisUpdateParams.remainChoose
|
||||
if (!this.analysisUpdateParams.measures) {
|
||||
this.analysisUpdateParams.measures = []
|
||||
}
|
||||
this.analysisUpdateParams.measures.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
return item
|
||||
})
|
||||
//编辑 参数处理
|
||||
this.updateAnalysisParam(row);
|
||||
//管控措施
|
||||
this.initAnalysisMeasure();
|
||||
|
||||
}
|
||||
}
|
||||
this.showSubUpdate = true
|
||||
}
|
||||
|
||||
//工作危害分析法 查看翻译
|
||||
public analysisTransformParam(row: any) {
|
||||
this.analysisUpdateParams = Object.assign({
|
||||
seriousResultName: row.seriousResult.split(",").map(item => this.$store.getters.prevention_serious_result_map[item]).join(","),
|
||||
safetySignName: row.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(","),
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[row.riskLevel],
|
||||
remainLevelName: this.$store.getters.prevention_risk_level_map[row.remainLevel],
|
||||
riskControlLevelName: this.$store.getters.prevention_control_level_map[row.riskControlLevel],
|
||||
}, row);
|
||||
}
|
||||
//分析法编辑 数据处理
|
||||
public updateAnalysisParam(row: any) {
|
||||
this.analysisUpdateParams.seriousResult = this.stringChangeArray(row.seriousResult);
|
||||
this.analysisUpdateParams.safetySign = this.stringChangeArray(row.safetySign);
|
||||
this.analysisUpdateParams.riskChoose = row.riskChoose ? row.riskChoose.split(",") : [];
|
||||
this.analysisUpdateParams.remainChoose = row.remainChoose ? row.remainChoose.split(",") : [];
|
||||
this.analysisUpdateParams.chargeUserName = this.updateParams.chargeUserName;
|
||||
this.checkRiskType.risk = this.analysisUpdateParams.riskChoose;
|
||||
this.checkRiskType.remain = this.analysisUpdateParams.remainChoose;
|
||||
}
|
||||
//管控措施初始化
|
||||
public initAnalysisMeasure() {
|
||||
if (!this.analysisUpdateParams.measures) {
|
||||
this.analysisUpdateParams.measures = [];
|
||||
}
|
||||
this.analysisUpdateParams.measures.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
//数组转字符串
|
||||
public arrayChangeString(data) {
|
||||
if (data && data.length > 0) {
|
||||
|
@ -985,6 +989,14 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
|
||||
//工作危害分析步骤 add 序号
|
||||
public addStepsIndex() {
|
||||
this.updateParams.steps.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss"></style>
|
||||
|
|
|
@ -68,7 +68,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
public showUpdate = false;
|
||||
public updateParams = {
|
||||
result:1
|
||||
result: 1
|
||||
} as any;
|
||||
public selectData = [];
|
||||
|
||||
|
@ -94,7 +94,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
labelWidth: 'auto',
|
||||
require: true,
|
||||
disable: true,
|
||||
|
||||
|
||||
datas: [
|
||||
{
|
||||
name: "否",
|
||||
|
@ -161,7 +161,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
width: "100%",
|
||||
require: true,
|
||||
hide: this.updateParams.result === 1 || this.updateParams.dangerFlag == 0,
|
||||
datas: this.$store.state.prevention_hazard_category,
|
||||
datas: this.$store.state.prevention_danger_type,
|
||||
}, {
|
||||
name: "隐患归属人",
|
||||
key: "ownerId",
|
||||
|
@ -310,7 +310,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
this.updateParams = {
|
||||
result:1
|
||||
result: 1
|
||||
} as any;
|
||||
} else if (data.value === "save") {
|
||||
this.doSave()
|
||||
|
@ -329,7 +329,6 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
this.userListName[item.value] = item.name
|
||||
})
|
||||
|
||||
|
||||
this.updateParams.taskChargeUserName = this.userListName[this.account.userId]
|
||||
this.updateParams.ownerName = this.userListName[this.updateParams.ownerId]
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id).then((res) => {
|
||||
|
@ -343,13 +342,13 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
if (item && item.key === "result") {
|
||||
if (data === 1) {
|
||||
this.updateParams.dangerFlag = null
|
||||
// this.updateParams.taskName = null
|
||||
this.updateParams.taskType = null
|
||||
this.updateParams.ownerId = null
|
||||
} else if (data === 2) {
|
||||
this.updateParams.dangerFlag = 0
|
||||
}
|
||||
this.subUpdateForm()
|
||||
}
|
||||
|
||||
if (item && item.key === "dangerFlag") {
|
||||
if (data === 0) {
|
||||
this.updateParams.taskType = null
|
||||
|
@ -358,7 +357,6 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
this.subUpdateForm()
|
||||
}
|
||||
this.subUpdateForm()
|
||||
|
||||
}
|
||||
|
||||
// 重置数据
|
||||
|
@ -380,7 +378,6 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
|
@ -451,10 +448,10 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
|||
// checkUserId: this.account.userId,
|
||||
checkTime: moment().format('YYYY-MM-DD HH:mm'),
|
||||
imeiCode: moment().format('DDHHmm') + mathData,
|
||||
result:1
|
||||
result: 1
|
||||
}, row)
|
||||
this.updateParams.checkUserId = this.account.userId,
|
||||
this.updateParams.status = 1
|
||||
this.updateParams.status = 1
|
||||
this.updateParams.endTime = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
this.subUpdateForm()
|
||||
this.showUpdate = true
|
||||
|
|
|
@ -323,8 +323,8 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '管控对象', key: "controlName",});
|
||||
this.tableColumn.push({ name: '分析对象', key: "analName",});
|
||||
this.tableColumn.push({ name: '管控对象', key: "controlName", });
|
||||
this.tableColumn.push({ name: '分析对象', key: "analName", });
|
||||
this.tableColumn.push({ name: '风险源', key: "riskSource", });
|
||||
this.tableColumn.push({
|
||||
name: '事故后果', key: "seriousResult", render: (data) => {
|
||||
|
@ -352,7 +352,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '评估人', key: "appraiser" });
|
||||
this.tableColumn.push({ name: '评估时间', key: "appraiseTime",});
|
||||
this.tableColumn.push({ name: '评估时间', key: "appraiseTime", });
|
||||
}
|
||||
|
||||
|
||||
|
@ -392,76 +392,94 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
|||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
|
||||
//查看
|
||||
public showUpdateModel(row) {
|
||||
this.showUpdate = true
|
||||
const tmprow = JSON.parse(JSON.stringify(row))
|
||||
this.subUpdateParams = tmprow
|
||||
this.subUpdateParams.safetySignName =tmprow.safetySign? tmprow.safetySign.split(',').map(item => this.$store.getters.prevention_security_identifier_map[item]).join(","):null
|
||||
this.subUpdateParams.safetySignName = tmprow.safetySign ? tmprow.safetySign.split(',').map(item => this.$store.getters.prevention_security_identifier_map[item]).join(",") : null
|
||||
this.subUpdateParams.seriousResultName = tmprow.seriousResult.split(',').map(item => this.$store.getters.prevention_serious_result_map[item]).join(",")
|
||||
|
||||
//风险评估
|
||||
this.riskUpdateParams.riskLevelName = this.$store.getters.prevention_risk_level_map[tmprow.riskLevel]
|
||||
this.riskUpdateParams.riskControlLevelName = this.$store.getters.prevention_control_level_map[tmprow.riskControlLevel]
|
||||
if (tmprow.riskLsValue) {
|
||||
const riskLsValue = JSON.parse(tmprow.riskLsValue)
|
||||
const tmpRiskLsValue = {}
|
||||
for (let key in riskLsValue) {
|
||||
if (key.indexOf('ls') !== -1) {
|
||||
tmpRiskLsValue[key] = riskLsValue[key];
|
||||
}
|
||||
}
|
||||
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLsValue }
|
||||
this.riskUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade]
|
||||
this.handleRiskLs(tmprow);
|
||||
}
|
||||
if (tmprow.riskLecValue) {
|
||||
const riskLecValue = JSON.parse(tmprow.riskLecValue)
|
||||
const tmpRiskLecValue = {}
|
||||
for (let key in riskLecValue) {
|
||||
if (key.indexOf('lec') !== -1) {
|
||||
tmpRiskLecValue[key] = riskLecValue[key];
|
||||
}
|
||||
}
|
||||
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLecValue }
|
||||
this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade]
|
||||
this.handleRiskLec(tmprow);
|
||||
}
|
||||
|
||||
//残余风险评估
|
||||
this.remainUpdateParams.remainLevelName = this.$store.getters.prevention_risk_level_map[tmprow.remainLevel]
|
||||
if (tmprow.remainLsValue) {
|
||||
const remainLsValue = JSON.parse(tmprow.remainLsValue)
|
||||
const tmpRemainLsValue = {}
|
||||
for (let key in remainLsValue) {
|
||||
if (key.indexOf('ls') !== -1) {
|
||||
tmpRemainLsValue[key] = remainLsValue[key];
|
||||
}
|
||||
}
|
||||
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLsValue }
|
||||
this.remainUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lsgrade]
|
||||
this.handelRemainRiskLs(tmprow);
|
||||
|
||||
}
|
||||
if (tmprow.remainLecValue) {
|
||||
const remainLecValue = JSON.parse(tmprow.remainLecValue)
|
||||
const tmpRemainLecValue = {}
|
||||
for (let key in remainLecValue) {
|
||||
if (key.indexOf('lec') !== -1) {
|
||||
tmpRemainLecValue[key] = remainLecValue[key];
|
||||
}
|
||||
}
|
||||
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLecValue }
|
||||
this.remainUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lecgrade]
|
||||
this.handleRemainRiskLec(tmprow);
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
//处理 风险评估LS
|
||||
public handleRiskLs(tmprow: any) {
|
||||
const riskLsValue = JSON.parse(tmprow.riskLsValue);
|
||||
const tmpRiskLsValue = {};
|
||||
for (let key in riskLsValue) {
|
||||
if (key.indexOf('ls') !== -1) {
|
||||
tmpRiskLsValue[key] = riskLsValue[key];
|
||||
}
|
||||
}
|
||||
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLsValue };
|
||||
this.riskUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade];
|
||||
}
|
||||
|
||||
//处理 风险评估 lec
|
||||
public handleRiskLec(tmprow: any) {
|
||||
const riskLecValue = JSON.parse(tmprow.riskLecValue);
|
||||
const tmpRiskLecValue = {};
|
||||
for (let key in riskLecValue) {
|
||||
if (key.indexOf('lec') !== -1) {
|
||||
tmpRiskLecValue[key] = riskLecValue[key];
|
||||
}
|
||||
}
|
||||
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLecValue };
|
||||
this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade];
|
||||
}
|
||||
|
||||
//处理 残余风险评估LS
|
||||
public handelRemainRiskLs(tmprow: any) {
|
||||
const remainLsValue = JSON.parse(tmprow.remainLsValue);
|
||||
const tmpRemainLsValue = {};
|
||||
for (let key in remainLsValue) {
|
||||
if (key.indexOf('ls') !== -1) {
|
||||
tmpRemainLsValue[key] = remainLsValue[key];
|
||||
}
|
||||
}
|
||||
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLsValue };
|
||||
this.remainUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lsgrade];
|
||||
}
|
||||
//处理 残余风险评估Lec
|
||||
public handleRemainRiskLec(tmprow: any) {
|
||||
const remainLecValue = JSON.parse(tmprow.remainLecValue);
|
||||
const tmpRemainLecValue = {};
|
||||
for (let key in remainLecValue) {
|
||||
if (key.indexOf('lec') !== -1) {
|
||||
tmpRemainLecValue[key] = remainLecValue[key];
|
||||
}
|
||||
}
|
||||
this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLecValue };
|
||||
this.remainUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lecgrade];
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue