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);
......
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
<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
:layout.sync="layout"
:col-num="colNum" :col-num="colNum"
:row-height="30" :row-height="30"
:vertical-compact="false" :vertical-compact="false"
...@@ -19,7 +20,8 @@ ...@@ -19,7 +20,8 @@
:prevent-collision="false" :prevent-collision="false"
:preventCollision="true" :preventCollision="true"
> >
<grid-item v-for="(item) in layout" <grid-item
v-for="item in layout"
:static="item.static" :static="item.static"
:x="item.x" :x="item.x"
:y="item.y" :y="item.y"
...@@ -31,19 +33,37 @@ ...@@ -31,19 +33,37 @@
:isResizable="item.isResizable" :isResizable="item.isResizable"
@resized="resizedEvent" @resized="resizedEvent"
@moved="movedEvent" @moved="movedEvent"
:style="{'backgroundColor':item.c,'border':(item.type == 'thorough'? 'none !important':'')}" :style="{
backgroundColor: item.c,
border: item.type == 'thorough' ? 'none !important' : ''
}"
>
<span class="text" :class="item.w > item.h * 5 ? '' : 'rowText'">{{
item.name
}}</span>
<span class="remove" @click="removeItem(item.i)" v-if="showHeader"
>x</span
> >
<span class="text" :class="item.w>(item.h*5) ? '': 'rowText'">{{item.name}}</span>
<span class="remove" @click="removeItem(item.i)" v-if="showHeader">x</span>
<!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> --> <!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> -->
</grid-item> </grid-item>
</grid-layout> </grid-layout>
<div class="setBtns"> <div class="setBtns">
<van-button @click="addItem" type="info" size="mini" v-if="!isViews">添加房间</van-button> <van-button @click="addItem" type="info" size="mini" v-if="!isViews"
<van-button @click="addOther" type="info" size="mini" v-if="!isViews">添加其他</van-button> >添加房间</van-button
<van-button @click="addBase" type="info" size="mini" v-if="!isViews">添加基础设施</van-button> >
<van-button @click="addOther" type="info" size="mini" v-if="!isViews"
>添加其他</van-button
>
<van-button @click="addBase" type="info" size="mini" v-if="!isViews"
>添加基础设施</van-button
>
<!-- <van-button @click="editItem" type="info" size="mini" v-if="!isViews">修改</van-button> --> <!-- <van-button @click="editItem" type="info" size="mini" v-if="!isViews">修改</van-button> -->
<van-grid direction="horizontal" :column-num="2" class="footer" v-if="isViews"> <van-grid
direction="horizontal"
:column-num="2"
class="footer"
v-if="isViews"
>
风险等级图例: 风险等级图例:
<span class="riskTab type1"></span>重大风险 <span class="riskTab type1"></span>重大风险
<span class="riskTab type2"></span>较大风险 <span class="riskTab type2"></span>较大风险
...@@ -51,9 +71,19 @@ ...@@ -51,9 +71,19 @@
<span class="riskTab type4"></span>较小风险 <span class="riskTab type4"></span>较小风险
</van-grid> </van-grid>
</div> </div>
<van-dialog v-model="show" :title="title" show-cancel-button @confirm="saveRoomName" @cancel = "cancelDialog"> <van-dialog
v-model="show"
:title="title"
show-cancel-button
@confirm="saveRoomName"
@cancel="cancelDialog"
>
<van-cell-group v-if="isRoom"> <van-cell-group v-if="isRoom">
<van-field v-model="roomName" label="房间名称" placeholder="请输入房间名称" /> <van-field
v-model="roomName"
label="房间名称"
placeholder="请输入房间名称"
/>
<van-field <van-field
readonly readonly
clickable clickable
...@@ -62,7 +92,6 @@ ...@@ -62,7 +92,6 @@
placeholder="选择房间类型" placeholder="选择房间类型"
@click="showPicker = true" @click="showPicker = true"
/> />
</van-cell-group> </van-cell-group>
<van-cell-group v-else-if="isBase"> <van-cell-group v-else-if="isBase">
<van-field <van-field
...@@ -73,7 +102,6 @@ ...@@ -73,7 +102,6 @@
placeholder="选择房间名称" placeholder="选择房间名称"
@click="showPicker = true" @click="showPicker = true"
/> />
</van-cell-group> </van-cell-group>
<van-cell-group v-else> <van-cell-group v-else>
<van-field v-model="roomName" label="名称" placeholder="请输入名称" /> <van-field v-model="roomName" label="名称" placeholder="请输入名称" />
...@@ -82,7 +110,7 @@ ...@@ -82,7 +110,7 @@
<van-popup v-model="showPicker" round position="bottom"> <van-popup v-model="showPicker" round position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
:columns="isRoom?roomArr:baseArr" :columns="isRoom ? roomArr : baseArr"
@cancel="showPicker = false" @cancel="showPicker = false"
@confirm="onConfirm" @confirm="onConfirm"
value-key="dictLabel" value-key="dictLabel"
...@@ -92,20 +120,20 @@ ...@@ -92,20 +120,20 @@
</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() { data() {
return { return {
text:'房间位置绘制工具', text: "房间位置绘制工具",
layout: [ layout: [
// { x: 0, y: 0, w: 2, h: 3, i: "1",name: "办公室1",c:'#FF4433',isDraggable:false,isResizable:false,}, // { 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: 2, y: 0, w: 2, h: 3, i: "2",name: "办公室2",c:'#FF9800',isDraggable:false,isResizable:false},
...@@ -117,68 +145,72 @@ export default { ...@@ -117,68 +145,72 @@ export default {
resizable: true, resizable: true,
colNum: 12, colNum: 12,
// isScreenFull :null, // isScreenFull :null,
layOutItem:{},//新增的房间对象 layOutItem: {}, //新增的房间对象
show:false, show: false,
title:'', title: "",
showPicker: false, showPicker: false,
roomType:'', roomType: "",
roomName:'', roomName: "",
roomArr: [], roomArr: [],
colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'], colorList: ["#FF4433", "#FF9800", "#FFFF00", "#0091EA"],
isViews:false,// true:查看页面; false: 添加页面 isViews: false, // true:查看页面; false: 添加页面
showHeader:true, showHeader: true,
isRoom:true,//是否为添加房间 isRoom: true, //是否为添加房间
isBase:false, isBase: false,
baseName:'', baseName: "",
baseArr:[], baseArr: [],
layoutData:[] layoutData: []
} };
}, },
props:{ props: {
isView: { isView: {
type: Boolean, type: Boolean,
default: false, default: false
}, }
}, },
mounted() { mounted() {
// screenfull.toggle(this.$refs.mapbox); // screenfull.toggle(this.$refs.mapbox);
// this.$nextTick(() => { // this.$nextTick(() => {
// this.rotateBox(); // this.rotateBox();
// }); // });
console.log('floorId==>>',this.$route.params.floorId ) console.log("floorId==>>", this.$route.params.floorId);
if (this._props.isView) { if (this._props.isView) {
console.log('作为组件传值==>>',) console.log("作为组件传值==>>");
this.isViews = true this.isViews = true;
this.showHeader = false this.showHeader = false;
} }
if (this.$route.params.isView) { if (this.$route.params.isView) {
this.isViews = true this.isViews = true;
this.initRotate(); this.initRotate();
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false); window.addEventListener(
"onorientationchange" in window ? "orientationchange" : "resize",
this.orientationChange,
false
);
} }
this.getRoomInfo() this.getRoomInfo();
}, },
methods: { methods: {
orientationChange(){ orientationChange() {
if (window.orientation === 180 || window.orientation === 0) { if (window.orientation === 180 || window.orientation === 0) {
console.log('竖屏状态!'); console.log("竖屏状态!");
} }
if (window.orientation === 90 || window.orientation === -90 ){ if (window.orientation === 90 || window.orientation === -90) {
console.log('横屏状态!'); console.log("横屏状态!");
} }
// let width = document.documentElement.clientWidth//页面宽度 // let width = document.documentElement.clientWidth//页面宽度
// let height = document.documentElement.clientHeight//页面高度 // let height = document.documentElement.clientHeight//页面高度
// console.log('width==>>',width) // console.log('width==>>',width)
// console.log('height==>>',height) // console.log('height==>>',height)
this.rotateBox() this.rotateBox();
}, },
initRotate(){ initRotate() {
let width = document.documentElement.clientWidth,//页面宽度 let width = document.documentElement.clientWidth, //页面宽度
height = document.documentElement.clientHeight,//页面高度 height = document.documentElement.clientHeight, //页面高度
wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果 wrapper = this.$refs.mapmidbox, //需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = "";//样式 style = ""; //样式
console.log('width==>>',width) console.log("width==>>", width);
console.log('height==>>',height) console.log("height==>>", height);
style += "width:" + height + "px;"; style += "width:" + height + "px;";
style += "height:" + width + "px;"; style += "height:" + width + "px;";
style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
...@@ -190,12 +222,12 @@ export default { ...@@ -190,12 +222,12 @@ export default {
}, },
rotateBox() { rotateBox() {
// this.isScreenFull = !this.isScreenFull;//是否全屏状态 // this.isScreenFull = !this.isScreenFull;//是否全屏状态
let width = document.documentElement.clientWidth,//页面宽度 let width = document.documentElement.clientWidth, //页面宽度
height = document.documentElement.clientHeight,//页面高度 height = document.documentElement.clientHeight, //页面高度
wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果 wrapper = this.$refs.mapmidbox, //需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = "";//样式 style = ""; //样式
console.log('width==>>',width) console.log("width==>>", width);
console.log('height==>>',height) console.log("height==>>", height);
// if (height < width) {//注意原来就是宽屏时不用横屏 // if (height < width) {//注意原来就是宽屏时不用横屏
// return; // return;
// } // }
...@@ -223,28 +255,30 @@ export default { ...@@ -223,28 +255,30 @@ export default {
style += "-webkit-transform-origin: 0 0;"; style += "-webkit-transform-origin: 0 0;";
style += "transform-origin: 0 0;"; style += "transform-origin: 0 0;";
} }
console.log('style==>>',style) console.log("style==>>", style);
wrapper.style.cssText = style; wrapper.style.cssText = style;
}, },
getRoomInfo(){ getRoomInfo() {
let data = { let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : '18' floorId: this.$route.params.floorId ? this.$route.params.floorId : "18"
} };
getFun('/ledger/room/list',data).then((res) => { getFun("/ledger/room/list", data)
.then(res => {
if (res.code == 200) { if (res.code == 200) {
this.layout = [] this.layout = [];
this.layoutData = res.data this.layoutData = res.data;
res.data.forEach((item) => { res.data.forEach(item => {
item.position = JSON.parse(item.position) item.position = JSON.parse(item.position);
item.position.i = item.id item.position.i = item.id;
item.position.id = item.id item.position.id = item.id;
if (!this.showHeader) { if (!this.showHeader) {
item.position.isDraggable = false item.position.isDraggable = false;
item.position.isResizable = false item.position.isResizable = false;
} }
if (!this.isViews || item.position.type == 'thorough') { //添加页面不显示颜色 if (!this.isViews || item.position.type == "thorough") {
item.position.c = '#e6e5e5' //添加页面不显示颜色
}else{ item.position.c = "#e6e5e5";
} else {
/** /**
* 根据风险评分来匹配相应的颜色 * 根据风险评分来匹配相应的颜色
* score 风险评分字段 * score 风险评分字段
...@@ -259,125 +293,128 @@ export default { ...@@ -259,125 +293,128 @@ export default {
// }else if (item.score>=0 && item.score <= 6) { //差 // }else if (item.score>=0 && item.score <= 6) { //差
// item.position.c = this.colorList[0] // item.position.c = this.colorList[0]
// } // }
item.position.c = this.colorList[Math.floor(Math.random()*4)] item.position.c = this.colorList[Math.floor(Math.random() * 4)];
} }
this.layout.push(item.position) this.layout.push(item.position);
}) });
// console.log('layout==>>',this.layout) // 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
}) })
.catch(err => {
console.log("err==>>", err);
});
getFun("/risk/plan/dict/data/list", {
dictType: "risk_plan_room_type"
}).then(res => {
this.roomArr = res.data;
});
getFun("/risk/plan/dict/data/list", {
dictType: "risk_plan_base_room"
}).then(res => {
this.baseArr = res.data;
});
}, },
// 增加 // 增加
addItem () { addItem() {
if (this.layout.find((item) => item.i == '')) { if (this.layout.find(item => item.i == "")) {
Toast.fail({ Toast.fail({
title: '提示', title: "提示",
forbidClick: true, forbidClick: true,
message: '请先点击确定,保存当前房间信息', message: "请先点击确定,保存当前房间信息"
}) });
return return;
} }
this.roomType = '' this.roomType = "";
this.roomName = '' this.roomName = "";
this.title = '创建房间' this.title = "创建房间";
this.isRoom = true this.isRoom = true;
this.show = true this.show = true;
this.isBase = false; this.isBase = false;
}, },
// 添加其他 // 添加其他
addOther(){ addOther() {
if (this.layout.find((item) => item.i == '')) { if (this.layout.find(item => item.i == "")) {
Toast.fail({ Toast.fail({
title: '提示', title: "提示",
forbidClick: true, forbidClick: true,
message: '请先点击确定,保存当前房间信息', message: "请先点击确定,保存当前房间信息"
}) });
return return;
} }
this.isRoom = false; this.isRoom = false;
this.isBase = false; this.isBase = false;
this.roomType = '' this.roomType = "";
this.roomName = '' this.roomName = "";
this.title = '创建其他' this.title = "创建其他";
this.show = true this.show = true;
}, },
// 删除 // 删除
removeItem (val) { removeItem(val) {
if (val == '') { if (val == "") {
const index = this.layout.map(item => item.i).indexOf(val); const index = this.layout.map(item => item.i).indexOf(val);
this.layout.splice(index, 1); this.layout.splice(index, 1);
return return;
} }
this.$dialog.confirm({ this.$dialog
title: '提示', .confirm({
message: '是否删除', title: "提示",
message: "是否删除"
}) })
.then(() => { .then(() => {
postFun('/ledger/room/delete/'+val).then((res) => { postFun("/ledger/room/delete/" + val)
.then(res => {
if (res.code == 200) { if (res.code == 200) {
Toast.success('删除成功'); Toast.success("删除成功");
this.getRoomInfo() this.getRoomInfo();
} }
}).catch((err) => {
console.log('err==>>',err)
}) })
.catch(err => {
console.log("err==>>", err);
});
}) })
.catch(() => { .catch(() => {
// on cancel // on cancel
}); });
}, },
//添加基础设施 //添加基础设施
addBase(){ addBase() {
if (this.layout.find((item) => item.i == '')) { if (this.layout.find(item => item.i == "")) {
Toast.fail({ Toast.fail({
title: '提示', title: "提示",
forbidClick: true, forbidClick: true,
message: '请先点击确定,保存当前房间信息', message: "请先点击确定,保存当前房间信息"
}) });
return return;
} }
this.roomType = '' this.roomType = "";
this.roomName = '' this.roomName = "";
this.title = '添加基础设备' this.title = "添加基础设备";
this.isRoom = false; this.isRoom = false;
this.isBase = true; this.isBase = true;
this.show = true this.show = true;
}, },
// 移动后的事件 // 移动后的事件
movedEvent(i, newX, newY){ movedEvent(i, newX, newY) {
this.layOutItem.x = newX this.layOutItem.x = newX;
this.layOutItem.y = newY this.layOutItem.y = newY;
// console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout) // console.log('this.layout==>>',this.layout)
}, },
// 调整大小后的事件 // 调整大小后的事件
resizedEvent: function(i, newH, newW){ resizedEvent: function(i, newH, newW) {
this.layOutItem.w = newW this.layOutItem.w = newW;
this.layOutItem.h = newH this.layOutItem.h = newH;
// console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout) // console.log('this.layout==>>',this.layout)
}, },
//关闭 //关闭
close(){ close() {
history.go(-1) history.go(-1);
}, },
//edger/room/update/batch //edger/room/update/batch
// 确定 执行批量编辑保存 // 确定 执行批量编辑保存
confim(){ confim() {
// if (this.roomName == '') { // if (this.roomName == '') {
// Toast.fail({ // Toast.fail({
// title: '提示', // title: '提示',
...@@ -386,126 +423,134 @@ export default { ...@@ -386,126 +423,134 @@ export default {
// }) // })
// return // return
// } // }
let data = this.layoutData let data = this.layoutData;
this.layoutData.forEach((item) => { this.layoutData.forEach(item => {
item.position = JSON.stringify(item.position) item.position = JSON.stringify(item.position);
}) });
console.log('data==>>',data) postFun("/ledger/room/update/batch", data)
postFun('/ledger/room/update/batch', data).then((res) => { .then(res => {
if (res.code == 200) { if (res.code == 200) {
Toast.success('保存成功'); Toast.success("保存成功");
this.getRoomInfo() this.getRoomInfo();
} }
}).catch((err) => {
console.log('err==>>',err)
}) })
.catch(err => {
console.log("err==>>", err);
});
}, },
//保存房间名称 //保存房间名称
saveRoomName(){ saveRoomName() {
if (this.roomName == "") {
if (this.roomName == '') {
Toast.fail({ Toast.fail({
title: '提示', title: "提示",
forbidClick: true, forbidClick: true,
message: '请输入名称!', message: "请输入名称!"
}) });
return 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",
isDraggable: true,
isResizable: true
};
this.layout.push(this.layOutItem);
// console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem)
let data = { let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : '18', floorId: this.$route.params.floorId ? this.$route.params.floorId : "18",
name:this.roomName, name: this.roomName,
position: JSON.stringify(this.layOutItem), position: JSON.stringify(this.layOutItem),
roomType: this.isRoom ? this.roomType : (this.isBase? '基础设施':'9999'), roomType: this.isRoom
} ? this.roomType
postFun('/ledger/room/save', data).then((res) => { : this.isBase
? "基础设施"
: "9999"
};
postFun("/ledger/room/save", data)
.then(res => {
if (res.code == 200) { if (res.code == 200) {
// Toast.success('保存成功'); // Toast.success('保存成功');
this.getRoomInfo() this.getRoomInfo();
this.roomType = '' this.roomType = "";
this.roomName = '' this.roomName = "";
} }
}).catch((err) => {
console.log('err==>>',err)
}) })
.catch(err => {
console.log("err==>>", err);
});
}, },
cancelDialog(){ cancelDialog() {
this.roomType = '' this.roomType = "";
this.roomName = '' this.roomName = "";
}, },
onConfirm(value) { onConfirm(value) {
if(this.isRoom){ if (this.isRoom) {
this.roomType = value.dictValue; this.roomType = value.dictValue;
}else{ } else {
this.roomName = value.dictValue this.roomName = value.dictValue;
} }
this.showPicker = false; 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;
...@@ -520,7 +565,7 @@ export default { ...@@ -520,7 +565,7 @@ export default {
} }
/*************************************/ /*************************************/
.setBtns{ .setBtns {
/* position: fixed; /* position: fixed;
top:auto; top:auto;
right: auto; right: auto;
...@@ -534,7 +579,7 @@ export default { ...@@ -534,7 +579,7 @@ export default {
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 {
...@@ -543,7 +588,7 @@ export default { ...@@ -543,7 +588,7 @@ export default {
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;
} }
...@@ -583,8 +628,8 @@ export default { ...@@ -583,8 +628,8 @@ export default {
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 {
...@@ -606,7 +651,8 @@ export default { ...@@ -606,7 +651,8 @@ export default {
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>")
no-repeat;
background-position: bottom right; background-position: bottom right;
padding: 0 8px 8px 0; padding: 0 8px 8px 0;
background-repeat: no-repeat; background-repeat: no-repeat;
...@@ -614,29 +660,29 @@ export default { ...@@ -614,29 +660,29 @@ export default {
box-sizing: border-box; box-sizing: border-box;
cursor: pointer; cursor: pointer;
} }
.header{ .header {
width:100%; width: 100%;
height:1.2rem; height: 1.2rem;
background:#2980F7; background: #2980f7;
text-align: center; text-align: center;
line-height: 1.5rem; line-height: 1.5rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.iconLeft{ .iconLeft {
color: white; color: white;
font-size: 12px; font-size: 12px;
transform: scale(0.8); transform: scale(0.8);
} }
.header span{ .header span {
color: white; color: white;
font-size: 16px; font-size: 16px;
line-height: 1.2rem; line-height: 1.2rem;
margin: auto; margin: auto;
font-family: 'Microsoft YaHei'; font-family: "Microsoft YaHei";
} }
.iconRight{ .iconRight {
color: white; color: white;
font-size: 12px; font-size: 12px;
transform: scale(0.8); transform: scale(0.8);
......
...@@ -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>
<keep-alive>
<van-form <van-form
@submit="onSubmit" @submit="onSubmit"
:scroll-to-error="true" :scroll-to-error="true"
...@@ -21,15 +22,15 @@ ...@@ -21,15 +22,15 @@
readonly readonly
required required
name="userName" name="userName"
:value="form.userName" v-model="form.userName"
label="评估人" label="评估人"
placeholder="请输入" placeholder="请输入"
/> />
<van-field <van-field
readonly readonly
required required
name="projectId" name="projectName"
:value="form.projectId" v-model="form.projectName"
label="所属项目" label="所属项目"
placeholder="请输入" placeholder="请输入"
/> />
...@@ -37,19 +38,19 @@ ...@@ -37,19 +38,19 @@
readonly readonly
required required
name="buildingName" name="buildingName"
:value="form.buildingName" v-model="form.buildingName"
label="所属建筑物" label="所属建筑物"
placeholder="请输入 " placeholder="请输入 "
/> />
<van-field <van-field
readonly
required required
clickable clickable
name="floorName" name="floorName"
:value="form.floorName" v-model="form.floorName"
label="所属楼层" label="所属楼层"
placeholder="请选择" placeholder="请选择"
@click="seletFloor('floor')"
:rules="[{ required: true, message: '所属楼层不能为空' }]" :rules="[{ required: true, message: '所属楼层不能为空' }]"
/> />
...@@ -58,22 +59,15 @@ ...@@ -58,22 +59,15 @@
readonly readonly
required required
name="roomName" name="roomName"
:value="form.roomName" v-model="form.roomName"
label="所属房间" label="所属房间"
placeholder="请输入" placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]" :rules="[{ required: true, message: '所属房间不能为空' }]"
/> />
<van-button
style="color: #cccc;background-color: #f0f1f5;"
icon="plus"
type="info"
native-type="button"
@click="tjfjClcik"
/>
</div> </div>
<van-field <van-field
readonly
required required
clickable clickable
name="name" name="name"
...@@ -89,7 +83,6 @@ ...@@ -89,7 +83,6 @@
name="factor" name="factor"
label="风险因素" label="风险因素"
placeholder="请选择" placeholder="请选择"
@click="selectData('factor', false)"
:rules="[{ required: true, message: '风险因素不能为空' }]" :rules="[{ required: true, message: '风险因素不能为空' }]"
/> />
...@@ -100,7 +93,6 @@ ...@@ -100,7 +93,6 @@
name="type" name="type"
label="准事故类型" label="准事故类型"
placeholder="请选择" placeholder="请选择"
@click="selectData('type', false)"
:rules="[{ required: true, message: '准事故类型不能为空' }]" :rules="[{ required: true, message: '准事故类型不能为空' }]"
/> />
...@@ -514,7 +506,11 @@ ...@@ -514,7 +506,11 @@
" "
> >
取消</button 取消</button
><button type="button" class="van-picker__confirm" @click="closeDept"> ><button
type="button"
class="van-picker__confirm"
@click="closeDept"
>
确认 确认
</button> </button>
</div> </div>
...@@ -539,6 +535,7 @@ ...@@ -539,6 +535,7 @@
> >
</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}`)
// })
// .catch(() => {
// this.$toast.fail("加载失败,请稍后再试");
// });
// },
getFXYS() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
.then(res => { .then(res => {
this.columnsTrouble = res.data; 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(() => { .catch(() => {
this.$toast.fail("加载失败,请稍后再试"); 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>
</van-sticky> <keep-alive>
<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"
...@@ -16,77 +16,95 @@ ...@@ -16,77 +16,95 @@
alt="" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" style="position: relative;top: 32%;transform: translateY(-50%);"
/> />
风险信息 现有风险信息
</div> </div>
<van-field readonly required label="评估人" placeholder="请输入" /> <van-field
<van-field readonly required label="所属项目" placeholder="请输入" /> readonly
<van-field readonly required label="所属建筑物" placeholder="请输入" /> 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="请输入 "
/>
<van-field <van-field
readonly
required required
clickable clickable
name="floorName" name="floorName"
v-model="form.floorName"
label="所属楼层" label="所属楼层"
placeholder="请选择" placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]" :rules="[{ required: true, message: '所属楼层不能为空' }]"
/> />
<div style="display: flex;"> <div style="display: flex;">
<van-field <van-field
readonly readonly
required required
name="roomName" name="roomName"
v-model="form.roomName"
label="所属房间" label="所属房间"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '所属房间不能为空' }]" :rules="[{ required: true, message: '所属房间不能为空' }]"
/> />
<!-- <van-button style="color: #cccc;background-color: #f0f1f5;" icon="plus" type="info" /> -->
</div> </div>
<van-field <van-field
readonly
required required
clickable clickable
name="name" name="name"
label="风险源名称" v-model="form.name"
label="危险源名称"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]" :rules="[{ required: true, message: '危险源名称不能为空' }]"
/> />
<van-field <van-field
v-model="form.factor"
readonly
required required
name="factor" name="factor"
label="风险因素" label="风险因素"
placeholder="请选择" placeholder="请选择"
:rules="[{ required: true, message: '风险因素不能为空' }]" :rules="[{ required: true, message: '风险因素不能为空' }]"
/> />
<van-field <van-field
readonly
v-model="form.type"
required required
name="type" name="type"
label="准事故类型" label="准事故类型"
placeholder="请选择" placeholder="请选择"
:rules="[{ required: true, message: '准事故类型不能为空' }]" :rules="[{ required: true, message: '准事故类型不能为空' }]"
/> />
<van-field
readonly
required
name="level"
label="风险等级"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-field <van-field
readonly
required required
name="presenceLocation" name="presenceLocation"
v-model="form.presenceLocation"
label="存在部位" label="存在部位"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]" :rules="[{ required: true, message: '存在部位不能为空' }]"
/> />
<!-- <van-field
readonly
required
name="level"
label="风险管控措施评价"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/> -->
<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;"
...@@ -101,13 +119,15 @@ ...@@ -101,13 +119,15 @@
<van-field name="hdPicture1" label="风险源图片"> <van-field name="hdPicture1" label="风险源图片">
<template #input> <template #input>
<van-uploader <van-uploader
disabled
@delete="deleteFile(...arguments, 'pictureFile')"
multiple multiple
:max-count="5" :max-count="5"
disabled
upload-text="最多上传五个" upload-text="最多上传五个"
v-model="uploaderImg" v-model="uploaderImg"
> >
<template slot="default"> <template slot="default">
<!-- 11111111111 -->
<div <div
style=" style="
width: 2.13333rem; width: 2.13333rem;
...@@ -141,15 +161,16 @@ ...@@ -141,15 +161,16 @@
技术措施 技术措施
</div> </div>
<van-field <van-field
disabled readonly
v-model="form.measuresProject"
name="measuresProject" name="measuresProject"
label="技术措施" label=""
type="textarea" type="textarea"
rows="1" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="measuresProjectFile[]" label=" "> <van-field name="measuresProjectFile[]" label="上传附件">
<template #input> <template #input>
<van-uploader <van-uploader
disabled disabled
...@@ -184,13 +205,6 @@ ...@@ -184,13 +205,6 @@
</template> </template>
</van-field> </van-field>
<!-- <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
应采取的管控措施
</div>
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="" type="textarea" rows="3"
autosize placeholder="请输入" /> -->
<div <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;"
> >
...@@ -202,44 +216,46 @@ ...@@ -202,44 +216,46 @@
已采取的管控措施 已采取的管控措施
</div> </div>
<van-field <van-field
v-model="form.takenMeasuresAdministration" readonly
name="takenMeasuresAdministration" v-model="form.measuresAdministration"
name="measuresAdministration"
label="" label=""
type="textarea" type="textarea"
rows="3" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field <van-field
required readonly
v-model="form.measuresDeptId" v-model="form.measuresDeptName"
name="measuresDeptId" name="measuresDeptName"
label="管控责任单位 " label="管控责任单位 "
type="textarea" type="textarea"
rows="1" rows="1"
autosize autosize
placeholder="请输入" placeholder="请选择"
/> />
<van-field <van-field
required readonly
v-model="form.measuresUserId" v-model="form.measuresUserName"
name="measuresUserId" name="measuresUserName"
label="管控责任人 " label="管控责任人 "
type="textarea" type="textarea"
rows="1" rows="1"
autosize autosize
placeholder="请输入" placeholder="请选择"
/> />
<van-field name="measuresAdministrationFile[]" 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="measuresAdministrationFile" v-model="measuresAdministrationFile"
accept="file" accept="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
> >
<template slot="default"> <template slot="default">
<div <div
...@@ -264,6 +280,7 @@ ...@@ -264,6 +280,7 @@
</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;"
> >
...@@ -275,15 +292,16 @@ ...@@ -275,15 +292,16 @@
应急措施 应急措施
</div> </div>
<van-field <van-field
disabled readonly
v-model="form.measuresEmergency"
name="measuresEmergency" name="measuresEmergency"
label="" label=""
type="textarea" type="textarea"
rows="1" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="measuresEmergencyFile[]" label=" "> <van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input> <template #input>
<van-uploader <van-uploader
disabled disabled
...@@ -295,6 +313,7 @@ ...@@ -295,6 +313,7 @@
@delete="deleteFile(...arguments, 'measuresEmergencyFile')" @delete="deleteFile(...arguments, 'measuresEmergencyFile')"
> >
<template slot="default"> <template slot="default">
<!-- 11111111111 -->
<div <div
style=" style="
width: 2.13333rem; width: 2.13333rem;
...@@ -317,6 +336,7 @@ ...@@ -317,6 +336,7 @@
</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;"
> >
...@@ -329,28 +349,212 @@ ...@@ -329,28 +349,212 @@
</div> </div>
<van-field <van-field
readonly readonly
required
clickable clickable
name="trouble" name="referenceBasis"
:value="form.trouble" :value="form.referenceBasis"
label="参考依据" label="参考依据"
placeholder="请选择" placeholder="请选择"
@click="showTrouble = true"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/> />
<van-field
readonly
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain">
<van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1">
<van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item>
<van-collapse-item title="风险模型配置" name="2">
<van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
>
<template #reference>
<van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template>
</van-popover>
<van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
>
<template #reference>
<van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button size="small" plain native-type="button" type="info"
>取消</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> </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({
methods: {}, message: "加载中...",
watch: {} 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;
}
},
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,14 +50,14 @@ ...@@ -45,14 +50,14 @@
<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 = res.list;
this.riskList.forEach((item, index) => { this.riskList.forEach((item, index) => {
item.children.forEach((i, k) => { item.children.forEach((i, k) => {
let data = this.riskList2.find((y) => y.text == i.menuName) let data = this.riskList2.find(y => y.text == i.menuName);
if (data) { if (data) {
i.icon = data.imgUrl i.icon = data.imgUrl;
} }
})
}); });
console.log('this.riskList==>>', this.riskList) });
}).catch((err) => {
console.log('err==>>', err)
}) })
.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