Commit df43f7d7 authored by dlkong's avatar dlkong

Merge branch 'develop' into dev_kdl

parents 1ec2d9e4 d7927ee9
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
'riskAdd' 'riskAdd'
], ],
// 不需要展示底部tabbar的页面 // 不需要展示底部tabbar的页面
noTab:["login", "login2", 'addCurrent','addPresent','addInherent','riskInherent',"choose-people","scan",'success','fail','warn','center','reset-pas-two','riskTaskList','riskView'], noTab:["login", "login2", 'addCurrent','addPresent','addInherent','riskInherent',"choose-people","scan",'success','fail','warn','center','reset-pas-two','riskTaskList','riskBigDetail','riskView'],
// cachePage预先定义的缓存页面 // cachePage预先定义的缓存页面
otherCache: [], otherCache: [],
// 专门处理列表缓存的页面,这些页面缓存逻辑与其他缓存不一样去详情返回列表缓存,但是进入列表必须刷新,如何有需要缓存的列表请放到这里来。 // 专门处理列表缓存的页面,这些页面缓存逻辑与其他缓存不一样去详情返回列表缓存,但是进入列表必须刷新,如何有需要缓存的列表请放到这里来。
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<template> <template>
<div> <div>
<van-sticky> <van-sticky>
<header class="header"> <header class="header">
<van-icon @click="to" name="arrow-left" class="iconColorLeft"/> <van-icon @click="to" name="arrow-left" class="iconColorLeft"/>
<span>{{text}}</span> <span>{{text}}</span>
<!-- <van-icon name="bars" class="iconColorRight"/> --> <!-- <van-icon name="bars" class="iconColorRight"/> -->
</header> </header>
</van-sticky> </van-sticky>
</div> </div>
</template> </template>
......
...@@ -166,6 +166,16 @@ const routes = [{ ...@@ -166,6 +166,16 @@ const routes = [{
name: 'addPresent', name: 'addPresent',
component: () => import('../views/riskProject/add/addPresent.vue'), component: () => import('../views/riskProject/add/addPresent.vue'),
}, },
{//风险评估列表详情页
path: '/riskBigDetail',
name: 'riskBigDetail',
component: () => import('../views/riskProject/assess/riskBigDetail.vue'),
},
{//执行情况管理
path: '/riskExecution',
name: 'riskExecution',
component: () => import('../views/riskProject/execution/index.vue'),
},
{//四色图 {//四色图
path: '/riskView', path: '/riskView',
name: 'riskView', name: 'riskView',
......
<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 @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit">
<van-form <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
@submit="onSubmit" <img src="@/assets/accidentIcon/bookmark.svg" alt=""
:scroll-to-error="true" style="position: relative;top: 32%;transform: translateY(-50%);">
:show-error="false" 风险信息
validate-trigger="onSubmit" </div>
> <van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" />
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <van-field readonly required name="projectId" :value="form.projectId" label="所属项目" placeholder="请输入" />
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > <van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物" placeholder="请输入" />
风险信息
</div>
<van-field
readonly
required
name="userName"
:value="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectId"
:value="form.projectId"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
:value="form.buildingName"
label="所属建筑物"
placeholder="请输入"
/>
<van-field <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
readonly
required
name="roomName"
:value="form.roomName"
label="所属房间"
placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
<van-field readonly required name="roomName" :value="form.roomName" label="所属房间" placeholder="请输入"
@click="seletRoom('room')" :rules="[{ required: true, message: '所属房间不能为空' }]" />
<van-field <van-field
required required
clickable clickable
...@@ -68,64 +25,30 @@ ...@@ -68,64 +25,30 @@
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]" :rules="[{ required: true, message: '风险源名称不能为空' }]"
/> />
<van-field v-model="form.factor" 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="请选择" @click="seletType('type')"
v-model="form.factor" :rules="[{ required: true, message: '准事故类型不能为空' }]" />
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="seletFactor('factor')"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field <van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择"
v-model="form.type" @click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" />
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="seletType('type')"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field <van-field required name="presenceLocation" v-model="form.presenceLocation" label="存在部位" placeholder="请输入"
readonly :rules="[{ required: true, message: '存在部位不能为空' }]" />
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
@click="seletGrade('level')"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-field <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
required <img src="@/assets/accidentIcon/bookmark.svg" alt=""
name="presenceLocation" style="position: relative;top: 32%;transform: translateY(-50%);">
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 <van-uploader @delete="deleteFile(...arguments, 'uploaderImg')" multiple :max-count="5"
@delete="deleteFile(...arguments, 'uploaderImg')" upload-text="最多上传五个" v-model="uploaderImg">
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default"> <template slot="default">
<!-- 11111111111 --> <!-- 11111111111 -->
<div <div style="
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -133,49 +56,28 @@ ...@@ -133,49 +56,28 @@
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"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
技术措施 style="position: relative;top: 32%;transform: translateY(-50%);">
技术措施
</div> </div>
<van-field <van-field v-model="form.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1" autosize
v-model="form.measuresProject" placeholder="请输入" />
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 <van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile" accept="file"
multiple result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')">
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default"> <template slot="default">
<!-- 11111111111 --> <!-- 11111111111 -->
<div <div style="
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -183,49 +85,28 @@ ...@@ -183,49 +85,28 @@
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"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
管理措施 style="position: relative;top: 32%;transform: translateY(-50%);">
管理措施
</div> </div>
<van-field <van-field v-model="form.measuresAdministration" name="measuresAdministration" label="管理措施" type="textarea"
v-model="form.measuresAdministration" rows="1" autosize placeholder="请输入" />
name="measuresAdministration"
label="管理措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="measuresAdministrationFile[]" label=" "> <van-field name="measuresAdministrationFile[]" label=" ">
<template #input> <template #input>
<van-uploader <van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile"
multiple accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresAdministrationFile')">
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default"> <template slot="default">
<!-- 11111111111 --> <!-- 11111111111 -->
<div <div style="
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -233,49 +114,28 @@ ...@@ -233,49 +114,28 @@
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"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
应急措施 style="position: relative;top: 32%;transform: translateY(-50%);">
应急措施
</div> </div>
<van-field <van-field v-model="form.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea" rows="1"
v-model="form.measuresEmergency" autosize placeholder="请输入" />
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 <van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile" accept="file"
multiple result-type="file" @delete="deleteFile(...arguments, 'measuresEmergencyFile')">
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default"> <template slot="default">
<!-- 11111111111 --> <!-- 11111111111 -->
<div <div style="
style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
...@@ -283,24 +143,18 @@ ...@@ -283,24 +143,18 @@
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"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text"
>最多上传五个</span
>
</div> </div>
</template> </template>
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" > <img src="@/assets/accidentIcon/bookmark.svg" alt=""
参考依据 style="position: relative;top: 32%;transform: translateY(-50%);">
参考依据
</div> </div>
<!-- <van-field <!-- <van-field
readonly readonly
...@@ -314,35 +168,20 @@ ...@@ -314,35 +168,20 @@
:rules="[{ required: true, message: '事故类型不能为空' }]" :rules="[{ required: true, message: '事故类型不能为空' }]"
/> --> /> -->
<van-popup v-model="showTrouble" position="bottom"> <van-popup v-model="showTrouble" position="bottom">
<van-picker <van-picker show-toolbar value-key="name" :columns="columnsTrouble" @confirm="onConTrouble"
show-toolbar @cancel="showTrouble = false" />
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 <van-picker show-toolbar value-key="name" :columns="columnsSource" @confirm="onConSource"
show-toolbar @cancel="showSource = false" />
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = 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
>
</div> </div>
</van-form> </van-form>
<div style="margin: 10px 16px 0px; padding-bottom: 16px"> <div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel" <van-button round block type="warning" @click.native="cancel">取消</van-button>
>取消</van-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -350,7 +189,7 @@ ...@@ -350,7 +189,7 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue"; // import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { getUserInfo, getLocalUserInfo} from '@/utils/userInfo' import { getUserInfo, getLocalUserInfo } from '@/utils/userInfo'
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
// import { // import {
// getFormList, // getFormList,
...@@ -390,7 +229,7 @@ export default { ...@@ -390,7 +229,7 @@ export default {
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") { if (to.name != "matrix-grad") {
} }
next(); next();
}, },
...@@ -399,9 +238,9 @@ export default { ...@@ -399,9 +238,9 @@ export default {
taskId: "", taskId: "",
text: "添加固有风险", text: "添加固有风险",
id: "", id: "",
isTimely:1, isTimely: 1,
active:0, active: 0,
form:{ form: {
}, },
projectId: "", // 所属工程 projectId: "", // 所属工程
...@@ -416,10 +255,10 @@ export default { ...@@ -416,10 +255,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: "", //风险源
...@@ -434,7 +273,7 @@ export default { ...@@ -434,7 +273,7 @@ export default {
columnsSetRank: ["矩阵式定级", "其他定级方式"], columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级 riskRank: "", // 风险等级
showRiskRank: false, showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险" ], columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"],
showSetRankMode: false, // 是否显示定级方式 showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字 setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片 setRankModeImg: [], // 定级方式图片
...@@ -465,103 +304,128 @@ export default { ...@@ -465,103 +304,128 @@ export default {
}; };
}, },
created() { created() {
var userInfo=getUserInfo() var userInfo = getUserInfo()
this.form.buildingIds=this.$route.params.id this.form.buildingIds = this.$route.params.id
this.form.planId=this.$route.params.planId this.form.planId = this.$route.params.planId
this.form.buildingName = '1号楼' this.form.buildingName = '1号楼'
this.form.userId=userInfo.userId this.form.userId = userInfo.userId
this.form.userName=userInfo.userName this.form.userName = userInfo.userName
this.form.deptName=userInfo.dept.deptName this.form.deptName = userInfo.dept.deptName
this.form.projectId='测试项目' this.form.projectId = '测试项目'
}, },
methods: { methods: {
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.form.buildingIds}`).then((res) => { getFun(`/risk/plan/floor/list/${this.form.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){ //风险因素
this.showTrouble=true seletFactor(name) {
this.riskName=name this.showTrouble = true
this.columnsTrouble=[ this.riskName = name
{ getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
name:'人的因素', .then(res => {
}, console.log(res.data)
{ const arr = []
name:'物的因素', res.data.forEach(item=>{
}, arr.push({name:item.dictLabel})
{ })
name:'环境因素', this.columnsTrouble = arr
}, })
{ .catch(() => {
name:'管理因素', this.$toast.fail("加载失败,请稍后再试");
}, });
] // this.columnsTrouble = [
// {
// name: '人的因素',
// },
// {
// name: '物的因素',
// },
// {
// name: '环境因素',
// },
// {
// name: '管理因素',
// },
// ]
}, },
seletType(name){ //准事故类型
this.showTrouble=true seletType(name) {
this.riskName=name this.showTrouble = true
this.columnsTrouble=[ this.riskName = name
{ getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
name:'物体打击', .then(res => {
}, const arr = []
{ res.data.forEach(item=>{
name:'车辆伤害', arr.push({name:item.dictLabel})
}, })
{ this.columnsTrouble = arr
name:'起重伤害', })
}, .catch(() => {
{ this.$toast.fail("加载失败,请稍后再试");
name:'机械伤害', });
}, // this.columnsTrouble = [
] // {
// 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() {
console.log('1233213 :>> ', 1233213); console.log('1233213 :>> ', 1233213);
}, },
// 点击预览图 // 点击预览图
...@@ -591,7 +455,7 @@ export default { ...@@ -591,7 +455,7 @@ export default {
} }
} }
}, },
jsonToFormData(config) { jsonToFormData(config) {
const formData = new FormData(); const formData = new FormData();
//循环传入的值转换formData //循环传入的值转换formData
Object.keys(config).forEach((key) => { Object.keys(config).forEach((key) => {
...@@ -601,33 +465,33 @@ export default { ...@@ -601,33 +465,33 @@ export default {
}, },
onSubmit(values) { onSubmit(values) {
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values) // console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson=this.jsonToFormData(this.form) var formDataJson = this.jsonToFormData(this.form)
let url = "/risk/plan/inherent"; let url = "/risk/plan/inherent";
values.hdPicture1.forEach((item) => { values.hdPicture1.forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("pictureFile[]", item.file); formDataJson.append("pictureFile[]", item.file);
}else{ } else {
formDataJson.append("pictureFile[]", item.fileId); formDataJson.append("pictureFile[]", item.fileId);
} }
}); });
values['measuresProjectFile[]'].forEach((item) => { values['measuresProjectFile[]'].forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file); formDataJson.append("measuresProjectFile[]", item.file);
}else{ } else {
formDataJson.append("measuresProjectFile[]", item.fileId); formDataJson.append("measuresProjectFile[]", item.fileId);
} }
}); });
values['measuresEmergencyFile[]'].forEach((item) => { values['measuresEmergencyFile[]'].forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file); formDataJson.append("measuresEmergencyFile[]", item.file);
}else{ } else {
formDataJson.append("measuresEmergencyFile[]", item.fileId); formDataJson.append("measuresEmergencyFile[]", item.fileId);
} }
}); });
values['measuresAdministrationFile[]'].forEach((item) => { values['measuresAdministrationFile[]'].forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file); formDataJson.append("measuresAdministrationFile[]", item.file);
}else{ } else {
formDataJson.append("measuresAdministrationFile[]", item.fileId); formDataJson.append("measuresAdministrationFile[]", item.fileId);
} }
}); });
...@@ -788,17 +652,17 @@ export default { ...@@ -788,17 +652,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;
}, },
}, },
...@@ -818,30 +682,34 @@ export default { ...@@ -818,30 +682,34 @@ export default {
.con-list { .con-list {
padding: 0; padding: 0;
background-color: #f0f1f5; background-color: #f0f1f5;
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 0.26667rem; margin-bottom: 0.26667rem;
padding: 0.25rem; padding: 0.25rem;
font-size: 0.4rem;
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%;
}
} }
}
} }
} }
</style> </style>
...@@ -61,14 +61,12 @@ ...@@ -61,14 +61,12 @@
<van-field <van-field
required required
clickable
name="name" name="name"
v-model="form.name" v-model="form.name"
label="风险源名称" label="风险源名称"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]" :rules="[{ required: true, message: '风险源名称不能为空' }]"
/> />
<van-field <van-field
v-model="form.factor" v-model="form.factor"
required required
......
<template> <template>
<!-- 提交 --> <!-- 提交 -->
<div> <div>
<van-sticky offset-top="0"> <van-sticky offset-top="0">
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
</van-sticky> </van-sticky>
<div style="margin-bottom: 1.5rem;"> <div style="margin-bottom: 1.5rem;">
<van-tabs <van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
v-model="active" <van-tab :title="buildingName">
@change="tabList" <van-dropdown-menu z-index="1000">
color="#2980f7" <van-dropdown-item
animated v-model="value1"
> @change="changeFloor"
<van-tab v-for="(item) in riskLogList" :title="item.name" :name="item.id" :key="item.id"> :options="option1"
<van-dropdown-menu z-index="1000"> get-container="body"
<van-dropdown-item v-model="value1" @change="changeFloor" :options="option1" get-container="body"/> />
<van-dropdown-item v-model="value2" @change="changeRoom" :options="option2" get-container="body"/> <van-dropdown-item
</van-dropdown-menu> v-model="value2"
<div @change="changeRoom"
class="con-list" :options="option2"
> get-container="body"
/>
</van-dropdown-menu>
<div class="con-list">
<van-cell-group <van-cell-group
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@click="touchstart(index, item)" @click="touchstart(index, item)"
> >
<div style="font-size: 0.45rem;padding: 5px 0;">{{item.title}}</div> <div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.title }}
</div>
<van-row gutter=""> <van-row gutter="">
<van-col span="17"> <van-col span="17">
<van-row gutter=""> <van-row gutter="">
<van-col span="9">发起时间:</van-col> <van-col span="9">发起时间:</van-col>
<van-col span="15">{{ timestampToTimes(item.createTime)}}</van-col> <van-col span="15">{{
</van-row> timestampToTimes(item.createTime)
<van-row gutter=""> }}</van-col>
<van-col span="9">楼层:</van-col> </van-row>
<van-col span="15">{{ item.floorName }}</van-col> <van-row gutter="">
</van-row> <van-col span="9">楼层:</van-col>
<van-row gutter=""> <van-col span="15">{{ item.floorName }}</van-col>
<van-col span="9">房间:</van-col> </van-row>
<van-col span="15">{{ item.roomName }}</van-col> <van-row gutter="">
</van-row> <van-col span="9">房间:</van-col>
<van-col span="15">{{ item.roomName }}</van-col>
</van-row>
</van-col> </van-col>
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}"> <van-col
{{ '●待审批'}} span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
{{ "●待审批" }}
</van-col> </van-col>
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<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 round type="info" @click="goConfirm(item)" v-show="active==0"
...@@ -59,22 +68,23 @@ ...@@ -59,22 +68,23 @@
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
<div <div
style=" 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-tab>
</van-tabs> </van-tabs>
</div> </div>
<div style="display: flex; <div
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;
...@@ -82,277 +92,285 @@ ...@@ -82,277 +92,285 @@
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 style="font-size: 22px;"><van-icon name="plus" /></div>
<div>新增固有风险</div>
</div>
<div
@click="endTasks"
style="color: #D9001B;font-size: 14px;font-weight: 600;"
>
<div style="font-size: 22px;"><van-icon name="cross" /></div>
<div>任务执行结束</div>
</div> </div>
</div> </div>
</template> </div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
export default {
name:'risk-confirme',
components: {
LHeader,
},
data() {
return {
text: "固有风险列表",
searchValue: "",
planId: 0,
value1: 1,
value2: 1,
option1: [],
option2: [],
isHaveNews: false,
messageList: [],
riskLogList:[],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 1,
form:{
}, <script>
tabs: [ import LHeader from "@/components/header.vue";
], import { getFun, postFun } from "@/service/table.js";
}; import { timestampToTime, generateId } from "@/utils/format";
}, export default {
created() { name: "risk-confirme",
this.planId=this.$route.params.id || sessionStorage.getItem('planId') components: {
this.getRiskList(this.planId); LHeader
},
data() {
return {
text: "固有风险列表",
searchValue: "",
planId: 0,
buildingId: 0,
buildingName: "",
value1: 1,
value2: 1,
option1: [],
option2: [],
isHaveNews: false,
messageList: [],
riskLogList: [],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 1,
form: {},
tabs: []
};
},
created() {
this.planId = this.$route.params.id || sessionStorage.getItem("planId");
this.buildingId = this.$route.params.buildingId;
this.buildingName = this.$route.params.buildingName;
console.log(this.buildingId, this.buildingName);
this.getRiskList(this.planId);
// this.postList(); // this.postList();
},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
changeData(arr) {
var arrList = [];
arr.forEach(item => {
arrList.push({
text: item.name,
value: item.id
});
});
return arrList;
},
//新增固有风险
performTasks() {
this.$router.push({
name: "addInherent",
params: {
id: this.active,
planId: this.planId
}
});
},
//任务执行结束
endTasks() {
//toDo
}, },
methods: { handadd() {
timestampToTimes(time){ this.$router.push({
return timestampToTime(new Date(time),"DT2", true) name: "riskAdd",
}, params: {
changeData(arr){ title: "新增"
var arrList=[] }
arr.forEach(item=>{ });
arrList.push( },
{
text:item.name, floorList(id) {
value:item.id return new Promise((resolve, reject) => {
} getFun(`/risk/plan/floor/list/${id}`)
) .then(res => {
}) this.option1 = this.changeData(res.data);
return arrList resolve(res.data);
}, })
performTasks(){ .catch(() => {
this.$router.push({ this.$toast.fail("加载失败,请稍后再试");
name: "addInherent",
params: {
id:this.active,
planId:this.planId
},
})
},
handadd(){
this.$router.push({
name: "riskAdd",
params: {
title:'新增'
},
})
},
buildingList(id) {
return new Promise((resolve, reject) => {
getFun(`/risk/plan/plan/building/list/${id}`).then((res) => {
this.riskLogList =res.data||res.rows;
resolve(res.data)
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
})
},
floorList(id) {
return new Promise((resolve, reject) => {
getFun(`/risk/plan/floor/list/${id}`).then((res) => {
this.option1=this.changeData(res.data)
resolve(res.data)
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
})
},
roomList(id) {
return new Promise((resolve, reject) => {
getFun(`/risk/plan/room/list/${id}`).then((res) => {
this.option2=this.changeData(res.data)
resolve(res.data)
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
})
},
riskList(planId,buildingId,floorId,roomId) {
return new Promise((resolve, reject) => {
var paramsJson={}
if(floorId||roomId){
paramsJson={
floorId,
roomId
}
}else{
paramsJson={}
}
getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`,paramsJson).then((res) => {
this.messageList=res.data
resolve(res.data)
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
})
},
async getRiskList(id){
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
}); });
let building= await this.buildingList(id) });
let floor= await this.floorList(building[0].id) },
let room= await this.roomList(floor[0].id) roomList(id) {
let risk= await this.riskList(id,building[0].id) return new Promise((resolve, reject) => {
this.$toast.clear(); getFun(`/risk/plan/room/list/${id}`)
}, .then(res => {
async tabList(value){ this.option2 = this.changeData(res.data);
let floor= await this.floorList(value) resolve(res.data);
let room= await this.roomList(floor[0].id) })
let risk= await this.riskList(this.planId,value) .catch(() => {
this.$toast.fail("加载失败,请稍后再试");
}, });
async changeFloor(){ });
let room= await this.roomList(this.value1) },
let risk= await this.riskList(this.planId,this.active,this.value1) riskList(planId, buildingId, floorId, roomId) {
}, return new Promise((resolve, reject) => {
async changeRoom(){ var paramsJson = {};
let risk= await this.riskList(this.planId,this.active,this.value1,this.value2) if (floorId || roomId) {
}, paramsJson = {
onSearch(val) { floorId,
this.postList(this.searchValue); roomId
}, };
touchstart(index, item) { } else {
if (this.showIndex != null) { paramsJson = {};
this.showIndex = null;
return;
} }
this.showIndex = index; getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`, paramsJson)
}, .then(res => {
// 详情 this.messageList = res.data;
goDetail(data) { resolve(res.data);
this.$router.push({ })
name: "addCurrent", .catch(() => {
params: { this.$toast.fail("加载失败,请稍后再试");
inherentId: data.businessId||data.id, });
buildingIds:this.active, });
}, },
}); async getRiskList(id) {
this.showIndex = null; this.$toast.loading({
}, message: "加载中...",
// 确认 forbidClick: true,
goConfirm(data) { loadingType: "spinner",
this.$router.push({ duration: 0
name: "risk-affirm", });
params: { let floor = await this.floorList(this.buildingId);
data: data, let room = await this.roomList(floor[0].id);
}, let risk = await this.riskList(id, this.buildingId);
}); this.$toast.clear();
},
async tabList(value) {
let floor = await this.floorList(value);
let room = await this.roomList(floor[0].id);
let risk = await this.riskList(this.planId, value);
},
async changeFloor() {
let room = await this.roomList(this.value1);
let risk = await this.riskList(this.planId, this.active, this.value1);
},
async changeRoom() {
let risk = await this.riskList(
this.planId,
this.active,
this.value1,
this.value2
);
},
onSearch(val) {
this.postList(this.searchValue);
},
touchstart(index, item) {
if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
}, return;
}
this.showIndex = index;
}, },
}; // 详情
</script> goDetail(data) {
<style lang="less" scoped> this.$router.push({
name: "addCurrent",
#app { params: {
font-family: ""; inherentId: data.businessId || data.id,
color: #2c3e50 buildingIds: this.active
} }
.cell-wrap { });
position: relative; this.showIndex = null;
},
// 确认
goConfirm(data) {
this.$router.push({
name: "risk-affirm",
params: {
data: data
}
});
this.showIndex = null;
} }
p { }
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50;
}
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem;
font-weight: none;
padding-left: 0.16rem;
margin: 0.186667rem 0;
color: #7f7f7f;
}
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
}
.journal-wrap {
position: relative;
}
.supervise-wrap {
position: relative;
}
.info-title {
color: #2980f7;
font-weight: none;
}
.field-title {
color: black;
font-weight: none;
}
.more {
position: absolute;
bottom: 0.32rem;
right: 15px;
color: #2a80f7;
font-weight: none;
z-index: 99;
}
.con-list {
padding: 0;
min-height: 10rem;
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; font-size: 0.4rem;
font-weight: none; line-height: 0.8rem;
padding-left: 0.16rem; margin-bottom: 0;
margin: 0.186667rem 0;
color: #7f7f7f;
}
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
}
.journal-wrap {
position: relative;
}
.supervise-wrap {
position: relative;
}
.info-title {
color: #2980f7;
font-weight: none;
} }
.field-title { .van-overlay {
color: black;
font-weight: none;
}
.more {
position: absolute; position: absolute;
bottom: 0.32rem; .wrapper {
right: 15px; display: flex;
color: #2a80f7; align-items: center;
font-weight: none; justify-content: space-evenly;
z-index: 99; height: 100%;
}
.con-list {
padding: 0;
min-height: 10rem;
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 {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
} }
} }
} }
</style> }
</style>
\ No newline at end of file
<template> <template>
<!-- 提交 --> <!-- 提交 -->
<div> <div>
<van-sticky offset-top="0"> <van-sticky offset-top="0">
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
</van-sticky> </van-sticky>
<div style="margin-bottom: 1.5rem;"> <div style="margin-bottom: 1.5rem;">
<van-grid :column-num="3" style="background-color: #fff;"> <van-grid :column-num="3" style="background-color: #fff;">
<van-grid-item > <van-grid-item>
<div>发起人员:</div> <div>发起人员:</div>
<div>{{messageList.createUserName}}</div> <div>{{ messageList.createUserName }}</div>
</van-grid-item> </van-grid-item>
<van-grid-item > <van-grid-item>
<div>项目负责人:</div> <div>项目负责人:</div>
<div>{{messageList.leaderUserName}}</div> <div>{{ messageList.leaderUserName }}</div>
</van-grid-item> </van-grid-item>
<van-grid-item > <van-grid-item>
<div>任务状态:</div> <div>任务状态:</div>
<div>{{messageList.status}}</div> <div>{{ messageList.status }}</div>
</van-grid-item> </van-grid-item>
<van-grid-item > <van-grid-item>
<div>开始时间:</div> <div>开始时间:</div>
<div>{{timestampToTimes(messageList.startTime)||messageList.startTime}}</div> <div>
{{
timestampToTimes(messageList.startTime) || messageList.startTime
}}
</div>
</van-grid-item> </van-grid-item>
<van-grid-item > <van-grid-item>
<div>结束时间:</div> <div>结束时间:</div>
<div>{{timestampToTimes(messageList.endTime)||messageList.endTime}}</div> <div>
{{ timestampToTimes(messageList.endTime) || messageList.endTime }}
</div>
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
<van-steps :active="active" active-icon="success" active-color="#38f" style="margin: 0.26rem 0;"> <van-steps
:active="active"
active-icon="success"
active-color="#38f"
style="margin: 0.26rem 0;"
>
<van-step>任务发起</van-step> <van-step>任务发起</van-step>
<van-step>风险评估</van-step> <van-step>风险评估</van-step>
<van-step>评估审核</van-step> <van-step>评估审核</van-step>
<van-step>项目完成</van-step> <van-step>项目完成</van-step>
</van-steps> </van-steps>
<van-tabs v-model="active" color="#2980f7" <van-tabs
v-model="active"
color="#2980f7"
animated animated
:sticky="true" :sticky="true"
offset-top="2.93rem"> offset-top="2.93rem"
>
<van-tab title="任务详情"> <van-tab title="任务详情">
<van-form <van-form
:scroll-to-error="true" :scroll-to-error="true"
:show-error="false" :show-error="false"
validate-trigger="onSubmit" validate-trigger="onSubmit"
> >
<van-field <van-field
readonly readonly
name="createUserName" name="createUserName"
:value="form.createUserName" :value="form.createUserName"
label="创建人员" label="创建人员"
input-align="right" input-align="right"
:rules="[{ required: true, message: '创建人员不能为空' }]" :rules="[{ required: true, message: '创建人员不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="createDeptName" name="createDeptName"
:value="form.createDeptName" :value="form.createDeptName"
label="创建单位" label="创建单位"
input-align="right" input-align="right"
:rules="[{ required: true, message: '创建单位不能为空' }]" :rules="[{ required: true, message: '创建单位不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="projectName" name="projectName"
:value="form.projectName" :value="form.projectName"
label="任务名称" label="任务名称"
input-align="right" input-align="right"
:rules="[{ required: true, message: '任务名称不能为空' }]" :rules="[{ required: true, message: '任务名称不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="projectName" name="projectName"
:value="form.projectName" :value="form.projectName"
label="关联项目" label="关联项目"
input-align="right" input-align="right"
:rules="[{ required: true, message: '关联项目不能为空' }]" :rules="[{ required: true, message: '关联项目不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="buildingNames" name="buildingNames"
:value="form.buildingNames" :value="form.buildingNames"
label="评估楼栋" label="评估楼栋"
input-align="right" input-align="right"
:rules="[{ required: true, message: '评估楼栋不能为空' }]" :rules="[{ required: true, message: '评估楼栋不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="leaderUserName" name="leaderUserName"
:value="form.leaderUserName" :value="form.leaderUserName"
label="项目负责人" label="项目负责人"
input-align="right" input-align="right"
:rules="[{ required: true, message: '事故类型不能为空' }]" :rules="[{ required: true, message: '事故类型不能为空' }]"
/> />
<van-field <van-field
v-model="form.startTime" v-model="form.startTime"
readonly readonly
name="location" name="location"
label="任务开始时间" label="任务开始时间"
input-align="right" input-align="right"
:formatter="()=>{ :formatter="
return timestampToTimes(form.startTime) () => {
}" return timestampToTimes(form.startTime);
:rules="[{ required: true, message: '任务开始时间不能为空' }]" }
"
:rules="[{ required: true, message: '任务开始时间不能为空' }]"
/> />
<van-field <van-field
v-model="form.endTime" v-model="form.endTime"
readonly readonly
name="location" name="location"
label="任务结束时间" label="任务结束时间"
:formatter="()=>{ :formatter="
return timestampToTimes(form.endTime) () => {
}" return timestampToTimes(form.endTime);
input-align="right" }
:rules="[{ required: true, message: '任务结束时间不能为空' }]" "
input-align="right"
:rules="[{ required: true, message: '任务结束时间不能为空' }]"
/> />
<van-field <van-field
clickable clickable
name="workUserNames" name="workUserNames"
:value="form.workUserNames" :value="form.workUserNames"
label="执行人员" label="执行人员"
input-align="right" input-align="right"
:rules="[{ required: true, message: '执行人员不能为空' }]" :rules="[{ required: true, message: '执行人员不能为空' }]"
/> />
</van-form> </van-form>
</van-tab>
<van-tab title="风险清单">
</van-tab> </van-tab>
<van-tab title="风险清单"> </van-tab>
<van-tab title="审核记录"> <van-tab title="审核记录">
<div class="journal-wrap"> <div class="journal-wrap">
<van-cell-group inset > <van-cell-group inset>
<van-steps direction="vertical" :active="99999" v-if="riskLogList.length>0"> <van-steps
<van-step v-for="(item, index) in riskLogList" :key="index"> direction="vertical"
<div class="step-wrap"> :active="99999"
<van-row> v-if="riskLogList.length > 0"
<van-col span="24" >
><div class="info-title">{{timestampToTimes(item.startTime)}}</div></van-col <van-step v-for="(item, index) in riskLogList" :key="index">
> <div class="step-wrap">
</van-row> <van-row>
<van-row> <van-col span="24"
<van-col span="7" ><div class="info-title">
><span class="field-title">操作人:</span></van-col {{ timestampToTimes(item.startTime) }}
> </div></van-col
<van-col span="17">{{item.approvalUserName}}</van-col> >
</van-row> </van-row>
<van-row> <van-row>
<van-col span="7" <van-col span="7"
><span class="field-title">审批结果:</span></van-col ><span class="field-title">操作人:</span></van-col
> >
<van-col span="17">{{item.taskName}}</van-col> <van-col span="17">{{ item.approvalUserName }}</van-col>
</van-row> </van-row>
<van-row> <van-row>
<van-col span="7" <van-col span="7"
><span class="field-title">岗位:</span></van-col ><span class="field-title">审批结果:</span></van-col
> >
<van-col span="17">{{item.taskResult}}</van-col> <van-col span="17">{{ item.taskName }}</van-col>
</van-row> </van-row>
<!-- <van-row> <van-row>
<van-col span="7"
><span class="field-title">岗位:</span></van-col
>
<van-col span="17">{{ item.taskResult }}</van-col>
</van-row>
<!-- <van-row>
<van-col span="7" <van-col span="7"
><span class="field-title">结果:</span></van-col ><span class="field-title">结果:</span></van-col
> >
<van-col span="17">{{LogType(item.taskResult)}}</van-col> <van-col span="17">{{LogType(item.taskResult)}}</van-col>
</van-row> --> </van-row> -->
</div> </div>
</van-step> </van-step>
</van-steps> </van-steps>
<div style="text-align: center;" v-if="riskLogList.length == 0">暂无数据</div> <div style="text-align: center;" v-if="riskLogList.length == 0">
</van-cell-group> 暂无数据
</div> </div>
</van-cell-group>
</div>
</van-tab> </van-tab>
<van-tab title="风险评估报告"> <van-tab title="风险评估报告">
<div style="height: 1.5rem; <div
style="height: 1.5rem;
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #97999a; border-bottom: 1px solid #97999a;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
line-height: 1.5rem; line-height: 1.5rem;
"> "
<div><van-icon name="column" size="26px"/></div> >
<div style="flex-grow:1;line-height: 0.6rem"> <div><van-icon name="column" size="26px" /></div>
<div>风险评估报告.PDF</div> <div style="flex-grow:1;line-height: 0.6rem">
<div>2019-3-21 10:23 100KB</div> <div>风险评估报告.PDF</div>
</div> <div>2019-3-21 10:23 100KB</div>
<div> </div>
<van-icon name="arrow" size="26px"/> <div>
</div> <van-icon name="arrow" size="26px" />
</div>
</div> </div>
<div style="height: 1.5rem; <div
style="height: 1.5rem;
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #97999a; border-bottom: 1px solid #97999a;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
line-height: 1.5rem; line-height: 1.5rem;
"> "
<div><van-icon name="column" size="26px"/></div> >
<div style="flex-grow:1;line-height: 0.6rem"> <div><van-icon name="column" size="26px" /></div>
<div>风险评估报告.PDF</div> <div style="flex-grow:1;line-height: 0.6rem">
<div>2019-3-21 10:23 100KB</div> <div>风险评估报告.PDF</div>
</div> <div>2019-3-21 10:23 100KB</div>
<div> </div>
<van-icon name="arrow" size="26px"/> <div>
</div> <van-icon name="arrow" size="26px" />
</div>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
<div style="display: flex; <div
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;
...@@ -220,170 +247,176 @@ ...@@ -220,170 +247,176 @@
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 style="color: #ec808d;font-size: 14px;font-weight: 600;"> >
<div style="font-size: 22px;"><van-icon name="plus" /></div>
<div>执行任务</div>
</div>
<!-- <div style="color: #ec808d;font-size: 14px;font-weight: 600;">
<div style="font-size: 22px;"><van-icon name="success" /></div> <div style="font-size: 22px;"><van-icon name="success" /></div>
<div>任务完成</div> <div>任务完成</div>
</div> </div> -->
</div>
</div> </div>
</template> </div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime, generateId } from "@/utils/format";
import { getFun, postFun } from "@/service/table.js";
export default {
name:'risk-confirme',
components: {
LHeader,
},
data() {
return {
text: "任务单",
searchValue: "",
isHaveNews: false,
messageList: [],
riskLogList:[],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 0,
form:{
}, <script>
tabs: [ import LHeader from "@/components/header.vue";
], import { timestampToTime, generateId } from "@/utils/format";
}; import { getFun, postFun } from "@/service/table.js";
export default {
name: "risk-confirme",
components: {
LHeader
},
data() {
return {
text: "任务单",
searchValue: "",
isHaveNews: false,
messageList: [],
riskLogList: [],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 0,
form: {},
tabs: []
};
},
created() {
var planId = this.$route.params.id || sessionStorage.getItem("planId");
var buildingId =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postList(planId, buildingId);
},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
}, },
created() { performTasks() {
var planId=this.$route.params.id || sessionStorage.getItem('planId') this.$router.push({
this.postList(planId); name: "riskInherent",
params: {
id: this.messageList.id,
buildingId: this.messageList.riskBuildingListDtos[0].buildingId,
buildingName: this.messageList.riskBuildingListDtos[0].buildingName
}
});
}, },
methods: { handadd() {
timestampToTimes(time){ this.$router.push({
return timestampToTime(new Date(time),"DT2", true) name: "riskAdd",
}, params: {
performTasks(){ title: "新增"
this.$router.push({
name: "riskInherent",
params: {
id:this.messageList.id
},
})
},
handadd(){
this.$router.push({
name: "riskAdd",
params: {
title:'新增'
},
})
},
postList(id) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun(`/risk/plan/details/${id}`)
.then((res) => {
this.$toast.clear();
this.messageList =res.data||res.rows;
this.form= this.messageList.detailsDto
this.riskLogList= this.messageList.approveListDtos
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
onSearch(val) {
this.postList(this.searchValue);
},
touchstart(index, item) {
if (this.showIndex != null) {
this.showIndex = null;
return;
} }
this.showIndex = index; });
}, },
// 详情 postList(id, buildingId) {
goDetail(data) { console.log(buildingId, "123");
this.$router.push({ this.$toast.loading({
name: "risk-big-detail", message: "加载中...",
params: { forbidClick: true,
id: data.businessId||data.id, loadingType: "spinner",
}, duration: 0
}); });
this.showIndex = null; var url = `/risk/plan/details/${id}`;
}, if (buildingId) url += "?buildingId=" + buildingId;
// 确认 getFun(url)
goConfirm(data) { .then(res => {
this.$router.push({ this.$toast.clear();
name: "risk-affirm", this.messageList = res.data || res.rows;
params: { this.form = this.messageList.detailsDto;
data: data, this.riskLogList = this.messageList.approveListDtos;
}, })
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
}); });
this.showIndex = null;
},
}, },
};
</script> onSearch(val) {
<style lang="less" scoped> this.postList(this.searchValue);
},
#app { touchstart(index, item) {
font-family: ""; if (this.showIndex != null) {
color: #2c3e50 this.showIndex = null;
} return;
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem;
font-weight: none;
padding-left: 0.16rem;
margin: 0.186667rem 0;
color: #7f7f7f;
}
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
} }
this.showIndex = index;
},
// 详情
goDetail(data) {
this.$router.push({
name: "risk-big-detail",
params: {
id: data.businessId || data.id
}
});
this.showIndex = null;
},
// 确认
goConfirm(data) {
this.$router.push({
name: "risk-affirm",
params: {
data: data
}
});
this.showIndex = null;
} }
.journal-wrap { }
position: relative; };
} </script>
.supervise-wrap { <style lang="less" scoped>
position: relative; #app {
} font-family: "";
.info-title { color: #2c3e50;
color: #2980f7; }
font-weight: none; .cell-wrap {
} position: relative;
.field-title { }
color: black; p {
font-weight: none; font-size: 0.4rem;
} font-weight: none;
.more { padding-left: 0.16rem;
position: absolute; margin: 0.186667rem 0;
bottom: 0.32rem; color: #7f7f7f;
right: 15px; }
color: #2a80f7; .van-cell-group--inset {
font-weight: none; margin: 0;
z-index: 99; margin-bottom: 10px;
} padding: 10px;
</style> font-size: 13px;
position: relative;
\ No newline at end of file .van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
}
.journal-wrap {
position: relative;
}
.supervise-wrap {
position: relative;
}
.info-title {
color: #2980f7;
font-weight: none;
}
.field-title {
color: black;
font-weight: none;
}
.more {
position: absolute;
bottom: 0.32rem;
right: 15px;
color: #2a80f7;
font-weight: none;
z-index: 99;
}
</style>
<template> <template>
<!-- 提交 --> <!-- 提交 -->
<div> <div>
<van-sticky offset-top="0"> <van-sticky offset-top="0">
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
</van-sticky> </van-sticky>
<van-sticky offset-top="1.5rem"> <van-tabs
<van-search v-model="active"
v-model="searchValue" @change="postList"
show-action color="#2980f7"
placeholder="请输入搜索内容" animated
@search="onSearch" :sticky="true"
> >
<template #action> <van-tab v-for="item in tabs" :key="item.key" :title="item.title">
<div @click="onSearch">搜索</div> <!-- 内容列表 -->
</template> <div class="con-list">
</van-search> <van-cell-group
</van-sticky> inset
<!-- <van-tabs v-for="(item, index) in messageList"
v-model="active" :key="index"
@change=" >
postList(searchValue); <div style="font-size: 0.45rem;padding: 5px 0;">
showIndex = null; {{ item.title }}
" </div>
color="#2980f7" <van-row gutter="">
animated <van-col span="17">
:sticky="true" <van-row gutter="">
offset-top="2.93rem" <van-col span="9">创建人:</van-col>
> <van-col span="15">{{ item.leaderUserName }}</van-col>
<van-tab v-for="(item, key) in tabs" :key="key" :title="item.title"> --> </van-row>
<!-- 内容列表 --> <van-row gutter="">
<van-col span="9">发起时间:</van-col>
<van-col span="15">{{
timestampToTimes(item.startTime)
}}</van-col>
</van-row>
</van-col>
<van-col span="7">
<van-row
:style="{
color:
active == 0
? '#f79648'
: active == 1
? '#0069e5'
: '#03b615'
}"
>
{{ item.state }}
</van-row>
<van-row>
<van-button
type="info"
size="mini"
@click="lookdetail(index, item)"
>执行情况</van-button
>
</van-row>
</van-col>
</van-row>
</van-cell-group>
<div <div
class="con-list" style="
@touchmove="showIndex = null" width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
"
v-if="messageList['length'] == 0"
>
暂无数据
</div>
</div>
<!-- 暂无数据 -->
<!-- {{messageList}} -->
</van-tab>
</van-tabs>
<!-- 长按显示遮罩层 -->
<van-popup
v-model="showIndex"
closeable
round
position="right"
:style="{ width: '90%', height: '100%' }"
>
<van-cell-group title="执行情况">
<!-- 内容列表 -->
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in buildingList"
:key="index"
> >
<van-cell-group <van-row gutter="">
inset <van-col span="16">{{ item.buildingName }}</van-col>
v-for="(item, index) in messageList" <van-col
:key="index" span="8"
@click="touchstart(index, item)" :style="{
> color:
<div style="font-size: 0.45rem;padding: 5px 0;">{{item.title}}</div> item.status == 'wait'
? '#F79648'
: item.status == 'finish'
? '#03B615'
: '#FF041D'
}"
>{{
item.status == "wait"
? "待评估"
: item.status == "finish"
? "已完成"
: "已退回"
}}</van-col
>
</van-row>
<van-row gutter=""> <van-row>
<van-col span="17"> <van-col span="18">
<van-row gutter=""> <van-row gutter="">
<van-col span="9">发起时间:</van-col> <van-col span="8">创 建 人:</van-col>
<van-col span="15">{{ item.time}}</van-col> <van-col span="16">{{ item.createUserName }}</van-col>
</van-row> </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'}">
{{ item.state==1?'●未执行':'●已执行' }}
</van-col>
</van-row>
<!-- <van-row gutter=""> <van-row gutter="">
<van-col span="7">风险源:</van-col> <van-col span="8">处理人员:</van-col>
<van-col span="17">{{ item.riskSource }}</van-col> <van-col span="16">{{ item.workUserNames }}</van-col>
</van-row> --> </van-row>
<!-- 长按显示遮罩层 --> <van-row gutter="">
<van-overlay :show="showIndex == index"> <van-col span="8">发起时间:</van-col>
<div class="wrapper" @click.stop="showIndex = null"> <van-col span="16"
<van-button round type="primary" @click="goDetail(item)" >{{ timestampToTimes(item.startTime) }}
</van-col>
>详情</van-button </van-row>
> </van-col>
<van-button round type="info" @click="goConfirm(item)" v-show="active==0" <van-col span="6">
>确认</van-button <van-row>
<van-button
type="info"
size="mini"
@click="todotail(index, item)"
>查看详情</van-button
> >
</div> </van-row></van-col
</van-overlay> >
</van-cell-group> </van-row>
<div </van-cell-group>
<div
style=" style="
width: 100%; width: 100%;
text-align: center; text-align: center;
...@@ -83,164 +153,191 @@ ...@@ -83,164 +153,191 @@
position: fixed; position: fixed;
top: 30%; top: 30%;
" "
v-if="messageList['length']==0" v-if="buildingList['length'] == 0"
> >
暂无数据 暂无数据
</div> </div>
</div> </div>
<!-- 暂无数据 --> </van-cell-group>
<!-- {{messageList}} --> </van-popup>
</div>
<!-- </van-tab> </template>
</van-tabs> -->
<script>
</div> import LHeader from "@/components/header.vue";
</template> import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
<script> export default {
import LHeader from "@/components/header.vue"; name: "risk-execution",
import { getFun, postFun } from "@/service/table.js"; components: {
// import { postriskConList } from "@/service/risk"; LHeader
export default { },
name:'risk-confirme', data() {
components: { return {
LHeader, text: "执行情况管理",
searchValue: "",
isHaveNews: false,
messageList: [
{
title: "XX项目评估任务单",
time: "2022-12-12",
name: "Mr.周",
state: 1
}
],
Loop: "", // 定时器
showIndex: false, // 是否显示遮罩层,
active: 0,
tabs: [
{
title: "待执行",
key: "running"
},
{
title: "已执行",
key: "finish"
},
{
title: "已退回",
key: "return"
}
],
buildingList: []
};
},
created() {
this.postList(0);
},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
}, },
data() { handadd() {
return { this.$router.push({
text: "风险评估", name: "riskAdd",
searchValue: "", params: {
isHaveNews: false, title: "新增"
messageList: [ }
{ });
title:'XX项目评估任务单',
time:'2022-12-12',
name:'Mr.周',
state:1
}
],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 0,
tabs: [
{
title: "未执行",
api: "/riskConfirm/list",
},
{
title: "已执行",
api: "/riskConfirm/finishList",
},
],
};
}, },
created() { postList(name, title) {
// this.postList();s this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
let url = `/risk/plan/task/list?status=running`;
if (name == 0) {
url = `/risk/plan/task/list?status=running`;
} else if (name == 1) {
url = `/risk/plan/task/list?status=finish`;
} else {
url = `/risk/plan/task/list?status=return`;
}
getFun(url)
.then(res => {
this.$toast.clear();
this.messageList = res.data || res.rows;
// 判断有无数据返回
if (this.messageList.length == 0) {
this.isHaveNews = true;
}
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
}, },
methods: {
handadd(){ onSearch(val) {
this.$router.push({ this.postList(this.searchValue);
name: "riskAdd", },
params: { //执行情况
title:'新增' lookdetail(index, item) {
}, this.showIndex = true;
}) console.log(item);
}, getFun("/risk/plan/allocation/building/list/" + item.id)
postList(select = "") { .then(res => {
this.$toast.loading({ console.log(res);
message: "加载中...", this.buildingList = res.data;
forbidClick: true, })
loadingType: "spinner", .catch(() => {
duration: 0, this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
}); });
let formdata = new FormData(); },
formdata.append("select", select); //查看详情
postFun(this.tabs[this.active]['api'], formdata) todotail(index, item) {
.then((res) => { console.log(item);
this.$toast.clear(); this.$router.push({
this.messageList =res.data||res.rows; name: "riskTaskList",
// 判断有无数据返回 params: {
if (this.messageList.length == 0) { id: item.id,
this.isHaveNews = true; buildingId: item.buildingId
}
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
onSearch(val) {
this.postList(this.searchValue);
},
touchstart(index, item) {
if (this.showIndex != null) {
this.showIndex = null;
return;
} }
this.showIndex = index; });
}, sessionStorage.setItem("planId", item.id);
sessionStorage.setItem("buildingId", item.buildingId);
// 详情 this.showIndex = false;
goDetail(data) {
this.$router.push({
name: "risk-big-detail",
params: {
id: data.businessId||data.id,
},
});
this.showIndex = null;
},
// 确认
goConfirm(data) {
this.$router.push({
name: "risk-affirm",
params: {
data: data,
},
});
this.showIndex = null;
},
}, },
};
</script> // 详情
<style lang="less" scoped> goDetail(data) {
this.$router.push({
#app { name: "riskBigDetail",
font-family: ""; params: {
color: #2c3e50; id: data.businessId || data.id
}
.con-list {
padding: 0;
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 {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
} }
} });
this.showIndex = false;
},
// 确认
goConfirm(data) {
this.$router.push({
name: "risk-affirm",
params: {
data: data
}
});
this.showIndex = false;
} }
} }
/deep/.van-tab__pane{ };
min-height: 8rem; </script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50;
}
.con-list {
padding: 0;
background-color: #f0f1f5;
position: relative;
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
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;
}
} }
</style> }
\ No newline at end of file .wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
<template>
<!-- 提交 -->
<div>
<van-sticky offset-top="0">
<LHeader :text="text"></LHeader>
</van-sticky>
<div style="margin-bottom: 1.5rem;">
<van-grid :column-num="3" style="background-color: #fff;">
<van-grid-item >
<div>发起人员:</div>
<div>{{messageList.createUserName}}</div>
</van-grid-item>
<van-grid-item >
<div>项目负责人:</div>
<div>{{messageList.leaderUserName}}</div>
</van-grid-item>
<van-grid-item >
<div>任务状态:</div>
<div>{{messageList.status}}</div>
</van-grid-item>
<van-grid-item >
<div>开始时间:</div>
<div>{{timestampToTimes(messageList.startTime)||messageList.startTime}}</div>
</van-grid-item>
<van-grid-item >
<div>结束时间:</div>
<div>{{timestampToTimes(messageList.endTime)||messageList.endTime}}</div>
</van-grid-item>
</van-grid>
<van-steps :active="active" active-icon="success" active-color="#38f" style="margin: 0.26rem 0;">
<van-step>任务发起</van-step>
<van-step>风险评估</van-step>
<van-step>评估审核</van-step>
<van-step>项目完成</van-step>
</van-steps>
<van-tabs v-model="active" color="#2980f7"
animated
:sticky="true"
offset-top="2.93rem">
<van-tab title="任务详情">
<van-form
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<van-field
readonly
name="createUserName"
:value="form.createUserName"
label="创建人员"
input-align="right"
:rules="[{ required: true, message: '创建人员不能为空' }]"
/>
<van-field
readonly
name="createDeptName"
:value="form.createDeptName"
label="创建单位"
input-align="right"
:rules="[{ required: true, message: '创建单位不能为空' }]"
/>
<van-field
readonly
name="projectName"
:value="form.projectName"
label="任务名称"
input-align="right"
:rules="[{ required: true, message: '任务名称不能为空' }]"
/>
<van-field
readonly
name="projectName"
:value="form.projectName"
label="关联项目"
input-align="right"
:rules="[{ required: true, message: '关联项目不能为空' }]"
/>
<van-field
readonly
name="buildingNames"
:value="form.buildingNames"
label="评估楼栋"
input-align="right"
:rules="[{ required: true, message: '评估楼栋不能为空' }]"
/>
<van-field
readonly
name="leaderUserName"
:value="form.leaderUserName"
label="项目负责人"
input-align="right"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
<van-field
v-model="form.startTime"
readonly
name="location"
label="任务开始时间"
input-align="right"
:formatter="()=>{
return timestampToTimes(form.startTime)
}"
:rules="[{ required: true, message: '任务开始时间不能为空' }]"
/>
<van-field
v-model="form.endTime"
readonly
name="location"
label="任务结束时间"
:formatter="()=>{
return timestampToTimes(form.endTime)
}"
input-align="right"
:rules="[{ required: true, message: '任务结束时间不能为空' }]"
/>
<van-field
clickable
name="workUserNames"
:value="form.workUserNames"
label="执行人员"
input-align="right"
:rules="[{ required: true, message: '执行人员不能为空' }]"
/>
</van-form>
</van-tab>
<van-tab title="风险清单">
</van-tab>
<van-tab title="审核记录">
<div class="journal-wrap">
<van-cell-group inset >
<van-steps direction="vertical" :active="99999" v-if="riskLogList.length>0">
<van-step v-for="(item, index) in riskLogList" :key="index">
<div class="step-wrap">
<van-row>
<van-col span="24"><div class="info-title">{{timestampToTimes(item.startTime)}}</div></van-col>
</van-row>
<van-row>
<van-col span="7"
><span class="field-title">操作人:</span></van-col
>
<van-col span="17">{{item.approvalUserName}}</van-col>
</van-row>
<van-row>
<van-col span="7"
><span class="field-title">审批结果:</span></van-col
>
<van-col span="17">{{item.taskName}}</van-col>
</van-row>
<van-row>
<van-col span="7"
><span class="field-title">岗位:</span></van-col
>
<van-col span="17">{{item.taskResult}}</van-col>
</van-row>
<!-- <van-row>
<van-col span="7"
><span class="field-title">结果:</span></van-col
>
<van-col span="17">{{LogType(item.taskResult)}}</van-col>
</van-row> -->
</div>
</van-step>
</van-steps>
<div style="text-align: center;" v-if="riskLogList.length == 0">暂无数据</div>
</van-cell-group>
</div>
</van-tab>
<van-tab title="风险评估报告">
<div style="height: 1.5rem;
background-color: #fff;
border-bottom: 1px solid #97999a;
display: flex;
justify-content: space-between;
line-height: 1.5rem;
">
<div><van-icon name="column" size="26px"/></div>
<div style="flex-grow:1;line-height: 0.6rem">
<div>风险评估报告.PDF</div>
<div>2019-3-21 10:23 100KB</div>
</div>
<div>
<van-icon name="arrow" size="26px"/>
</div>
</div>
<div style="height: 1.5rem;
background-color: #fff;
border-bottom: 1px solid #97999a;
display: flex;
justify-content: space-between;
line-height: 1.5rem;
">
<div><van-icon name="column" size="26px"/></div>
<div style="flex-grow:1;line-height: 0.6rem">
<div>风险评估报告.PDF</div>
<div>2019-3-21 10:23 100KB</div>
</div>
<div>
<van-icon name="arrow" size="26px"/>
</div>
</div>
</van-tab>
</van-tabs>
</div>
<div style="display: flex;
justify-content: space-around;
background-color: #fff;
border-top: 1px solid #e3e3e3;
height: 1.5rem;
width: 100%;
text-align: center;
position: fixed;
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>
<!-- <div style="color: #ec808d;font-size: 14px;font-weight: 600;">
<div style="font-size: 22px;"><van-icon name="success" /></div>
<div>任务完成</div>
</div> -->
</div>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime, generateId } from "@/utils/format";
import { getFun, postFun } from "@/service/table.js";
export default {
name:'riskBigDetail',
components: {
LHeader,
},
data() {
return {
text: "任务单",
searchValue: "",
isHaveNews: false,
messageList: [],
riskLogList:[],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 0,
form:{
},
tabs: [
],
};
},
created() {
var planId=this.$route.params.id || sessionStorage.getItem('planId')
this.postList(planId);
},
methods: {
timestampToTimes(time){
return timestampToTime(new Date(time),"DT2", true)
},
performTasks(){
this.$router.push({
name: "riskInherent",
params: {
id:this.messageList.id
},
})
},
handadd(){
this.$router.push({
name: "riskAdd",
params: {
title:'新增'
},
})
},
postList(id) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun(`/risk/plan/details/${id}`)
.then((res) => {
this.$toast.clear();
this.messageList =res.data||res.rows;
this.form= this.messageList.detailsDto
this.riskLogList= this.messageList.approveListDtos
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
onSearch(val) {
this.postList(this.searchValue);
},
touchstart(index, item) {
if (this.showIndex != null) {
this.showIndex = null;
return;
}
this.showIndex = index;
},
// 详情
goDetail(data) {
this.$router.push({
name: "riskBigDetail",
params: {
id: data.businessId||data.id,
},
});
sessionStorage.setItem('planId',data.id)
this.showIndex = null;
},
// 确认
goConfirm(data) {
this.$router.push({
name: "risk-affirm",
params: {
data: data,
},
});
this.showIndex = null;
},
},
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50
}
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem;
font-weight: none;
padding-left: 0.16rem;
margin: 0.186667rem 0;
color: #7f7f7f;
}
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
}
.journal-wrap {
position: relative;
}
.supervise-wrap {
position: relative;
}
.info-title {
color: #2980f7;
font-weight: none;
}
.field-title {
color: black;
font-weight: none;
}
.more {
position: absolute;
bottom: 0.32rem;
right: 15px;
color: #2a80f7;
font-weight: none;
z-index: 99;
}
</style>
\ No newline at end of file
<template>
<!-- 提交 -->
<div>
<van-sticky offset-top="0">
<LHeader :text="text"></LHeader>
</van-sticky>
<van-tabs
v-model="active"
@change="postList"
color="#2980f7"
animated
:sticky="true"
>
<van-tab v-for="item in tabs" :key="item.key" :title="item.title">
<!-- 内容列表 -->
<div class="con-list">
<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.leaderUserName }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">发起时间:</van-col>
<van-col span="15">{{
timestampToTimes(item.startTime)
}}</van-col>
</van-row>
</van-col>
<van-col span="7">
<van-row
:style="{
color:
active == 0
? '#f79648'
: active == 1
? '#0069e5'
: '#03b615'
}"
>
{{ item.state }}
</van-row>
<van-row>
<van-button
type="info"
size="mini"
@click="lookdetail(index, item)"
>执行情况</van-button
>
</van-row>
</van-col>
</van-row>
</van-cell-group>
<div
style="
width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
"
v-if="messageList['length'] == 0"
>
暂无数据
</div>
</div>
<!-- 暂无数据 -->
<!-- {{messageList}} -->
</van-tab>
</van-tabs>
<!-- 长按显示遮罩层 -->
<van-popup
v-model="showIndex"
closeable
round
position="right"
:style="{ width: '90%', height: '100%' }"
>
<van-cell-group title="执行情况">
<!-- 内容列表 -->
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in buildingList"
:key="index"
>
<van-row gutter="">
<van-col span="16">{{ item.buildingName }}</van-col>
<van-col
span="8"
:style="{
color:
item.status == 'wait'
? '#F79648'
: item.status == 'finish'
? '#03B615'
: '#FF041D'
}"
>{{
item.status == "wait"
? "待评估"
: item.status == "finish"
? "已完成"
: "已退回"
}}</van-col
>
</van-row>
<van-row>
<van-col span="18">
<van-row gutter="">
<van-col span="8">创 建 人:</van-col>
<van-col span="16">{{ item.createUserName }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="8">处理人员:</van-col>
<van-col span="16">{{ item.workUserNames }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="8">发起时间:</van-col>
<van-col span="16"
>{{ timestampToTimes(item.startTime) }}
</van-col>
</van-row>
</van-col>
<van-col span="6">
<van-row>
<van-button
type="info"
size="mini"
@click="todetail(index, item)"
>查看详情</van-button
>
</van-row></van-col
>
</van-row>
</van-cell-group>
<div
style="
width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
"
v-if="buildingList['length'] == 0"
>
暂无数据
</div>
</div>
</van-cell-group>
</van-popup>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
export default {
name: "risk-execution",
components: {
LHeader
},
data() {
return {
text: "执行情况管理",
searchValue: "",
isHaveNews: false,
messageList: [
{
title: "XX项目评估任务单",
time: "2022-12-12",
name: "Mr.周",
state: 1
}
],
Loop: "", // 定时器
showIndex: false, // 是否显示遮罩层,
active: 0,
// 状态 wait 待评估,running 执行中,finish 已完成
tabs: [
{
title: "待评估",
key: "wait"
},
{
title: "执行中",
key: "running"
},
{
title: "已完成",
key: "finish"
}
],
buildingList: []
};
},
created() {
this.postList(0);
},
methods: {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
handadd() {
this.$router.push({
name: "riskAdd",
params: {
title: "新增"
}
});
},
postList(name, title) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
let url = `/risk/plan/allocation/list?status=wait`;
if (name == 0) {
url = `/risk/plan/allocation/list?status=wait`;
} else if (name == 1) {
url = `/risk/plan/allocation/list?status=running`;
} else {
url = `/risk/plan/allocation/list?status=finish`;
}
getFun(url)
.then(res => {
this.$toast.clear();
this.messageList = res.data || res.rows;
// 判断有无数据返回
if (this.messageList.length == 0) {
this.isHaveNews = true;
}
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
onSearch(val) {
this.postList(this.searchValue);
},
//执行情况
lookdetail(index, item) {
this.showIndex = true;
console.log(item);
getFun("/risk/plan/allocation/building/list/" + item.id)
.then(res => {
console.log(res);
this.buildingList = res.data;
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
//查看详情
todetail(index, item) {
this.$router.push({
name: "riskTaskList",
params: {
id: item.id,
buildingId: item.buildingId
}
});
sessionStorage.setItem("planId", item.id);
sessionStorage.setItem("buildingId", item.buildingId);
this.showIndex = false;;
},
// 详情
goDetail(data) {
this.$router.push({
name: "risk-big-detail",
params: {
id: data.businessId || data.id
}
});
this.showIndex = false;
},
// 确认
goConfirm(data) {
this.$router.push({
name: "risk-affirm",
params: {
data: data
}
});
this.showIndex = false;
}
}
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50;
}
.con-list {
padding: 0;
background-color: #f0f1f5;
position: relative;
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
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;
}
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
...@@ -122,7 +122,11 @@ ...@@ -122,7 +122,11 @@
active: 0, active: 0,
tabs: [ tabs: [
{ {
title: "未执行", title: "待执行",
api: "/risk/plan/create/list?status=wait",
},
{
title: "执行中",
api: "/risk/plan/create/list?status=running", api: "/risk/plan/create/list?status=running",
}, },
{ {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<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
...@@ -120,6 +120,7 @@ export default { ...@@ -120,6 +120,7 @@ export default {
this.getMenuList() this.getMenuList()
}, },
methods: { methods: {
//查询角色菜单列表 //查询角色菜单列表
getMenuList(){ getMenuList(){
getFun('/menu/roleMenuTreeselect').then((res) => { getFun('/menu/roleMenuTreeselect').then((res) => {
...@@ -137,22 +138,44 @@ export default { ...@@ -137,22 +138,44 @@ export default {
console.log('err==>>',err) console.log('err==>>',err)
}) })
}, },
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>
...@@ -167,20 +190,23 @@ export default { ...@@ -167,20 +190,23 @@ 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;
}
} }
.notice-swipe { .notice-swipe {
height: 40px; height: 40px;
......
...@@ -9,7 +9,8 @@ module.exports = { ...@@ -9,7 +9,8 @@ module.exports = {
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/', //这里是杨帆的地址
// target: 'http://192.168.10.137:8080/', //这里是昊哥的地址
target: 'http://192.168.10.36:8080/', //这里是后台的地址 target: 'http://192.168.10.36:8080/', //这里是后台的地址
ws: true, ws: true,
changOrigin: true, //允许跨域 changOrigin: true, //允许跨域
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment