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