Commit 5a83b0c8 authored by p-wanping.song's avatar p-wanping.song

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

parents d11786e8 4a9c431e
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<span class="iconRight" v-show="isViews"></span> <span class="iconRight" v-show="isViews"></span>
</header> </header>
</van-sticky> </van-sticky>
<div class="north">
<img src="../../assets/imgs/north.png" alt="">
</div>
<grid-layout :layout.sync="layout" <grid-layout :layout.sync="layout"
:col-num="colNum" :col-num="colNum"
:row-height="30" :row-height="30"
...@@ -16,7 +19,7 @@ ...@@ -16,7 +19,7 @@
: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,12 +34,15 @@ ...@@ -31,12 +34,15 @@
: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="text" :class="item.w>(item.h*5) ? '': 'rowText'">{{item.name}}</span>
<span class="remove" @click="removeItem(item.i)" v-if="!item.i">x</span> <span class="remove" @click="removeItem(item.i)" v-if="showHeader">x</span>
<!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> -->
</grid-item> </grid-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>
<van-button @click="addOther" type="info" size="mini" v-if="!isViews">添加其他</van-button> <van-button @click="addOther" type="info" size="mini" v-if="!isViews">添加其他</van-button>
<van-button @click="addBase" type="info" size="mini" v-if="!isViews">添加基础设施</van-button>
<!-- <van-button @click="editItem" type="info" size="mini" v-if="!isViews">修改</van-button> -->
<van-grid direction="horizontal" :column-num="2" class="footer" v-if="isViews"> <van-grid direction="horizontal" :column-num="2" class="footer" v-if="isViews">
风险等级图例: 风险等级图例:
<span class="riskTab type1"></span>重大风险 <span class="riskTab type1"></span>重大风险
...@@ -110,6 +116,7 @@ export default { ...@@ -110,6 +116,7 @@ export default {
isViews:false,// true:查看页面; false: 添加页面 isViews:false,// true:查看页面; false: 添加页面
showHeader:true, showHeader:true,
isRoom:true,//是否为添加房间 isRoom:true,//是否为添加房间
layoutData:[]
} }
}, },
props:{ props:{
...@@ -123,6 +130,7 @@ export default { ...@@ -123,6 +130,7 @@ export default {
// this.$nextTick(() => { // this.$nextTick(() => {
// this.rotateBox(); // this.rotateBox();
// }); // });
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
...@@ -210,11 +218,15 @@ export default { ...@@ -210,11 +218,15 @@ export default {
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 = []
res.rows.forEach((item) => { this.layoutData = res.data
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.isDraggable = false item.position.id = item.id
item.position.isResizable = false if (!this.showHeader) {
item.position.isDraggable = false
item.position.isResizable = false
}
if (!this.isViews || item.position.type == 'thorough') { //添加页面不显示颜色 if (!this.isViews || item.position.type == 'thorough') { //添加页面不显示颜色
item.position.c = '#e6e5e5' item.position.c = '#e6e5e5'
}else{ }else{
...@@ -281,53 +293,66 @@ export default { ...@@ -281,53 +293,66 @@ export default {
this.layout.splice(index, 1); this.layout.splice(index, 1);
return return
} }
postFun('/ledger/room/delete/'+val).then((res) => { this.$dialog.confirm({
if (res.code == 200) { title: '提示',
Toast.success('删除成功'); message: '是否删除',
this.getRoomInfo()
}
}).catch((err) => {
console.log('err==>>',err)
}) })
.then(() => {
postFun('/ledger/room/delete/'+val).then((res) => {
if (res.code == 200) {
Toast.success('删除成功');
this.getRoomInfo()
}
}).catch((err) => {
console.log('err==>>',err)
})
})
.catch(() => {
// on cancel
});
},
//添加基础设施
addBase(){
}, },
// 移动后的事件 // 移动后的事件
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)
}, },
// 调整大小后的事件 // 调整大小后的事件
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)
}, },
//关闭 //关闭
close(){ close(){
history.go(-1) history.go(-1)
}, },
// 确定 保存房间信息 //edger/room/update/batch
// 确定 执行批量编辑保存
confim(){ confim(){
if (this.roomName == '') { // if (this.roomName == '') {
Toast.fail({ // Toast.fail({
title: '提示', // title: '提示',
forbidClick: true, // forbidClick: true,
message: '请先添加房间!', // message: '请先添加房间!',
}) // })
return // return
} // }
let data = { let data = this.layoutData
floorId: this.$route.params.floorId ? this.$route.params.floorId : '18', this.layoutData.forEach((item) => {
name:this.roomName, item.position = JSON.stringify(item.position)
position: JSON.stringify(this.layOutItem), })
roomType: this.isRoom ? this.roomType : '9999', console.log('data==>>',data)
} postFun('/ledger/room/update/batch', data).then((res) => {
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.roomName = ''
} }
}).catch((err) => { }).catch((err) => {
console.log('err==>>',err) console.log('err==>>',err)
...@@ -350,13 +375,29 @@ export default { ...@@ -350,13 +375,29 @@ export default {
h: 3, h: 3,
i: '', i: '',
name: this.roomName, name: this.roomName,
c: '#0091EA', c: '#e6e5e5',
type:this.isRoom ? this.roomType : 'thorough', type:this.isRoom ? this.roomType : 'thorough',
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)
let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : '18',
name:this.roomName,
position: JSON.stringify(this.layOutItem),
roomType: this.isRoom ? this.roomType : '9999',
}
postFun('/ledger/room/save', data).then((res) => {
if (res.code == 200) {
// Toast.success('保存成功');
this.getRoomInfo()
this.roomType = ''
this.roomName = ''
}
}).catch((err) => {
console.log('err==>>',err)
})
}, },
cancelDialog(){ cancelDialog(){
this.roomType = '' this.roomType = ''
...@@ -379,6 +420,17 @@ export default { ...@@ -379,6 +420,17 @@ export default {
width: 100vw; width: 100vw;
position: relative; position: relative;
} }
.north{
position: absolute;
display: inline-block;
top: 1.5rem;
right: 0.5rem;
z-index: 999;
}
.north img{
width: 15px;
height: 30px;
}
.footer{ .footer{
/* position: fixed; */ /* position: fixed; */
/* left: 0; */ /* left: 0; */
......
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-tabs v-model="active" @change="tabList" color="#2980f7" animated> <van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
<van-tab title="固有风险信息"> <van-tab title="固有风险信息">
<van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit"> <van-form
<div @submit="onSubmit"
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> :scroll-to-error="true"
<img src="@/assets/accidentIcon/bookmark.svg" alt="" :show-error="false"
style="position: relative;top: 32%;transform: translateY(-50%);" /> validate-trigger="onSubmit"
风险信息 >
</div> <div
<van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" /> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field readonly required name="projectId" :value="form.projectName" label="所属项目" >
placeholder="请输入" /> <img
<van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物" src="@/assets/accidentIcon/bookmark.svg"
placeholder="请输入" /> alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
<van-field required clickable name="floorName" :value="form.floorName" label="所属楼层" placeholder="请选择" />
@click="seletFloor('floor')" :rules="[{ required: true, message: '所属楼层不能为空' }]" /> 风险信息
</div>
<van-field readonly required name="roomName" :value="form.roomName" label="所属房间" placeholder="请输入" <van-field
@click="seletRoom('room')" :rules="[{ required: true, message: '所属房间不能为空' }]" /> readonly
required
<van-field readonly required name="name" v-model="form.name" label="风险源名称" placeholder="请输入" name="userName"
:rules="[{ required: true, message: '风险源名称不能为空' }]" @click="seletSource()" /> :value="form.userName"
<van-field readonly required name="name" v-model="form.name" label="风险点类型" placeholder="请输入" label="评估人"
:rules="[{ required: true, message: '风险点类型不能为空' }]" @click="seletSource()" /> placeholder="请输入"
<van-field readonly required name="name" v-model="form.name" label="安全警示标志" placeholder="请输入" />
:rules="[{ required: true, message: '安全警示标志不能为空' }]" @click="seletSource()" /> <van-field
readonly
<van-field v-model="form.factor" required name="factor" label="风险因素" placeholder="请选择" required
@click="seletFactor('factor')" :rules="[{ required: true, message: '风险因素不能为空' }]" /> name="projectId"
:value="form.projectId"
<van-field v-model="form.type" required name="type" label="准事故类型" placeholder="请选择" label="所属项目"
@click="seletType('type')" :rules="[{ required: true, message: '准事故类型不能为空' }]" /> placeholder="请输入"
/>
<van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择" <van-field
@click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" /> readonly
required
<van-field required name="presenceLocation" v-model="form.presenceLocation" label="存在部位" name="buildingName"
placeholder="请输入" :rules="[{ required: true, message: '存在部位不能为空' }]" /> :value="form.buildingName"
label="所属建筑物"
<div placeholder="请输入 "
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> />
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" /> <van-field
风险源图片 required
</div> clickable
<van-field name="hdPicture1" label="风险源图片"> name="floorName"
<template #input> :value="form.floorName"
<van-uploader @delete="deleteFile(...arguments, 'uploaderImg')" multiple :max-count="5" label="所属楼层"
upload-text="最多上传五个" v-model="uploaderImg"> placeholder="请选择"
<template slot="default"> @click="seletFloor('floor')"
<div style=" :rules="[{ required: true, message: '所属楼层不能为空' }]"
width: 2.13333rem; />
height: 2.13333rem;
background: #f7f8fa; <div style="display: flex;">
display: flex; <van-field
align-items: center; readonly
justify-content: center; required
flex-direction: column; name="roomName"
"> :value="form.roomName"
<img src="@/assets/upload/pic.png" alt="" style="width: 0.64rem; height: 0.64rem" /> label="所属房间"
<span class="van-uploader__upload-text">最多上传五个</span> placeholder="请输入"
</div> @click="seletRoom('room')"
</template> :rules="[{ required: true, message: '所属房间不能为空' }]"
</van-uploader> />
</template> <van-button
</van-field> style="color: #cccc;background-color: #f0f1f5;"
<div icon="plus"
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> type="info"
<img src="@/assets/accidentIcon/bookmark.svg" alt="" native-type="button"
style="position: relative;top: 32%;transform: translateY(-50%);" /> @click="tjfjClcik"
技术措施 />
</div> </div>
<van-field v-model="form.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1"
autosize placeholder="请输入" /> <van-field
<van-field name="measuresProjectFile[]" label=" "> required
<template #input> clickable
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile" name="name"
accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')"> v-model="form.name"
<template slot="default"> label="危险源名称"
<div style=" placeholder="请输入"
width: 2.13333rem; :rules="[{ required: true, message: '危险源名称不能为空' }]"
height: 2.13333rem; />
background: #f7f8fa; <!-- 单选 -->
display: flex; <van-field
align-items: center; required
justify-content: center; clickable
flex-direction: column; name="pointType"
"> v-model="form.pointType"
<img src="@/assets/upload/file.png" alt="" label="风险点类型"
style="width: 0.64rem; height: 0.64rem" /> placeholder="请选择"
<span class="van-uploader__upload-text">最多上传五个</span> @click="selectData('pointType', true)"
</div> :rules="[{ required: true, message: '风险点类型不能为空' }]"
</template> />
</van-uploader> <!-- 多选 -->
</template> <van-field
</van-field> v-model="form.safetyWarningSigns"
<!-- <div readonly
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> required
<img src="@/assets/accidentIcon/bookmark.svg" alt="" name="safetyWarningSigns"
style="position: relative;top: 32%;transform: translateY(-50%);" /> label="安全警示标志"
应采取的管控措施 placeholder="请选择"
</div> @click="selectData('safetyWarningSigns', false)"
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="" type="textarea" :rules="[{ required: true, message: '安全警示标志不能为空' }]"
rows="3" autosize placeholder="请输入" /> --> />
<div <van-field
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> v-model="form.factor"
<img src="@/assets/accidentIcon/bookmark.svg" alt="" readonly
style="position: relative;top: 32%;transform: translateY(-50%);" /> required
应采取的管控措施 name="factor"
</div> label="风险因素"
<van-field v-model="form.takenMeasuresAdministration" name="takenMeasuresAdministration" label="" placeholder="请选择"
type="textarea" rows="3" autosize placeholder="请输入" /> @click="selectData('factor', false)"
<van-field required v-model="form.measuresDeptId" name="measuresDeptId" label="管控责任单位 " type="textarea" :rules="[{ required: true, message: '风险因素不能为空' }]"
rows="1" autosize placeholder="请输入" /> />
<van-field required v-model="form.measuresUserId" name="measuresUserId" label="管控责任人 " type="textarea"
rows="1" autosize placeholder="请输入" /> <van-field
<van-field name="measuresAdministrationFile[]" label=" "> readonly
<template #input> v-model="form.type"
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile" required
accept="file" result-type="file" name="type"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"> label="准事故类型"
<template slot="default"> placeholder="请选择"
<div style=" @click="selectData('type', false)"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field
readonly
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: '风险等级不能为空' }]" /> -->
<van-field
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;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险源图片
</div>
<van-field name="hdPicture1" label="风险源图片">
<template #input>
<van-uploader
@delete="deleteFile(...arguments, '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;
...@@ -132,36 +180,52 @@ ...@@ -132,36 +180,52 @@
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" /> <img
<span class="van-uploader__upload-text">最多上传五个</span> src="@/assets/upload/pic.png"
</div> alt=""
</template> style="width: 0.64rem; height: 0.64rem"
</van-uploader> />
</template> <span class="van-uploader__upload-text">最多上传五个</span>
</van-field> </div>
<div </template>
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </van-uploader>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </template>
style="position: relative;top: 32%;transform: translateY(-50%);" /> </van-field>
危险源管理 <div
</div> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field required v-model="form.hazardSourceName" name="hazardSourceName" label="危险源名称 " >
type="textarea" rows="1" autosize placeholder="请输入" /> <img
<van-field required v-model="form.majorHazardSource" name="majorHazardSource" label="是否存在重大危险源 " src="@/assets/accidentIcon/bookmark.svg"
type="textarea" rows="1" autosize placeholder="请输入" /> alt=""
<van-field required v-model="form.measuresUserId" name="measuresUserId" label="重大危险源描述" type="textarea" style="position: relative;top: 32%;transform: translateY(-50%);"
rows="3" autosize placeholder="请输入" /> />
<van-field v-model="form.majorHazardSourceDescription" name="majorHazardSourceDescription" label="应急措施" 技术措施
type="textarea" rows="1" autosize placeholder="请输入" /> </div>
<van-field name="measuresEmergencyFile[]" label=" "> <van-field
<template #input> v-model="form.measuresProject"
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile" name="measuresProject"
accept="file" result-type="file" label=""
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"> type="textarea"
<template slot="default"> rows="3"
<div style=" 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">
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -169,32 +233,81 @@ ...@@ -169,32 +233,81 @@
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" /> <img
<span class="van-uploader__upload-text">最多上传五个</span> src="@/assets/upload/file.png"
</div> alt=""
</template> style="width: 0.64rem; height: 0.64rem"
</van-uploader> />
</template> <span class="van-uploader__upload-text">最多上传五个</span>
</van-field> </div>
</template>
<div </van-uploader>
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </template>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </van-field>
style="position: relative;top: 32%;transform: translateY(-50%);" />
应急措施 <div
</div> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field v-model="form.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea" >
rows="1" autosize placeholder="请输入" /> <img
<van-field name="measuresEmergencyFile[]" label=" "> src="@/assets/accidentIcon/bookmark.svg"
<template #input> alt=""
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile" style="position: relative;top: 32%;transform: translateY(-50%);"
accept="file" result-type="file" />
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"> 应采取的管控措施
<template slot="default"> </div>
<!-- 11111111111 --> <van-field
<div style=" v-model="form.measuresAdministration"
name="measuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field
required
v-model="form.measuresDeptName"
name="measuresDeptName"
label="管控责任单位 "
type="textarea"
rows="1"
autosize
@click="
{
measuresDept = true;
}
"
placeholder="请选择"
/>
<van-field
required
v-model="form.measuresUserName"
name="measuresUserName"
label="管控责任人 "
type="textarea"
rows="1"
autosize
@click="getUserData('measuresUser')"
placeholder="请选择"
/>
<van-field name="measuresAdministrationFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -202,95 +315,372 @@ ...@@ -202,95 +315,372 @@
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" /> <img
<span class="van-uploader__upload-text">最多上传五个</span> src="@/assets/upload/file.png"
</div> alt=""
</template> style="width: 0.64rem; height: 0.64rem"
</van-uploader> />
</template> <span class="van-uploader__upload-text">最多上传五个</span>
</van-field> </div>
<div </template>
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> </van-uploader>
<img src="@/assets/accidentIcon/bookmark.svg" alt="" </template>
style="position: relative;top: 32%;transform: translateY(-50%);" /> </van-field>
参考依据 <div
</div> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-field readonly required clickable name="trouble" :value="form.trouble" label="参考依据" >
placeholder="请选择" @click="showTrouble = true" :rules="[{ required: true, message: '事故类型不能为空' }]" /> <img
src="@/assets/accidentIcon/bookmark.svg"
<div style="margin: 16px 16px 0"> alt=""
<van-button round block type="info" native-type="submit">提交</van-button> style="position: relative;top: 32%;transform: translateY(-50%);"
</div> />
</van-form> 危险源管理
<div style="margin: 10px 16px 0px; padding-bottom: 16px"> </div>
<van-button round block type="warning" @click.native="cancel">取消</van-button> <van-field
</div> v-model="form.hazardSourceName"
</van-tab> name="hazardSourceName"
<van-tab title="现状风险"> label="危险源名称 "
<div class="con-list" @touchmove="showIndex = null"> type="textarea"
<van-cell-group inset v-for="(item, index) in messageList" :key="index"> rows="1"
<div style="font-size: 0.45rem;padding: 5px 0;"> autosize
{{ item.title }} placeholder="请输入"
</div> />
<van-field name="majorHazardSource" label="是否存在重大危险源">
<van-row gutter=""> <template #input>
<van-col span="17"> <van-switch v-model="form.majorHazardSource" size="20" />
<van-row gutter=""> </template>
<van-col span="9">风险名称:</van-col> </van-field>
<van-col span="15">{{ item.name }}</van-col>
</van-row> <div
<van-row gutter=""> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
<van-col span="9">创建时间:</van-col> >
<van-col span="15">{{ timestampToTimes(item.createTime) }}</van-col> <img
</van-row> src="@/assets/accidentIcon/bookmark.svg"
<van-row gutter=""> alt=""
<van-col span="9">风险描述:</van-col> style="position: relative;top: 32%;transform: translateY(-50%);"
<van-col span="15">{{ item.describe }}</van-col> />
</van-row> 重大危险源描述
</van-col> </div>
<van-col span="7" :style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"> <van-field
{{ "●待审批" }} v-model="form.majorHazardSourceDescription"
</van-col> name="majorHazardSourceDescription"
</van-row> label=""
</van-cell-group> type="textarea"
<div style=" rows="3"
autosize
placeholder="请输入"
/>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应急措施
</div>
<van-field
v-model="form.measuresEmergency"
name="measuresEmergency"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
参考依据
</div>
<van-field
readonly
required
clickable
name="referenceBasis"
:value="form.referenceBasis"
label="参考依据"
placeholder="请选择"
@click="selectData('referenceBasis', false)"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
<van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain">
<van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1">
<van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item>
<van-collapse-item title="风险模型配置" name="2">
<van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
>
<template #reference>
<van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template>
</van-popover>
<van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
>
<template #reference>
<van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button
size="small"
plain
native-type="button"
type="info"
@click="showGradeDialog = false"
>取消</van-button
></van-col
>
<van-col span="6"
><van-button
size="small"
type="info"
native-type="button"
@click="goResultPage"
>开始测评</van-button
></van-col
>
</van-row>
</div>
</van-dialog>
<!-- 楼层弹出层 -->
<van-popup
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-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"
@click="closeDept"
>
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit"
>提交</van-button
>
</div>
</van-form>
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
</div>
</van-tab>
<van-tab title="现状风险">
<div class="con-list" @touchmove="showIndex = null">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
>
<div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.title }}
</div>
<van-row gutter="">
<van-col span="17">
<van-row gutter="">
<van-col span="9">风险名称:</van-col>
<van-col span="15">{{ item.name }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">创建时间:</van-col>
<van-col span="15">{{
timestampToTimes(item.createTime)
}}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">风险描述:</van-col>
<van-col span="15">{{ item.describe }}</van-col>
</van-row>
</van-col>
<van-col
span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
{{ "●待审批" }}
</van-col>
</van-row>
</van-cell-group>
<div
style="
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 0.48rem; font-size: 0.48rem;
position: fixed; position: fixed;
top: 30%; top: 30%;
" v-if="messageList['length'] == 0"> "
暂无数据 v-if="messageList['length'] == 0"
</div> >
</div> 暂无数据
</van-tab> </div>
</van-tabs> </div>
<van-popup v-model="showTrouble" position="bottom"> </van-tab>
<van-picker show-toolbar value-key="name" :columns="columnsTrouble" @confirm="onConTrouble" </van-tabs>
@cancel="showTrouble = false" />
</van-popup> <div
v-if="active != 0"
<!-- 楼层弹出层 --> style="display: flex;
<van-popup v-model="ShowfloorList" position="bottom" :style="{ height: '100%' }">
<selectFloor :listdata="floorSource" @closeSlect="closeSlectfloor" @saveSlect="saveSlectfloor"></selectFloor>
</van-popup>
<!-- 风险源弹出层 -->
<van-popup v-model="ShowSelectList" position="bottom" :style="{ height: '100%' }">
<selectList :listdata="columnsTrouble" @closeSlect="closeSlect" @saveSlect="saveSlect"></selectList>
</van-popup>
<!-- 准事故类型 -->
<van-popup v-model="ShowAccidentList" position="bottom" :style="{ height: '100%' }">
<selectList :listdata="columnsAccident" @closeSlect="closeSlectAccident" @saveSlect="saveSlectAccident">
</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>
<div v-if="active != 0" style="display: flex;
justify-content: space-around; justify-content: space-around;
background-color: #fff; background-color: #fff;
border-top: 1px solid #e3e3e3; border-top: 1px solid #e3e3e3;
...@@ -298,552 +688,753 @@ ...@@ -298,552 +688,753 @@
width: 100%; width: 100%;
text-align: center; text-align: center;
position: fixed; position: fixed;
bottom: 0;"> bottom: 0;"
<div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;"> >
<div style="font-size: 22px;"><van-icon name="plus" /></div> <div
<div>新增现状风险</div> @click="performTasks"
</div> style="color: #4bced0;font-size: 14px;font-weight: 600;"
</div> >
<!-- 风险源 --> <div style="font-size: 22px;"><van-icon name="plus" /></div>
<van-popup v-model="visiableSource" round position="bottom" <div>新增现状风险</div>
:style="{ height: '30%', display: 'flex', flexDirection: 'column' }"> </div>
<van-button class="btns" @click="nameByselfInput">输入风险源名称</van-button>
<van-button class="btns" @click="importFromList">从风险清单导入</van-button>
<van-button class="btns" @click="cancleSource">取消</van-button>
</van-popup>
</div> </div>
<!-- 楼层弹出层 -->
<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" @click="closeDept">
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
</div>
</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 SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue"; import selectFloor from "@/components/selectFloor.vue";
import { timestampToTime, generateId } from "@/utils/format"; import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
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: "addCurrent", name: "addCurrent",
components: { components: {
LHeader, LHeader,
SelectList, selectDept,
selectFloor SelectList,
}, selectFloor
beforeRouteLeave(to, from, next) { },
if (to.name != "matrix-grad") { activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一
this.getList();
this.$bus.$on("riskLevelBus", res => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
if (res) {
this.riskRank = res;
} else {
this.setRank = "";
}
// 销毁一下监听事件 不然会越加越多
this.$bus.$off("riskLevelBus");
});
},
beforeRouteEnter(to, from, next) {
if (from.name == "riskInherent") {
sessionStorage.setItem("inherenForm", "");
sessionStorage.setItem("level", "");
}
next();
},
beforeRouteLeave(to, from, next) {
if (to.name != "riskInherent") {
sessionStorage.setItem("inherenForm", JSON.stringify(this.form));
}
next();
},
data() {
return {
measuresDept: false,
ShowfloorList: false,
floorSource: [],
dataName: "",
// 单选
showSelect: false,
columnsData: [],
// 多选
showCheckSelect: false,
columnsCheckData: [],
ShowAccidentList: false,
ShowSelectList: false,
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: [],
source: "", //风险源
userPrefix: "", //风险源
showSource: false,
columnsSource: [],
trouble: "", //事故类型
columnsAccident: [],
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,
messageList: [],
inherentId: 0,
buildingIds: ""
};
},
created() {
if (this.$route.params.inherentId || sessionStorage.getItem("inherentId")) {
this.inherentId =
this.$route.params.inherentId || sessionStorage.getItem("inherentId");
this.buildingIds =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postReturnEcho();
}
},
mounted() {
if (sessionStorage.getItem("inherenForm") != "") {
this.form = JSON.parse(sessionStorage.getItem("inherenForm"));
this.form.level = sessionStorage.getItem("level");
}
},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
tabList(value) {
console.log(
"%c [ value ]-527",
"font-size:13px; background:pink; color:#bf2c9f;",
value
);
if (value == 1) {
this.getList();
}
},
// 请求表单数据
getList() {
getFun(`/risk/plan/existing/list/${this.inherentId}`)
.then(res => {
console.log(
"%c [ res ]-670",
"font-size:13px; background:pink; color:#bf2c9f;",
res
);
this.messageList = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
// 请求详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then(res => {
this.form = res.data;
this.getFloor();
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;
console.log("this.form :>> ", this.form);
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();
} }
next(); });
}, },
data() { changeDept(id, name) {
return { console.log(id);
ShowfloorList: false, this.form.measuresDeptId = id;
floorSource: [], this.form.measuresDeptName = name;
ShowAccidentList: false, },
ShowSelectList: false, closeDept() {
columnsAccident: [], console.log(this.form.deptId);
inherentId: "", this.measuresDept = false;
text: "编辑固有风险", },
id: "", selectData(dataName, isSinge) {
isTimely: 1, this.dataName = dataName;
active: 0, getFun(
form: {}, `/risk/plan/dict/data/list?dictType=risk_plan_${dataName.toLowerCase()}`
projectId: "", // 所属工程 )
projectName: "", // 所属工程 .then(res => {
projectDirectorName: "", // 所属工程 if (isSinge) {
projectDirector: "", // 所属工程 this.columnsData = res.data;
showProjectName: false, this.showSelect = true;
show: false, } else {
columnsProjectName: [], this.columnsCheckData = res.data;
factor: "", //风险因素 this.showCheckSelect = true;
showFactor: false, }
columnsFactor: [], })
messageList: [], .catch(() => {
source: "", //风险源 this.$toast.fail("加载失败,请稍后再试");
userPrefix: "", //风险源 });
showSource: false, },
columnsSource: [], saveSelect(data) {
trouble: "", //事故类型 this.form[this.dataName] = data.dictValue;
showTrouble: false, this.showSelect = false;
columnsTrouble: [], },
setRank: "", //风险定级 saveCheckSelect(data) {
showSetRank: false, this.form[this.dataName] = data.join(",");
columnsSetRank: ["矩阵式定级", "其他定级方式"], this.showCheckSelect = false;
riskRank: "", // 风险等级 },
showRiskRank: false, renameKeyInTree(data, oldKey, newKey) {
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"], let arr = data.map(item => {
showSetRankMode: false, // 是否显示定级方式 const newItem = { ...item };
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片 if (item.hasOwnProperty(oldKey)) {
uploaderImg: [], // 定级方式图片 newItem[newKey] = newItem[oldKey];
location: "", //风险部位 delete newItem[oldKey];
control: "", //管控层级
riskName: "", //管控层级
showControl: false,
columnsControl: ["项目级", "企业级"],
mainDutyDept: "", // 主责部门
mainDutyDeptId: "",
showMainDutyDept: false,
columnsMainDutyDept: [],
mainDutyPeopLe: "", // 主责人员
mainDutyPeopLeId: "",
showMainDutyPeopLe: false,
columnsMainDutyPeopLe: [],
technology: "", //技术措施文字
technologyImg: [], //技术措施图片
administration: "", //管理措施文字
measuresAdministrationFile: [], //管理措施图片
measuresProjectFile: [], //管理措施图片
measuresEmergencyFile: [], //管理措施图片
urgent: "", //应急措施文字
urgentImg: [], //应急措施图片
buildingIds: "", // 退回原因
isShowreturnCause: false,
visiableSource: false
};
},
created() {
if (this.$route.params.inherentId || sessionStorage.getItem("inherentId")) {
this.inherentId =
this.$route.params.inherentId || sessionStorage.getItem("inherentId");
this.buildingIds =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postReturnEcho();
} }
this.getFloor();
this.getFXYS(); if (newItem.children && newItem.children.length > 0) {
this.getZSGLX(); newItem.children = this.renameKeyInTree(
}, newItem.children,
methods: { oldKey,
timestampToTimes(time) { newKey
return timestampToTime(new Date(time), "DT2", true); );
}, }
tabList(value) { return newItem;
console.log( });
"%c [ value ]-527",
"font-size:13px; background:pink; color:#bf2c9f;", return arr;
value },
); getFloor() {
if (value == 1) { console.log(this.form, 111);
this.getList(); getFun(`/risk/plan/floor/list/${this.form.buildingId}`)
} .then(res => {
}, // this.$toast.clear();
getFloor() { // this.showSource = true;
getFun(`/risk/plan/floor/list/${this.buildingIds}`)
.then(res => { let newArr = this.renameKeyInTree(res.data, "name", "text");
// this.$toast.clear(); this.floorSource = newArr;
// this.showSource = true; })
let newArr = this.renameKeyInTree(res.data, "name", "text"); .catch(() => {
this.floorSource = newArr; this.$toast.fail("加载失败,请稍后再试");
}) });
.catch(() => { },
// this.$toast.fail("加载失败,请稍后再试"); seletFloor(name) {
}); this.ShowfloorList = true;
}, this.userPrefix = name;
getFXYS() { },
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`) seletRoom(name) {
.then(res => { this.$toast.loading({
this.columnsTrouble = res.data; message: "加载中...",
}) forbidClick: true,
.catch(() => { loadingType: "spinner",
// this.$toast.fail("加载失败,请稍后再试"); duration: 0
}); });
}, this.userPrefix = name;
getZSGLX() { getFun(`/risk/plan/room/list/${this.form.floorId}`)
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`) .then(res => {
.then(res => { this.$toast.clear();
this.columnsAccident = res.data; this.showSource = true;
}) this.columnsSource = res.data;
.catch(() => { })
// this.$toast.fail("加载失败,请稍后再试"); .catch(() => {
}); this.$toast.fail("加载失败,请稍后再试");
}, });
seletFloor(name) { },
this.ShowfloorList = true;
this.userPrefix = name; //风险等级
}, seletGrade(name) {
seletRoom(name) { this.getGradeList("possibility");
this.$toast.loading({ this.getGradeList("severity");
message: "加载中...", this.showGradeDialog = true;
forbidClick: true, },
loadingType: "spinner", //风险模型配置
duration: 0 getGradeList(type) {
}); // possibility 可能性 severity 严重性
this.userPrefix = name; getFun(`/risk/plan/matrix/${type}/list`).then(res => {
getFun(`/risk/plan/room/list/${this.form.floorId}`) let arr = [];
.then(res => { res.data.forEach(item => {
this.$toast.clear(); arr.push({
this.showSource = true; text: item.title,
this.columnsSource = res.data; type: item.type,
}) sort: item.sort,
.catch(() => { score: item.score
// this.$toast.fail("加载失败,请稍后再试"); });
}); });
}, if (type === "possibility") {
//风险因素 this.columnsRiskRank = arr;
seletFactor(name) { } else {
// this.showTrouble = true; this.columnsSetRank = arr;
this.riskName = name; }
this.ShowSelectList = true; });
}, },
//准事故类型
seletType(name) { closeSlectfloor() {
// this.showTrouble = true; this.ShowfloorList = false;
this.riskName = name; },
this.ShowAccidentList = true; saveSlectfloor(data) {
}, this.form.floorId = data.id;
seletGrade(name) { this.form.floorName = data.text;
this.showTrouble = true; this.ShowfloorList = false;
this.riskName = name; },
this.columnsTrouble = [
{ onSelect(data) {
name: "重大风险" this.possibleValue = data.text;
}, this.possibleScore = data.score;
{ },
name: "较大风险" onSelectSetRank(data) {
}, this.severityValue = data.text;
{ this.severityScore = data.score;
name: "一般风险" },
}, //开始测评
{ goResultPage() {
name: "较小风险" this.$router.push({
} name: "resultPage",
]; params: {
}, score: this.severityScore * this.possibleScore
performTasks() { }
this.$router.push({ });
name: "addPresent", },
params: { performTasks() {
id: this.inherentId, console.log("1233213 :>> ", 1233213);
// planId:this.planId },
buildingId: this.buildingId, // 点击预览图
planId: this.inherentId, clickPre(e) {
floorId: this.form.floorId, console.log(e);
floorName: this.form.floorName, if (e.filePath) {
projectName: this.form.projectName, this.videoUrl = e.filePath;
projectId: this.form.projectId, } else {
roomName: this.form.roomName, this.videoUrl = e.content;
roomId: this.form.roomId }
} },
}); async deleteFile(val, detail, key) {
}, // console.log(val,detail)
// 点击预览图 if (val.fileId) {
clickPre(e) { let formdata = new FormData();
console.log(e); formdata.append("key", val["fileId"]);
if (e.filePath) { let res = await postFun("/mobile/remove", formdata);
this.videoUrl = e.filePath; if (res) {
} else { console.log(res);
this.videoUrl = e.content; this.$toast({
} title: "提示",
}, message: "删除成功!"
async deleteFile(val, detail, key) { });
// console.log(val,detail) } else {
if (val.fileId) { console.log("删除失败");
let formdata = new FormData(); this[key].splice(detail.index, 0, val);
formdata.append("key", val["fileId"]); }
let res = await postFun("/mobile/remove", formdata); }
if (res) { },
console.log(res); jsonToFormData(config) {
this.$toast({ const formData = new FormData();
title: "提示", //循环传入的值转换formData
message: "删除成功!" Object.keys(config).forEach(key => {
}); formData.append(key, config[key]);
} else { });
console.log("删除失败"); return formData;
this[key].splice(detail.index, 0, val); },
} onSubmit(values) {
} // console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
}, var formDataJson = this.jsonToFormData(this.form);
onSubmit(values) { let url = "/risk/plan/inherent";
let url = "/riskMain/add"; values.hdPicture1.forEach(item => {
postReAdd(url, formdata) if (item.file) {
.then(res => { formDataJson.append("pictureFile[]", item.file);
this.$toast.clear(); } else {
this.$toast.success({ formDataJson.append("pictureFile[]", item.fileId);
message: "提交成功", }
duration: 2000 });
}); values["measuresProjectFile[]"].forEach(item => {
history.go(-1); if (item.file) {
}) formDataJson.append("measuresProjectFile[]", item.file);
.catch(() => { } else {
this.$toast.clear(); formDataJson.append("measuresProjectFile[]", item.fileId);
this.$toast.fail("提交失败,请稍后再试"); }
}); });
this.$toast.clear(); values["measuresEmergencyFile[]"].forEach(item => {
}, if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
// 请求表单数据 } else {
getList() { formDataJson.append("measuresEmergencyFile[]", item.fileId);
getFun(`/risk/plan/existing/list/${this.inherentId}`) }
.then(res => { });
console.log( values["measuresAdministrationFile[]"].forEach(item => {
"%c [ res ]-670", if (item.file) {
"font-size:13px; background:pink; color:#bf2c9f;", formDataJson.append("measuresAdministrationFile[]", item.file);
res } else {
); formDataJson.append("measuresAdministrationFile[]", item.fileId);
this.messageList = res.data; }
}) });
.catch(() => { postFun(url, formDataJson)
this.$toast.fail("加载失败,请稍后再试"); .then(res => {
}); this.$toast.clear();
}, this.$toast.success({
message: "提交成功",
// 请求已退回详情数据 duration: 2000
postReturnEcho() { });
this.$toast.loading({ history.go(-1);
message: "加载中...", })
forbidClick: true, .catch(() => {
loadingType: "spinner", this.$toast.clear();
duration: 0 this.$toast.fail("提交失败,请稍后再试");
}); });
getFun(`/risk/plan/inherent/details/${this.inherentId}`) this.$toast.clear();
.then(res => { },
this.form = res.data;
this.uploaderImg = (res.data.pictureFile || []).map(item => { // 所属项目
return { onConProjectName(value) {
...item, if (!value) {
url: item.filePath this.showProjectName = false;
}; return;
}); }
this.measuresProjectFile = (res.data.measuresProjectFile || []).map( this.projectId = value.id;
item => { this.projectName = value.projectName;
return { this.showProjectName = false;
...item, },
url: item.filePath // 风险因素
}; onConFactor(value) {
} if (!value) {
); this.showFactor = false;
this.measuresAdministrationFile = ( return;
res.data.measuresAdministrationFile || [] }
).map(item => { this.factor = value.factorType;
return { this.showFactor = false;
...item, this.source = "";
url: item.filePath this.trouble = "";
}; // 请求风险源
}); postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then(
this.measuresEmergencyFile = ( res => {
res.data.measuresEmergencyFile || [] this.columnsSource = res.data;
).map(item => { }
return { );
...item, },
url: item.filePath // 房间
}; onConSource(value) {
}); if (!value) {
}) this.showSource = false;
.catch(() => { return;
this.$toast.clear(); }
}); this.form[this.userPrefix + "Id"] = value.id;
}, this.form[this.userPrefix + "Name"] = value.name;
this.showSource = false;
// 所属项目 },
onConProjectName(value) { // 风险定级
if (!value) { onConSetRank(value) {
this.showProjectName = false; this.showSetRank = false;
return; this.setRank = value;
} this.riskRank = "";
this.projectId = value.id; if (this.setRank == "矩阵式定级") {
this.projectName = value.projectName; this.showSetRank = false;
this.showProjectName = false; this.$router.push({
}, name: "matrix-grad"
// 风险因素 });
onConFactor(value) { }
if (!value) { },
this.showFactor = false; // 自己定义风险等级点击方法
return; myRiskRank() {
} if (this.setRank == "") {
this.factor = value.factorType; this.$toast("请先选择风险定级");
this.showFactor = false; } else if (this.setRank == "其他定级方式") {
this.source = ""; this.showRiskRank = true;
this.trouble = ""; }
// 请求风险源 },
postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then( // 风险等级
res => { onConRiskRank(value) {
this.columnsSource = res.data; this.riskRank = value;
} this.showRiskRank = false;
); },
},
// 风险源 // 管控层级
onConSource(value) { onConControl(value) {
if (!value) { this.control = value;
this.showSource = false; this.showControl = false;
return; },
} // 主责部门
this.form[this.userPrefix + "Id"] = value.id; onConMainDutyDept(value) {
this.form[this.userPrefix + "Name"] = value.name; this.mainDutyDeptId = value.deptId;
this.showSource = false; this.mainDutyDept = value.deptName;
}, this.showMainDutyDept = false;
seletSource() { this.mainDutyPeopLe = "";
this.visiableSource = true; // 请求主责人员
}, let formdata = new FormData();
//从风险清单列表导入 formdata.append("organizationId", this.mainDutyDeptId);
importFromList() { }, postHdPeople(`/riskMain/getUserList`, formdata).then(res => {
//输入风险源名称 this.columnsMainDutyPeopLe = res.data;
nameByselfInput() { }, });
//取消风险弹窗 },
cancleSource() { // 主责人员
this.visiableSource = false; onConMainDutyPeopLe(value) {
}, this.mainDutyPeopLeId = value.userId;
this.mainDutyPeopLe = value.userName;
// 事故类型 this.showMainDutyPeopLe = false;
onConTrouble(value) { },
if (!value) { //添加房间
this.showTrouble = false; tjfjClcik() {
return; this.$router.push({
} name: "riskView",
this.form[this.riskName] = value.name; params: {
this.showTrouble = false; floorId: this.form.floorId,
}, isView: false
// 风险定级 }
onConSetRank(value) { });
this.showSetRank = false; },
this.setRank = value;
this.riskRank = ""; cancel() {
if (this.setRank == "矩阵式定级") { this.$router.go(-1);
this.showSetRank = false; },
this.$router.push({
name: "matrix-grad" // 选择作业人
}); goSelPeoTwo(val) {
} this.peopleName = val;
}, this.show = true;
// 自己定义风险等级点击方法 },
myRiskRank() { onClose() {
if (this.setRank == "") { this.show = false;
this.$toast("请先选择风险定级"); },
} else if (this.setRank == "其他定级方式") { onSave(e) {
this.showRiskRank = true; this.projectDirector = e[0].loginName;
} this.projectDirectorName = e[0].userName;
}, this.show = false;
// 风险等级
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;
},
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;
},
},
watch: {
// setRank(newVal, oldVal) {
// if (newVal == "其他定级方式") {
// this.showSetRankMode = true;
// } else {
// this.showSetRankMode = false;
// }
// },
} }
},
watch: {}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/* @import url(); 引入css类 */ /* @import url(); 引入css类 */
.con-list { .con-list {
margin-bottom: 1.5rem; padding: 0;
padding: 0; background-color: #f0f1f5;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
.van-row {
font-size: 0.4rem;
line-height: 0.8rem;
margin-bottom: 0;
}
.van-overlay { .van-cell-group--inset {
position: absolute; margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
.wrapper { .van-row {
display: flex; font-size: 0.4rem;
align-items: center; line-height: 0.8rem;
justify-content: space-evenly; margin-bottom: 0;
height: 100%; }
}
} .van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
} }
}
} }
.btns { .dialogContain {
margin: 10px 10px 0 10px; width: 100%;
border: none; height: 100%;
border-bottom: 1px solid #efefef; padding: 10px;
color: #2980f7; box-sizing: border-box;
} }
</style> </style>
...@@ -256,8 +256,8 @@ ...@@ -256,8 +256,8 @@
应采取的管控措施 应采取的管控措施
</div> </div>
<van-field <van-field
v-model="form.takenMeasuresAdministration" v-model="form.measuresAdministration"
name="takenMeasuresAdministration" name="measuresAdministration"
label="" label=""
type="textarea" type="textarea"
rows="3" rows="3"
...@@ -608,6 +608,7 @@ ...@@ -608,6 +608,7 @@
@cancel="showTrouble = false" @cancel="showTrouble = false"
/> />
</van-popup> </van-popup>
<div style="margin: 16px 16px 0"> <div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>提交</van-button >提交</van-button
...@@ -627,7 +628,6 @@ import LHeader from "@/components/header.vue"; ...@@ -627,7 +628,6 @@ 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 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";
...@@ -941,6 +941,13 @@ export default { ...@@ -941,6 +941,13 @@ export default {
} }
}); });
}, },
//风险点
clickRiskDot(){
},
// //后果严重程度
// getConsequence(){
// getFun(`/risk/plan/matrix/${type}/list`).then(res=>{
closeSlectfloor() { closeSlectfloor() {
this.ShowfloorList = false; this.ShowfloorList = false;
......
<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
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> </div>
<van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" /> <van-field
<van-field readonly required name="projectName" :value="form.projectName" label="所属项目" placeholder="请输入" /> readonly
<van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物" placeholder="请输入" /> required
name="userName"
:value="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectName"
:value="form.projectName"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
:value="form.buildingName"
label="所属建筑物"
placeholder="请输入"
/>
<van-field required readonly name="floorName" :value="form.floorName" label="所属楼层" placeholder="请选择" <van-field
:rules="[{ required: true, message: '所属楼层不能为空' }]" /> required
readonly
name="floorName"
:value="form.floorName"
label="所属楼层"
placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<van-field readonly required name="roomName" :value="form.roomName" label="所属房间" placeholder="请输入" <van-field
:rules="[{ required: true, message: '所属房间不能为空' }]" /> readonly
required
name="roomName"
:value="form.roomName"
label="所属房间"
placeholder="请输入"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
<van-field required name="name" v-model="form.name" label="危险源名称" placeholder="请输入" <van-field
:rules="[{ required: true, message: '危险源名称不能为空' }]" /> required
<van-field readonly v-model="form.factor" required name="factor" label="风险因素" placeholder="请选择" name="name"
@click="seletFactor('factor')" :rules="[{ required: true, message: '风险因素不能为空' }]" /> v-model="form.name"
label="危险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '危险源名称不能为空' }]"
/>
<van-field
readonly
v-model="form.factor"
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="seletFactor('factor')"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field readonly v-model="form.type" required name="type" label="准事故类型" placeholder="请选择" <van-field
@click="seletType('type')" :rules="[{ required: true, message: '准事故类型不能为空' }]" /> readonly
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="seletType('type')"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field <van-field
readonly readonly
v-model="form.level" v-model="form.level"
required required
name="level" name="level"
label="风险等级" label="风险等级"
placeholder="请选择" placeholder="请选择"
@click="seletGrade('level')" @click="seletGrade('level')"
:rules="[{ required: true, message: '风险等级不能为空' }]" :rules="[{ required: true, message: '风险等级不能为空' }]"
/> />
<!-- <van-field <!-- <van-field
readonly readonly
v-model="form.level" v-model="form.level"
...@@ -46,20 +113,37 @@ ...@@ -46,20 +113,37 @@
:rules="[{ required: true, message: '风险等级不能为空' }]" :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
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险源图片 风险源图片
</div> </div>
<van-field name="hdPicture1" label="风险源图片"> <van-field name="hdPicture1" label="风险源图片">
<template #input> <template #input>
<van-uploader @delete="deleteFile(...arguments, 'uploaderImg')" multiple :max-count="5" upload-text="最多上传五个" <van-uploader
v-model="uploaderImg"> @delete="deleteFile(...arguments, 'uploaderImg')"
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default"> <template slot="default">
<div style=" <div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -67,27 +151,52 @@ ...@@ -67,27 +151,52 @@
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" /> >
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> <div
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
style="position: relative;top: 32%;transform: translateY(-50%);" /> >
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
技术措施 技术措施
</div> </div>
<van-field v-model="form.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1" autosize <van-field
placeholder="请输入" /> v-model="form.measuresProject"
name="measuresProject"
label="技术措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresProjectFile[]" label=" "> <van-field name="measuresProjectFile[]" label=" ">
<template #input> <template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile" accept="file" <van-uploader
result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')"> multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default"> <template slot="default">
<div style=" <div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -95,8 +204,13 @@ ...@@ -95,8 +204,13 @@
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" /> >
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
...@@ -110,23 +224,60 @@ ...@@ -110,23 +224,60 @@
</div> </div>
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="" type="textarea" rows="3" <van-field v-model="form.measuresAdministration" name="measuresAdministration" label="" type="textarea" rows="3"
autosize placeholder="请输入" /> --> autosize placeholder="请输入" /> -->
<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
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
已采取的管控措施
</div> </div>
<van-field v-model="form.takenMeasuresAdministration" name="takenMeasuresAdministration" label="" type="textarea" rows="3" <van-field
autosize placeholder="请输入" /> v-model="form.measuresAdministration"
name="measuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field required v-model="form.measuresDeptId" name="measuresDeptId" label="管控责任单位" type="textarea" rows="1" autosize placeholder="请输入" /> <van-field
<van-field required v-model="form.measuresUserId" name="measuresUserId" label="管控责任人" type="textarea" rows="1" required
autosize placeholder="请输入" /> v-model="form.measuresDeptId"
name="measuresDeptId"
label="管控责任单位"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field
required
v-model="form.measuresUserId"
name="measuresUserId"
label="管控责任人"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresAdministrationFile[]" label=" "> <van-field name="measuresAdministrationFile[]" label=" ">
<template #input> <template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile" accept="file" <van-uploader
result-type="file" @delete="deleteFile(...arguments, 'measuresAdministrationFile')"> multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default"> <template slot="default">
<div style=" <div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -134,27 +285,52 @@ ...@@ -134,27 +285,52 @@
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" /> >
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> <div
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
style="position: relative;top: 32%;transform: translateY(-50%);" /> >
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应急措施 应急措施
</div> </div>
<van-field v-model="form.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea" rows="1" autosize <van-field
placeholder="请输入" /> v-model="form.measuresEmergency"
name="measuresEmergency"
label="应急措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label=" "> <van-field name="measuresEmergencyFile[]" label=" ">
<template #input> <template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile" accept="file" <van-uploader
result-type="file" @delete="deleteFile(...arguments, 'measuresEmergencyFile')"> multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default"> <template slot="default">
<div style=" <div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -162,8 +338,13 @@ ...@@ -162,8 +338,13 @@
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" /> >
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
...@@ -171,68 +352,165 @@ ...@@ -171,68 +352,165 @@
</template> </template>
</van-field> </van-field>
<!-- v-if="this.$route.params.isView" --> <!-- v-if="this.$route.params.isView" -->
<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
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
参考依据 参考依据
</div> </div>
<van-field readonly required name="trouble" :value="form.trouble" label="参考依据" placeholder="请选择" <van-field
@click="showTrouble = true" :rules="[{ required: true, message: '事故类型不能为空' }]" /> readonly
required
name="trouble"
:value="form.trouble"
label="参考依据"
placeholder="请选择"
@click="showTrouble = true"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
<van-popup v-model="showTrouble" position="bottom"> <van-popup v-model="showTrouble" position="bottom">
<van-picker show-toolbar value-key="name" :columns="columnsTrouble" @confirm="onConTrouble" <van-picker
@cancel="showTrouble = false" /> show-toolbar
value-key="name"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup> </van-popup>
<van-popup v-model="showSource" position="bottom"> <van-popup v-model="showSource" position="bottom">
<van-picker show-toolbar value-key="name" :columns="columnsSource" @confirm="onConSource" <van-picker
@cancel="showSource = false" /> show-toolbar
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup> </van-popup>
<!-- 楼层弹出层 --> <!-- 楼层弹出层 -->
<van-popup v-model="ShowfloorList" position="bottom" :style="{ height: '100%' }"> <van-popup
<selectFloor :listdata="floorSource" @closeSlect="closeSlectfloor" @saveSlect="saveSlectfloor"></selectFloor> v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup> </van-popup>
<!-- 风险源弹出层 --> <!-- 风险源弹出层 -->
<van-popup v-model="ShowSelectList" position="bottom" :style="{ height: '100%' }"> <van-popup
<selectList :listdata="columnsTrouble" @closeSlect="closeSlect" @saveSlect="saveSlect"></selectList> v-model="ShowSelectList"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsTrouble"
@closeSlect="closeSlect"
@saveSlect="saveSlect"
></selectList>
</van-popup> </van-popup>
<!-- 准事故类型 --> <!-- 准事故类型 -->
<van-popup v-model="ShowAccidentList" position="bottom" :style="{ height: '100%' }"> <van-popup
<selectList :listdata="columnsAccident" @closeSlect="closeSlectAccident" @saveSlect="saveSlectAccident"> v-model="ShowAccidentList"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsAccident"
@closeSlect="closeSlectAccident"
@saveSlect="saveSlectAccident"
>
</selectList> </selectList>
</van-popup> </van-popup>
<!-- v-if="this.$route.params.isView" --> <!-- v-if="this.$route.params.isView" -->
<div style="margin: 16px 16px 0"> <div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit">提交</van-button> <van-button round block type="info" native-type="submit"
>提交</van-button
>
</div> </div>
</van-form> </van-form>
<van-dialog v-model="showGradeDialog" title="风险评测配置" :show-cancel-button="false" :show-confirm-button="false"> <van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain"> <div class="dialogContain">
<van-collapse v-model="activeNames"> <van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1"> <van-collapse-item title="风险模型" name="1">
<van-field readonly required name="level" label="当前风险模型" placeholder="LS风险矩阵评估模型" /> <van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item> </van-collapse-item>
<van-collapse-item title="风险模型配置" name="2"> <van-collapse-item title="风险模型配置" name="2">
<van-popover v-model="showPopover" trigger="click" :actions="columnsRiskRank" @select="onSelect"> <van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
>
<template #reference> <template #reference>
<van-field v-model="possibleValue" readonly required name="level" label="发生的可能性" placeholder="请选择" /> <van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template> </template>
</van-popover> </van-popover>
<van-popover v-model="showPopoveSetRank" trigger="click" :actions="columnsSetRank" @select="onSelectSetRank"> <van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
>
<template #reference> <template #reference>
<van-field v-model="severityValue" readonly required name="level" label="后果严重程度" placeholder="请选择" /> <van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template> </template>
</van-popover> </van-popover>
</van-collapse-item> </van-collapse-item>
</van-collapse> </van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px"> <van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"><van-button size="small" plain type="info" <van-col span="6"
@click="showGradeDialog = false">取消</van-button></van-col> ><van-button
<van-col span="6"><van-button size="small" type="info" @click="goResultPage">开始测评</van-button></van-col> size="small"
plain
type="info"
@click="showGradeDialog = false"
>取消</van-button
></van-col
>
<van-col span="6"
><van-button size="small" type="info" @click="goResultPage"
>开始测评</van-button
></van-col
>
</van-row> </van-row>
</div> </div>
</van-dialog> </van-dialog>
<!-- 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> <van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -260,7 +538,7 @@ export default { ...@@ -260,7 +538,7 @@ export default {
selectFloor, selectFloor,
SelectList SelectList
}, },
activated() { }, activated() {},
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
if (from.name == "addCurrent") { if (from.name == "addCurrent") {
sessionStorage.setItem("presentForm", ""); sessionStorage.setItem("presentForm", "");
...@@ -506,7 +784,7 @@ export default { ...@@ -506,7 +784,7 @@ export default {
} }
}); });
}, },
performTasks() { }, performTasks() {},
// 点击预览图 // 点击预览图
clickPre(e) { clickPre(e) {
console.log(e); console.log(e);
......
...@@ -63,9 +63,13 @@ ...@@ -63,9 +63,13 @@
<van-button round type="primary" @click="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>编辑</van-button >编辑</van-button
> >
<!-- <van-button round type="info" @click="goConfirm(item)" v-show="active==0" <van-button
>确认</van-button round
> --> type="danger"
@click="delInherent(item)"
v-show="active == 0"
>删除</van-button
>
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
...@@ -158,6 +162,18 @@ export default { ...@@ -158,6 +162,18 @@ export default {
// this.postList(); // this.postList();
}, },
methods: { methods: {
delInherent() {
Dialog.confirm({
title: "删除固有风险",
message: "是否确认删除?"
})
.then(() => {
// on confirm
})
.catch(() => {
// on cancel
});
},
timestampToTimes(time) { timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true); return timestampToTime(new Date(time), "DT2", true);
}, },
......
...@@ -170,40 +170,50 @@ ...@@ -170,40 +170,50 @@
:key="index" :key="index"
> >
<van-row <van-row
class="list-row"
type="flex" type="flex"
justify="space-between" justify="space-between"
style="margin-top:10px;" style="margin-top:10px;"
@click="toRiskDetail(item)" @click="toRiskDetail(item)"
> >
<van-col span="20"> <van-col span="20">
<van-col span="5"> <van-col span="5" style="line-height: 9;">
<van-image <van-image
width="58" width="58"
height="58" height="58"
:src="require('@/assets/imgs/inherentOrange.png')" :src="(item.level == '较大风险' ?
require('@/assets/imgs/redInherent.png'):item.level == '较小风险'?
require('@/assets/imgs/blueInherent.png'):require('@/assets/imgs/inherentOrange.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="15"> <van-col span="17">
<van-row gutter=""> <van-row gutter="">
<van-col span="9">风险名称:</van-col> <van-col span="9" style="font-weight: bold;color:#000;">风险名称:</van-col>
<van-col span="15">{{ item.name }}</van-col> <van-col span="15" style="color: #606266;">{{ item.name }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">风险等级:</van-col> <van-col span="9" style="font-weight: bold;color:#000;">风险等级:</van-col>
<van-col span="15">{{ item.level }}</van-col> <van-col span="15" style="color: #606266;">{{ item.level }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">上报时间:</van-col> <van-col span="9" style="font-weight: bold;color:#000;">上报时间:</van-col>
<van-col span="15">{{ timestampToTimes(item.createTime, "DT2") }}</van-col> <van-col span="15" style="color: #606266;">{{ timestampToTimes(item.createTime, "DT2") }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9" style="font-weight: bold;color:#000;">所属房间:</van-col>
<van-col span="15" style="color: #606266;">{{ item.buildingName + item.floorName + item.roomName }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
</van-col> </van-col>
<van-col span="4"> <van-col span="4" class="list-right">
<van-row type="flex"> <van-tag plain type="primary">详情<van-icon name="arrow" size="12px" /></van-tag>
<!-- <van-row type="flex">
详情 详情
<van-icon name="arrow" size="26px" />
</van-row> </van-row> -->
</van-col> </van-col>
</van-row> </van-row>
</van-cell-group> </van-cell-group>
...@@ -810,6 +820,13 @@ p { ...@@ -810,6 +820,13 @@ p {
line-height: 0.64rem; line-height: 0.64rem;
} }
} }
.list-row{
position: relative;
}
.list-right{
position: absolute;
right: 0;
}
.journal-wrap { .journal-wrap {
position: relative; position: relative;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<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.leaderUserName }}</van-col> <van-col span="15">{{ item.createUserName }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">发起时间:</van-col> <van-col span="9">发起时间:</van-col>
......
<template> <template>
<div> <div>
<van-form :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
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> </div>
<van-field readonly required :value="InherentRisk.userName" label="评估人" placeholder="请输入" /> <van-field
<van-field readonly required :value="InherentRisk.projectName" label="所属项目" placeholder="请输入" /> readonly
<van-field readonly required :value="InherentRisk.buildingName" label="所属建筑物" placeholder="请输入" /> 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
readonly
required
clickable
name="floorName"
:value="form.floorName"
label="所属楼层"
placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<van-field required clickable name="floorName" :value="InherentRisk.floorName" label="所属楼层" placeholder="请选择"
:rules="[{ required: true, message: '所属楼层不能为空' }]" />
<div style="display: flex;"> <div style="display: flex;">
<van-field readonly required name="roomName" :value="InherentRisk.roomName" label="所属房间" placeholder="请输入" <van-field
:rules="[{ required: true, message: '所属房间不能为空' }]" /> readonly
<!-- <van-button style="color: #cccc;background-color: #f0f1f5;" icon="plus" type="info" /> --> required
name="roomName"
:value="form.roomName"
label="所属房间"
placeholder="请输入"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
</div> </div>
<van-field required clickable name="name" v-model="InherentRisk.factor" label="风险源名称" placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]" /> <van-field
<van-field required clickable name="name" v-model="InherentRisk.factor" label="风险点类型" placeholder="请输入" readonly
:rules="[{ required: true, message: '风险点类型不能为空' }]" /> required
<van-field required clickable name="name" v-model="InherentRisk.factor" label="安全警示标志" placeholder="请输入" clickable
:rules="[{ required: true, message: '安全警示标志不能为空' }]" /> name="name"
<van-field v-model="InherentRisk.factor" required name="factor" label="风险因素" placeholder="请选择" v-model="form.name"
:rules="[{ required: true, message: '风险因素不能为空' }]" /> label="危险源名称"
<van-field v-model="InherentRisk.type" required name="type" label="准事故类型" placeholder="请选择" placeholder="请输入"
:rules="[{ required: true, message: '准事故类型不能为空' }]" /> :rules="[{ required: true, message: '危险源名称不能为空' }]"
/>
<van-field readonly v-model="InherentRisk.level" required name="level" label="风险等级" placeholder="请选择" <!-- 单选 -->
:rules="[{ required: true, message: '风险等级不能为空' }]" /> <van-field
readonly
<van-field required name="presenceLocation" v-model="InherentRisk.presenceLocation" label="存在部位" placeholder="请输入" required
:rules="[{ required: true, message: '存在部位不能为空' }]" /> clickable
name="pointType"
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"> v-model="form.pointType"
<img src="@/assets/accidentIcon/bookmark.svg" alt="" label="风险点类型"
style="position: relative;top: 32%;transform: translateY(-50%);" /> placeholder="请选择"
:rules="[{ required: true, message: '风险点类型不能为空' }]"
/>
<!-- 多选 -->
<van-field
v-model="form.safetyWarningSigns"
readonly
required
name="safetyWarningSigns"
label="安全警示标志"
placeholder="请选择"
:rules="[{ required: true, message: '安全警示标志不能为空' }]"
/>
<van-field
v-model="form.factor"
readonly
required
name="factor"
label="风险因素"
placeholder="请选择"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field
readonly
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field
readonly
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-field
readonly
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;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险源图片 风险源图片
</div> </div>
<van-field name="hdPicture1" label="风险源图片"> <van-field name="hdPicture1" label="风险源图片">
<template #input> <template #input>
<van-uploader multiple :max-count="5" disabled upload-text="最多上传五个" v-model="uploaderImg"> <van-uploader
<template slot="default"> @delete="deleteFile(...arguments, 'uploaderImg')"
<div style=" multiple
width: 2.13333rem; disabled
height: 2.13333rem; :max-count="5"
background: #f7f8fa; upload-text="最多上传五个"
display: flex; v-model="uploaderImg"
align-items: center; >
justify-content: center;
flex-direction: column;
">
<img src="@/assets/upload/pic.png" alt="" style="width: 0.64rem; height: 0.64rem" />
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
技术措施
</div>
<van-field disabled v-model="InherentRisk.measuresProject" name="measuresProject" label="技术措施" type="textarea"
rows="1" autosize placeholder="请输入" />
<van-field name="measuresProjectFile[]" label=" ">
<template #input>
<van-uploader disabled multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile" accept="file"
result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')">
<template slot="default"> <template slot="default">
<div style=" <!-- 11111111111 -->
width: 2.13333rem; <div
height: 2.13333rem; style="
background: #f7f8fa; width: 2.13333rem;
display: flex; height: 2.13333rem;
align-items: center; background: #f7f8fa;
justify-content: center; display: flex;
flex-direction: column; align-items: center;
"> justify-content: center;
<img src="@/assets/upload/file.png" alt="" style="width: 0.64rem; height: 0.64rem" /> flex-direction: column;
"
>
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div
<!-- <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
> >
<img <img
...@@ -96,17 +187,54 @@ ...@@ -96,17 +187,54 @@
alt="" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" style="position: relative;top: 32%;transform: translateY(-50%);"
/> />
应采取的管控措施 技术措施
</div> </div>
<van-field <van-field
v-model="form.measuresAdministration" readonly
name="measuresAdministration" v-model="form.measuresProject"
name="measuresProject"
label="" label=""
type="textarea" type="textarea"
rows="3" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
/> --> />
<van-field name="measuresProjectFile[]" label="上传附件">
<template #input>
<van-uploader
multiple
disabled
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div <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;"
> >
...@@ -118,49 +246,68 @@ ...@@ -118,49 +246,68 @@
应采取的管控措施 应采取的管控措施
</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 required
v-model="form.measuresDeptId" readonly
name="measuresDeptId" v-model="form.measuresDeptName"
name="measuresDeptName"
label="管控责任单位 " label="管控责任单位 "
type="textarea" type="textarea"
rows="1" rows="1"
autosize autosize
placeholder="请输入" placeholder="请选择"
/> />
<van-field <van-field
required required
v-model="form.measuresUserId" readonly
name="measuresUserId" v-model="form.measuresUserName"
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 disabled multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile" <van-uploader
accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresAdministrationFile')"> multiple
disabled
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default"> <template slot="default">
<div style=" <div
width: 2.13333rem; style="
height: 2.13333rem; width: 2.13333rem;
background: #f7f8fa; height: 2.13333rem;
display: flex; background: #f7f8fa;
align-items: center; display: flex;
justify-content: center; align-items: center;
flex-direction: column; justify-content: center;
"> flex-direction: column;
<img src="@/assets/upload/file.png" alt="" style="width: 0.64rem; height: 0.64rem" /> "
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
...@@ -178,6 +325,7 @@ ...@@ -178,6 +325,7 @@
危险源管理 危险源管理
</div> </div>
<van-field <van-field
readonly
v-model="form.hazardSourceName" v-model="form.hazardSourceName"
name="hazardSourceName" name="hazardSourceName"
label="危险源名称 " label="危险源名称 "
...@@ -186,16 +334,12 @@ ...@@ -186,16 +334,12 @@
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="majorHazardSource" label="是否存在重大危险源">
<template #input>
<van-switch disabled v-model="form.majorHazardSource" size="20" />
</template>
</van-field>
<van-field
v-model="form.majorHazardSource"
name="majorHazardSource"
label="是否存在重大危险源 "
type="textarea"
rows="1"
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;"
> >
...@@ -207,6 +351,7 @@ ...@@ -207,6 +351,7 @@
重大危险源描述 重大危险源描述
</div> </div>
<van-field <van-field
readonly
v-model="form.majorHazardSourceDescription" v-model="form.majorHazardSourceDescription"
name="majorHazardSourceDescription" name="majorHazardSourceDescription"
label="" label=""
...@@ -215,50 +360,138 @@ ...@@ -215,50 +360,138 @@
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<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
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应急措施 应急措施
</div> </div>
<van-field disabled v-model="InherentRisk.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea" <van-field
rows="1" autosize placeholder="请输入" /> readonly
<van-field name="measuresEmergencyFile[]" label=" "> v-model="form.measuresEmergency"
name="measuresEmergency"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input> <template #input>
<van-uploader disabled multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile" <van-uploader
accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresEmergencyFile')"> multiple
disabled
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default"> <template slot="default">
<div style=" <!-- 11111111111 -->
width: 2.13333rem; <div
height: 2.13333rem; style="
background: #f7f8fa; width: 2.13333rem;
display: flex; height: 2.13333rem;
align-items: center; background: #f7f8fa;
justify-content: center; display: flex;
flex-direction: column; align-items: center;
"> justify-content: center;
<img src="@/assets/upload/file.png" alt="" style="width: 0.64rem; height: 0.64rem" /> flex-direction: column;
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span> <span class="van-uploader__upload-text">最多上传五个</span>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt="" <div
style="position: relative;top: 32%;transform: translateY(-50%);" /> 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> </div>
<van-field readonly required clickable name="trouble" :value="form.trouble" label="参考依据" placeholder="请选择" <van-field
@click="showTrouble = true" :rules="[{ required: true, message: '事故类型不能为空' }]" /> readonly
required
clickable
name="referenceBasis"
:value="form.referenceBasis"
label="参考依据"
placeholder="请选择"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
</van-form> </van-form>
</div> </div>
</template> </template>
<script> <script>
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
export default { export default {
props: ["InherentRisk"], name: "addCurrent",
activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一
this.getList();
this.$bus.$on("riskLevelBus", res => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
if (res) {
this.riskRank = res;
} else {
this.setRank = "";
}
// 销毁一下监听事件 不然会越加越多
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,
ShowfloorList: false,
floorSource: [],
dataName: "",
// 单选
showSelect: false,
columnsData: [],
// 多选
showCheckSelect: false,
columnsCheckData: [],
ShowAccidentList: false,
ShowSelectList: false,
showPopoveSetRank: false, showPopoveSetRank: false,
activeNames: ["1"], activeNames: ["1"],
showPopover: false, showPopover: false,
...@@ -279,19 +512,12 @@ export default { ...@@ -279,19 +512,12 @@ export default {
factor: "", //风险因素 factor: "", //风险因素
showFactor: false, showFactor: false,
columnsFactor: [], columnsFactor: [],
messageList: [
{
title: "回显风险源名称",
time: "2022-12-12",
name: "Mr.周",
state: 1
}
],
source: "", //风险源 source: "", //风险源
userPrefix: "", //风险源 userPrefix: "", //风险源
showSource: false, showSource: false,
columnsSource: [], columnsSource: [],
trouble: "", //事故类型 trouble: "", //事故类型
columnsAccident: [],
showTrouble: false, showTrouble: false,
columnsTrouble: [], columnsTrouble: [],
setRank: "", //风险定级 setRank: "", //风险定级
...@@ -330,20 +556,473 @@ export default { ...@@ -330,20 +556,473 @@ export default {
possibleValue: "", possibleValue: "",
possibleScore: 0, possibleScore: 0,
severityValue: "", severityValue: "",
severityScore: 0 severityScore: 0,
messageList: [],
inherentId: 0,
buildingIds: ""
}; };
}, },
created() { created() {
// this.form.buildingIds = this.$route.params.buildingId ||sessionStorage.getItem("buildingId") if (this.$route.params.inherentId || sessionStorage.getItem("inherentId")) {
// this.form.planId = this.$route.params.planId||sessionStorage.getItem("planId") this.inherentId =
// this.form.buildingName = this.$route.params.buildingName||sessionStorage.getItem("buildingName") this.$route.params.inherentId || sessionStorage.getItem("inherentId");
// this.form.userId = userInfo.userId this.buildingIds =
// this.form.userName = userInfo.userName this.$route.params.buildingId || sessionStorage.getItem("buildingId");
// this.form.deptName = userInfo.dept.deptName this.postReturnEcho();
// this.form.projectId = '测试项目', }
// this.form.level = this.$route.params.level ? this.$route.params.level :'' },
mounted() {
if (sessionStorage.getItem("inherenForm") != "") {
this.form = JSON.parse(sessionStorage.getItem("inherenForm"));
this.form.level = sessionStorage.getItem("level");
}
},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
tabList(value) {
console.log(
"%c [ value ]-527",
"font-size:13px; background:pink; color:#bf2c9f;",
value
);
if (value == 1) {
this.getList();
}
},
// 请求详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then(res => {
this.form = res.data;
this.getFloor();
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;
console.log("this.form :>> ", this.form);
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) {
console.log(id);
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
closeDept() {
console.log(this.form.deptId);
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;
},
renameKeyInTree(data, oldKey, newKey) {
let arr = data.map(item => {
const newItem = { ...item };
if (item.hasOwnProperty(oldKey)) {
newItem[newKey] = newItem[oldKey];
delete newItem[oldKey];
}
if (newItem.children && newItem.children.length > 0) {
newItem.children = this.renameKeyInTree(
newItem.children,
oldKey,
newKey
);
}
return newItem;
});
return arr;
},
getFloor() {
console.log(this.form, 111);
getFun(`/risk/plan/floor/list/${this.form.buildingId}`)
.then(res => {
// this.$toast.clear();
// this.showSource = true;
let newArr = this.renameKeyInTree(res.data, "name", "text");
this.floorSource = newArr;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
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("加载失败,请稍后再试");
});
},
//风险等级
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;
},
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();
},
// 所属项目
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;
},
//添加房间
tjfjClcik() {
this.$router.push({
name: "riskView",
params: {
floorId: this.form.floorId,
isView: false
}
});
},
cancel() {
this.$router.go(-1);
},
// 选择作业人
goSelPeoTwo(val) {
this.peopleName = val;
this.show = true;
},
onClose() {
this.show = false;
},
onSave(e) {
this.projectDirector = e[0].loginName;
this.projectDirectorName = e[0].userName;
this.show = false;
}
}, },
methods: {},
watch: {} watch: {}
}; };
</script> </script>
......
...@@ -8,11 +8,11 @@ module.exports = { ...@@ -8,11 +8,11 @@ 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://192.168.10.36:8080/', //这里是昊哥的地址
target: 'http://localhost:8081/', //这里是后台的地址 // target: 'http://localhost:8081/', //这里是后台的地址
ws: true, ws: true,
changOrigin: true, //允许跨域 changOrigin: true, //允许跨域
// logLevel: 'debug', // 显示代理调试信息 // logLevel: 'debug', // 显示代理调试信息
......
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