Commit a5653ea2 authored by wei's avatar wei

菜单控制

parent 6de75853
...@@ -166,6 +166,11 @@ const routes = [{ ...@@ -166,6 +166,11 @@ const routes = [{
name: 'addPresent', name: 'addPresent',
component: () => import('../views/riskProject/add/addPresent.vue'), component: () => import('../views/riskProject/add/addPresent.vue'),
}, },
{//风险评估列表详情页
path: '/risk-big-detail',
name: 'risk-big-detail',
component: () => import('../views/riskProject/approve/riskBigDetail.vue'),
},
] ]
const router = new VueRouter({ const router = new VueRouter({
......
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-tabs <van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
v-model="active" <van-tab title="固有风险信息">
@change="tabList" <van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit">
color="#2980f7" <div
animated style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
> <img src="@/assets/accidentIcon/bookmark.svg" alt=""
<van-tab title="固有风险信息"> style="position: relative;top: 32%;transform: translateY(-50%);">
<van-form 风险信息
@submit="onSubmit" </div>
:scroll-to-error="true" <van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" />
:show-error="false" <van-field readonly required name="projectId" :value="form.projectId" label="所属项目" placeholder="请输入" />
validate-trigger="onSubmit" <van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物"
> 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
readonly
required
name="userName"
:value="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectId"
:value="form.projectId"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
:value="form.buildingName"
label="所属建筑物"
placeholder="请输入"
/>
<van-field <van-field required clickable name="floorId" :value="form.floorId" label="所属楼层" placeholder="请选择"
required @click="seletFloor('floor')" :rules="[{ required: true, message: '所属楼层不能为空' }]" />
clickable
name="floorId"
:value="form.floorId"
label="所属楼层"
placeholder="请选择"
@click="seletFloor('floor')"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
<van-field <van-field readonly required name="roomName" :value="form.roomName" label="所属房间" placeholder="请输入"
readonly @click="seletRoom('room')" :rules="[{ required: true, message: '所属房间不能为空' }]" />
required
name="roomName"
:value="form.roomName"
label="所属房间"
placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
<van-field <van-field readonly required name="name" v-model="form.name" label="风险源名称" placeholder="请输入"
required :rules="[{ required: true, message: '风险源名称不能为空' }]" @click="seletSource()" />
clickable
name="name"
v-model="form.name"
label="风险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]"
/>
<van-field <van-field v-model="form.factor" required name="factor" label="风险因素" placeholder="请选择"
v-model="form.factor" @click="seletFactor('factor')" :rules="[{ required: true, message: '风险因素不能为空' }]" />
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="seletFactor('factor')"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field <van-field v-model="form.type" required name="type" label="准事故类型" placeholder="请选择"
v-model="form.type" @click="seletType('type')" :rules="[{ required: true, message: '准事故类型不能为空' }]" />
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="seletType('type')"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field <van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择"
readonly @click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" />
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
@click="seletGrade('level')"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-field <van-field required name="presenceLocation" v-model="form.presenceLocation" label="存在部位"
required placeholder="请输入" :rules="[{ required: true, message: '存在部位不能为空' }]" />
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="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=""
</div> style="position: relative;top: 32%;transform: translateY(-50%);">
<van-field name="hdPicture1" label="风险源图片" > 风险源图片
<template #input> </div>
<van-uploader <van-field name="hdPicture1" label="风险源图片">
@delete="deleteFile(...arguments, 'uploaderImg')" <template #input>
multiple <van-uploader @delete="deleteFile(...arguments, 'uploaderImg')" multiple :max-count="5"
:max-count="5" upload-text="最多上传五个" v-model="uploaderImg">
upload-text="最多上传五个" <template slot="default">
v-model="uploaderImg" <!-- 11111111111 -->
> <div style="
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -139,49 +56,29 @@ ...@@ -139,49 +56,29 @@
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 <span class="van-uploader__upload-text">最多上传五个</span>
src="@/assets/upload/pic.png" </div>
alt="" </template>
style="width: 0.64rem; height: 0.64rem" </van-uploader>
/>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div>
</template> </template>
</van-uploader> </van-field>
</template> <div
</van-field> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
<img src="@/assets/accidentIcon/bookmark.svg" 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.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1"
v-model="form.measuresProject" autosize placeholder="请输入" />
name="measuresProject" <van-field name="measuresProjectFile[]" label=" ">
label="技术措施" <template #input>
type="textarea" <van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile"
rows="1" accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')">
autosize <template slot="default">
placeholder="请输入" <!-- 11111111111 -->
/> <div style="
<van-field name="measuresProjectFile[]" label=" ">
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -189,49 +86,31 @@ ...@@ -189,49 +86,31 @@
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=""
<img style="width: 0.64rem; height: 0.64rem" />
src="@/assets/upload/file.png" <span class="van-uploader__upload-text">最多上传五个</span>
alt="" </div>
style="width: 0.64rem; height: 0.64rem" </template>
/> </van-uploader>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div>
</template> </template>
</van-uploader> </van-field>
</template> <div
</van-field> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
<img src="@/assets/accidentIcon/bookmark.svg" 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" name="measuresAdministration" label="管理措施"
v-model="form.measuresAdministration" type="textarea" rows="1" autosize placeholder="请输入" />
name="measuresAdministration" <van-field name="measuresAdministrationFile[]" label=" ">
label="管理措施" <template #input>
type="textarea" <van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile"
rows="1" accept="file" result-type="file"
autosize @delete="deleteFile(...arguments, 'measuresAdministrationFile')">
placeholder="请输入" <template slot="default">
/> <!-- 11111111111 -->
<van-field name="measuresAdministrationFile[]" label=" "> <div style="
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -239,49 +118,31 @@ ...@@ -239,49 +118,31 @@
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=""
<img style="width: 0.64rem; height: 0.64rem" />
src="@/assets/upload/file.png" <span class="van-uploader__upload-text">最多上传五个</span>
alt="" </div>
style="width: 0.64rem; height: 0.64rem" </template>
/> </van-uploader>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div>
</template> </template>
</van-uploader> </van-field>
</template> <div
</van-field> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
<img src="@/assets/accidentIcon/bookmark.svg" 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.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea"
v-model="form.measuresEmergency" rows="1" autosize placeholder="请输入" />
name="measuresEmergency" <van-field name="measuresEmergencyFile[]" label=" ">
label="应急措施" <template #input>
type="textarea" <van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile"
rows="1" accept="file" result-type="file"
autosize @delete="deleteFile(...arguments, 'measuresEmergencyFile')">
placeholder="请输入" <template slot="default">
/> <!-- 11111111111 -->
<van-field name="measuresEmergencyFile[]" label=" "> <div style="
<template #input>
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -289,26 +150,22 @@ ...@@ -289,26 +150,22 @@
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=""
<img style="width: 0.64rem; height: 0.64rem" />
src="@/assets/upload/file.png" <span class="van-uploader__upload-text">最多上传五个</span>
alt="" </div>
style="width: 0.64rem; height: 0.64rem" </template>
/> </van-uploader>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div>
</template> </template>
</van-uploader> </van-field>
</template> <div
</van-field> style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > style="position: relative;top: 32%;transform: translateY(-50%);">
参考依据 参考依据
</div> </div>
<!-- <van-field <!-- <van-field
readonly readonly
required required
clickable clickable
...@@ -319,90 +176,64 @@ ...@@ -319,90 +176,64 @@
@click="showTrouble = true" @click="showTrouble = true"
:rules="[{ required: true, message: '事故类型不能为空' }]" :rules="[{ required: true, message: '事故类型不能为空' }]"
/> --> /> -->
<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=""> <div style="margin: 16px 16px 0">
<van-col span="17"> <van-button round block type="info" native-type="submit">上报</van-button>
<van-row gutter=""> </div>
<van-col span="9">风险系数:</van-col> </van-form>
<van-col span="15">{{ item.time}}</van-col> <div style="margin: 10px 16px 0px; padding-bottom: 16px">
</van-row> <van-button round block type="warning" @click.native="cancel">取消</van-button>
<van-row gutter=""> </div>
<van-col span="9">创建时间:</van-col> </van-tab>
<van-col span="15">{{ item.name }}</van-col> <van-tab title="现状风险">
</van-row> <div class="con-list" @touchmove="showIndex = null">
<van-row gutter=""> <van-cell-group inset v-for="(item, index) in messageList" :key="index">
<van-col span="9">风险描述:</van-col> <div style="font-size: 0.45rem;padding: 5px 0;">{{ item.title }}</div>
<van-col span="15">{{ item.name }}</van-col>
</van-row> <van-row gutter="">
</van-col> <van-col span="17">
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}"> <van-row gutter="">
{{ '●待审批'}} <van-col span="9">风险系数:</van-col>
</van-col> <van-col span="15">{{ item.time }}</van-col>
</van-row> </van-row>
</van-cell-group> <van-row gutter="">
<div <van-col span="9">创建时间:</van-col>
style=" <van-col span="15">{{ item.name }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">风险描述:</van-col>
<van-col span="15">{{ item.name }}</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>
</div>
</div> </van-tab>
</van-tabs>
</van-tab> <van-popup v-model="showTrouble" position="bottom">
</van-tabs> <van-picker show-toolbar value-key="name" :columns="columnsTrouble" @confirm="onConTrouble"
<van-popup v-model="showTrouble" position="bottom"> @cancel="showTrouble = false" />
<van-picker </van-popup>
show-toolbar
value-key="name"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<van-popup v-model="showSource" position="bottom"> <van-popup v-model="showSource" position="bottom">
<van-picker <van-picker show-toolbar value-key="name" :columns="columnsSource" @confirm="onConSource"
show-toolbar @cancel="showSource = false" />
value-key="name" </van-popup>
:columns="columnsSource" <div v-if="active != 0" style="display: flex;
@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;
...@@ -412,10 +243,16 @@ ...@@ -412,10 +243,16 @@
position: fixed; position: fixed;
bottom: 0;"> bottom: 0;">
<div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;"> <div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;">
<div style="font-size: 22px;"><van-icon name="plus" /></div> <div style="font-size: 22px;"><van-icon name="plus" /></div>
<div>新增现状风险</div> <div>新增现状风险</div>
</div> </div>
</div> </div>
<!-- 风险源 -->
<van-popup v-model="visiableSource" round position="bottom" :style="{ height: '30%',display:'flex',flexDirection:'column', }">
<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>
</template> </template>
...@@ -439,7 +276,7 @@ export default { ...@@ -439,7 +276,7 @@ export default {
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") { if (to.name != "matrix-grad") {
} }
next(); next();
}, },
...@@ -448,9 +285,9 @@ export default { ...@@ -448,9 +285,9 @@ export default {
inherentId: "", inherentId: "",
text: "编辑固有风险", text: "编辑固有风险",
id: "", id: "",
isTimely:1, isTimely: 1,
active:0, active: 0,
form:{ form: {
}, },
projectId: "", // 所属工程 projectId: "", // 所属工程
...@@ -465,10 +302,10 @@ export default { ...@@ -465,10 +302,10 @@ export default {
columnsFactor: [], columnsFactor: [],
messageList: [ messageList: [
{ {
title:'回显风险源名称', title: '回显风险源名称',
time:'2022-12-12', time: '2022-12-12',
name:'Mr.周', name: 'Mr.周',
state:1 state: 1
} }
], ],
source: "", //风险源 source: "", //风险源
...@@ -483,7 +320,7 @@ export default { ...@@ -483,7 +320,7 @@ export default {
columnsSetRank: ["矩阵式定级", "其他定级方式"], columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级 riskRank: "", // 风险等级
showRiskRank: false, showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险" ], columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"],
showSetRankMode: false, // 是否显示定级方式 showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字 setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片 setRankModeImg: [], // 定级方式图片
...@@ -511,114 +348,115 @@ export default { ...@@ -511,114 +348,115 @@ export default {
urgentImg: [], //应急措施图片 urgentImg: [], //应急措施图片
buildingIds: "", // 退回原因 buildingIds: "", // 退回原因
isShowreturnCause: false, isShowreturnCause: false,
visiableSource:false,
}; };
}, },
created() { created() {
if (this.$route.params.inherentId) { if (this.$route.params.inherentId) {
this.inherentId=this.$route.params.inherentId this.inherentId = this.$route.params.inherentId
this.buildingIds=this.$route.params.buildingIds this.buildingIds = this.$route.params.buildingIds
this.postReturnEcho(); this.postReturnEcho();
} }
// this.getList(); // this.getList();
}, },
methods: { methods: {
tabList(value){ tabList(value) {
console.log('%c [ value ]-527', 'font-size:13px; background:pink; color:#bf2c9f;', value) console.log('%c [ value ]-527', 'font-size:13px; background:pink; color:#bf2c9f;', value)
if(value==1){ if (value == 1) {
this.getList(); this.getList();
} }
}, },
seletFloor(name){ seletFloor(name) {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0,
}); });
this.userPrefix=name this.userPrefix = name
getFun(`/risk/plan/floor/list/${this.buildingIds}`).then((res) => { getFun(`/risk/plan/floor/list/${this.buildingIds}`).then((res) => {
this.$toast.clear() this.$toast.clear()
this.showSource=true this.showSource = true
this.columnsSource=res.data this.columnsSource = res.data
}).catch(() => { }).catch(() => {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}, },
seletRoom(name){ seletRoom(name) {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0,
}); });
this.userPrefix=name this.userPrefix = name
getFun(`/risk/plan/room/list/${this.form.floorId}`).then((res) => { getFun(`/risk/plan/room/list/${this.form.floorId}`).then((res) => {
this.$toast.clear() this.$toast.clear()
this.showSource=true this.showSource = true
this.columnsSource=res.data this.columnsSource = res.data
}).catch(() => { }).catch(() => {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}, },
seletFactor(name){ seletFactor(name) {
this.showTrouble=true this.showTrouble = true
this.riskName=name this.riskName = name
this.columnsTrouble=[ this.columnsTrouble = [
{ {
name:'人的因素', name: '人的因素',
}, },
{ {
name:'物的因素', name: '物的因素',
}, },
{ {
name:'环境因素', name: '环境因素',
}, },
{ {
name:'管理因素', name: '管理因素',
}, },
] ]
}, },
seletType(name){ seletType(name) {
this.showTrouble=true this.showTrouble = true
this.riskName=name this.riskName = name
this.columnsTrouble=[ this.columnsTrouble = [
{ {
name:'物体打击', name: '物体打击',
}, },
{ {
name:'车辆伤害', name: '车辆伤害',
}, },
{ {
name:'起重伤害', name: '起重伤害',
}, },
{ {
name:'机械伤害', name: '机械伤害',
}, },
] ]
}, },
seletGrade(name){ seletGrade(name) {
this.showTrouble=true this.showTrouble = true
this.riskName=name this.riskName = name
this.columnsTrouble=[ this.columnsTrouble = [
{ {
name:'重大风险', name: '重大风险',
}, },
{ {
name:'较大风险', name: '较大风险',
}, },
{ {
name:'一般风险', name: '一般风险',
}, },
{ {
name:'较小风险', name: '较小风险',
}, },
] ]
}, },
performTasks(){ performTasks() {
this.$router.push({ this.$router.push({
name: "addPresent", name: "addPresent",
params: { params: {
id:this.inherentId, id: this.inherentId,
// planId:this.planId // planId:this.planId
}, },
}) })
...@@ -690,7 +528,7 @@ export default { ...@@ -690,7 +528,7 @@ export default {
}); });
getFun(`/risk/plan/inherent/details/${this.inherentId}`) getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then((res) => { .then((res) => {
this.form=res.data this.form = res.data
this.uploaderImg = (res.data.pictureFile || []).map( this.uploaderImg = (res.data.pictureFile || []).map(
(item) => { (item) => {
return { return {
...@@ -766,8 +604,24 @@ export default { ...@@ -766,8 +604,24 @@ export default {
this.form[this.userPrefix + "Name"] = value.name; this.form[this.userPrefix + "Name"] = value.name;
this.showSource = false; this.showSource = false;
}, },
// 事故类型 seletSource() {
onConTrouble(value) { this.visiableSource = true
},
//从风险清单列表导入
importFromList(){
},
//输入风险源名称
nameByselfInput(){
},
//取消风险弹窗
cancleSource(){
this.visiableSource = false
},
// 事故类型
onConTrouble(value) {
if (!value) { if (!value) {
this.showTrouble = false; this.showTrouble = false;
return; return;
...@@ -831,17 +685,17 @@ export default { ...@@ -831,17 +685,17 @@ export default {
this.$router.go(-1); this.$router.go(-1);
}, },
// 选择作业人 // 选择作业人
goSelPeoTwo(val) { goSelPeoTwo(val) {
this.peopleName=val this.peopleName = val
this.show = true; this.show = true;
}, },
onClose() { onClose() {
this.show = false; this.show = false;
}, },
onSave(e) { onSave(e) {
this.projectDirector=e[0].loginName this.projectDirector = e[0].loginName
this.projectDirectorName=e[0].userName this.projectDirectorName = e[0].userName
this.show = false; this.show = false;
}, },
}, },
...@@ -862,30 +716,40 @@ export default { ...@@ -862,30 +716,40 @@ export default {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
padding: 0; padding: 0;
background-color: #f0f1f5; background-color: #f0f1f5;
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 0.26667rem; margin-bottom: 0.26667rem;
padding: 0.25rem; padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
.van-row {
font-size: 0.4rem; font-size: 0.4rem;
line-height: 0.8rem; position: relative;
margin-bottom: 0; border-radius: 4%;
} box-shadow: 0px 0px 10px 2px #f3f3f3;
.van-overlay { width: 90%;
position: absolute; margin: 0.4rem auto;
.wrapper {
display: flex; .van-row {
align-items: center; font-size: 0.4rem;
justify-content: space-evenly; line-height: 0.8rem;
height: 100%; margin-bottom: 0;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
} }
}
} }
} }
.btns{
margin:10px 10px 0 10px;
border:none;
border-bottom: 1px solid #efefef;
color: #2980F7;
}
</style> </style>
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-form <van-form
@submit="onSubmit" @submit="onSubmit"
:scroll-to-error="true" :scroll-to-error="true"
...@@ -58,8 +57,7 @@ ...@@ -58,8 +57,7 @@
@click="seletRoom('room')" @click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]" :rules="[{ required: true, message: '所属房间不能为空' }]"
/> />
<!-- <van-field
<van-field
required required
clickable clickable
name="name" name="name"
...@@ -67,8 +65,17 @@ ...@@ -67,8 +65,17 @@
label="风险源名称" label="风险源名称"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]" :rules="[{ required: true, message: '风险源名称不能为空' }]"
/> -->
<van-field
v-model="form.name"
required
name="name"
label="风险源名称"
placeholder="请选择"
@click="seletFactor('factor')"
:rules="[{ required: true, message: '风险源名称不能为空' }]"
/> />
<van-field <van-field
v-model="form.factor" v-model="form.factor"
required required
......
<template>
<div>
详情页面
</div>
</template>
<script>
export default {
name:'risk-big-detail'
}
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
...@@ -16,19 +16,14 @@ ...@@ -16,19 +16,14 @@
</template> </template>
</van-search> --> </van-search> -->
<div class="con"> <div class="con">
<van-cell-group inset> <van-cell-group inset v-if="finalRiskList.length > 0">
<van-cell value="风险评估管理" /> <van-cell value="风险评估管理" />
<van-grid :column-num="5"> <van-grid :column-num="4">
<van-grid-item <van-grid-item @click="dangerJump(item.path)" v-for="item in finalRiskList" :key="item.key" :icon="item.imgUrl"
@click="dangerJump(item.path)" :text="item.text" />
v-for="item in riskList" </van-grid>
:key="item.key" </van-cell-group>
:icon="item.imgUrl" </div>
:text="item.text"
/>
</van-grid>
</van-cell-group>
</div>
<!-- tanBar --> <!-- tanBar -->
<tab-bar :index="1"></tab-bar> <tab-bar :index="1"></tab-bar>
</div> </div>
...@@ -36,69 +31,96 @@ ...@@ -36,69 +31,96 @@
<script> <script>
import tabBar from "@/components/TabBar"; import tabBar from "@/components/TabBar";
import { getFun,postFun } from '@/service/table' import { getFun, postFun } from '@/service/table'
export default { export default {
components: { components: {
tabBar tabBar
}, },
data() { data() {
return { return {
value:'', value: '',
riskList: [ riskList: [
// { // {
// key: "1", // key: "1",
// path: "/riskAdd", // path: "/riskAdd",
// imgUrl: require("@/assets/workbench/risk-report.png"), // imgUrl: require("@/assets/workbench/risk-report.png"),
// text: "任务创建", // text: "任务创建",
// }, // },
{ {
key: "2", key: "2",
// path: "/danger", // path: "/danger",
path: "/riskManage", path: "/riskManage",
imgUrl: require("@/assets/workbench/risk-report.png"), imgUrl: require("@/assets/workbench/risk-report.png"),
text: "任务管理", text: "任务执行情况",
}, },
{ {
key: "3", key: "3",
path: "/riskAssess", path: "/riskAssess",
imgUrl: require("@/assets/workbench/risk-confirm.png"), imgUrl: require("@/assets/workbench/risk-confirm.png"),
text: "风险评估", text: "风险评估",
}, },
{ {
key: "4", key: "4",
path: "/riskApprove", path: "/riskApprove",
imgUrl: require("@/assets/workbench/risk-account.png"), imgUrl: require("@/assets/workbench/risk-account.png"),
text: "风险审批", text: "任务审批",
}, },
{ {
key: "5", key: "5",
path: "/riskLedger", path: "/riskLedger",
imgUrl: require("@/assets/workbench/danger-account.png"), imgUrl: require("@/assets/workbench/danger-account.png"),
text: "风险台账", text: "任务台账",
}, },
], ],
// 后台给的数据权限对象
powerObj: {},
finalRiskList: [],
}; };
}, },
created() { created() {
// 根据权限显示对应的图标
this.workBenchList()
}, },
methods: { methods: {
onSearch(){
workBenchList() {
getFun(`/menu/getMenu`).then(res => {
if (res.code == 200) {
this.powerObj = res.data;
if (this.powerObj.风险评估管理) {
this.finalRiskList = [
...this.riskList
].filter((x) =>
[...this.powerObj.风险评估管理].some(
(y) => (`/${y.path}`) == x.path
)
);
} else {
this.finalRiskList = [];
}
console.log(this.finalRiskList)
} else {
this.powerObj = {}
}
});
},
onSearch() {
}, },
createdClick(){ createdClick() {
this.$router.push('/create-task') this.$router.push('/create-task')
}, },
dangerJump(path) { dangerJump(path) {
if (path) { if (path) {
if(path=='/add-danger'){ if (path == '/add-danger') {
sessionStorage.removeItem('obj') sessionStorage.removeItem('obj')
this.$router.push({name:'add-danger',params:{isWorkbenchTo:1}}); this.$router.push({ name: 'add-danger', params: { isWorkbenchTo: 1 } });
}else{ } else {
this.$router.push(path); this.$router.push(path);
} }
} }
}, },
} }
}; };
</script> </script>
...@@ -113,19 +135,22 @@ export default { ...@@ -113,19 +135,22 @@ export default {
color: white; color: white;
text-align: center; text-align: center;
} }
.con { .con {
// height: calc(100% - 110px); // height: calc(100% - 110px);
// height: 100%; // height: 100%;
padding: 10px 0 50px 0; padding: 10px 0 50px 0;
background-color: #f0f1f5; background-color: #f0f1f5;
/deep/ .van-grid-item__content--center {
// padding-left: 0px; /deep/ .van-grid-item__content--center {
// padding-right: 0px; // padding-left: 0px;
padding: 0.22667rem 0px; // padding-right: 0px;
} padding: 0.22667rem 0px;
/deep/ .van-icon__image { }
width: auto;
height: 1rem; /deep/ .van-icon__image {
} width: auto;
height: 1rem;
}
} }
</style> </style>
...@@ -8,8 +8,8 @@ module.exports = { ...@@ -8,8 +8,8 @@ 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.10.137:8080/', //这里是后台的地址 target: 'http://192.168.15.124:8080/', //这里是后台的地址
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