Commit cf6fcf52 authored by p-wanping.song's avatar p-wanping.song

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/rongtong-app into dev-swp

parents 9dbc7f59 a55ac9de
......@@ -114,7 +114,6 @@ export default {
getFun("/risk/plan/dept/list").then(res => {
this.allDeptList = res.data;
this.deptList = this.allDeptList.filter(item => item.parentId == 0);
console.log(res.data);
});
},
// // 待搜索框内容发生变化
......@@ -139,7 +138,6 @@ export default {
else this.showPre = false;
this.deptName = data.deptName;
this.deptId = data.deptId;
console.log(this.deptList);
// this.deptId = data.deptId;
// this.searchVal = "";
// this.deptName = data.deptName;
......@@ -150,7 +148,6 @@ export default {
goBack() {
var parentId = this.allDeptList.find(item => item.deptId == this.deptId)
.parentId;
console.log(parentId);
if (parentId != 0) {
this.showPre = true;
var dept = this.allDeptList.find(item => item.deptId == parentId);
......
<template>
<div class="wrap" ref="mapmidbox">
<van-sticky v-if="showHeader">
<header class="header">
<span @click="close" class="iconLeft"> 返回</span>
<span>{{text}}</span>
<span @click="confim" class="iconRight" v-show="!isViews">保存</span>
<span class="iconRight" v-show="isViews"></span>
</header>
</van-sticky>
<div class="north">
<img src="../../assets/imgs/north.png" alt="">
</div>
<grid-layout :layout.sync="layout"
:col-num="colNum"
:row-height="30"
:vertical-compact="false"
:use-css-transforms="true"
:prevent-collision="false"
:preventCollision="true"
<div class="wrap" ref="mapmidbox">
<van-sticky v-if="showHeader">
<header class="header">
<span @click="close" class="iconLeft"> 返回</span>
<span>{{ text }}</span>
<span @click="confim" class="iconRight" v-show="!isViews">保存</span>
<span class="iconRight" v-show="isViews"></span>
</header>
</van-sticky>
<div class="north">
<img src="../../assets/imgs/north.png" alt="" />
</div>
<grid-layout
:layout.sync="layout"
:col-num="colNum"
:row-height="30"
:vertical-compact="false"
:use-css-transforms="true"
:prevent-collision="false"
:preventCollision="true"
>
<grid-item
v-for="item in layout"
:static="item.static"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i"
:isDraggable="item.isDraggable"
:isResizable="item.isResizable"
@resized="resizedEvent"
@moved="movedEvent"
:style="{
backgroundColor: item.c,
border: item.type == 'thorough' ? 'none !important' : ''
}"
>
<span class="text" :class="item.w > item.h * 5 ? '' : 'rowText'">{{
item.name
}}</span>
<span class="remove" @click="removeItem(item.i)" v-if="showHeader"
>x</span
>
<grid-item v-for="(item) in layout"
:static="item.static"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i"
:isDraggable="item.isDraggable"
:isResizable="item.isResizable"
@resized="resizedEvent"
@moved="movedEvent"
:style="{'backgroundColor':item.c,'border':(item.type == 'thorough'? 'none !important':'')}"
>
<span class="text" :class="item.w>(item.h*5) ? '': 'rowText'">{{item.name}}</span>
<span class="remove" @click="removeItem(item.i)" v-if="showHeader">x</span>
<!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> -->
</grid-item>
</grid-layout>
<div class="setBtns">
<van-button @click="addItem" type="info" size="mini" v-if="!isViews">添加房间</van-button>
<van-button @click="addOther" type="info" size="mini" v-if="!isViews">添加其他</van-button>
<van-button @click="addBase" type="info" size="mini" v-if="!isViews">添加基础设施</van-button>
<!-- <van-button @click="editItem" type="info" size="mini" v-if="!isViews">修改</van-button> -->
<van-grid direction="horizontal" :column-num="2" class="footer" v-if="isViews">
风险等级图例:
<span class="riskTab type1"></span>重大风险
<span class="riskTab type2"></span>较大风险
<span class="riskTab type3"></span>一般风险
<span class="riskTab type4"></span>较小风险
</van-grid>
</div>
<van-dialog v-model="show" :title="title" show-cancel-button @confirm="saveRoomName" @cancel = "cancelDialog">
<van-cell-group v-if="isRoom">
<van-field v-model="roomName" label="房间名称" placeholder="请输入房间名称" />
<van-field
readonly
clickable
label="房间类型"
:value="roomType"
placeholder="选择房间类型"
@click="showPicker = true"
/>
</van-cell-group>
<van-cell-group v-else-if="isBase">
<van-field
readonly
clickable
label="房间名称"
:value="roomName"
placeholder="选择房间名称"
@click="showPicker = true"
/>
</van-cell-group>
<van-cell-group v-else>
<van-field v-model="roomName" label="名称" placeholder="请输入名称" />
</van-cell-group>
</van-dialog>
<van-popup v-model="showPicker" round position="bottom">
<van-picker
show-toolbar
:columns="isRoom?roomArr:baseArr"
@cancel="showPicker = false"
@confirm="onConfirm"
value-key="dictLabel"
/>
</van-popup>
<!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> -->
</grid-item>
</grid-layout>
<div class="setBtns">
<van-button @click="addItem" type="info" size="mini" v-if="!isViews"
>添加房间</van-button
>
<van-button @click="addOther" type="info" size="mini" v-if="!isViews"
>添加其他</van-button
>
<van-button @click="addBase" type="info" size="mini" v-if="!isViews"
>添加基础设施</van-button
>
<!-- <van-button @click="editItem" type="info" size="mini" v-if="!isViews">修改</van-button> -->
<van-grid
direction="horizontal"
:column-num="2"
class="footer"
v-if="isViews"
>
风险等级图例:
<span class="riskTab type1"></span>重大风险
<span class="riskTab type2"></span>较大风险
<span class="riskTab type3"></span>一般风险
<span class="riskTab type4"></span>较小风险
</van-grid>
</div>
<van-dialog
v-model="show"
:title="title"
show-cancel-button
@confirm="saveRoomName"
@cancel="cancelDialog"
>
<van-cell-group v-if="isRoom">
<van-field
v-model="roomName"
label="房间名称"
placeholder="请输入房间名称"
/>
<van-field
readonly
clickable
label="房间类型"
:value="roomType"
placeholder="选择房间类型"
@click="showPicker = true"
/>
</van-cell-group>
<van-cell-group v-else-if="isBase">
<van-field
readonly
clickable
label="房间名称"
:value="roomName"
placeholder="选择房间名称"
@click="showPicker = true"
/>
</van-cell-group>
<van-cell-group v-else>
<van-field v-model="roomName" label="名称" placeholder="请输入名称" />
</van-cell-group>
</van-dialog>
<van-popup v-model="showPicker" round position="bottom">
<van-picker
show-toolbar
:columns="isRoom ? roomArr : baseArr"
@cancel="showPicker = false"
@confirm="onConfirm"
value-key="dictLabel"
/>
</van-popup>
</div>
</template>
<script>
import { GridLayout, GridItem } from "vue-grid-layout"
import { GridLayout, GridItem } from "vue-grid-layout";
import screenfull from "screenfull";
import { Toast } from 'vant';
import { Toast } from "vant";
import { getFun, postFun } from "@/service/table.js";
// 动态添加/删除
export default {
name:'riskView',
components: {
GridLayout,
GridItem
name: "riskView",
components: {
GridLayout,
GridItem
},
data() {
return {
text: "房间位置绘制工具",
layout: [
// { x: 0, y: 0, w: 2, h: 3, i: "1",name: "办公室1",c:'#FF4433',isDraggable:false,isResizable:false,},
// { x: 2, y: 0, w: 2, h: 3, i: "2",name: "办公室2",c:'#FF9800',isDraggable:false,isResizable:false},
// { x: 4, y: 0, w: 2, h: 3, i: "3",name: "办公室2",c:'#FFFF00',isDraggable:false,isResizable:false},
// { x: 6, y: 0, w: 2, h: 3, i: "4",name: "办公室2",c:'#0091EA',isDraggable:false,isResizable:false},
// { x: 0, y: 3, w: 2, h: 3, i: "5",name: "办公室2",c:'#FF4433',isDraggable:false,isResizable:false},
],
draggable: false,
resizable: true,
colNum: 12,
// isScreenFull :null,
layOutItem: {}, //新增的房间对象
show: false,
title: "",
showPicker: false,
roomType: "",
roomName: "",
roomArr: [],
colorList: ["#FF4433", "#FF9800", "#FFFF00", "#0091EA"],
isViews: false, // true:查看页面; false: 添加页面
showHeader: true,
isRoom: true, //是否为添加房间
isBase: false,
baseName: "",
baseArr: [],
layoutData: []
};
},
props: {
isView: {
type: Boolean,
default: false
}
},
mounted() {
// screenfull.toggle(this.$refs.mapbox);
// this.$nextTick(() => {
// this.rotateBox();
// });
console.log("floorId==>>", this.$route.params.floorId);
if (this._props.isView) {
console.log("作为组件传值==>>");
this.isViews = true;
this.showHeader = false;
}
if (this.$route.params.isView) {
this.isViews = true;
this.initRotate();
window.addEventListener(
"onorientationchange" in window ? "orientationchange" : "resize",
this.orientationChange,
false
);
}
this.getRoomInfo();
},
methods: {
orientationChange() {
if (window.orientation === 180 || window.orientation === 0) {
console.log("竖屏状态!");
}
if (window.orientation === 90 || window.orientation === -90) {
console.log("横屏状态!");
}
// let width = document.documentElement.clientWidth//页面宽度
// let height = document.documentElement.clientHeight//页面高度
// console.log('width==>>',width)
// console.log('height==>>',height)
this.rotateBox();
},
initRotate() {
let width = document.documentElement.clientWidth, //页面宽度
height = document.documentElement.clientHeight, //页面高度
wrapper = this.$refs.mapmidbox, //需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = ""; //样式
console.log("width==>>", width);
console.log("height==>>", height);
style += "width:" + height + "px;";
style += "height:" + width + "px;";
style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
// 注意旋转中点的处理
style +=
"-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
wrapper.style.cssText = style;
},
rotateBox() {
// this.isScreenFull = !this.isScreenFull;//是否全屏状态
let width = document.documentElement.clientWidth, //页面宽度
height = document.documentElement.clientHeight, //页面高度
wrapper = this.$refs.mapmidbox, //需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = ""; //样式
console.log("width==>>", width);
console.log("height==>>", height);
// if (height < width) {//注意原来就是宽屏时不用横屏
// return;
// }
if (height < width) {
// 横屏
style += "width:" + height + "px;";
style += "height:" + width + "px;";
style += "-webkit-transform: rotate(0deg); transform: rotate(0deg);";
// 注意旋转中点的处理
style +=
"-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
} else {
// 竖屏
// style += "width:" + height + "px;";
// style += "height:" + width + "px;";
// style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
// // 注意旋转中点的处理
// style +=
// "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
// style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "width:100%";
style += "height:100%;";
style += "-webkit-transform: rotate(0); transform: rotate(0);";
style += "-webkit-transform-origin: 0 0;";
style += "transform-origin: 0 0;";
}
console.log("style==>>", style);
wrapper.style.cssText = style;
},
data() {
return {
text:'房间位置绘制工具',
layout: [
// { x: 0, y: 0, w: 2, h: 3, i: "1",name: "办公室1",c:'#FF4433',isDraggable:false,isResizable:false,},
// { x: 2, y: 0, w: 2, h: 3, i: "2",name: "办公室2",c:'#FF9800',isDraggable:false,isResizable:false},
// { x: 4, y: 0, w: 2, h: 3, i: "3",name: "办公室2",c:'#FFFF00',isDraggable:false,isResizable:false},
// { x: 6, y: 0, w: 2, h: 3, i: "4",name: "办公室2",c:'#0091EA',isDraggable:false,isResizable:false},
// { x: 0, y: 3, w: 2, h: 3, i: "5",name: "办公室2",c:'#FF4433',isDraggable:false,isResizable:false},
],
draggable: false,
resizable: true,
colNum: 12,
// isScreenFull :null,
layOutItem:{},//新增的房间对象
show:false,
title:'',
showPicker: false,
roomType:'',
roomName:'',
roomArr: [],
colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'],
isViews:false,// true:查看页面; false: 添加页面
showHeader:true,
isRoom:true,//是否为添加房间
isBase:false,
baseName:'',
baseArr:[],
layoutData:[]
}
getRoomInfo() {
let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : "18"
};
getFun("/ledger/room/list", data)
.then(res => {
if (res.code == 200) {
this.layout = [];
this.layoutData = res.data;
res.data.forEach(item => {
item.position = JSON.parse(item.position);
item.position.i = item.id;
item.position.id = item.id;
if (!this.showHeader) {
item.position.isDraggable = false;
item.position.isResizable = false;
}
if (!this.isViews || item.position.type == "thorough") {
//添加页面不显示颜色
item.position.c = "#e6e5e5";
} else {
/**
* 根据风险评分来匹配相应的颜色
* score 风险评分字段
*/
// item.score = Number(item.score)
// if (item.score>=21 && item.score <= 27) { //优
// item.position.c = this.colorList[3]
// }else if(item.score>=14 && item.score <=20){ //良
// item.position.c = this.colorList[2]
// }else if (item.score>=7&& item.score <= 13) { //中
// item.position.c = this.colorList[1]
// }else if (item.score>=0 && item.score <= 6) { //差
// item.position.c = this.colorList[0]
// }
item.position.c = this.colorList[Math.floor(Math.random() * 4)];
}
this.layout.push(item.position);
});
// console.log('layout==>>',this.layout)
}
})
.catch(err => {
console.log("err==>>", err);
});
getFun("/risk/plan/dict/data/list", {
dictType: "risk_plan_room_type"
}).then(res => {
this.roomArr = res.data;
});
getFun("/risk/plan/dict/data/list", {
dictType: "risk_plan_base_room"
}).then(res => {
this.baseArr = res.data;
});
},
props:{
isView: {
type: Boolean,
default: false,
},
// 增加
addItem() {
if (this.layout.find(item => item.i == "")) {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请先点击确定,保存当前房间信息"
});
return;
}
this.roomType = "";
this.roomName = "";
this.title = "创建房间";
this.isRoom = true;
this.show = true;
this.isBase = false;
},
mounted() {
// screenfull.toggle(this.$refs.mapbox);
// this.$nextTick(() => {
// this.rotateBox();
// });
console.log('floorId==>>',this.$route.params.floorId )
if (this._props.isView) {
console.log('作为组件传值==>>',)
this.isViews = true
this.showHeader = false
}
if (this.$route.params.isView) {
this.isViews = true
this.initRotate();
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false);
}
this.getRoomInfo()
// 添加其他
addOther() {
if (this.layout.find(item => item.i == "")) {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请先点击确定,保存当前房间信息"
});
return;
}
this.isRoom = false;
this.isBase = false;
this.roomType = "";
this.roomName = "";
this.title = "创建其他";
this.show = true;
},
methods: {
orientationChange(){
if (window.orientation === 180 || window.orientation === 0) {
console.log('竖屏状态!');
}
if (window.orientation === 90 || window.orientation === -90 ){
console.log('横屏状态!');
}
// let width = document.documentElement.clientWidth//页面宽度
// let height = document.documentElement.clientHeight//页面高度
// console.log('width==>>',width)
// console.log('height==>>',height)
this.rotateBox()
},
initRotate(){
let width = document.documentElement.clientWidth,//页面宽度
height = document.documentElement.clientHeight,//页面高度
wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = "";//样式
console.log('width==>>',width)
console.log('height==>>',height)
style += "width:" + height + "px;";
style += "height:" + width + "px;";
style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
// 注意旋转中点的处理
style +=
"-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
wrapper.style.cssText = style;
},
rotateBox() {
// this.isScreenFull = !this.isScreenFull;//是否全屏状态
let width = document.documentElement.clientWidth,//页面宽度
height = document.documentElement.clientHeight,//页面高度
wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = "";//样式
console.log('width==>>',width)
console.log('height==>>',height)
// if (height < width) {//注意原来就是宽屏时不用横屏
// return;
// }
if (height < width) {
// 横屏
style += "width:" + height + "px;";
style += "height:" + width + "px;";
style += "-webkit-transform: rotate(0deg); transform: rotate(0deg);";
// 注意旋转中点的处理
style +=
"-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
} else {
// 竖屏
// style += "width:" + height + "px;";
// style += "height:" + width + "px;";
// style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
// // 注意旋转中点的处理
// style +=
// "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
// style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "width:100%";
style += "height:100%;";
style += "-webkit-transform: rotate(0); transform: rotate(0);";
style += "-webkit-transform-origin: 0 0;";
style += "transform-origin: 0 0;";
}
console.log('style==>>',style)
wrapper.style.cssText = style;
},
getRoomInfo(){
let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : '18'
}
getFun('/ledger/room/list',data).then((res) => {
// 删除
removeItem(val) {
if (val == "") {
const index = this.layout.map(item => item.i).indexOf(val);
this.layout.splice(index, 1);
return;
}
this.$dialog
.confirm({
title: "提示",
message: "是否删除"
})
.then(() => {
postFun("/ledger/room/delete/" + val)
.then(res => {
if (res.code == 200) {
this.layout = []
this.layoutData = res.data
res.data.forEach((item) => {
item.position = JSON.parse(item.position)
item.position.i = item.id
item.position.id = item.id
if (!this.showHeader) {
item.position.isDraggable = false
item.position.isResizable = false
}
if (!this.isViews || item.position.type == 'thorough') { //添加页面不显示颜色
item.position.c = '#e6e5e5'
}else{
/**
* 根据风险评分来匹配相应的颜色
* score 风险评分字段
*/
// item.score = Number(item.score)
// if (item.score>=21 && item.score <= 27) { //优
// item.position.c = this.colorList[3]
// }else if(item.score>=14 && item.score <=20){ //良
// item.position.c = this.colorList[2]
// }else if (item.score>=7&& item.score <= 13) { //中
// item.position.c = this.colorList[1]
// }else if (item.score>=0 && item.score <= 6) { //差
// item.position.c = this.colorList[0]
// }
item.position.c = this.colorList[Math.floor(Math.random()*4)]
}
this.layout.push(item.position)
})
// console.log('layout==>>',this.layout)
Toast.success("删除成功");
this.getRoomInfo();
}
}).catch((err) => {
console.log('err==>>',err)
})
getFun('/risk/plan/dict/data/list',{
dictType:'risk_plan_room_type'
}).then(res=>{
this.roomArr = res.data
})
getFun('/risk/plan/dict/data/list',{
dictType:'risk_plan_base_room'
}).then(res=>{
this.baseArr = res.data
})
},
// 增加
addItem () {
if (this.layout.find((item) => item.i == '')) {
Toast.fail({
title: '提示',
forbidClick: true,
message: '请先点击确定,保存当前房间信息',
})
return
}
this.roomType = ''
this.roomName = ''
this.title = '创建房间'
this.isRoom = true
this.show = true
this.isBase = false;
},
// 添加其他
addOther(){
if (this.layout.find((item) => item.i == '')) {
Toast.fail({
title: '提示',
forbidClick: true,
message: '请先点击确定,保存当前房间信息',
})
return
}
this.isRoom = false;
this.isBase = false;
this.roomType = ''
this.roomName = ''
this.title = '创建其他'
this.show = true
},
// 删除
removeItem (val) {
if (val == '') {
const index = this.layout.map(item => item.i).indexOf(val);
this.layout.splice(index, 1);
return
}
this.$dialog.confirm({
title: '提示',
message: '是否删除',
})
.then(() => {
postFun('/ledger/room/delete/'+val).then((res) => {
if (res.code == 200) {
Toast.success('删除成功');
this.getRoomInfo()
}
}).catch((err) => {
console.log('err==>>',err)
})
})
.catch(() => {
// on cancel
.catch(err => {
console.log("err==>>", err);
});
},
//添加基础设施
addBase(){
if (this.layout.find((item) => item.i == '')) {
Toast.fail({
title: '提示',
forbidClick: true,
message: '请先点击确定,保存当前房间信息',
})
return
}
this.roomType = ''
this.roomName = ''
this.title = '添加基础设备'
this.isRoom = false;
this.isBase = true;
this.show = true
},
// 移动后的事件
movedEvent(i, newX, newY){
this.layOutItem.x = newX
this.layOutItem.y = newY
// console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout)
},
// 调整大小后的事件
resizedEvent: function(i, newH, newW){
this.layOutItem.w = newW
this.layOutItem.h = newH
// console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout)
},
//关闭
close(){
history.go(-1)
},
//edger/room/update/batch
// 确定 执行批量编辑保存
confim(){
// if (this.roomName == '') {
// Toast.fail({
// title: '提示',
// forbidClick: true,
// message: '请先添加房间!',
// })
// return
// }
let data = this.layoutData
this.layoutData.forEach((item) => {
item.position = JSON.stringify(item.position)
})
console.log('data==>>',data)
postFun('/ledger/room/update/batch', data).then((res) => {
if (res.code == 200) {
Toast.success('保存成功');
this.getRoomInfo()
}
}).catch((err) => {
console.log('err==>>',err)
})
},
//保存房间名称
saveRoomName(){
if (this.roomName == '') {
Toast.fail({
title: '提示',
forbidClick: true,
message: '请输入名称!',
})
return
}
})
.catch(() => {
// on cancel
});
},
//添加基础设施
addBase() {
if (this.layout.find(item => item.i == "")) {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请先点击确定,保存当前房间信息"
});
return;
}
this.roomType = "";
this.roomName = "";
this.title = "添加基础设备";
this.isRoom = false;
this.isBase = true;
this.show = true;
},
// 移动后的事件
movedEvent(i, newX, newY) {
this.layOutItem.x = newX;
this.layOutItem.y = newY;
// console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout)
},
// 调整大小后的事件
resizedEvent: function(i, newH, newW) {
this.layOutItem.w = newW;
this.layOutItem.h = newH;
// console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout)
},
//关闭
close() {
history.go(-1);
},
//edger/room/update/batch
// 确定 执行批量编辑保存
confim() {
// if (this.roomName == '') {
// Toast.fail({
// title: '提示',
// forbidClick: true,
// message: '请先添加房间!',
// })
// return
// }
let data = this.layoutData;
this.layoutData.forEach(item => {
item.position = JSON.stringify(item.position);
});
postFun("/ledger/room/update/batch", data)
.then(res => {
if (res.code == 200) {
Toast.success("保存成功");
this.getRoomInfo();
}
})
.catch(err => {
console.log("err==>>", err);
});
},
//保存房间名称
saveRoomName() {
if (this.roomName == "") {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请输入名称!"
});
return;
}
this.layOutItem = {
x: (this.layout.length * 2) % (this.colNum || 12),
y: this.layout.length + (this.colNum/2 || 12),
w: 2,
h: 3,
i: '',
name: this.roomName,
c: '#e6e5e5',
type:this.isRoom ? this.roomType :(this.isBase? '基础设施':'thorough'),
isDraggable:true,
isResizable:true
}
this.layout.push(this.layOutItem)
// console.log('layOutItem==>>',this.layOutItem)
let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : '18',
name:this.roomName,
position: JSON.stringify(this.layOutItem),
roomType: this.isRoom ? this.roomType : (this.isBase? '基础设施':'9999'),
}
postFun('/ledger/room/save', data).then((res) => {
if (res.code == 200) {
// Toast.success('保存成功');
this.getRoomInfo()
this.roomType = ''
this.roomName = ''
}
}).catch((err) => {
console.log('err==>>',err)
})
},
cancelDialog(){
this.roomType = ''
this.roomName = ''
},
onConfirm(value) {
if(this.isRoom){
this.roomType = value.dictValue;
}else{
this.roomName = value.dictValue
}
this.showPicker = false;
},
this.layOutItem = {
x: (this.layout.length * 2) % (this.colNum || 12),
y: this.layout.length + (this.colNum / 2 || 12),
w: 2,
h: 3,
i: "",
name: this.roomName,
c: "#e6e5e5",
type: this.isRoom
? this.roomType
: this.isBase
? "基础设施"
: "thorough",
isDraggable: true,
isResizable: true
};
this.layout.push(this.layOutItem);
// console.log('layOutItem==>>',this.layOutItem)
let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : "18",
name: this.roomName,
position: JSON.stringify(this.layOutItem),
roomType: this.isRoom
? this.roomType
: this.isBase
? "基础设施"
: "9999"
};
postFun("/ledger/room/save", data)
.then(res => {
if (res.code == 200) {
// Toast.success('保存成功');
this.getRoomInfo();
this.roomType = "";
this.roomName = "";
}
})
.catch(err => {
console.log("err==>>", err);
});
},
cancelDialog() {
this.roomType = "";
this.roomName = "";
},
onConfirm(value) {
if (this.isRoom) {
this.roomType = value.dictValue;
} else {
this.roomName = value.dictValue;
}
this.showPicker = false;
}
}
}
};
</script>
<style scoped >
.router-view{
padding-bottom: 0px !important;
}
.wrap{
/* height: 100vh; */
width: 100vw;
position: relative;
}
.north{
position: absolute;
display: inline-block;
top: 1.5rem;
right: 0.5rem;
z-index: 999;
}
.north img{
width: 15px;
height: 30px;
}
.footer{
/* position: fixed; */
/* left: 0; */
/* bottom: 0; */
font-size: 0.3rem;
font-weight: 600;
}
.riskTab{
display: inline-block;
width: 50px;
height: 20px;
margin: 0 10px 0px 15px;
border-radius: 5px;
}
.type1{
background-color: #FF4433;
}
.type2{
background-color: #FF9800;
}
.type3{
background-color: #FFFF00;
}
.type4{
background-color: #0091EA;
<style scoped>
.router-view {
padding-bottom: 0px !important;
}
.wrap {
/* height: 100vh; */
width: 100vw;
position: relative;
}
.north {
position: absolute;
display: inline-block;
top: 1.5rem;
right: 0.5rem;
z-index: 999;
}
.north img {
width: 15px;
height: 30px;
}
.footer {
/* position: fixed; */
/* left: 0; */
/* bottom: 0; */
font-size: 0.3rem;
font-weight: 600;
}
.riskTab {
display: inline-block;
width: 50px;
height: 20px;
margin: 0 10px 0px 15px;
border-radius: 5px;
}
.type1 {
background-color: #ff4433;
}
.type2 {
background-color: #ff9800;
}
.type3 {
background-color: #ffff00;
}
.type4 {
background-color: #0091ea;
}
.layoutJSON {
background: #ddd;
border: 1px solid black;
padding: 10px;
background: #ddd;
border: 1px solid black;
padding: 10px;
}
.columns {
-moz-columns: 120px;
-webkit-columns: 120px;
columns: 120px;
-moz-columns: 120px;
-webkit-columns: 120px;
columns: 120px;
}
/*************************************/
.setBtns{
/* position: fixed;
.setBtns {
/* position: fixed;
top:auto;
right: auto;
left: 0;
bottom: 0; */
margin-top: 10px;
font-size: 0.3rem;
padding: 10px;
vertical-align: middle;
display: flex;
align-items: flex-start;
/* flex-direction: column; */
margin-top: 10px;
font-size: 0.3rem;
padding: 10px;
vertical-align: middle;
display: flex;
align-items: flex-start;
/* flex-direction: column; */
}
.setBtns .van-button--mini{
padding: 0 10px;
.setBtns .van-button--mini {
padding: 0 10px;
}
.remove {
position: absolute;
right: 2px;
top: 0;
cursor: pointer;
position: absolute;
right: 2px;
top: 0;
cursor: pointer;
}
::v-deep .van-dialog__header{
padding-top: 15px !important;
padding-bottom: 15px !important;
::v-deep .van-dialog__header {
padding-top: 15px !important;
padding-bottom: 15px !important;
}
.vue-grid-item {
-ms-touch-action: none;
touch-action: none;
box-sizing: border-box;
/* container-type: inline-size; */
-ms-touch-action: none;
touch-action: none;
box-sizing: border-box;
/* container-type: inline-size; */
}
.vue-grid-layout {
background: #f0f1f5;
background: #f0f1f5;
}
.vue-grid-item:not(.vue-grid-placeholder) {
background: #ccc;
border: 1px solid black;
background: #ccc;
border: 1px solid black;
}
.vue-grid-item .resizing {
opacity: 0.9;
opacity: 0.9;
}
.vue-grid-item .static {
background: #cce;
background: #cce;
}
.vue-grid-item .text {
/* font-size: 6cqw; */
display: flex;
align-items: center;
justify-content: center;
/* position: absolute;
/* font-size: 6cqw; */
display: flex;
align-items: center;
justify-content: center;
/* position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0; */
margin: auto;
height: 100%;
width: 100%;
margin: auto;
height: 100%;
width: 100%;
}
.rowText{
writing-mode:vertical-rl;
-webkit-writing-mode: vertical-rl;
.rowText {
writing-mode: vertical-rl;
-webkit-writing-mode: vertical-rl;
}
.vue-grid-item .no-drag {
height: 100%;
width: 100%;
height: 100%;
width: 100%;
}
.vue-grid-item .minMax {
font-size: 12px;
font-size: 12px;
}
.vue-grid-item .add {
cursor: pointer;
cursor: pointer;
}
.vue-draggable-handle {
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><circle cx='5' cy='5' r='5' fill='#999999'/></svg>") no-repeat;
background-position: bottom right;
padding: 0 8px 8px 0;
background-repeat: no-repeat;
background-origin: content-box;
box-sizing: border-box;
cursor: pointer;
}
.header{
width:100%;
height:1.2rem;
background:#2980F7;
text-align: center;
line-height: 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.iconLeft{
color: white;
font-size: 12px;
transform: scale(0.8);
}
.header span{
color: white;
font-size: 16px;
line-height: 1.2rem;
margin: auto;
font-family: 'Microsoft YaHei';
}
.iconRight{
color: white;
font-size: 12px;
transform: scale(0.8);
}
</style>
\ No newline at end of file
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><circle cx='5' cy='5' r='5' fill='#999999'/></svg>")
no-repeat;
background-position: bottom right;
padding: 0 8px 8px 0;
background-repeat: no-repeat;
background-origin: content-box;
box-sizing: border-box;
cursor: pointer;
}
.header {
width: 100%;
height: 1.2rem;
background: #2980f7;
text-align: center;
line-height: 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.iconLeft {
color: white;
font-size: 12px;
transform: scale(0.8);
}
.header span {
color: white;
font-size: 16px;
line-height: 1.2rem;
margin: auto;
font-family: "Microsoft YaHei";
}
.iconRight {
color: white;
font-size: 12px;
transform: scale(0.8);
}
</style>
......@@ -17,7 +17,7 @@
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险信息
固有风险信息
</div>
<van-field
readonly
......@@ -30,8 +30,8 @@
<van-field
readonly
required
name="projectId"
:value="form.projectId"
name="projectName"
:value="form.projectName"
label="所属项目"
placeholder="请输入"
/>
......@@ -620,40 +620,47 @@
</div>
</van-tab>
<van-tab title="现状风险">
<div class="con-list" @touchmove="showIndex = null">
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.title }}
{{ item.name }}
</div>
<van-row gutter="">
<van-col span="17">
<van-row gutter="">
<van-col span="9">风险名称:</van-col>
<van-col span="15">{{ item.name }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">创建时间:</van-col>
<van-col span="9">发起时间:</van-col>
<van-col span="15">{{
timestampToTimes(item.createTime)
}}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">风险描述:</van-col>
<van-col span="15">{{ item.describe }}</van-col>
<van-col span="9">楼层:</van-col>
<van-col span="15">{{ item.floorName }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">房间:</van-col>
<van-col span="15">{{ item.roomName }}</van-col>
</van-row>
</van-col>
<van-col
span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
{{ "●待审批" }}
</van-col>
<!-- <van-col span="7" :style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }">
{{ "●待审批" }}
</van-col> -->
</van-row>
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)"
>编辑</van-button
>
<van-button round type="danger" @click="delInherent(item)"
>删除</van-button
>
</div>
</van-overlay>
</van-cell-group>
<div
style="
......@@ -780,12 +787,14 @@
</template>
<script>
import { Dialog } from "vant";
import LHeader from "@/components/header.vue";
import selectDept from "@/components/selectDept/index.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
export default {
name: "addCurrent",
......@@ -825,6 +834,7 @@ export default {
},
data() {
return {
showIndex: null,
measuresDept: false,
ShowfloorList: false,
floorSource: [],
......@@ -844,7 +854,7 @@ export default {
showPopover: false,
showGradeDialog: false,
taskId: "",
text: "添加固有风险",
text: "编辑固有风险",
id: "",
isTimely: 1,
active: 0,
......@@ -925,12 +935,55 @@ export default {
}
},
methods: {
// 详情
goDetail(data) {
sessionStorage.setItem("inherentId", this.inherentId);
sessionStorage.setItem("existingId", data.id);
this.$router.push({
name: "addPresent",
params: {
inherentId: this.inherentId,
existingId: data.id,
isEdit: true
}
});
this.showIndex = null;
},
delInherent(item) {
Dialog.confirm({
title: "删除现有风险",
message: "是否确认删除?"
})
.then(() => {
// on confirm
getFun(`/risk/plan/existing/delete/${item.id}`).then(res => {
this.$toast.success(res.msg);
this.getList();
// });
});
{
inherentId;
}
})
.catch(() => {
// on cancel
});
},
afterRead(file) {
console.log(file);
},
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
touchstart(index, item) {
if (this.showIndex != null) {
this.showIndex = null;
return;
}
this.showIndex = index;
},
tabList(value) {
console.log(
"%c [ value ]-527",
......@@ -1011,7 +1064,6 @@ export default {
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
console.log("this.form :>> ", this.form);
this.showTrouble = false;
},
getUserData(e) {
......@@ -1041,12 +1093,10 @@ export default {
});
},
changeDept(id, name) {
console.log(id);
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
closeDept() {
console.log(this.form.deptId);
this.measuresDept = false;
},
selectData(dataName, isSinge) {
......@@ -1097,7 +1147,6 @@ export default {
return arr;
},
getFloor() {
console.log(this.form, 111);
getFun(`/risk/plan/floor/list/${this.form.buildingId}`)
.then(res => {
// this.$toast.clear();
......@@ -1187,11 +1236,12 @@ export default {
});
},
performTasks() {
console.log("1233213 :>> ", 1233213);
sessionStorage.setItem("inherentId", this.inherentId);
this.$router.push({
name: "addPresent",
params: {
id: this.inherentId
inherentId: this.inherentId,
isEdit: false
}
});
},
......@@ -1207,7 +1257,6 @@ export default {
async deleteFile(val, detail, key) {
// console.log(val,detail)
if (val.fileId) {
console.log(detail, "ccc");
let formdata = new FormData();
formdata.append("key", val["fileId"]);
var ids = this.form[key + "Ids"].split(",");
......
......@@ -28,8 +28,8 @@
<van-field
readonly
required
name="projectId"
:value="form.projectId"
name="projectName"
:value="form.projectName"
label="所属项目"
placeholder="请输入"
/>
......@@ -765,10 +765,11 @@ export default {
this.$route.params.planId || sessionStorage.getItem("planId");
this.form.buildingName =
this.$route.params.buildingName || sessionStorage.getItem("buildingName");
this.form.projectId = sessionStorage.getItem("projectId");
this.form.projectName = sessionStorage.getItem("projectName");
this.form.userId = userInfo.userId;
this.form.userName = userInfo.userName;
this.form.deptName = userInfo.dept.deptName;
this.form.projectId = "测试项目";
},
mounted() {
if (sessionStorage.getItem("inherenForm") != "") {
......@@ -786,7 +787,6 @@ export default {
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
console.log("this.form :>> ", this.form);
this.showTrouble = false;
},
getUserData(e) {
......@@ -816,12 +816,10 @@ export default {
});
},
changeDept(id, name) {
console.log(id);
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
closeDept() {
console.log(this.form.deptId);
this.measuresDept = false;
},
selectData(dataName, isSinge) {
......
<template>
<div>
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<keep-alive>
<van-form
@submit="onSubmit"
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
现有风险信息
</div>
<van-field
readonly
required
name="userName"
v-model="form.userName"
label="评估人"
placeholder="请输入"
/>
现有风险信息
</div>
<van-field
readonly
required
name="userName"
:value="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectId"
:value="form.projectId"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
:value="form.buildingName"
label="所属建筑物"
placeholder="请输入 "
/>
<van-field
required
clickable
name="floorName"
:value="form.floorName"
label="所属楼层"
placeholder="请选择"
@click="seletFloor('floor')"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<div style="display: flex;">
<van-field
readonly
required
name="roomName"
:value="form.roomName"
label="所属房间"
name="projectName"
v-model="form.projectName"
label="所属项目"
placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
icon="plus"
type="info"
native-type="button"
@click="tjfjClcik"
<van-field
readonly
required
name="buildingName"
v-model="form.buildingName"
label="所属建筑物"
placeholder="请输入 "
/>
<van-field
readonly
required
clickable
name="floorName"
v-model="form.floorName"
label="所属楼层"
placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
</div>
<van-field
required
clickable
name="name"
v-model="form.name"
label="危险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '危险源名称不能为空' }]"
/>
<van-field
v-model="form.factor"
readonly
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="selectData('factor', false)"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<div style="display: flex;">
<van-field
readonly
required
name="roomName"
v-model="form.roomName"
label="所属房间"
placeholder="请输入"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
</div>
<van-field
readonly
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="selectData('type', false)"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field
readonly
required
clickable
name="name"
v-model="form.name"
label="危险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '危险源名称不能为空' }]"
/>
<van-field
v-model="form.factor"
readonly
required
name="factor"
label="风险因素"
placeholder="请选择"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field
required
name="presenceLocation"
v-model="form.presenceLocation"
label="存在部位"
placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]"
/>
<van-field
readonly
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<van-field
required
name="presenceLocation"
v-model="form.presenceLocation"
label="存在部位"
placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]"
/>
风险源图片
</div>
<van-field name="hdPicture1" label="风险源图片">
<template #input>
<van-uploader
@delete="deleteFile(...arguments, 'pictureFile')"
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险源图片
</div>
<van-field name="hdPicture1" label="风险源图片">
<template #input>
<van-uploader
@delete="deleteFile(...arguments, 'pictureFile')"
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -144,50 +136,50 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
>
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
技术措施
</div>
<van-field
v-model="form.measuresProject"
name="measuresProject"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
技术措施
</div>
<van-field
v-model="form.measuresProject"
name="measuresProject"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresProjectFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<div
style="
<van-field name="measuresProjectFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -196,77 +188,77 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
已采取的管控措施
</div>
<van-field
v-model="form.measuresAdministration"
name="measuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
已采取的管控措施
</div>
<van-field
v-model="form.measuresAdministration"
name="measuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field
v-model="form.measuresDeptName"
name="measuresDeptName"
label="管控责任单位 "
type="textarea"
rows="1"
autosize
@click="
{
measuresDept = true;
}
"
placeholder="请选择"
/>
<van-field
v-model="form.measuresUserName"
name="measuresUserName"
label="管控责任人 "
type="textarea"
rows="1"
autosize
@click="getUserData('measuresUser')"
placeholder="请选择"
/>
<van-field
v-model="form.measuresDeptName"
name="measuresDeptName"
label="管控责任单位 "
type="textarea"
rows="1"
autosize
@click="
{
measuresDept = true;
}
"
placeholder="请选择"
/>
<van-field
v-model="form.measuresUserName"
name="measuresUserName"
label="管控责任人 "
type="textarea"
rows="1"
autosize
@click="getUserData('measuresUser')"
placeholder="请选择"
/>
<van-field name="measuresAdministrationFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<div
style="
<van-field name="measuresAdministrationFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -275,52 +267,52 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应急措施
</div>
<van-field
v-model="form.measuresEmergency"
name="measuresEmergency"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
应急措施
</div>
<van-field
v-model="form.measuresEmergency"
name="measuresEmergency"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
<van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -329,216 +321,221 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
参考依据
</div>
<van-field
clickable
name="referenceBasis"
:value="form.referenceBasis"
label="参考依据"
placeholder="请选择"
@click="selectData('referenceBasis', false)"
/>
参考依据
</div>
<van-field
clickable
name="referenceBasis"
:value="form.referenceBasis"
label="参考依据"
placeholder="请选择"
@click="selectData('referenceBasis', false)"
/>
<van-field
readonly
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
@click="seletGrade"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain">
<van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1">
<van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item>
<van-collapse-item title="风险模型配置" name="2">
<van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
<van-field
readonly
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
@click="seletGrade"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain">
<van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1">
<van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item>
<van-collapse-item title="风险模型配置" name="2">
<van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
>
<template #reference>
<van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template>
</van-popover>
<van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
>
<template #reference>
<van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button
size="small"
plain
native-type="button"
type="info"
@click="showGradeDialog = false"
>取消</van-button
></van-col
>
<template #reference>
<van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template>
</van-popover>
<van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
<van-col span="6"
><van-button
size="small"
type="info"
native-type="button"
@click="goResultPage"
>开始测评</van-button
></van-col
>
<template #reference>
<van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button
size="small"
plain
native-type="button"
type="info"
@click="showGradeDialog = false"
>取消</van-button
></van-col
>
<van-col span="6"
><van-button
size="small"
type="info"
native-type="button"
@click="goResultPage"
>开始测评</van-button
></van-col
>
</van-row>
</div>
</van-dialog>
<!-- 楼层弹出层 -->
<van-popup
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
</van-row>
</div>
</van-dialog>
<!-- 楼层弹出层 -->
<van-popup
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
show-toolbar
value-key="dictValue"
:columns="columnsData"
@confirm="saveSelect"
@cancel="showSelect = false"
/>
</van-popup>
<!-- 复选弹出层 -->
<van-popup
v-model="showCheckSelect"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
></selectList>
</van-popup>
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
show-toolbar
value-key="dictValue"
:columns="columnsData"
@confirm="saveSelect"
@cancel="showSelect = false"
/>
</van-popup>
<!-- 复选弹出层 -->
<van-popup
v-model="showCheckSelect"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
></selectList>
</van-popup>
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup>
<!-- 管控责任单位 -->
<van-popup
v-model="measuresDept"
position="bottom"
:style="{ height: '100%' }"
>
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup>
<!-- 管控责任单位 -->
<van-popup
v-model="measuresDept"
position="bottom"
:style="{ height: '100%' }"
>
<button
type="button"
class="van-picker__cancel"
v-on:click="
{
form.measuresDeptId = 0;
projectDept = false;
}
"
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
>
取消</button
><button type="button" class="van-picker__confirm" @click="closeDept">
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<button
type="button"
class="van-picker__cancel"
v-on:click="
{
form.measuresDeptId = 0;
projectDept = false;
}
"
>
取消</button
><button
type="button"
class="van-picker__confirm"
@click="closeDept"
>
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit"
>提交</van-button
>
</div>
</van-form>
<div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit"
>提交</van-button
>
</div>
</van-form>
</keep-alive>
<!-- v-if="this.$route.params.isView" -->
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel"
......@@ -550,28 +547,20 @@
<script>
import LHeader from "@/components/header.vue";
import selectDept from "@/components/selectDept/index.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
// import {
// getFormList,
// postHdSource,
// postHdType,
// postHdPeople,
// postReAdd,
// postriskConiCause,
// postRiskShowMeasures,
// } from "@/service/risk";
export default {
name: "addPresent",
components: {
LHeader,
selectFloor,
SelectList
selectDept,
SelectList,
selectFloor
},
activated() {},
beforeRouteEnter(to, from, next) {
if (from.name == "addCurrent") {
sessionStorage.setItem("presentForm", "");
......@@ -587,8 +576,19 @@ export default {
},
data() {
return {
isEdit: false,
existingId: 0,
measuresDept: false,
ShowfloorList: false,
floorSource: [],
dataName: "",
// 单选
showSelect: false,
columnsData: [],
// 多选
showCheckSelect: false,
columnsCheckData: [],
ShowAccidentList: false,
ShowSelectList: false,
columnsAccident: [],
......@@ -658,67 +658,191 @@ export default {
};
},
created() {
var userInfo = getUserInfo();
this.form.buildingIds =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.form.planId =
this.$route.params.planId || sessionStorage.getItem("planId");
this.form.buildingName =
this.$route.params.buildingName || sessionStorage.getItem("buildingName");
this.form.userId = userInfo.userId;
this.form.userName = userInfo.userName;
this.form.deptName = userInfo.dept.deptName;
this.form.planId = this.$route.params.planId;
this.form.floorId = this.$route.params.floorId;
this.form.floorName = this.$route.params.floorName;
this.form.projectName = this.$route.params.projectName;
this.form.projectId = this.$route.params.projectId;
this.form.roomId = this.$route.params.roomId;
this.form.inherentId = this.$route.params.id;
this.form.roomName = this.$route.params.roomName;
this.form.buildingName = "1号楼";
this.form.userId = userInfo.userId;
this.form.userName = userInfo.userName;
this.form.deptName = userInfo.dept.deptName;
this.form.projectId = "测试项目";
this.isEdit = this.$route.params.isEdit;
this.existingId = this.$route.params.existingId;
this.inherentId = this.form.inherentId =
this.$route.params.inherentId || sessionStorage.getItem("inherentId");
this.postReturnEcho();
},
mounted() {
// this.getFloor();
this.getFXYS();
this.getZSGLX();
if (sessionStorage.getItem("presentForm") != "") {
this.form = JSON.parse(sessionStorage.getItem("presentForm"));
this.form.level = sessionStorage.getItem("level");
}
},
methods: {
// getFloor() {
// getFun(`/risk/plan/floor/list/${this.form.buildingIds}`)
// .then(res => {
// // this.$toast.clear();
// // this.showSource = true;
// 请求详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
// let newArr = this.renameKeyInTree(res.data, "name", "text");
// this.floorSource = newArr;
// })
// .catch(() => {
// this.$toast.fail("加载失败,请稍后再试");
// });
// },
getFXYS() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
.then(res => {
this.columnsTrouble = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
if (this.isEdit) {
getFun(`/risk/plan/existing/details/${this.existingId}`)
.then(res => {
this.form = res.data;
this.uploaderImg = (res.data.pictureFile || []).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresProjectFile = (res.data.measuresProjectFile || []).map(
item => {
return {
...item,
url: item.filePath
};
}
);
this.measuresAdministrationFile = (
res.data.measuresAdministrationFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresEmergencyFile = (
res.data.measuresEmergencyFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
})
.catch(() => {
this.$toast.clear();
});
} else {
getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then(res => {
this.form.userId = res.data.userId;
this.form.userName = res.data.userName;
this.form.projectId = res.data.projectId;
this.form.projectName = res.data.projectName;
this.form.buildingId = res.data.buildingId;
this.form.buildingName = res.data.buildingName;
this.form.floorId = res.data.floorId;
this.form.floorName = res.data.floorName;
this.form.roomId = res.data.roomId;
this.form.roomName = res.data.roomName;
this.form.name = res.data.name;
this.form.factor = res.data.factor;
this.form.type = res.data.type;
this.form.planId = res.data.planId;
this.uploaderImg = (res.data.pictureFile || []).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresProjectFile = (res.data.measuresProjectFile || []).map(
item => {
return {
...item,
url: item.filePath
};
}
);
this.measuresAdministrationFile = (
res.data.measuresAdministrationFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresEmergencyFile = (
res.data.measuresEmergencyFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
this.$forceUpdate();
})
.catch(() => {
this.$toast.clear();
});
}
},
// 项目负责人
onConTrouble(value) {
if (!value) {
this.showTrouble = false;
return;
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
this.showTrouble = false;
},
getUserData(e) {
this.userPrefix = e;
if (!this.form.measuresDeptId) {
this.$toast({
title: "提示",
message: "请选择管控责任单位!"
});
return false;
}
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/user/list/${this.form.measuresDeptId}`).then(res => {
if (res.code == 200) {
this.columnsTrouble = res.data;
// 对数据进行赋值
this.$toast.clear();
this.showTrouble = true;
} else {
this.$toast.clear();
}
});
},
changeDept(id, name) {
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
getZSGLX() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
closeDept() {
this.measuresDept = false;
},
selectData(dataName, isSinge) {
this.dataName = dataName;
getFun(
`/risk/plan/dict/data/list?dictType=risk_plan_${dataName.toLowerCase()}`
)
.then(res => {
this.columnsAccident = res.data;
if (isSinge) {
this.columnsData = res.data;
this.showSelect = true;
} else {
this.columnsCheckData = res.data;
this.showCheckSelect = true;
}
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
saveSelect(data) {
this.form[this.dataName] = data.dictValue;
this.showSelect = false;
},
saveCheckSelect(data) {
this.form[this.dataName] = data.join(",");
this.showCheckSelect = false;
},
seletFloor(name) {
this.ShowfloorList = true;
this.userPrefix = name;
......@@ -810,7 +934,7 @@ export default {
},
//开始测评
goResultPage() {
this.$router.replace({
this.$router.push({
name: "resultPage",
params: {
score: this.severityScore * this.possibleScore
......@@ -834,7 +958,6 @@ export default {
formdata.append("key", val["fileId"]);
let res = await postFun("/mobile/remove", formdata);
if (res) {
console.log(res);
this.$toast({
title: "提示",
message: "删除成功!"
......@@ -901,28 +1024,6 @@ export default {
});
this.$toast.clear();
},
// 请求已退回详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
postriskConiCause(`/riskMain/edit/${this.taskId}`)
.then(res => {
console.log(
"%c [ res ]-332",
"font-size:13px; background:pink; color:#bf2c9f;",
res
);
})
.catch(() => {
this.$toast.clear();
});
},
// 所属项目
onConProjectName(value) {
if (!value) {
......@@ -960,20 +1061,6 @@ export default {
this.form[this.userPrefix + "Name"] = value.name;
this.showSource = false;
},
// 事故类型
onConTrouble(value) {
console.log(
"%c [ value ]-653",
"font-size:13px; background:pink; color:#bf2c9f;",
value
);
if (!value) {
this.showTrouble = false;
return;
}
this.form[this.riskName] = value.name;
this.showTrouble = false;
},
// 风险定级
onConSetRank(value) {
this.showSetRank = false;
......@@ -1089,4 +1176,11 @@ export default {
}
}
}
.dialogContain {
width: 100%;
height: 100%;
padding: 10px;
box-sizing: border-box;
}
</style>
......@@ -399,7 +399,6 @@ export default {
loadingType: "spinner",
duration: 0
});
console.log(this.form.deptId,'00000')
getFun(`/risk/plan/user/list/${this.form.deptId}`).then(res => {
if (res.code == 200) {
this.columnsTrouble = res.data;
......@@ -493,7 +492,7 @@ export default {
formdata.append("key", val["fileId"]);
let res = await postFun("/mobile/remove", formdata);
if (res) {
console.log(res);
res;
this.$toast({
title: "提示",
message: "删除成功!"
......@@ -657,7 +656,6 @@ export default {
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
console.log("this.form :>> ", this.form);
this.showTrouble = false;
},
// 风险定级
......
......@@ -153,11 +153,11 @@ export default {
};
},
created() {
this.planId = this.$route.params.id || sessionStorage.getItem("planId");
this.planId = sessionStorage.getItem("planId") || this.$route.params.id;
this.buildingId =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
sessionStorage.getItem("buildingId") || this.$route.params.buildingId;
this.buildingName =
this.$route.params.buildingName || sessionStorage.getItem("buildingName");
sessionStorage.getItem("buildingName") || this.$route.params.buildingName;
this.getRiskList(this.planId);
// this.postList();
},
......@@ -260,7 +260,6 @@ export default {
this.changeBuild(res.data[0].name);
this.option0 = this.changeData(res.data);
this.value0 = res.data[0].name || "";
console.log(this.value0, 222);
this.changeBuild();
})
.catch(() => {
......@@ -274,7 +273,6 @@ export default {
.then(res => {
this.option2 = this.changeData(res.data);
this.value2 = res.data[0].id || 0;
console.log(this.value2, "vlaue2");
resolve(res.data);
let risk = this.riskList(
this.planId,
......@@ -331,11 +329,9 @@ export default {
},
changeBuild() {
if (this.value0) {
console.log(this.floorListData, this.value0, 111);
let arr = this.floorListData.filter(item => item.name == this.value0)[0]
.children;
console.log(arr);
this.option1 = this.changeData(arr);
this.value1 = arr[0].id;
this.roomList(this.value1);
......@@ -373,7 +369,7 @@ export default {
sessionStorage.setItem("buildingId", this.buildingId);
sessionStorage.setItem("planId", this.planId);
sessionStorage.setItem("buildingName", this.buildingName);
sessionStorage.setItem("inherentId", data.businessId || data.id);
sessionStorage.setItem("inherentId", data.id);
this.$router.push({
name: "addCurrent",
params: {
......
......@@ -67,7 +67,6 @@ export default {
};
buildingDtos[i] = buildingDto;
}
console.log(buildingDtos);
var params = {
id: this.planId,
taskResult: this.result,
......@@ -75,9 +74,7 @@ export default {
buildingDtos: buildingDtos
};
postFun("/risk/plan/approve", params)
.then(res => {
console.log(res);
})
.then(res => {})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
......
......@@ -177,40 +177,83 @@
@click="toRiskDetail(item)"
>
<!-- <van-col span="20"> -->
<van-col>
<van-image
<van-col>
<van-image
style="vertical-align: middle;margin-right: 15px;margin-left: 10px;"
width="58"
height="58"
:src="(item.level == '重大风险' ?
require('@/assets/imgs/redInherent.png'):item.level == '较大风险'?
require('@/assets/imgs/inherentOrange.png'): item.level === '一般风险'?require('@/assets/imgs/yellowInherent.png') :require('@/assets/imgs/blueInherent.png')
)"
/>
<!-- <van-image width="46" height="46" :src="item.avatar" /> -->
</van-col>
<van-col span="17">
<van-row gutter="0">
<van-col style="font-weight: bold;color:#000;font-size: 16px;">风险名称:</van-col>
<van-col span="14" style="color: #000;font-size: 16px;" class="item-prop">{{ item.name }}</van-col>
</van-row>
<van-row gutter="0">
<van-col style="font-weight: bold;color:#666666;font-size: 12px;">风险等级:</van-col>
<van-col span="15" style="color: #9d9d9d;font-size: 12px;" class="item-prop">{{ item.level }}</van-col>
</van-row>
<van-row gutter="0">
<van-col style="font-weight: bold;color:#666666;font-size: 12px;">上报时间:</van-col>
<van-col span="15" style="color: #9d9d9d;font-size: 12px;" class="item-prop">{{ timestampToTimes(item.createTime, "DT2") }}</van-col>
</van-row>
<van-row gutter="0">
<van-col style="font-weight: bold;color:#666666;font-size: 12px;">所属房间:</van-col>
<van-col span="15" style="color: #9d9d9d;font-size: 12px;" class="item-prop">{{ item.buildingName + item.floorName + item.roomName }}</van-col>
</van-row>
</van-col>
<!-- </van-col> -->
<!-- <van-col span="4" class="list-right">
<van-tag plain type="primary">详情<van-icon name="arrow" size="12px" /></van-tag>
</van-col> -->
width="58"
height="58"
:src="
item.level == '重大风险'
? require('@/assets/imgs/redInherent.png')
: item.level == '较大风险'
? require('@/assets/imgs/inherentOrange.png')
: item.level === '一般风险'
? require('@/assets/imgs/yellowInherent.png')
: require('@/assets/imgs/blueInherent.png')
"
/>
<!-- <van-image width="46" height="46" :src="item.avatar" /> -->
</van-col>
<van-col span="17">
<van-row gutter="0">
<van-col
span="10"
style="font-weight: bold;color:#000;font-size: 16px;"
>风险名称:</van-col
>
<van-col span="14" style="color: #000;font-size: 16px;">{{
item.name
}}</van-col>
</van-row>
<van-row gutter="0">
<van-col
span="9"
style="font-weight: bold;color:#666666;font-size: 12px;"
>风险等级:</van-col
>
<van-col
span="15"
style="color: #9d9d9d;font-size: 12px;"
>{{ item.level }}</van-col
>
</van-row>
<van-row gutter="0">
<van-col
span="9"
style="font-weight: bold;color:#666666;font-size: 12px;"
>上报时间:</van-col
>
<van-col
span="15"
style="color: #9d9d9d;font-size: 12px;"
>{{ timestampToTimes(item.createTime, "DT2") }}</van-col
>
</van-row>
<van-row gutter="0">
<van-col
span="9"
style="font-weight: bold;color:#666666;font-size: 12px;"
>所属房间:</van-col
>
<van-col
span="15"
style="color: #9d9d9d;font-size: 12px;"
>{{
item.buildingName + item.floorName + item.roomName
}}</van-col
>
</van-row>
</van-col>
<van-col span="4" class="list-right">
<van-tag plain type="primary"
>详情<van-icon name="arrow" size="12px"
/></van-tag>
<!-- <van-row type="flex">
详情
</van-row> -->
</van-col>
</van-row>
</van-cell-group>
</div>
......@@ -596,6 +639,15 @@ export default {
"buildingName",
this.messageList.riskBuildingListDtos[0].buildingName
);
sessionStorage.setItem(
"projectId",
this.messageList.detailsDto.projectId
);
sessionStorage.setItem(
"projectName",
this.messageList.detailsDto.projectName
);
this.$router.push({
name: "riskInherent",
params: {
......@@ -644,7 +696,6 @@ export default {
this.isShowAppvoreList = true;
getFun("/risk/plan/allocation/building/list/" + id)
.then(res => {
console.log(res);
this.buildingList = res.data;
this.checkValue = this.buildingList.map(item => item.buildingId);
})
......@@ -665,18 +716,15 @@ export default {
getRiskTaskList(planId, buildingId) {
if (buildingId) {
getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`).then(res => {
console.log(res.data, "lll");
this.riskList = res.data;
});
} else {
getFun(`/risk/plan/inherent/list/${planId}`).then(res => {
console.log(res.data, "lll");
this.riskList = res.data;
});
}
},
postList(id, buildingId) {
console.log(buildingId, "123");
this.$toast.loading({
message: "加载中...",
forbidClick: true,
......@@ -689,13 +737,11 @@ export default {
.then(res => {
this.$toast.clear();
this.messageList = res.data || res.rows;
console.log(this.messageList);
this.form = this.messageList.detailsDto;
this.checkValue = this.messageList.riskBuildingListDtos.map(
item => item.buildingId
);
this.riskLogList = this.messageList.approveListDtos;
console.log(this.messageList.statusKey, 111);
switch (this.messageList.statusKey) {
case "CREATE_TASK":
case "WAIT_START":
......@@ -775,10 +821,11 @@ export default {
},
//风险清单列表点击
toRiskDetail(item) {
sessionStorage.setItem("inherentId", item.id);
this.$router.push({
name: "taskDetail",
params: {
id: item.id,
inherentId: item.id,
floorId: item.floorId
}
});
......@@ -795,7 +842,7 @@ export default {
.cell-wrap {
position: relative;
}
.van-cell-group--inset .van-row{
.van-cell-group--inset .van-row {
line-height: 1.5 !important;
}
......@@ -819,10 +866,10 @@ p {
line-height: 0.64rem;
}
}
.list-row{
.list-row {
position: relative;
}
.list-right{
.list-right {
position: absolute;
right: 0;
}
......@@ -853,9 +900,9 @@ p {
font-weight: none;
z-index: 99;
}
.item-prop{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.item-prop {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
</style>
<template>
<div>
<van-sticky offset-top="0">
<LHeader :text="text"></LHeader>
</van-sticky>
<van-form
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<LHeader :text="text"></LHeader>
<keep-alive>
<van-form
@submit="onSubmit"
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
现有风险信息
</div>
<van-field
readonly
required
name="userName"
v-model="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectName"
v-model="form.projectName"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
v-model="form.buildingName"
label="所属建筑物"
placeholder="请输入 "
/>
风险信息
</div>
<van-field readonly required label="评估人" placeholder="请输入" />
<van-field readonly required label="所属项目" placeholder="请输入" />
<van-field readonly required label="所属建筑物" placeholder="请输入" />
<van-field
required
clickable
name="floorName"
label="所属楼层"
placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<div style="display: flex;">
<van-field
readonly
required
name="roomName"
label="所属房间"
clickable
name="floorName"
v-model="form.floorName"
label="所属楼层"
placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<div style="display: flex;">
<van-field
readonly
required
name="roomName"
v-model="form.roomName"
label="所属房间"
placeholder="请输入"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
</div>
<van-field
readonly
required
clickable
name="name"
v-model="form.name"
label="危险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '所属房间不能为空' }]"
:rules="[{ required: true, message: '危险源名称不能为空' }]"
/>
<van-field
v-model="form.factor"
readonly
required
name="factor"
label="风险因素"
placeholder="请选择"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<!-- <van-button style="color: #cccc;background-color: #f0f1f5;" icon="plus" type="info" /> -->
</div>
<van-field
required
clickable
name="name"
label="风险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]"
/>
<van-field
required
name="factor"
label="风险因素"
placeholder="请选择"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field
required
name="type"
label="准事故类型"
placeholder="请选择"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field
readonly
required
name="level"
label="风险等级"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-field
required
name="presenceLocation"
label="存在部位"
placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]"
/>
<!-- <van-field
readonly
required
name="level"
label="风险管控措施评价"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/> -->
<van-field
readonly
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<van-field
readonly
required
name="presenceLocation"
v-model="form.presenceLocation"
label="存在部位"
placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]"
/>
风险源图片
</div>
<van-field name="hdPicture1" label="风险源图片">
<template #input>
<van-uploader
multiple
:max-count="5"
disabled
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default">
<div
style="
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险源图片
</div>
<van-field name="hdPicture1" label="风险源图片">
<template #input>
<van-uploader
disabled
@delete="deleteFile(...arguments, 'pictureFile')"
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -118,51 +138,52 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
>
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
技术措施
</div>
<van-field
readonly
v-model="form.measuresProject"
name="measuresProject"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
技术措施
</div>
<van-field
disabled
name="measuresProject"
label="技术措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresProjectFile[]" label=" ">
<template #input>
<van-uploader
disabled
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<div
style="
<van-field name="measuresProjectFile[]" label="上传附件">
<template #input>
<van-uploader
disabled
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -171,132 +192,74 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<!-- <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
应采取的管控措施
</div>
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="" type="textarea" rows="3"
autosize placeholder="请输入" /> -->
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
已采取的管控措施
</div>
<van-field
readonly
v-model="form.measuresAdministration"
name="measuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
已采取的管控措施
</div>
<van-field
v-model="form.takenMeasuresAdministration"
name="takenMeasuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field
required
v-model="form.measuresDeptId"
name="measuresDeptId"
label="管控责任单位 "
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field
required
v-model="form.measuresUserId"
name="measuresUserId"
label="管控责任人 "
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresAdministrationFile[]" label=" ">
<template #input>
<van-uploader
disabled
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<van-field
readonly
v-model="form.measuresDeptName"
name="measuresDeptName"
label="管控责任单位 "
type="textarea"
rows="1"
autosize
placeholder="请选择"
/>
应急措施
</div>
<van-field
disabled
name="measuresEmergency"
label=""
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label=" ">
<template #input>
<van-uploader
disabled
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<div
style="
<van-field
readonly
v-model="form.measuresUserName"
name="measuresUserName"
label="管控责任人 "
type="textarea"
rows="1"
autosize
placeholder="请选择"
/>
<van-field name="measuresAdministrationFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
disabled
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
>
<template slot="default">
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -305,52 +268,293 @@
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应急措施
</div>
<van-field
readonly
v-model="form.measuresEmergency"
name="measuresEmergency"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input>
<van-uploader
disabled
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
参考依据
</div>
<van-field
readonly
clickable
name="referenceBasis"
:value="form.referenceBasis"
label="参考依据"
placeholder="请选择"
/>
<van-field
readonly
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
参考依据
</div>
<van-field
readonly
required
clickable
name="trouble"
:value="form.trouble"
label="参考依据"
placeholder="请选择"
@click="showTrouble = true"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
</van-form>
<van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain">
<van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1">
<van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item>
<van-collapse-item title="风险模型配置" name="2">
<van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
>
<template #reference>
<van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template>
</van-popover>
<van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
>
<template #reference>
<van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button size="small" plain native-type="button" type="info"
>取消</van-button
></van-col
>
<van-col span="6"
><van-button size="small" type="info" native-type="button"
>开始测评</van-button
></van-col
>
</van-row>
</div>
</van-dialog>
<!-- 楼层弹出层 -->
<van-popup
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
show-toolbar
value-key="dictValue"
:columns="columnsData"
@confirm="saveSelect"
@cancel="showSelect = false"
/>
</van-popup>
<!-- 复选弹出层 -->
<van-popup
v-model="showCheckSelect"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
></selectList>
</van-popup>
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup>
<!-- 管控责任单位 -->
<van-popup
v-model="measuresDept"
position="bottom"
:style="{ height: '100%' }"
>
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
>
<button
type="button"
class="van-picker__cancel"
v-on:click="
{
form.measuresDeptId = 0;
projectDept = false;
}
"
>
取消</button
><button type="button" class="van-picker__confirm">
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
</van-form>
</keep-alive>
<!-- v-if="this.$route.params.isView" -->
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import selectDept from "@/components/selectDept/index.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
export default {
// props: ["presentList"],
name: "addPresent",
components: {
LHeader
LHeader,
selectDept,
SelectList,
selectFloor
},
data() {
return {
measuresDept: false,
ShowfloorList: false,
floorSource: [],
dataName: "",
// 单选
showSelect: false,
columnsData: [],
existingId: 0,
// 多选
showCheckSelect: false,
columnsCheckData: [],
ShowAccidentList: false,
ShowSelectList: false,
columnsAccident: [],
showPopoveSetRank: false,
activeNames: ["1"],
showPopover: false,
......@@ -370,15 +574,6 @@ export default {
columnsProjectName: [],
factor: "", //风险因素
showFactor: false,
columnsFactor: [],
messageList: [
{
title: "回显风险源名称",
time: "2022-12-12",
name: "Mr.周",
state: 1
}
],
source: "", //风险源
userPrefix: "", //风险源
showSource: false,
......@@ -388,10 +583,10 @@ export default {
columnsTrouble: [],
setRank: "", //风险定级
showSetRank: false,
columnsSetRank: ["矩阵式定级", "其他定级方式"], //严重程度
columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级
showRiskRank: false,
columnsRiskRank: [], //发生可能性
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"],
showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
......@@ -426,17 +621,423 @@ export default {
};
},
created() {
// this.form.buildingIds = this.$route.params.buildingId ||sessionStorage.getItem("buildingId")
// this.form.planId = this.$route.params.planId||sessionStorage.getItem("planId")
// this.form.buildingName = this.$route.params.buildingName||sessionStorage.getItem("buildingName")
// this.form.userId = userInfo.userId
// this.form.userName = userInfo.userName
// this.form.deptName = userInfo.dept.deptName
// this.form.projectId = '测试项目',
// this.form.level = this.$route.params.level ? this.$route.params.level :''
this.existingId =
this.$route.params.existingId || sessionStorage.getItem("existingId");
this.postReturnEcho();
},
mounted() {},
methods: {
// 请求详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/existing/details/${this.existingId}`)
.then(res => {
this.form = res.data;
this.uploaderImg = (res.data.pictureFile || []).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresProjectFile = (res.data.measuresProjectFile || []).map(
item => {
return {
...item,
url: item.filePath
};
}
);
this.measuresAdministrationFile = (
res.data.measuresAdministrationFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresEmergencyFile = (
res.data.measuresEmergencyFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
})
.catch(() => {
this.$toast.clear();
});
},
// 项目负责人
onConTrouble(value) {
if (!value) {
this.showTrouble = false;
return;
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
this.showTrouble = false;
},
getUserData(e) {
this.userPrefix = e;
if (!this.form.measuresDeptId) {
this.$toast({
title: "提示",
message: "请选择管控责任单位!"
});
return false;
}
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/user/list/${this.form.measuresDeptId}`).then(res => {
if (res.code == 200) {
this.columnsTrouble = res.data;
// 对数据进行赋值
this.$toast.clear();
this.showTrouble = true;
} else {
this.$toast.clear();
}
});
},
changeDept(id, name) {
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
closeDept() {
this.measuresDept = false;
},
selectData(dataName, isSinge) {
this.dataName = dataName;
getFun(
`/risk/plan/dict/data/list?dictType=risk_plan_${dataName.toLowerCase()}`
)
.then(res => {
if (isSinge) {
this.columnsData = res.data;
this.showSelect = true;
} else {
this.columnsCheckData = res.data;
this.showCheckSelect = true;
}
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
saveSelect(data) {
this.form[this.dataName] = data.dictValue;
this.showSelect = false;
},
saveCheckSelect(data) {
this.form[this.dataName] = data.join(",");
this.showCheckSelect = false;
},
seletFloor(name) {
this.ShowfloorList = true;
this.userPrefix = name;
},
seletRoom(name) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
this.userPrefix = name;
getFun(`/risk/plan/room/list/${this.form.floorId}`)
.then(res => {
this.$toast.clear();
this.showSource = true;
this.columnsSource = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
//风险因素
seletFactor(name) {
// this.showTrouble = true;
this.riskName = name;
this.ShowSelectList = true;
},
//准事故类型
seletType(name) {
// this.showTrouble = true;
this.riskName = name;
this.ShowAccidentList = true;
},
seletGrade(name) {
this.getGradeList("possibility");
this.getGradeList("severity");
this.showGradeDialog = true;
},
//风险模型配置
getGradeList(type) {
// possibility 可能性 severity 严重性
getFun(`/risk/plan/matrix/${type}/list`).then(res => {
let arr = [];
res.data.forEach(item => {
arr.push({
text: item.title,
type: item.type,
sort: item.sort,
score: item.score
});
});
if (type === "possibility") {
this.columnsRiskRank = arr;
} else {
this.columnsSetRank = arr;
}
});
},
closeSlectfloor() {
this.ShowfloorList = false;
},
saveSlectfloor(data) {
this.form.floorId = data.id;
this.form.floorName = data.text;
this.ShowfloorList = false;
},
closeSlect() {
this.ShowSelectList = false;
},
saveSlect(data) {
this.form.factor = data.join(",");
this.ShowSelectList = false;
},
closeSlectAccident() {
this.ShowAccidentList = false;
},
saveSlectAccident(data) {
this.form.type = data.join(",");
this.ShowAccidentList = false;
},
onSelect(data) {
this.possibleValue = data.text;
this.possibleScore = data.score;
},
onSelectSetRank(data) {
this.severityValue = data.text;
this.severityScore = data.score;
},
//开始测评
goResultPage() {
this.$router.push({
name: "resultPage",
params: {
score: this.severityScore * this.possibleScore
}
});
},
performTasks() {},
// 点击预览图
clickPre(e) {
console.log(e);
if (e.filePath) {
this.videoUrl = e.filePath;
} else {
this.videoUrl = e.content;
}
},
async deleteFile(val, detail, key) {
// console.log(val,detail)
if (val.fileId) {
let formdata = new FormData();
formdata.append("key", val["fileId"]);
let res = await postFun("/mobile/remove", formdata);
if (res) {
this.$toast({
title: "提示",
message: "删除成功!"
});
} else {
console.log("删除失败");
this[key].splice(detail.index, 0, val);
}
}
},
jsonToFormData(config) {
const formData = new FormData();
//循环传入的值转换formData
Object.keys(config).forEach(key => {
formData.append(key, config[key]);
});
return formData;
},
onSubmit(values) {
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson = this.jsonToFormData(this.form);
// let url = "/risk/plan/inherent";
let url = "/risk/plan/existing";
values.hdPicture1.forEach(item => {
if (item.file) {
formDataJson.append("pictureFile[]", item.file);
} else {
formDataJson.append("pictureFile[]", item.fileId);
}
});
values["measuresProjectFile[]"].forEach(item => {
if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file);
} else {
formDataJson.append("measuresProjectFile[]", item.fileId);
}
});
values["measuresEmergencyFile[]"].forEach(item => {
if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
} else {
formDataJson.append("measuresEmergencyFile[]", item.fileId);
}
});
values["measuresAdministrationFile[]"].forEach(item => {
if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file);
} else {
formDataJson.append("measuresAdministrationFile[]", item.fileId);
}
});
postFun(url, formDataJson)
.then(res => {
this.$toast.clear();
this.$toast.success({
message: "提交成功",
duration: 2000
});
history.go(-1);
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("提交失败,请稍后再试");
});
this.$toast.clear();
},
// 所属项目
onConProjectName(value) {
if (!value) {
this.showProjectName = false;
return;
}
this.projectId = value.id;
this.projectName = value.projectName;
this.showProjectName = false;
},
// 风险因素
onConFactor(value) {
if (!value) {
this.showFactor = false;
return;
}
this.factor = value.factorType;
this.showFactor = false;
this.source = "";
this.trouble = "";
// 请求风险源
postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then(
res => {
this.columnsSource = res.data;
}
);
},
// 风险源
onConSource(value) {
if (!value) {
this.showSource = false;
return;
}
this.form[this.userPrefix + "Id"] = value.id;
this.form[this.userPrefix + "Name"] = value.name;
this.showSource = false;
},
// 风险定级
onConSetRank(value) {
this.showSetRank = false;
this.setRank = value;
this.riskRank = "";
if (this.setRank == "矩阵式定级") {
this.showSetRank = false;
this.$router.push({
name: "matrix-grad"
});
}
},
// 自己定义风险等级点击方法
myRiskRank() {
if (this.setRank == "") {
this.$toast("请先选择风险定级");
} else if (this.setRank == "其他定级方式") {
this.showRiskRank = true;
}
},
// 风险等级
onConRiskRank(value) {
this.riskRank = value;
this.showRiskRank = false;
},
// 管控层级
onConControl(value) {
this.control = value;
this.showControl = false;
},
// 主责部门
onConMainDutyDept(value) {
this.mainDutyDeptId = value.deptId;
this.mainDutyDept = value.deptName;
this.showMainDutyDept = false;
this.mainDutyPeopLe = "";
// 请求主责人员
let formdata = new FormData();
formdata.append("organizationId", this.mainDutyDeptId);
postHdPeople(`/riskMain/getUserList`, formdata).then(res => {
this.columnsMainDutyPeopLe = res.data;
});
},
// 主责人员
onConMainDutyPeopLe(value) {
this.mainDutyPeopLeId = value.userId;
this.mainDutyPeopLe = value.userName;
this.showMainDutyPeopLe = false;
},
cancel() {
this.$router.go(-1);
},
// 选择作业人
goSelPeoTwo(val) {
this.peopleName = val;
this.show = true;
},
onClose() {
this.show = false;
},
onSave(e) {
this.projectDirector = e[0].loginName;
this.projectDirectorName = e[0].userName;
this.show = false;
}
},
methods: {},
watch: {}
watch: {
// setRank(newVal, oldVal) {
// if (newVal == "其他定级方式") {
// this.showSetRankMode = true;
// } else {
// this.showSetRankMode = false;
// }
// },
}
};
</script>
<style lang="less" scoped>
......
......@@ -27,8 +27,8 @@
<van-field
readonly
required
name="projectId"
:value="form.projectId"
name="projectName"
:value="form.projectName"
label="所属项目"
placeholder="请输入"
/>
......@@ -457,19 +457,6 @@ export default {
this.$bus.$off("riskLevelBus");
});
},
beforeRouteEnter(to, from, next) {
if (from.name == "riskInherent") {
sessionStorage.setItem("inherenForm", "");
sessionStorage.setItem("level", "");
}
next();
},
beforeRouteLeave(to, from, next) {
if (to.name != "riskInherent") {
sessionStorage.setItem("inherenForm", JSON.stringify(this.form));
}
next();
},
data() {
return {
measuresDept: false,
......@@ -491,7 +478,7 @@ export default {
showPopover: false,
showGradeDialog: false,
taskId: "",
text: "添加固有风险",
text: "固有风险详情",
id: "",
isTimely: 1,
active: 0,
......@@ -560,17 +547,13 @@ export default {
if (this.$route.params.inherentId || sessionStorage.getItem("inherentId")) {
this.inherentId =
this.$route.params.inherentId || sessionStorage.getItem("inherentId");
this.buildingIds =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postReturnEcho();
}
},
mounted() {
if (sessionStorage.getItem("inherenForm") != "") {
this.form = JSON.parse(sessionStorage.getItem("inherenForm"));
this.form.level = sessionStorage.getItem("level");
}
},
mounted() {},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
......@@ -640,7 +623,6 @@ export default {
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
console.log("this.form :>> ", this.form);
this.showTrouble = false;
},
getUserData(e) {
......@@ -670,12 +652,10 @@ export default {
});
},
changeDept(id, name) {
console.log(id);
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
closeDept() {
console.log(this.form.deptId);
this.measuresDept = false;
},
selectData(dataName, isSinge) {
......@@ -726,7 +706,6 @@ export default {
return arr;
},
getFloor() {
console.log(this.form, 111);
getFun(`/risk/plan/floor/list/${this.form.buildingId}`)
.then(res => {
// this.$toast.clear();
......
......@@ -6,11 +6,16 @@
<div class="section">
<van-tabs v-model="activeName" color="#2980f7" animated @click="onClick">
<van-tab title="固有风险信息" name="a">
<TabDetail :InherentRisk="InherentRisk"/>
<TabDetail :InherentRisk="InherentRisk" />
</van-tab>
<van-tab title="现状风险" name="b">
<div class="quolist">
<van-cell-group style="padding: 10px;box-sizing: border-box;background-color: #fff;margin: 8px;border-radius: 10px;" v-for="(item, index) in quoRiskList" :key="index" @click="goDetail(item)">
<van-cell-group
style="padding: 10px;box-sizing: border-box;background-color: #fff;margin: 8px;border-radius: 10px;"
v-for="(item, index) in quoRiskList"
:key="index"
@click="goDetail(item)"
>
<div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.name }}
</div>
......@@ -28,18 +33,24 @@
</van-row>
<van-row gutter="">
<van-col span="9">风险因素:</van-col>
<van-col span="15">{{
item.factor
}}</van-col>
<van-col span="15">{{ item.factor }}</van-col>
</van-row>
</van-col>
<van-col span="7">
<van-row>
{{ item.state }}
</van-row>
<van-row type="flex" style="flex-direction: column;align-items: center;">
<van-row
type="flex"
style="flex-direction: column;align-items: center;"
>
<van-col>
<van-image round width="34" height="34" src="http://rongtongpc.censoft.com.cn/dev-api/profile/upload/2023/07/08/xianyou.png" />
<van-image
round
width="34"
height="34"
src="http://rongtongpc.censoft.com.cn/dev-api/profile/upload/2023/07/08/xianyou.png"
/>
</van-col>
<van-col>
{{ item.userName }}
......@@ -51,7 +62,7 @@
</div>
</van-tab>
<van-tab title="四色图" name="c">
<drawCanvas :isView="true" :floorId="floorId"/>
<drawCanvas :isView="true" :floorId="floorId" />
</van-tab>
</van-tabs>
</div>
......@@ -82,7 +93,7 @@ export default {
TabDetail
},
created() {
this.inherentId = this.$route.params.id ||sessionStorage.getItem('inherntId')
this.inherentId = this.$route.params.id ||sessionStorage.getItem('inherentId')
this.floorId = this.$route.params.floorId
},
mounted() {
......@@ -104,11 +115,13 @@ export default {
return timestampToTime(new Date(time), "DT1", true);
},
goDetail(item){
sessionStorage.setItem('inherntId',this.inherentId)
sessionStorage.setItem('inherentId',this.inherentId)
sessionStorage.setItem('existingId',item.id)
this.$router.push({
name:'presentDetail',
params:{
isView:false,
existingId:item.id
}
})
},
......@@ -134,7 +147,7 @@ export default {
/* height: 100%; */
overflow-y: auto;
}
.quolist{
.quolist {
padding: 10px;
box-sizing: border-box;
}
......
......@@ -21,8 +21,13 @@
<van-cell-group inset v-if="finalRiskList.length > 0">
<van-cell value="风险评估管理" />
<van-grid :column-num="4">
<van-grid-item @click="dangerJump(item.path)" v-for="item in finalRiskList" :key="item.key" :icon="item.imgUrl"
:text="item.text" />
<van-grid-item
@click="dangerJump(item.path)"
v-for="item in finalRiskList"
:key="item.key"
:icon="item.imgUrl"
:text="item.text"
/>
</van-grid>
</van-cell-group>
<!-- <van-cell-group inset v-for="(item, index) in riskList" :key="index">
......@@ -45,15 +50,15 @@
<script>
import tabBar from "@/components/TabBar";
import { getFun, postFun } from '@/service/table'
import { getFun, postFun } from "@/service/table";
export default {
components: {
tabBar
},
data() {
return {
value: '',
/**
value: "",
/**
* 总公司:任务台账;
* 区域负责人:任务管理,任务审批,任务台账
* 评估负责人: 执行管理,风险评估,任务审批,任务台账
......@@ -63,166 +68,161 @@ export default {
{
path: "/taskLedger",
imgUrl: require("@/assets/workbench/work-approval.png"),
text: "任务台账",
text: "任务台账"
},
{
path: "/riskManage",
imgUrl: require("@/assets/workbench/risk-report.png"),
text: "任务管理",
text: "任务管理"
},
{
path: "/taskManage",
imgUrl: require("@/assets/workbench/plane-approval.png"),
text: "任务审批",
text: "任务审批"
},
{
path: "/riskExecution",
imgUrl: require("@/assets/workbench/rectification-notice.png"),
text: "执行管理",
text: "执行管理"
},
{
path: "/riskAssess",
imgUrl: require("@/assets/workbench/risk-confirm.png"),
text: "风险评估",
text: "风险评估"
},
{
path: "/riskApprove",
imgUrl: require("@/assets/workbench/risk-account.png"),
text: "风险审批",
text: "风险审批"
},
{
path: "/riskLedger",
imgUrl: require("@/assets/workbench/danger-account.png"),
text: "风险台账",
},
text: "风险台账"
}
// {
// path: "/riskView",
// imgUrl: require("@/assets/workbench/quarter_record.png"),
// text: "四色图",
// },
],
riskList: [ {
key:"1",
riskList: [
{
key: "1",
path: "/taskLedger",
imgUrl: require("@/assets/workbench/work-approval.png"),
text: "任务台账",
text: "任务台账"
},
{
key:"2",
key: "2",
path: "/riskManage",
imgUrl: require("@/assets/workbench/risk-report.png"),
text: "任务管理",
text: "任务管理"
},
{
key:"3",
key: "3",
path: "/taskManage",
imgUrl: require("@/assets/workbench/plane-approval.png"),
text: "任务审批",
text: "任务审批"
},
{
key:"4",
key: "4",
path: "/riskExecution",
imgUrl: require("@/assets/workbench/rectification-notice.png"),
text: "执行管理",
text: "执行管理"
},
{
key:"5",
key: "5",
path: "/riskAssess",
imgUrl: require("@/assets/workbench/risk-confirm.png"),
text: "风险评估",
text: "风险评估"
},
{
key:"6",
key: "6",
path: "/riskApprove",
imgUrl: require("@/assets/workbench/risk-account.png"),
text: "风险审批",
text: "风险审批"
},
{
key:"7",
key: "7",
path: "/riskLedger",
imgUrl: require("@/assets/workbench/danger-account.png"),
text: "风险台账",
},],
finalRiskList:[],
text: "风险台账"
}
],
finalRiskList: [],
images: [
{
url: require('@/assets/workbench/u47.png'),
url: require("@/assets/workbench/u47.png")
},
{
url: require('@/assets/workbench/u51.png'),
url: require("@/assets/workbench/u51.png")
},
{
url: require('@/assets/workbench/u55.png'),
},
url: require("@/assets/workbench/u55.png")
}
]
};
},
created() {
},
created() {},
mounted() {
// this.getMenuList();
this.workBenchList();
},
methods: {
//查询角色菜单列表
getMenuList() {
getFun('/menu/roleMenuTreeselect').then((res) => {
this.riskList = res.list
this.riskList.forEach((item, index) => {
item.children.forEach((i, k) => {
let data = this.riskList2.find((y) => y.text == i.menuName)
if (data) {
i.icon = data.imgUrl
}
})
getFun("/menu/roleMenuTreeselect")
.then(res => {
this.riskList = res.list;
this.riskList.forEach((item, index) => {
item.children.forEach((i, k) => {
let data = this.riskList2.find(y => y.text == i.menuName);
if (data) {
i.icon = data.imgUrl;
}
});
});
})
.catch(err => {
console.log("err==>>", err);
});
console.log('this.riskList==>>', this.riskList)
}).catch((err) => {
console.log('err==>>', err)
})
},
workBenchList() {
getFun(`/menu/getMenu`).then(res => {
if (res.code == 200) {
this.powerObj = res.data;
if (this.powerObj.风险评估管理) {
this.finalRiskList = [
...this.riskList
].filter((x) =>
[...this.powerObj.风险评估管理].some(
(y) => (`/${y.path}`) == x.path
)
this.finalRiskList = [...this.riskList].filter(x =>
[...this.powerObj.风险评估管理].some(y => `/${y.path}` == x.path)
);
} else {
this.finalRiskList = [];
}
console.log(this.finalRiskList)
} else {
this.powerObj = {}
this.powerObj = {};
}
});
},
onSearch() {
},
onSearch() {},
createdClick() {
this.$router.push('/create-task')
this.$router.push("/create-task");
},
dangerJump(path) {
if (path) {
if (path == '/add-danger') {
sessionStorage.removeItem('obj')
this.$router.push({ name: 'add-danger', params: { isWorkbenchTo: 1 } });
if (path == "/add-danger") {
sessionStorage.removeItem("obj");
this.$router.push({
name: "add-danger",
params: { isWorkbenchTo: 1 }
});
} else {
this.$router.push(path);
}
}
},
}
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment