Commit f5d652e4 authored by 杨帆's avatar 杨帆

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

parents cf637611 5d4ec285
...@@ -162,7 +162,7 @@ const routes = [{ ...@@ -162,7 +162,7 @@ const routes = [{
component: () => import('../views/riskProject/add/addCurrent.vue'), component: () => import('../views/riskProject/add/addCurrent.vue'),
}, },
{//新增现状风险 {//新增现状风险
path: '/addPresent ', path: '/addPresent',
name: 'addPresent', name: 'addPresent',
component: () => import('../views/riskProject/add/addPresent.vue'), component: () => import('../views/riskProject/add/addPresent.vue'),
}, },
......
<template> <template>
<div class="wrap" ref="mapmidbox"> <div class="wrap" ref="mapmidbox">
<van-sticky> <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="!isView">确定</span> <span @click="confim" class="iconRight" v-show="!isViews">确定</span>
<span class="iconRight" v-show="isView"></span> <span class="iconRight" v-show="isViews"></span>
</header> </header>
</van-sticky> </van-sticky>
<grid-layout :layout.sync="layout" <grid-layout :layout.sync="layout"
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
</grid-item> </grid-item>
</grid-layout> </grid-layout>
<div class="setBtns"> <div class="setBtns">
<van-button @click="addItem" type="info" size="mini" v-if="!isView">添加房间</van-button> <van-button @click="addItem" type="info" size="mini" v-if="!isViews">添加房间</van-button>
<van-grid direction="horizontal" :column-num="2" class="footer"> <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>较大风险
...@@ -55,16 +55,17 @@ ...@@ -55,16 +55,17 @@
placeholder="选择房间类型" placeholder="选择房间类型"
@click="showPicker = true" @click="showPicker = true"
/> />
<van-popup v-model="showPicker" round position="bottom">
<van-picker
show-toolbar
:columns="columns"
@cancel="showPicker = false"
@confirm="onConfirm"
/>
</van-popup>
</van-cell-group> </van-cell-group>
</van-dialog> </van-dialog>
<van-popup v-model="showPicker" round position="bottom">
<van-picker
show-toolbar
:columns="columns"
@cancel="showPicker = false"
@confirm="onConfirm"
/>
</van-popup>
</div> </div>
</template> </template>
...@@ -101,44 +102,99 @@ export default { ...@@ -101,44 +102,99 @@ export default {
roomName:'', roomName:'',
columns: ['办公', '餐饮', '住宅', '超市'], columns: ['办公', '餐饮', '住宅', '超市'],
colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'], colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'],
isView:true,// true:查看页面; false: 添加页面 isViews:false,// true:查看页面; false: 添加页面
showHeader:true
} }
}, },
props:{
isView: {
type: Boolean,
default: false,
},
},
mounted() { mounted() {
// screenfull.toggle(this.$refs.mapbox); // screenfull.toggle(this.$refs.mapbox);
// this.$nextTick(() => { // this.$nextTick(() => {
// this.rotateBox(); // this.rotateBox();
// }); // });
this.isView = this.$route.params.isView? true : false if (this._props.isView) {
console.log('作为组件传值==>>',)
this.isViews = true
this.showHeader = false
}
if (this.$route.params.isView) {
this.isViews = true
this.initRotate();
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false);
}
this.getRoomInfo() this.getRoomInfo()
}, },
methods: { methods: {
orientationChange(){
if (window.orientation === 180 || window.orientation === 0) {
console.log('竖屏状态!');
}
if (window.orientation === 90 || window.orientation === -90 ){
console.log('横屏状态!');
}
// let width = document.documentElement.clientWidth//页面宽度
// let height = document.documentElement.clientHeight//页面高度
// console.log('width==>>',width)
// console.log('height==>>',height)
this.rotateBox()
},
initRotate(){
let width = document.documentElement.clientWidth,//页面宽度
height = document.documentElement.clientHeight,//页面高度
wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果
style = "";//样式
console.log('width==>>',width)
console.log('height==>>',height)
style += "width:" + height + "px;";
style += "height:" + width + "px;";
style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
// 注意旋转中点的处理
style +=
"-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
wrapper.style.cssText = style;
},
rotateBox() { 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 = "";//样式
if (height < width) {//注意原来就是宽屏时不用横屏 console.log('width==>>',width)
return; console.log('height==>>',height)
} // if (height < width) {//注意原来就是宽屏时不用横屏
if (this.isScreenFull) { // return;
// }
if (height < width) {
// 横屏 // 横屏
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(0deg); transform: rotate(0deg);";
// 注意旋转中点的处理 // 注意旋转中点的处理
style += style +=
"-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
} else { } else {
// 竖屏 // 竖屏
// style += "width:" + height + "px;";
// style += "height:" + width + "px;";
// style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
// // 注意旋转中点的处理
// style +=
// "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
// style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
style += "width:100%"; style += "width:100%";
style += "height:100%;"; style += "height:100%;";
style += "-webkit-transform: rotate(0); transform: rotate(0);"; style += "-webkit-transform: rotate(0); transform: rotate(0);";
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)
wrapper.style.cssText = style; wrapper.style.cssText = style;
}, },
getRoomInfo(){ getRoomInfo(){
...@@ -153,14 +209,14 @@ export default { ...@@ -153,14 +209,14 @@ export default {
item.position.i = item.id item.position.i = item.id
item.position.isDraggable = false item.position.isDraggable = false
item.position.isResizable = false item.position.isResizable = false
if (!this.isView) { //添加页面不显示颜色 if (!this.isViews) { //添加页面不显示颜色
item.position.c = '#eee' item.position.c = '#eee'
}else{ }else{
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) => { }).catch((err) => {
console.log('err==>>',err) console.log('err==>>',err)
...@@ -182,8 +238,11 @@ export default { ...@@ -182,8 +238,11 @@ export default {
}, },
// 删除 // 删除
removeItem: function (val) { removeItem: function (val) {
// const index = this.layout.map(item => item.i).indexOf(val); if (val == '') {
// this.layout.splice(index, 1); const index = this.layout.map(item => item.i).indexOf(val);
this.layout.splice(index, 1);
return
}
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('删除成功');
...@@ -211,6 +270,14 @@ export default { ...@@ -211,6 +270,14 @@ export default {
}, },
// 确定 保存房间信息 // 确定 保存房间信息
confim(){ confim(){
if (this.roomName == '') {
Toast.fail({
title: '提示',
forbidClick: true,
message: '请先添加房间!',
})
return
}
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,
...@@ -221,6 +288,8 @@ export default { ...@@ -221,6 +288,8 @@ export default {
if (res.code == 200) { if (res.code == 200) {
Toast.success('提交成功'); Toast.success('提交成功');
this.getRoomInfo() this.getRoomInfo()
this.roomType = ''
this.roomName = ''
} }
}).catch((err) => { }).catch((err) => {
console.log('err==>>',err) console.log('err==>>',err)
...@@ -235,13 +304,13 @@ export default { ...@@ -235,13 +304,13 @@ export default {
h: 3, h: 3,
i: '', i: '',
name: this.roomName, name: this.roomName,
c: '#eee', c: '#0091EA',
type:this.roomType, type:this.roomType,
isDraggable:true, isDraggable:true,
isResizable:true isResizable:true
} }
this.layout.push(this.layOutItem) this.layout.push(this.layOutItem)
console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem)
}, },
onConfirm(value) { onConfirm(value) {
this.roomType = value; this.roomType = value;
...@@ -252,11 +321,15 @@ export default { ...@@ -252,11 +321,15 @@ export default {
</script> </script>
<style scoped > <style scoped >
.router-view{
padding-bottom: 0px !important;
}
.wrap{ .wrap{
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
/* transform: rotate(90deg); /* transform: rotate(90deg);
transform-origin: bottom left; */ transform-origin: bottom left; */
position: relative;
} }
.footer{ .footer{
/* position: fixed; */ /* position: fixed; */
...@@ -298,9 +371,12 @@ export default { ...@@ -298,9 +371,12 @@ export default {
/*************************************/ /*************************************/
.setBtns{ .setBtns{
position: fixed; /* position: fixed;
top:auto;
right: auto;
left: 0; left: 0;
bottom: 0; bottom: 0; */
margin-top: 10px;
font-size: 0.3rem; font-size: 0.3rem;
padding: 10px; padding: 10px;
vertical-align: middle; vertical-align: middle;
...@@ -342,6 +418,7 @@ export default { ...@@ -342,6 +418,7 @@ export default {
.vue-grid-item .text { .vue-grid-item .text {
writing-mode:vertical-rl; writing-mode:vertical-rl;
-webkit-writing-mode: vertical-rl;
font-size: 10cqw; font-size: 10cqw;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -270,7 +270,7 @@ import { getFun, postFun } from "@/service/table.js"; ...@@ -270,7 +270,7 @@ import { getFun, postFun } from "@/service/table.js";
// postRiskShowMeasures, // postRiskShowMeasures,
// } from "@/service/risk"; // } from "@/service/risk";
export default { export default {
name: "risk-add", name: "addCurrent",
components: { components: {
LHeader, LHeader,
}, },
...@@ -345,9 +345,9 @@ export default { ...@@ -345,9 +345,9 @@ export default {
}; };
}, },
created() { created() {
if (this.$route.params.inherentId) { if (this.$route.params.inherentId || sessionStorage.getItem("inherentId")) {
this.inherentId = this.$route.params.inherentId this.inherentId = this.$route.params.inherentId || sessionStorage.getItem("inherentId")
this.buildingIds = this.$route.params.buildingId this.buildingIds = this.$route.params.buildingId || sessionStorage.getItem("buildingId")
this.postReturnEcho(); this.postReturnEcho();
} }
// this.getList(); // this.getList();
......
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit"> <van-form
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> @submit="onSubmit"
<img src="@/assets/accidentIcon/bookmark.svg" alt="" :scroll-to-error="true"
style="position: relative;top: 32%;transform: translateY(-50%);"> :show-error="false"
风险信息 validate-trigger="onSubmit"
</div> >
<van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" /> <div
<van-field readonly required name="projectId" :value="form.projectId" label="所属项目" placeholder="请输入" /> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物" placeholder="请输入" /> >
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险信息
</div>
<van-field
readonly
required
name="userName"
:value="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectId"
:value="form.projectId"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
:value="form.buildingName"
label="所属建筑物"
placeholder="请输入"
/>
<van-field required clickable name="floorId" :value="form.floorId" label="所属楼层" placeholder="请选择" <van-field
@click="seletFloor('floor')" :rules="[{ required: true, message: '所属楼层不能为空' }]" /> required
clickable
name="floorId"
:value="form.floorId"
label="所属楼层"
placeholder="请选择"
@click="seletFloor('floor')"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<div style="display: flex;"> <div style="display: flex;">
<van-field readonly required name="roomName" :value="form.roomName" label="所属房间" placeholder="请输入" <van-field
@click="seletRoom('room')" :rules="[{ required: true, message: '所属房间不能为空' }]" /> readonly
<van-button style="color: #cccc;background-color: #f0f1f5;" icon="plus" type="info" @click="tjfjClcik"/> required
</div> name="roomName"
:value="form.roomName"
label="所属房间"
placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
icon="plus"
type="info"
native-type="button"
@click="tjfjClcik"
/>
</div>
<van-field required clickable name="name" v-model="form.name" label="风险源名称" placeholder="请输入" <van-field
:rules="[{ required: true, message: '风险源名称不能为空' }]" /> required
<van-field v-model="form.factor" required name="factor" label="风险因素" placeholder="请选择" clickable
@click="seletFactor('factor')" :rules="[{ required: true, message: '风险因素不能为空' }]" /> name="name"
v-model="form.name"
label="风险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]"
/>
<van-field
v-model="form.factor"
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="seletFactor('factor')"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field v-model="form.type" required name="type" label="准事故类型" placeholder="请选择" @click="seletType('type')" <van-field
:rules="[{ required: true, message: '准事故类型不能为空' }]" /> v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="seletType('type')"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择" <van-field
@click="seletGrade" :rules="[{ required: true, message: '风险等级不能为空' }]" /> readonly
<!-- <van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择" v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
@click="seletGrade"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<!-- <van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择"
@click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" /> --> @click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" /> -->
<van-field required name="presenceLocation" v-model="form.presenceLocation" label="存在部位" placeholder="请输入" <van-field
:rules="[{ required: true, message: '存在部位不能为空' }]" /> required
name="presenceLocation"
v-model="form.presenceLocation"
label="存在部位"
placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]"
/>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> <div
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
style="position: relative;top: 32%;transform: translateY(-50%);"> >
风险源图片 <img
</div> src="@/assets/accidentIcon/bookmark.svg"
<van-field name="hdPicture1" label="风险源图片"> alt=""
<template #input> style="position: relative;top: 32%;transform: translateY(-50%);"
<van-uploader @delete="deleteFile(...arguments, 'uploaderImg')" multiple :max-count="5" />
upload-text="最多上传五个" v-model="uploaderImg"> 风险源图片
<template slot="default"> </div>
<!-- 11111111111 --> <van-field name="hdPicture1" label="风险源图片">
<div style=" <template #input>
<van-uploader
@delete="deleteFile(...arguments, 'uploaderImg')"
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -55,28 +154,53 @@ ...@@ -55,28 +154,53 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
"> "
<img src="@/assets/upload/pic.png" alt="" style="width: 0.64rem; height: 0.64rem" /> >
<span class="van-uploader__upload-text">最多上传五个</span> <img
</div> src="@/assets/upload/pic.png"
</template> alt=""
</van-uploader> style="width: 0.64rem; height: 0.64rem"
</template> />
</van-field> <span class="van-uploader__upload-text">最多上传五个</span>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </div>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </template>
style="position: relative;top: 32%;transform: translateY(-50%);"> </van-uploader>
技术措施 </template>
</div> </van-field>
<van-field v-model="form.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1" autosize <div
placeholder="请输入" /> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field name="measuresProjectFile[]" label=" "> >
<template #input> <img
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile" accept="file" src="@/assets/accidentIcon/bookmark.svg"
result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')"> alt=""
<template slot="default"> style="position: relative;top: 32%;transform: translateY(-50%);"
<!-- 11111111111 --> />
<div style=" 技术措施
</div>
<van-field
v-model="form.measuresProject"
name="measuresProject"
label="技术措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresProjectFile[]" label=" ">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -84,28 +208,53 @@ ...@@ -84,28 +208,53 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
"> "
<img src="@/assets/upload/file.png" alt="" style="width: 0.64rem; height: 0.64rem" /> >
<span class="van-uploader__upload-text">最多上传五个</span> <img
</div> src="@/assets/upload/file.png"
</template> alt=""
</van-uploader> style="width: 0.64rem; height: 0.64rem"
</template> />
</van-field> <span class="van-uploader__upload-text">最多上传五个</span>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </div>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </template>
style="position: relative;top: 32%;transform: translateY(-50%);"> </van-uploader>
管理措施 </template>
</div> </van-field>
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="管理措施" type="textarea" <div
rows="1" autosize placeholder="请输入" /> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field name="measuresAdministrationFile[]" label=" "> >
<template #input> <img
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile" src="@/assets/accidentIcon/bookmark.svg"
accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresAdministrationFile')"> alt=""
<template slot="default"> style="position: relative;top: 32%;transform: translateY(-50%);"
<!-- 11111111111 --> />
<div style=" 管理措施
</div>
<van-field
v-model="form.measuresAdministration"
name="measuresAdministration"
label="管理措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresAdministrationFile[]" label=" ">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -113,28 +262,53 @@ ...@@ -113,28 +262,53 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
"> "
<img src="@/assets/upload/file.png" alt="" style="width: 0.64rem; height: 0.64rem" /> >
<span class="van-uploader__upload-text">最多上传五个</span> <img
</div> src="@/assets/upload/file.png"
</template> alt=""
</van-uploader> style="width: 0.64rem; height: 0.64rem"
</template> />
</van-field> <span class="van-uploader__upload-text">最多上传五个</span>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </div>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </template>
style="position: relative;top: 32%;transform: translateY(-50%);"> </van-uploader>
应急措施 </template>
</div> </van-field>
<van-field v-model="form.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea" rows="1" <div
autosize placeholder="请输入" /> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field name="measuresEmergencyFile[]" label=" "> >
<template #input> <img
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile" accept="file" src="@/assets/accidentIcon/bookmark.svg"
result-type="file" @delete="deleteFile(...arguments, 'measuresEmergencyFile')"> alt=""
<template slot="default"> style="position: relative;top: 32%;transform: translateY(-50%);"
<!-- 11111111111 --> />
<div style=" 应急措施
</div>
<van-field
v-model="form.measuresEmergency"
name="measuresEmergency"
label="应急措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label=" ">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -142,20 +316,30 @@ ...@@ -142,20 +316,30 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
"> "
<img src="@/assets/upload/file.png" alt="" style="width: 0.64rem; height: 0.64rem" /> >
<span class="van-uploader__upload-text">最多上传五个</span> <img
</div> src="@/assets/upload/file.png"
</template> alt=""
</van-uploader> style="width: 0.64rem; height: 0.64rem"
</template> />
</van-field> <span class="van-uploader__upload-text">最多上传五个</span>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </div>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </template>
style="position: relative;top: 32%;transform: translateY(-50%);"> </van-uploader>
参考依据 </template>
</div> </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
readonly readonly
required required
clickable clickable
...@@ -166,58 +350,120 @@ ...@@ -166,58 +350,120 @@
@click="showTrouble = true" @click="showTrouble = true"
:rules="[{ required: true, message: '事故类型不能为空' }]" :rules="[{ required: true, message: '事故类型不能为空' }]"
/> --> /> -->
<van-dialog v-model="showGradeDialog" title="风险评测配置" :show-cancel-button="false" :show-confirm-button="false" > <van-dialog
<div class="dialogContain"> v-model="showGradeDialog"
<van-collapse v-model="activeNames"> title="风险评测配置"
<van-collapse-item title="风险模型" name="1"> :show-cancel-button="false"
<van-field readonly required name="level" label="当前风险模型" placeholder="LS风险矩阵评估模型" /> :show-confirm-button="false"
</van-collapse-item> >
<van-collapse-item title="风险模型配置" name="2"> <div class="dialogContain">
<van-popover v-model="showPopover" trigger="click" :actions="columnsRiskRank" <van-collapse v-model="activeNames">
@select="onSelect"> <van-collapse-item title="风险模型" name="1">
<template #reference> <van-field
<van-field v-model="possibleValue" readonly required name="level" label="发生的可能性" readonly
placeholder="请选择" /> required
</template> name="level"
</van-popover> label="当前风险模型"
<van-popover v-model="showPopoveSetRank" trigger="click" :actions="columnsSetRank" placeholder="LS风险矩阵评估模型"
@select="onSelectSetRank"> />
<template #reference> </van-collapse-item>
<van-field v-model="severityValue" readonly required name="level" label="后果严重程度" <van-collapse-item title="风险模型配置" name="2">
placeholder="请选择" /> <van-popover
</template> v-model="showPopover"
</van-popover> trigger="click"
</van-collapse-item> :actions="columnsRiskRank"
</van-collapse> @select="onSelect"
<van-row type="flex" justify="center" style="margin-top:10px"> >
<van-col span="6"><van-button size="small" plain native-type="button" type="info" @click="showGradeDialog = false">取消</van-button></van-col> <template #reference>
<van-col span="6"><van-button size="small" type="info" native-type="button" @click="goResultPage">开始测评</van-button></van-col> <van-field
</van-row> v-model="possibleValue"
</div> readonly
</van-dialog> required
<van-popup v-model="showTrouble" position="bottom"> name="level"
<van-picker show-toolbar value-key="name" :columns="columnsTrouble" @confirm="onConTrouble" label="发生的可能性"
@cancel="showTrouble = false" /> placeholder="请选择"
</van-popup> />
<van-popup v-model="showSource" position="bottom"> </template>
<van-picker show-toolbar value-key="name" :columns="columnsSource" @confirm="onConSource" </van-popover>
@cancel="showSource = false" /> <van-popover
</van-popup> v-model="showPopoveSetRank"
trigger="click"
<div style="margin: 16px 16px 0"> :actions="columnsSetRank"
<van-button round block type="info" native-type="submit">上报</van-button> @select="onSelectSetRank"
</div> >
</van-form> <template #reference>
<div style="margin: 10px 16px 0px; padding-bottom: 16px"> <van-field
<van-button round block type="warning" @click.native="cancel">取消</van-button> v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button
size="small"
plain
native-type="button"
type="info"
@click="showGradeDialog = false"
>取消</van-button
></van-col
>
<van-col span="6"
><van-button
size="small"
type="info"
native-type="button"
@click="goResultPage"
>开始测评</van-button
></van-col
>
</van-row>
</div> </div>
</van-dialog>
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="name"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</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>
<div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit"
>上报</van-button
>
</div>
</van-form>
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
</div> </div>
</div>
</template> </template>
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.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 { // import {
// getFormList, // getFormList,
...@@ -229,557 +475,584 @@ import { getFun, postFun } from "@/service/table.js"; ...@@ -229,557 +475,584 @@ import { getFun, postFun } from "@/service/table.js";
// postRiskShowMeasures, // postRiskShowMeasures,
// } from "@/service/risk"; // } from "@/service/risk";
export default { export default {
name: "risk-add", name: "addInherent",
components: { components: {
LHeader, LHeader
}, },
activated() { activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一 this.showSetRank = false; // 再次关闭弹出层 以防万一
if (this.$route.params.taskId) { if (this.$route.params.taskId) {
this.isShowreturnCause = true; this.isShowreturnCause = true;
this.text = "风险上报退回"; this.text = "风险上报退回";
this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId;
this.postReturnEcho(); this.postReturnEcho();
} }
this.getList(); this.getList();
this.$bus.$on("riskLevelBus", (res) => { this.$bus.$on("riskLevelBus", res => {
this.showSetRank = false; // 再次关闭弹出层 以防万一 this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res)); console.log(Boolean(res));
if (res) { if (res) {
this.riskRank = res; this.riskRank = res;
} else { } else {
this.setRank = ""; this.setRank = "";
} }
// 销毁一下监听事件 不然会越加越多 // 销毁一下监听事件 不然会越加越多
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() {
return {
showPopoveSetRank: false,
activeNames: ["1"],
showPopover: false,
showGradeDialog: false,
taskId: "",
text: "添加固有风险",
id: "",
isTimely: 1,
active: 0,
form: {},
projectId: "", // 所属工程
projectName: "", // 所属工程
projectDirectorName: "", // 所属工程
projectDirector: "", // 所属工程
showProjectName: false,
show: false,
columnsProjectName: [],
factor: "", //风险因素
showFactor: false,
columnsFactor: [],
messageList: [
{
title: "回显风险源名称",
time: "2022-12-12",
name: "Mr.周",
state: 1
}
],
source: "", //风险源
userPrefix: "", //风险源
showSource: false,
columnsSource: [],
trouble: "", //事故类型
showTrouble: false,
columnsTrouble: [],
setRank: "", //风险定级
showSetRank: false,
columnsSetRank: ["矩阵式定级", "其他定级方式"], //严重程度
riskRank: "", // 风险等级
showRiskRank: false,
columnsRiskRank: [], //发生可能性
showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
uploaderImg: [], // 定级方式图片
location: "", //风险部位
control: "", //管控层级
riskName: "", //管控层级
showControl: false,
columnsControl: ["项目级", "企业级"],
mainDutyDept: "", // 主责部门
mainDutyDeptId: "",
showMainDutyDept: false,
columnsMainDutyDept: [],
mainDutyPeopLe: "", // 主责人员
mainDutyPeopLeId: "",
showMainDutyPeopLe: false,
columnsMainDutyPeopLe: [],
technology: "", //技术措施文字
technologyImg: [], //技术措施图片
administration: "", //管理措施文字
measuresAdministrationFile: [], //管理措施图片
measuresProjectFile: [], //管理措施图片
measuresEmergencyFile: [], //管理措施图片
urgent: "", //应急措施文字
urgentImg: [], //应急措施图片
returnCause: "", // 退回原因
isShowreturnCause: false,
possibleValue: "",
possibleScore: 0,
severityValue: "",
severityScore: 0
};
},
created() {
var userInfo = getUserInfo();
this.form.buildingIds =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.form.planId =
this.$route.params.planId || sessionStorage.getItem("planId");
this.form.buildingName =
this.$route.params.buildingName || sessionStorage.getItem("buildingName");
this.form.userId = userInfo.userId;
this.form.userName = userInfo.userName;
this.form.deptName = userInfo.dept.deptName;
(this.form.projectId = "测试项目")
},
mounted(){
if(sessionStorage.getItem('inherenForm')!=''){
this.form=JSON.parse(sessionStorage.getItem('inherenForm'))
this.form.level = sessionStorage.getItem('level')
}
},
methods: {
seletFloor(name) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
this.userPrefix = name;
getFun(`/risk/plan/floor/list/${this.form.buildingIds}`)
.then(res => {
this.$toast.clear();
this.showSource = true;
this.columnsSource = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
}); });
}, },
beforeRouteLeave(to, from, next) { seletRoom(name) {
if (to.name != "matrix-grad") { 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;
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
.then(res => {
console.log(res.data);
const arr = [];
res.data.forEach(item => {
arr.push({ name: item.dictLabel });
});
this.columnsTrouble = arr;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
//准事故类型
seletType(name) {
this.showTrouble = true;
this.riskName = name;
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
.then(res => {
const arr = [];
res.data.forEach(item => {
arr.push({ name: item.dictLabel });
});
this.columnsTrouble = arr;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
//风险等级
seletGrade(name) {
// this.showTrouble = true
// this.riskName = name
// this.columnsTrouble = [
// {
// name: '重大风险',
// },
// {
// name: '较大风险',
// },
// {
// name: '一般风险',
// },
// {
// 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;
} }
next(); });
}, },
data() { // //后果严重程度
return { // getConsequence(){
showPopoveSetRank: false, // getFun(`/risk/plan/matrix/${type}/list`).then(res=>{
activeNames: ["1"],
showPopover: false,
showGradeDialog: false,
taskId: "",
text: "添加固有风险",
id: "",
isTimely: 1,
active: 0,
form: {
}, // })
projectId: "", // 所属工程 // },
projectName: "", // 所属工程 onSelect(data) {
projectDirectorName: "", // 所属工程 this.possibleValue = data.text;
projectDirector: "", // 所属工程 this.possibleScore = data.score;
showProjectName: false,
show: false,
columnsProjectName: [],
factor: "", //风险因素
showFactor: false,
columnsFactor: [],
messageList: [
{
title: '回显风险源名称',
time: '2022-12-12',
name: 'Mr.周',
state: 1
}
],
source: "", //风险源
userPrefix: "", //风险源
showSource: false,
columnsSource: [],
trouble: "", //事故类型
showTrouble: false,
columnsTrouble: [],
setRank: "", //风险定级
showSetRank: false,
columnsSetRank: ["矩阵式定级", "其他定级方式"],//严重程度
riskRank: "", // 风险等级
showRiskRank: false,
columnsRiskRank: [],//发生可能性
showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
uploaderImg: [], // 定级方式图片
location: "", //风险部位
control: "", //管控层级
riskName: "", //管控层级
showControl: false,
columnsControl: ["项目级", "企业级"],
mainDutyDept: "", // 主责部门
mainDutyDeptId: "",
showMainDutyDept: false,
columnsMainDutyDept: [],
mainDutyPeopLe: "", // 主责人员
mainDutyPeopLeId: "",
showMainDutyPeopLe: false,
columnsMainDutyPeopLe: [],
technology: "", //技术措施文字
technologyImg: [], //技术措施图片
administration: "", //管理措施文字
measuresAdministrationFile: [], //管理措施图片
measuresProjectFile: [], //管理措施图片
measuresEmergencyFile: [], //管理措施图片
urgent: "", //应急措施文字
urgentImg: [], //应急措施图片
returnCause: "", // 退回原因
isShowreturnCause: false,
possibleValue: "",
possibleScore:0,
severityValue: "",
severityScore:0,
};
}, },
created() { onSelectSetRank(data) {
var userInfo = getUserInfo() this.severityValue = data.text;
this.form.buildingIds = this.$route.params.buildingId ||sessionStorage.getItem("buildingId") this.severityScore = data.score;
this.form.planId = this.$route.params.planId||sessionStorage.getItem("planId") },
this.form.buildingName = this.$route.params.buildingName||sessionStorage.getItem("buildingName") //开始测评
this.form.userId = userInfo.userId goResultPage() {
this.form.userName = userInfo.userName this.$router.push({
this.form.deptName = userInfo.dept.deptName name: "resultPage",
this.form.projectId = '测试项目', params: {
this.form.level = this.$route.params.level ? this.$route.params.level :'' score: this.severityScore * this.possibleScore
}
});
},
performTasks() {
console.log("1233213 :>> ", 1233213);
},
// 点击预览图
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) {
console.log(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";
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();
}, },
methods: {
seletFloor(name) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
this.userPrefix = name
getFun(`/risk/plan/floor/list/${this.form.buildingIds}`).then((res) => {
this.$toast.clear()
this.showSource = true
this.columnsSource = res.data
}).catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
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
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
.then(res => {
console.log(res.data)
const arr = []
res.data.forEach(item => {
arr.push({ name: item.dictLabel })
})
this.columnsTrouble = arr
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
//准事故类型
seletType(name) {
this.showTrouble = true
this.riskName = name
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
.then(res => {
const arr = []
res.data.forEach(item => {
arr.push({ name: item.dictLabel })
})
this.columnsTrouble = arr
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
//风险等级
seletGrade(name) {
// this.showTrouble = true
// this.riskName = name
// this.columnsTrouble = [
// {
// name: '重大风险',
// },
// {
// name: '较大风险',
// },
// {
// name: '一般风险',
// },
// {
// 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
}
})
},
// //后果严重程度
// getConsequence(){
// getFun(`/risk/plan/matrix/${type}/list`).then(res=>{
// })
// },
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() {
console.log('1233213 :>> ', 1233213);
},
// 点击预览图
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) {
console.log(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";
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();
},
// 请求表单数据
getList() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFormList("/riskMain/add")
.then((res) => {
this.$toast.clear();
this.columnsProjectName = res.data.projectInformations;
this.columnsFactor = res.data.riskInventories;
this.columnsMainDutyDept = res.data.organizationList;
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
// 请求已退回详情数据 // 请求表单数据
postReturnEcho() { getList() {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0
}); });
postriskConiCause(`/riskMain/edit/${this.taskId}`) getFormList("/riskMain/add")
.then((res) => { .then(res => {
console.log('%c [ res ]-332', 'font-size:13px; background:pink; color:#bf2c9f;', res) this.$toast.clear();
}) this.columnsProjectName = res.data.projectInformations;
.catch(() => { this.columnsFactor = res.data.riskInventories;
this.$toast.clear(); this.columnsMainDutyDept = res.data.organizationList;
}); })
}, .catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
// 所属项目 // 请求已退回详情数据
onConProjectName(value) { postReturnEcho() {
if (!value) { this.$toast.loading({
this.showProjectName = false; message: "加载中...",
return; forbidClick: true,
} loadingType: "spinner",
this.projectId = value.id; duration: 0
this.projectName = value.projectName; });
this.showProjectName = false; postriskConiCause(`/riskMain/edit/${this.taskId}`)
}, .then(res => {
// 风险因素 console.log(
onConFactor(value) { "%c [ res ]-332",
if (!value) { "font-size:13px; background:pink; color:#bf2c9f;",
this.showFactor = false; res
return; );
} })
this.factor = value.factorType; .catch(() => {
this.showFactor = false; this.$toast.clear();
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;
},
// 事故类型
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;
}, // 所属项目
// 风险定级 onConProjectName(value) {
onConSetRank(value) { if (!value) {
this.showSetRank = false; this.showProjectName = false;
this.setRank = value; return;
this.riskRank = ""; }
if (this.setRank == "矩阵式定级") { this.projectId = value.id;
this.showSetRank = false; this.projectName = value.projectName;
this.$router.push({ this.showProjectName = false;
name: "matrix-grad", },
}); // 风险因素
} onConFactor(value) {
}, if (!value) {
// 自己定义风险等级点击方法 this.showFactor = false;
myRiskRank() { return;
if (this.setRank == "") { }
this.$toast("请先选择风险定级"); this.factor = value.factorType;
} else if (this.setRank == "其他定级方式") { this.showFactor = false;
this.showRiskRank = true; this.source = "";
} this.trouble = "";
}, // 请求风险源
// 风险等级 postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then(
onConRiskRank(value) { res => {
this.riskRank = value; this.columnsSource = res.data;
this.showRiskRank = false; }
}, );
},
// 风险源
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;
},
// 事故类型
onConTrouble(value) {
console.log(
"%c [ value ]-653",
"font-size:13px; background:pink; color:#bf2c9f;",
value
);
if (!value) {
this.showTrouble = false;
return;
}
this.form[this.riskName] = value.name;
this.showTrouble = false;
},
// 风险定级
onConSetRank(value) {
this.showSetRank = false;
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) { onConControl(value) {
this.control = value; this.control = value;
this.showControl = false; this.showControl = false;
}, },
// 主责部门 // 主责部门
onConMainDutyDept(value) { onConMainDutyDept(value) {
this.mainDutyDeptId = value.deptId; this.mainDutyDeptId = value.deptId;
this.mainDutyDept = value.deptName; this.mainDutyDept = value.deptName;
this.showMainDutyDept = false; this.showMainDutyDept = false;
this.mainDutyPeopLe = ""; this.mainDutyPeopLe = "";
// 请求主责人员 // 请求主责人员
let formdata = new FormData(); let formdata = new FormData();
formdata.append("organizationId", this.mainDutyDeptId); formdata.append("organizationId", this.mainDutyDeptId);
postHdPeople(`/riskMain/getUserList`, formdata).then((res) => { postHdPeople(`/riskMain/getUserList`, formdata).then(res => {
this.columnsMainDutyPeopLe = res.data; this.columnsMainDutyPeopLe = res.data;
}); });
}, },
// 主责人员 // 主责人员
onConMainDutyPeopLe(value) { onConMainDutyPeopLe(value) {
this.mainDutyPeopLeId = value.userId; this.mainDutyPeopLeId = value.userId;
this.mainDutyPeopLe = value.userName; this.mainDutyPeopLe = value.userName;
this.showMainDutyPeopLe = false; this.showMainDutyPeopLe = false;
}, },
//添加房间 //添加房间
tjfjClcik(){ tjfjClcik() {
this.$router.push({ this.$router.push({
name:"riskView", name: "riskView",
params:{ params: {
floorId:18, floorId: 18,
isView:false isView: false
} }
}) });
}, },
cancel() { cancel() {
this.$router.go(-1); this.$router.go(-1);
}, },
// 选择作业人 // 选择作业人
goSelPeoTwo(val) { goSelPeoTwo(val) {
this.peopleName = val this.peopleName = val;
this.show = true; this.show = true;
},
onClose() {
this.show = false;
},
onSave(e) {
this.projectDirector = e[0].loginName
this.projectDirectorName = e[0].userName
this.show = false;
},
}, },
watch: { onClose() {
// setRank(newVal, oldVal) { this.show = false;
// if (newVal == "其他定级方式") {
// this.showSetRankMode = true;
// } else {
// this.showSetRankMode = 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>
/* @import url(); 引入css类 */ /* @import url(); 引入css类 */
.con-list { .con-list {
padding: 0; padding: 0;
background-color: #f0f1f5; background-color: #f0f1f5;
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 0.26667rem; margin-bottom: 0.26667rem;
padding: 0.25rem; padding: 0.25rem;
font-size: 0.4rem; font-size: 0.4rem;
position: relative; position: relative;
border-radius: 4%; border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3; box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%; width: 90%;
margin: 0.4rem auto; margin: 0.4rem auto;
.van-row { .van-row {
font-size: 0.4rem; font-size: 0.4rem;
line-height: 0.8rem; line-height: 0.8rem;
margin-bottom: 0; margin-bottom: 0;
} }
.van-overlay { .van-overlay {
position: absolute; position: absolute;
.wrapper { .wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: space-evenly;
height: 100%; height: 100%;
} }
}
} }
}
} }
.dialogContain { .dialogContain {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>
...@@ -297,7 +297,8 @@ ...@@ -297,7 +297,8 @@
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div v-if="this.$route.params.isView" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <!-- v-if="this.$route.params.isView" -->
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" >
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > <img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" >
参考依据 参考依据
</div> </div>
...@@ -331,8 +332,8 @@ ...@@ -331,8 +332,8 @@
@cancel="showSource = false" @cancel="showSource = false"
/> />
</van-popup> </van-popup>
<!-- v-if="this.$route.params.isView" -->
<div style="margin: 16px 16px 0" v-if="this.$route.params.isView" > <div style="margin: 16px 16px 0" >
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>上报</van-button >上报</van-button
> >
...@@ -367,7 +368,8 @@ ...@@ -367,7 +368,8 @@
</van-row> </van-row>
</div> </div>
</van-dialog> </van-dialog>
<div v-if="this.$route.params.isView" style="margin: 10px 16px 0px; padding-bottom: 16px"> <!-- v-if="this.$route.params.isView" -->
<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"
>取消</van-button >取消</van-button
> >
...@@ -390,35 +392,23 @@ import { getFun, postFun } from "@/service/table.js"; ...@@ -390,35 +392,23 @@ import { getFun, postFun } from "@/service/table.js";
// postRiskShowMeasures, // postRiskShowMeasures,
// } from "@/service/risk"; // } from "@/service/risk";
export default { export default {
name: "risk-add", name: "addPresent",
components: { components: {
LHeader, LHeader,
}, },
activated() { activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一
if (this.$route.params.taskId) { },
this.isShowreturnCause = true; beforeRouteEnter(to, from, next){
this.text = "风险上报退回"; if(from.name=='addCurrent'){
this.taskId = this.$route.params.taskId; sessionStorage.setItem('presentForm','')
this.postReturnEcho(); sessionStorage.setItem('level','')
} }
this.getList(); next()
this.$bus.$on("riskLevelBus", (res) => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
if (res) {
this.riskRank = res;
} else {
this.setRank = "";
}
// 销毁一下监听事件 不然会越加越多
this.$bus.$off("riskLevelBus");
});
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") { if (to.name != "riskInherent") {
sessionStorage.setItem('presentForm',JSON.stringify(this.form))
} }
next(); next();
}, },
...@@ -445,15 +435,6 @@ export default { ...@@ -445,15 +435,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,
...@@ -515,6 +496,12 @@ export default { ...@@ -515,6 +496,12 @@ export default {
this.form.projectId='测试项目' this.form.projectId='测试项目'
}, },
mounted(){
if(sessionStorage.getItem('presentForm')!=''){
this.form=JSON.parse(sessionStorage.getItem('presentForm'))
this.form.level = sessionStorage.getItem('level')
}
},
methods: { methods: {
seletFloor(name){ seletFloor(name){
this.$toast.loading({ this.$toast.loading({
...@@ -709,27 +696,6 @@ export default { ...@@ -709,27 +696,6 @@ export default {
this.$toast.clear(); this.$toast.clear();
}, },
// 请求表单数据
getList() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFormList("/riskMain/add")
.then((res) => {
this.$toast.clear();
this.columnsProjectName = res.data.projectInformations;
this.columnsFactor = res.data.riskInventories;
this.columnsMainDutyDept = res.data.organizationList;
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
// 请求已退回详情数据 // 请求已退回详情数据
postReturnEcho() { postReturnEcho() {
this.$toast.loading({ this.$toast.loading({
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
<van-col span="15">{{ item.roomName }}</van-col> <van-col span="15">{{ item.roomName }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
<van-col span="7" :style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"> <!-- <van-col span="7" :style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }">
{{ "●待审批" }} {{ "●待审批" }}
</van-col> </van-col> -->
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
...@@ -113,8 +113,8 @@ export default { ...@@ -113,8 +113,8 @@ export default {
}, },
created() { created() {
this.planId = this.$route.params.id || sessionStorage.getItem("planId"); this.planId = this.$route.params.id || sessionStorage.getItem("planId");
this.buildingId = this.$route.params.buildingId|| sessionStorage.getItem("buildingId"); this.buildingId = this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.buildingName = this.$route.params.buildingName|| sessionStorage.getItem("buildingName"); this.buildingName = this.$route.params.buildingName || sessionStorage.getItem("buildingName");
this.getRiskList(this.planId); this.getRiskList(this.planId);
// this.postList(); // this.postList();
}, },
...@@ -134,36 +134,47 @@ export default { ...@@ -134,36 +134,47 @@ export default {
}, },
//新增固有风险 //新增固有风险
performTasks() { performTasks() {
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)
this.$router.push({ this.$router.push({
name: "addInherent", name: "addInherent",
params: { params: {
id: this.active, id: this.active,
planId: this.planId, planId: this.planId,
buildingId:this.buildingId, buildingId: this.buildingId,
buildingName:this.buildingName buildingName: this.buildingName
} }
}); });
}, },
//任务执行结束 //任务执行结束
endTasks() { endTasks() {
//toDo //toDo
postFun( Dialog.confirm({
`/risk/plan/submit/${this.planId}/${this.buildingId}` title: '任务执行结束',
).then(res => { message: '是否任务执行结束',
console.log(res.msg,'lllll') })
Dialog.alert({ .then(() => {
title: '任务执行结束', postFun(
message: res.msg, `/risk/plan/submit/${this.planId}/${this.buildingId}`
}).then(() => { ).then(res => {
this.$router.push({ // Dialog.alert({
name:'riskAssess' // title: '任务执行结束',
// message: res.msg,
// }).then(() => {
// resolve(res.data);
this.$toast.success(res.msg)
this.$router.push({
name: 'riskAssess'
})
// });
}) })
})
.catch(() => {
// on cancel
}); });
})
}, },
handadd() { handadd() {
this.$router.push({ this.$router.push({
...@@ -224,7 +235,7 @@ export default { ...@@ -224,7 +235,7 @@ export default {
async getRiskList(id) { async getRiskList(id) {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0
}); });
...@@ -240,12 +251,12 @@ export default { ...@@ -240,12 +251,12 @@ export default {
}, },
async changeFloor() { async changeFloor() {
let room = await this.roomList(this.value1); let room = await this.roomList(this.value1);
let risk = await this.riskList(this.planId, this.active, this.value1); let risk = await this.riskList(this.planId, this.buildingId, this.value1, this.value2);
}, },
async changeRoom() { async changeRoom() {
let risk = await this.riskList( let risk = await this.riskList(
this.planId, this.planId,
this.active, this.buildingId,
this.value1, this.value1,
this.value2 this.value2
); );
...@@ -262,16 +273,17 @@ export default { ...@@ -262,16 +273,17 @@ export default {
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
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)
this.$router.push({ this.$router.push({
name: "addCurrent", name: "addCurrent",
params: { params: {
inherentId: data.businessId || data.id, inherentId: data.businessId || data.id,
planId: this.planId, planId: this.planId,
buildingId:this.buildingId, buildingId: this.buildingId,
buildingName:this.buildingName buildingName: this.buildingName
} }
}); });
this.showIndex = null; this.showIndex = null;
......
...@@ -3,19 +3,20 @@ ...@@ -3,19 +3,20 @@
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<div class="section"> <div class="section">
<p>该次测评风险值为:</p> <p>该次测评风险值为:</p>
<div> <div class="resultScore">
<p style="font-weight: bold;font-size: 20px;">{{ score }}</p> <p style="font-weight: bold;font-size: 20px;">{{ this.$route.params.score }}</p>
</div> </div>
<p>本次评估结果评定为:{{ level }}</p> <p>本次评估结果评定为:{{ level }}</p>
<van-divider></van-divider> <van-divider></van-divider>
<van-field readonly label="所属模型:" placeholder="ls风险矩阵评估模型" /> <van-field readonly label="所属模型:" placeholder="ls风险矩阵评估模型" />
<van-field readonly label="风险发生可能性:" placeholder="一般情况不会发生" /> <van-field readonly label="风险发生可能性:" placeholder="一般情况不会发生" />
<van-field readonly label="后果严重程度" placeholder="轻微影响" /> <van-field readonly label="后果严重程度" placeholder="轻微影响" />
<van-field readonly label="判定标准:" placeholder="见下图" /> <van-field readonly label="判定标准:" placeholder="见下图" />
<van-image width="90vw" height="auto" :src="require('@/assets/workbench/sst.jpg')" />
</div> </div>
<div style="display: flex;margin: 10px 16px 0px; padding-bottom: 16px"> <div style="display: flex;margin: 10px 16px 0px; padding-bottom: 16px">
<van-button block type="info" @click="sureClose">确认本次测评结果</van-button> <van-button block type="info" @click="sureClose" style="margin-right: 4px;">确认本次测评结果</van-button>
<van-button block plain type="info" @click="resetClose">取消</van-button> <van-button block plain type="info" @click="resetClose" style="margin-left: 4px;">取消</van-button>
</div> </div>
</div> </div>
...@@ -47,30 +48,30 @@ import LHeader from "@/components/header.vue"; ...@@ -47,30 +48,30 @@ import LHeader from "@/components/header.vue";
}) })
}, },
resetClose(){ resetClose(){
this.$router.push({ sessionStorage.setItem('level','')
name:'addInherent', history.go(-1)
params:{
level:''
}
})
}, },
sureClose(){ sureClose(){
this.$router.push({ // this.$emit('',)
name:'addInherent', sessionStorage.setItem('level',this.level)
params:{ history.go(-1)
level:this.level // this.$router.push({
} // name:'addInherent',
}) // params:{
// level:this.level
// }
// })
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.wrapper{ .wrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
.section{
.section {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
...@@ -78,5 +79,15 @@ import LHeader from "@/components/header.vue"; ...@@ -78,5 +79,15 @@ import LHeader from "@/components/header.vue";
background: #fff; background: #fff;
font-size: 14px; font-size: 14px;
} }
.resultScore{
width: 48px;
height: 48px;
background: #ffc600;
text-align: center;
line-height: 48px;
border-radius: 50%;
margin: 0 auto;
}
} }
</style> </style>
\ No newline at end of file
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
/> />
<van-field <van-field
readonly readonly
name="projectName" name="name"
:value="form.projectName" :value="form.name"
label="任务名称" label="任务名称"
input-align="right" input-align="right"
:rules="[{ required: true, message: '任务名称不能为空' }]" :rules="[{ required: true, message: '任务名称不能为空' }]"
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
/> />
<van-field <van-field
readonly
clickable clickable
name="workUserNames" name="workUserNames"
:value="form.workUserNames" :value="form.workUserNames"
...@@ -169,28 +170,25 @@ ...@@ -169,28 +170,25 @@
justify="space-between" justify="space-between"
style="margin-top:10px;" style="margin-top:10px;"
> >
<van-col span="22" @click="toRiskDetail(item)"> <van-col span="20" @click="toRiskDetail(item)">
<van-col span="5"> <van-col span="5">
<van-image <van-image
width="46" width="46"
height="46" height="46"
src="https://img01.yzcdn.cn/vant/cat.jpeg" src="http://rongtongpc.censoft.com.cn/dev-api/profile/upload/2023/07/08/guyou.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="15">
<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-col span="15">{{ item.name }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
</van-col> </van-col>
<van-col span="2"> <van-col span="4">
<van-row <van-row type="flex">
:style="{ 详情
color: '#03b615'
}"
>
<van-icon name="arrow" size="26px" @click="goColorDetail" /> <van-icon name="arrow" size="26px" @click="goColorDetail" />
</van-row> </van-row>
</van-col> </van-col>
...@@ -561,6 +559,7 @@ export default { ...@@ -561,6 +559,7 @@ export default {
}, },
//执行任务 //执行任务
performTasks() { performTasks() {
console.log( this.messageList,'LLLL')
sessionStorage.setItem( sessionStorage.setItem(
"buildingId", "buildingId",
this.messageList.riskBuildingListDtos[0].buildingId this.messageList.riskBuildingListDtos[0].buildingId
...@@ -642,6 +641,11 @@ export default { ...@@ -642,6 +641,11 @@ export default {
console.log(res.data, "lll"); console.log(res.data, "lll");
this.riskList = res.data; this.riskList = res.data;
}); });
}else{
getFun(`/risk/plan/inherent/list/${planId}`).then(res => {
console.log(res.data, "lll");
this.riskList = res.data;
});
} }
}, },
postList(id, buildingId) { postList(id, buildingId) {
...@@ -744,7 +748,6 @@ export default { ...@@ -744,7 +748,6 @@ export default {
}, },
//风险清单列表点击 //风险清单列表点击
toRiskDetail(item) { toRiskDetail(item) {
console.log(item, "LLLL");
this.$router.push({ this.$router.push({
name: "taskDetail", name: "taskDetail",
params: { params: {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</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="https://img01.yzcdn.cn/vant/cat.jpeg" /> <van-image round width="34" height="34" src="http://rongtongpc.censoft.com.cn/dev-api/profile/upload/2023/07/08/guyou.png" />
</van-col> </van-col>
<van-col> <van-col>
{{ item.userName }} {{ item.userName }}
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</div> </div>
</van-tab> </van-tab>
<van-tab title="四色图" name="c"> <van-tab title="四色图" name="c">
<drawCanvas /> <drawCanvas :isView="true"/>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
goDetail(item){ goDetail(item){
console.log(item,'???') console.log(item,'???')
this.$router.push({ this.$router.push({
name:'addPresent', name:'taskDetail',
params:{ params:{
isView:false, isView:false,
// buildingId:, // buildingId:,
......
...@@ -8,9 +8,10 @@ module.exports = { ...@@ -8,9 +8,10 @@ module.exports = {
//以上的ip和端口是我们本机的;下面为需要跨域的 //以上的ip和端口是我们本机的;下面为需要跨域的
proxy: { //配置跨域 proxy: { //配置跨域
'/app-api': { '/app-api': {
target: 'http://192.168.4.232:8080/', //这里是后台的地址 // target: 'http://192.168.4.232:8080/', //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址 // target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
// target: 'http://192.168.10.137:8080/', //这里是昊哥的地址 // target: 'http://192.168.10.137:8080/', //这里是昊哥的地址
target: 'http://192.168.10.36:8080/', //这里是昊哥的地址
// target: 'http://localhost:8080/', //这里是后台的地址 // target: 'http://localhost:8080/', //这里是后台的地址
ws: true, ws: true,
changOrigin: true, //允许跨域 changOrigin: true, //允许跨域
......
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