Commit 716674fb authored by 杨帆's avatar 杨帆

Dev yf'

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