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: [],
// 专门处理列表缓存的页面,这些页面缓存逻辑与其他缓存不一样去详情返回列表缓存,但是进入列表必须刷新,如何有需要缓存的列表请放到这里来。 // 专门处理列表缓存的页面,这些页面缓存逻辑与其他缓存不一样去详情返回列表缓存,但是进入列表必须刷新,如何有需要缓存的列表请放到这里来。
......
...@@ -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"
@change="tabList"
color="#2980f7"
animated
>
<van-tab title="固有风险信息"> <van-tab title="固有风险信息">
<van-form <van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit">
@submit="onSubmit" <div
:scroll-to-error="true" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
:show-error="false" <img src="@/assets/accidentIcon/bookmark.svg" alt=""
validate-trigger="onSubmit" style="position: relative;top: 32%;transform: translateY(-50%);">
>
<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 <van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" />
readonly <van-field readonly required name="projectId" :value="form.projectId" label="所属项目" placeholder="请输入" />
required <van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物"
name="userName" placeholder="请输入" />
: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=""
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;
...@@ -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"
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
<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=""
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"
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"
multiple accept="file" 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;
...@@ -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=""
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
<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=""
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"
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"
:max-count="5" @delete="deleteFile(...arguments, 'measuresAdministrationFile')">
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;
...@@ -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=""
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
<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=""
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"
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"
multiple accept="file" result-type="file"
:max-count="5" @delete="deleteFile(...arguments, 'measuresEmergencyFile')">
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;
...@@ -289,23 +150,19 @@ ...@@ -289,23 +150,19 @@
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=""
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
<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=""
style="position: relative;top: 32%;transform: translateY(-50%);">
参考依据 参考依据
</div> </div>
<!-- <van-field <!-- <van-field
...@@ -322,34 +179,23 @@ ...@@ -322,34 +179,23 @@
<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>
</van-tab> </van-tab>
<van-tab title="现状风险"> <van-tab title="现状风险">
<div <div class="con-list" @touchmove="showIndex = null">
class="con-list" <van-cell-group inset v-for="(item, index) in messageList" :key="index">
@touchmove="showIndex = null" <div style="font-size: 0.45rem;padding: 5px 0;">{{ item.title }}</div>
>
<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-row gutter="">
<van-col span="17"> <van-col span="17">
<van-row gutter=""> <van-row gutter="">
<van-col span="9">风险系数:</van-col> <van-col span="9">风险系数:</van-col>
<van-col span="15">{{ item.time}}</van-col> <van-col span="15">{{ item.time }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">创建时间:</van-col> <van-col span="9">创建时间:</van-col>
...@@ -360,21 +206,18 @@ ...@@ -360,21 +206,18 @@
<van-col span="15">{{ item.name }}</van-col> <van-col span="15">{{ item.name }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
<van-col 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-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>
...@@ -382,27 +225,15 @@ ...@@ -382,27 +225,15 @@
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<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 <div v-if="active != 0" style="display: flex;
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;
...@@ -416,6 +247,12 @@ ...@@ -416,6 +247,12 @@
<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>
...@@ -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,6 +604,22 @@ export default { ...@@ -766,6 +604,22 @@ export default {
this.form[this.userPrefix + "Name"] = value.name; this.form[this.userPrefix + "Name"] = value.name;
this.showSource = false; this.showSource = false;
}, },
seletSource() {
this.visiableSource = true
},
//从风险清单列表导入
importFromList(){
},
//输入风险源名称
nameByselfInput(){
},
//取消风险弹窗
cancleSource(){
this.visiableSource = false
},
// 事故类型 // 事故类型
onConTrouble(value) { onConTrouble(value) {
if (!value) { if (!value) {
...@@ -833,15 +687,15 @@ export default { ...@@ -833,15 +687,15 @@ export default {
// 选择作业人 // 选择作业人
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,6 +716,7 @@ export default { ...@@ -862,6 +716,7 @@ 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;
...@@ -872,13 +727,16 @@ export default { ...@@ -872,13 +727,16 @@ export default {
box-shadow: 0px 0px 10px 2px #f3f3f3; box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%; width: 90%;
margin: 0.4rem auto; margin: 0.4rem auto;
.van-row { .van-row {
font-size: 0.4rem; font-size: 0.4rem;
line-height: 0.8rem; line-height: 0.8rem;
margin-bottom: 0; margin-bottom: 0;
} }
.van-overlay { .van-overlay {
position: absolute; position: absolute;
.wrapper { .wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -887,5 +745,11 @@ export default { ...@@ -887,5 +745,11 @@ export default {
} }
} }
} }
} }
.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 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 <van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" />
readonly <van-field readonly required name="projectId" :value="form.projectId" label="所属项目" placeholder="请输入" />
required <van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物" placeholder="请输入" />
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,23 +143,17 @@ ...@@ -283,23 +143,17 @@
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
...@@ -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,
...@@ -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 = [
}, // {
seletType(name){ // name: '人的因素',
this.showTrouble=true // },
this.riskName=name // {
this.columnsTrouble=[ // name: '物的因素',
{ // },
name:'物体打击', // {
}, // name: '环境因素',
{ // },
name:'车辆伤害', // {
}, // name: '管理因素',
{ // },
name:'起重伤害', // ]
}, },
{ //准事故类型
name:'机械伤害', seletType(name) {
}, this.showTrouble = true
] this.riskName = name
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
.then(res => {
const arr = []
res.data.forEach(item=>{
arr.push({name:item.dictLabel})
})
this.columnsTrouble = arr
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
// 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);
}, },
// 点击预览图 // 点击预览图
...@@ -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);
} }
}); });
...@@ -790,15 +654,15 @@ export default { ...@@ -790,15 +654,15 @@ export default {
// 选择作业人 // 选择作业人
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,6 +682,7 @@ export default { ...@@ -818,6 +682,7 @@ 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;
...@@ -828,13 +693,16 @@ export default { ...@@ -828,13 +693,16 @@ export default {
box-shadow: 0px 0px 10px 2px #f3f3f3; box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%; width: 90%;
margin: 0.4rem auto; margin: 0.4rem auto;
.van-row { .van-row {
font-size: 0.4rem; font-size: 0.4rem;
line-height: 0.8rem; line-height: 0.8rem;
margin-bottom: 0; margin-bottom: 0;
} }
.van-overlay { .van-overlay {
position: absolute; position: absolute;
.wrapper { .wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -843,5 +711,5 @@ export default { ...@@ -843,5 +711,5 @@ export default {
} }
} }
} }
} }
</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
......
...@@ -5,33 +5,40 @@ ...@@ -5,33 +5,40 @@
<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"
color="#2980f7"
animated
>
<van-tab v-for="(item) in riskLogList" :title="item.name" :name="item.id" :key="item.id">
<van-dropdown-menu z-index="1000"> <van-dropdown-menu z-index="1000">
<van-dropdown-item v-model="value1" @change="changeFloor" :options="option1" get-container="body"/> <van-dropdown-item
<van-dropdown-item v-model="value2" @change="changeRoom" :options="option2" get-container="body"/> 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-menu> </van-dropdown-menu>
<div <div class="con-list">
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">{{
timestampToTimes(item.createTime)
}}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">楼层:</van-col> <van-col span="9">楼层:</van-col>
...@@ -42,14 +49,16 @@ ...@@ -42,14 +49,16 @@
<van-col span="15">{{ item.roomName }}</van-col> <van-col span="15">{{ item.roomName }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}"> <van-col
{{ '●待审批'}} span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
{{ "●待审批" }}
</van-col> </van-col>
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<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"
...@@ -66,7 +75,7 @@ ...@@ -66,7 +75,7 @@
position: fixed; position: fixed;
top: 30%; top: 30%;
" "
v-if="messageList['length']==0" v-if="messageList['length'] == 0"
> >
暂无数据 暂无数据
</div> </div>
...@@ -74,7 +83,8 @@ ...@@ -74,7 +83,8 @@
</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,164 +92,174 @@ ...@@ -82,164 +92,174 @@
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
@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
@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> </div>
</template> </template>
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format"; import { timestampToTime, generateId } from "@/utils/format";
export default { export default {
name:'risk-confirme', name: "risk-confirme",
components: { components: {
LHeader, LHeader
}, },
data() { data() {
return { return {
text: "固有风险列表", text: "固有风险列表",
searchValue: "", searchValue: "",
planId: 0, planId: 0,
buildingId: 0,
buildingName: "",
value1: 1, value1: 1,
value2: 1, value2: 1,
option1: [], option1: [],
option2: [], option2: [],
isHaveNews: false, isHaveNews: false,
messageList: [], messageList: [],
riskLogList:[], riskLogList: [],
Loop: "", // 定时器 Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层, showIndex: null, // 是否显示遮罩层,
active: 1, active: 1,
form:{ form: {},
tabs: []
},
tabs: [
],
}; };
}, },
created() { created() {
this.planId=this.$route.params.id || sessionStorage.getItem('planId') this.planId = this.$route.params.id || sessionStorage.getItem("planId");
this.buildingId = this.$route.params.buildingId;
this.buildingName = this.$route.params.buildingName;
console.log(this.buildingId, this.buildingName);
this.getRiskList(this.planId); this.getRiskList(this.planId);
// this.postList(); // this.postList();
}, },
methods: { methods: {
timestampToTimes(time){ timestampToTimes(time) {
return timestampToTime(new Date(time),"DT2", true) return timestampToTime(new Date(time), "DT2", true);
}, },
changeData(arr){ changeData(arr) {
var arrList=[] var arrList = [];
arr.forEach(item=>{ arr.forEach(item => {
arrList.push( arrList.push({
{ text: item.name,
text:item.name, value: item.id
value:item.id });
} });
) return arrList;
})
return arrList
}, },
performTasks(){ //新增固有风险
performTasks() {
this.$router.push({ this.$router.push({
name: "addInherent", name: "addInherent",
params: { params: {
id:this.active, id: this.active,
planId:this.planId planId: this.planId
}
});
}, },
}) //任务执行结束
endTasks() {
//toDo
}, },
handadd(){ handadd() {
this.$router.push({ this.$router.push({
name: "riskAdd", name: "riskAdd",
params: { params: {
title:'新增' 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) { floorList(id) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getFun(`/risk/plan/floor/list/${id}`).then((res) => { getFun(`/risk/plan/floor/list/${id}`)
this.option1=this.changeData(res.data) .then(res => {
resolve(res.data) this.option1 = this.changeData(res.data);
resolve(res.data);
}) })
.catch(() => { .catch(() => {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}) });
}, },
roomList(id) { roomList(id) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getFun(`/risk/plan/room/list/${id}`).then((res) => { getFun(`/risk/plan/room/list/${id}`)
this.option2=this.changeData(res.data) .then(res => {
resolve(res.data) this.option2 = this.changeData(res.data);
resolve(res.data);
}) })
.catch(() => { .catch(() => {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}) });
}, },
riskList(planId,buildingId,floorId,roomId) { riskList(planId, buildingId, floorId, roomId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var paramsJson={} var paramsJson = {};
if(floorId||roomId){ if (floorId || roomId) {
paramsJson={ paramsJson = {
floorId, floorId,
roomId roomId
};
} else {
paramsJson = {};
} }
}else{ getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`, paramsJson)
paramsJson={} .then(res => {
} this.messageList = res.data;
getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`,paramsJson).then((res) => { resolve(res.data);
this.messageList=res.data
resolve(res.data)
}) })
.catch(() => { .catch(() => {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}) });
}, },
async getRiskList(id){ async getRiskList(id) {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0
}); });
let building= await this.buildingList(id) let floor = await this.floorList(this.buildingId);
let floor= await this.floorList(building[0].id) let room = await this.roomList(floor[0].id);
let room= await this.roomList(floor[0].id) let risk = await this.riskList(id, this.buildingId);
let risk= await this.riskList(id,building[0].id)
this.$toast.clear(); this.$toast.clear();
}, },
async tabList(value){ async tabList(value) {
let floor= await this.floorList(value) let floor = await this.floorList(value);
let room= await this.roomList(floor[0].id) let room = await this.roomList(floor[0].id);
let risk= await this.riskList(this.planId,value) let risk = await this.riskList(this.planId, value);
}, },
async changeFloor(){ async changeFloor() {
let room= await this.roomList(this.value1) let room = await this.roomList(this.value1);
let risk= await this.riskList(this.planId,this.active,this.value1) let risk = await this.riskList(this.planId, this.active, this.value1);
}, },
async changeRoom(){ async changeRoom() {
let risk= await this.riskList(this.planId,this.active,this.value1,this.value2) let risk = await this.riskList(
this.planId,
this.active,
this.value1,
this.value2
);
}, },
onSearch(val) { onSearch(val) {
this.postList(this.searchValue); this.postList(this.searchValue);
...@@ -256,9 +276,9 @@ ...@@ -256,9 +276,9 @@
this.$router.push({ this.$router.push({
name: "addCurrent", name: "addCurrent",
params: { params: {
inherentId: data.businessId||data.id, inherentId: data.businessId || data.id,
buildingIds:this.active, buildingIds: this.active
}, }
}); });
this.showIndex = null; this.showIndex = null;
}, },
...@@ -267,31 +287,30 @@ ...@@ -267,31 +287,30 @@
this.$router.push({ this.$router.push({
name: "risk-affirm", name: "risk-affirm",
params: { params: {
data: data, data: data
}, }
}); });
this.showIndex = null; this.showIndex = null;
},
},
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50
} }
.cell-wrap {
position: relative;
} }
p { };
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50;
}
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem; font-size: 0.4rem;
font-weight: none; font-weight: none;
padding-left: 0.16rem; padding-left: 0.16rem;
margin: 0.186667rem 0; margin: 0.186667rem 0;
color: #7f7f7f; color: #7f7f7f;
} }
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
...@@ -301,30 +320,30 @@ ...@@ -301,30 +320,30 @@
margin-bottom: 0.133333rem; margin-bottom: 0.133333rem;
line-height: 0.64rem; line-height: 0.64rem;
} }
} }
.journal-wrap { .journal-wrap {
position: relative; position: relative;
} }
.supervise-wrap { .supervise-wrap {
position: relative; position: relative;
} }
.info-title { .info-title {
color: #2980f7; color: #2980f7;
font-weight: none; font-weight: none;
} }
.field-title { .field-title {
color: black; color: black;
font-weight: none; font-weight: none;
} }
.more { .more {
position: absolute; position: absolute;
bottom: 0.32rem; bottom: 0.32rem;
right: 15px; right: 15px;
color: #2a80f7; color: #2a80f7;
font-weight: none; font-weight: none;
z-index: 99; z-index: 99;
} }
.con-list { .con-list {
padding: 0; padding: 0;
min-height: 10rem; min-height: 10rem;
background-color: #f0f1f5; background-color: #f0f1f5;
...@@ -353,6 +372,5 @@ ...@@ -353,6 +372,5 @@
} }
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -6,37 +6,51 @@ ...@@ -6,37 +6,51 @@
</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"
...@@ -95,16 +109,17 @@ ...@@ -95,16 +109,17 @@
: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: '任务开始时间不能为空' }]"
/> />
...@@ -113,9 +128,11 @@ ...@@ -113,9 +128,11 @@
readonly readonly
name="location" name="location"
label="任务结束时间" label="任务结束时间"
:formatter="()=>{ :formatter="
return timestampToTimes(form.endTime) () => {
}" return timestampToTimes(form.endTime);
}
"
input-align="right" input-align="right"
:rules="[{ required: true, message: '任务结束时间不能为空' }]" :rules="[{ required: true, message: '任务结束时间不能为空' }]"
/> />
...@@ -130,38 +147,41 @@ ...@@ -130,38 +147,41 @@
/> />
</van-form> </van-form>
</van-tab> </van-tab>
<van-tab title="风险清单"> <van-tab title="风险清单"> </van-tab>
</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
direction="vertical"
:active="99999"
v-if="riskLogList.length > 0"
>
<van-step v-for="(item, index) in riskLogList" :key="index"> <van-step v-for="(item, index) in riskLogList" :key="index">
<div class="step-wrap"> <div class="step-wrap">
<van-row> <van-row>
<van-col span="24" <van-col span="24"
><div class="info-title">{{timestampToTimes(item.startTime)}}</div></van-col ><div class="info-title">
{{ timestampToTimes(item.startTime) }}
</div></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.approvalUserName}}</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.taskName }}</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.taskResult }}</van-col>
</van-row> </van-row>
<!-- <van-row> <!-- <van-row>
<van-col span="7" <van-col span="7"
...@@ -172,47 +192,54 @@ ...@@ -172,47 +192,54 @@
</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">
暂无数据
</div>
</van-cell-group> </van-cell-group>
</div> </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><van-icon name="column" size="26px" /></div>
<div style="flex-grow:1;line-height: 0.6rem"> <div style="flex-grow:1;line-height: 0.6rem">
<div>风险评估报告.PDF</div> <div>风险评估报告.PDF</div>
<div>2019-3-21 10:23 100KB</div> <div>2019-3-21 10:23 100KB</div>
</div> </div>
<div> <div>
<van-icon name="arrow" size="26px"/> <van-icon name="arrow" size="26px" />
</div> </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><van-icon name="column" size="26px" /></div>
<div style="flex-grow:1;line-height: 0.6rem"> <div style="flex-grow:1;line-height: 0.6rem">
<div>风险评估报告.PDF</div> <div>风险评估报告.PDF</div>
<div>2019-3-21 10:23 100KB</div> <div>2019-3-21 10:23 100KB</div>
</div> </div>
<div> <div>
<van-icon name="arrow" size="26px"/> <van-icon name="arrow" size="26px" />
</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;
...@@ -220,27 +247,31 @@ ...@@ -220,27 +247,31 @@
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
@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 style="color: #ec808d;font-size: 14px;font-weight: 600;"> <!-- <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>
</div> </template>
</template>
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { timestampToTime, generateId } from "@/utils/format"; import { timestampToTime, generateId } from "@/utils/format";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
export default { export default {
name:'risk-confirme', name: "risk-confirme",
components: { components: {
LHeader, LHeader
}, },
data() { data() {
return { return {
...@@ -248,54 +279,58 @@ ...@@ -248,54 +279,58 @@
searchValue: "", searchValue: "",
isHaveNews: false, isHaveNews: false,
messageList: [], messageList: [],
riskLogList:[], riskLogList: [],
Loop: "", // 定时器 Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层, showIndex: null, // 是否显示遮罩层,
active: 0, active: 0,
form:{ form: {},
tabs: []
},
tabs: [
],
}; };
}, },
created() { created() {
var planId=this.$route.params.id || sessionStorage.getItem('planId') var planId = this.$route.params.id || sessionStorage.getItem("planId");
this.postList(planId); var buildingId =
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postList(planId, buildingId);
}, },
methods: { methods: {
timestampToTimes(time){ timestampToTimes(time) {
return timestampToTime(new Date(time),"DT2", true) return timestampToTime(new Date(time), "DT2", true);
}, },
performTasks(){ performTasks() {
this.$router.push({ this.$router.push({
name: "riskInherent", name: "riskInherent",
params: { params: {
id:this.messageList.id id: this.messageList.id,
}, buildingId: this.messageList.riskBuildingListDtos[0].buildingId,
}) buildingName: this.messageList.riskBuildingListDtos[0].buildingName
}
});
}, },
handadd(){ handadd() {
this.$router.push({ this.$router.push({
name: "riskAdd", name: "riskAdd",
params: { params: {
title:'新增' title: "新增"
}, }
}) });
}, },
postList(id) { postList(id, buildingId) {
console.log(buildingId, "123");
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0
}); });
getFun(`/risk/plan/details/${id}`) var url = `/risk/plan/details/${id}`;
.then((res) => { if (buildingId) url += "?buildingId=" + buildingId;
getFun(url)
.then(res => {
this.$toast.clear(); this.$toast.clear();
this.messageList =res.data||res.rows; this.messageList = res.data || res.rows;
this.form= this.messageList.detailsDto this.form = this.messageList.detailsDto;
this.riskLogList= this.messageList.approveListDtos this.riskLogList = this.messageList.approveListDtos;
}) })
.catch(() => { .catch(() => {
this.$toast.clear(); this.$toast.clear();
...@@ -318,8 +353,8 @@ ...@@ -318,8 +353,8 @@
this.$router.push({ this.$router.push({
name: "risk-big-detail", name: "risk-big-detail",
params: { params: {
id: data.businessId||data.id, id: data.businessId || data.id
}, }
}); });
this.showIndex = null; this.showIndex = null;
}, },
...@@ -328,31 +363,30 @@ ...@@ -328,31 +363,30 @@
this.$router.push({ this.$router.push({
name: "risk-affirm", name: "risk-affirm",
params: { params: {
data: data, data: data
}, }
}); });
this.showIndex = null; this.showIndex = null;
},
},
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50
} }
.cell-wrap {
position: relative;
} }
p { };
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50;
}
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem; font-size: 0.4rem;
font-weight: none; font-weight: none;
padding-left: 0.16rem; padding-left: 0.16rem;
margin: 0.186667rem 0; margin: 0.186667rem 0;
color: #7f7f7f; color: #7f7f7f;
} }
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
...@@ -362,28 +396,27 @@ ...@@ -362,28 +396,27 @@
margin-bottom: 0.133333rem; margin-bottom: 0.133333rem;
line-height: 0.64rem; line-height: 0.64rem;
} }
} }
.journal-wrap { .journal-wrap {
position: relative; position: relative;
} }
.supervise-wrap { .supervise-wrap {
position: relative; position: relative;
} }
.info-title { .info-title {
color: #2980f7; color: #2980f7;
font-weight: none; font-weight: none;
} }
.field-title { .field-title {
color: black; color: black;
font-weight: none; font-weight: none;
} }
.more { .more {
position: absolute; position: absolute;
bottom: 0.32rem; bottom: 0.32rem;
right: 15px; right: 15px;
color: #2a80f7; color: #2a80f7;
font-weight: none; font-weight: none;
z-index: 99; z-index: 99;
} }
</style> </style>
\ No newline at end of file
...@@ -4,76 +4,146 @@ ...@@ -4,76 +4,146 @@
<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="searchValue"
show-action
placeholder="请输入搜索内容"
@search="onSearch"
>
<template #action>
<div @click="onSearch">搜索</div>
</template>
</van-search>
</van-sticky>
<!-- <van-tabs
v-model="active" v-model="active"
@change=" @change="postList"
postList(searchValue);
showIndex = null;
"
color="#2980f7" color="#2980f7"
animated animated
:sticky="true" :sticky="true"
offset-top="2.93rem"
> >
<van-tab v-for="(item, key) in tabs" :key="key" :title="item.title"> --> <van-tab v-for="item in tabs" :key="item.key" :title="item.title">
<!-- 内容列表 --> <!-- 内容列表 -->
<div <div class="con-list">
class="con-list"
@touchmove="showIndex = null"
>
<van-cell-group <van-cell-group
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@click="touchstart(index, item)"
> >
<div style="font-size: 0.45rem;padding: 5px 0;">{{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">{{ item.time}}</van-col> <van-col span="15">{{ item.leaderUserName }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">处理人员:</van-col> <van-col span="9">发起时间:</van-col>
<van-col span="15">{{ item.name }}</van-col> <van-col span="15">{{
timestampToTimes(item.startTime)
}}</van-col>
</van-row> </van-row>
</van-col> </van-col>
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}"> <van-col span="7">
{{ item.state==1?'●未执行':'●已执行' }} <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-col>
</van-row> </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 gutter=""> <van-row>
<van-col span="7">风险源:</van-col> <van-col span="18">
<van-col span="17">{{ item.riskSource }}</van-col> <van-row gutter="">
</van-row> --> <van-col span="8">创 建 人:</van-col>
<van-col span="16">{{ item.createUserName }}</van-col>
</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">{{ item.workUserNames }}</van-col>
<van-button round type="primary" @click="goDetail(item)" </van-row>
>详情</van-button <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="todotail(index, item)"
>查看详情</van-button
> >
<van-button round type="info" @click="goConfirm(item)" v-show="active==0" </van-row></van-col
>确认</van-button
> >
</div> </van-row>
</van-overlay>
</van-cell-group> </van-cell-group>
<div <div
style=" style="
...@@ -83,82 +153,92 @@ ...@@ -83,82 +153,92 @@
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>
<!-- </van-tab>
</van-tabs> -->
</div> </div>
</template> </template>
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
// import { postriskConList } from "@/service/risk"; import { timestampToTime, generateId } from "@/utils/format";
export default { export default {
name:'risk-confirme', name: "risk-execution",
components: { components: {
LHeader, LHeader
}, },
data() { data() {
return { return {
text: "风险评估", text: "执行情况管理",
searchValue: "", searchValue: "",
isHaveNews: false, isHaveNews: false,
messageList: [ messageList: [
{ {
title:'XX项目评估任务单', title: "XX项目评估任务单",
time:'2022-12-12', time: "2022-12-12",
name:'Mr.周', name: "Mr.周",
state:1 state: 1
} }
], ],
Loop: "", // 定时器 Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层, showIndex: false, // 是否显示遮罩层,
active: 0, active: 0,
tabs: [ tabs: [
{ {
title: "执行", title: "执行",
api: "/riskConfirm/list", key: "running"
}, },
{ {
title: "已执行", title: "已执行",
api: "/riskConfirm/finishList", key: "finish"
}, },
{
title: "已退回",
key: "return"
}
], ],
buildingList: []
}; };
}, },
created() { created() {
// this.postList();s this.postList(0);
}, },
methods: { methods: {
handadd(){ timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
handadd() {
this.$router.push({ this.$router.push({
name: "riskAdd", name: "riskAdd",
params: { params: {
title:'新增' title: "新增"
}, }
}) });
}, },
postList(select = "") { postList(name, title) {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0
}); });
let formdata = new FormData(); let url = `/risk/plan/task/list?status=running`;
formdata.append("select", select); if (name == 0) {
postFun(this.tabs[this.active]['api'], formdata) url = `/risk/plan/task/list?status=running`;
.then((res) => { } 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.$toast.clear();
this.messageList =res.data||res.rows; this.messageList = res.data || res.rows;
// 判断有无数据返回 // 判断有无数据返回
if (this.messageList.length == 0) { if (this.messageList.length == 0) {
this.isHaveNews = true; this.isHaveNews = true;
...@@ -173,74 +253,91 @@ ...@@ -173,74 +253,91 @@
onSearch(val) { onSearch(val) {
this.postList(this.searchValue); this.postList(this.searchValue);
}, },
touchstart(index, item) { //执行情况
if (this.showIndex != null) { lookdetail(index, item) {
this.showIndex = null; this.showIndex = true;
return; 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("加载失败,请稍后再试");
});
},
//查看详情
todotail(index, item) {
console.log(item);
this.$router.push({
name: "riskTaskList",
params: {
id: item.id,
buildingId: item.buildingId
} }
this.showIndex = index; });
sessionStorage.setItem("planId", item.id);
sessionStorage.setItem("buildingId", item.buildingId);
this.showIndex = false;
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
this.$router.push({ this.$router.push({
name: "risk-big-detail", name: "riskBigDetail",
params: { params: {
id: data.businessId||data.id, id: data.businessId || data.id
}, }
}); });
this.showIndex = null; this.showIndex = false;
}, },
// 确认 // 确认
goConfirm(data) { goConfirm(data) {
this.$router.push({ this.$router.push({
name: "risk-affirm", name: "risk-affirm",
params: { params: {
data: data, data: data
}, }
}); });
this.showIndex = null; this.showIndex = false;
}, }
}, }
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
#app {
#app {
font-family: ""; font-family: "";
color: #2c3e50; color: #2c3e50;
} }
.con-list {
.con-list {
padding: 0; padding: 0;
background-color: #f0f1f5; background-color: #f0f1f5;
position: relative;
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 0.26667rem; margin-bottom: 0.26667rem;
padding: 0.25rem; padding: 0.25rem;
font-size: 0.4rem; font-size: 0.4rem;
position: relative;
border-radius: 4%; border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3; box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%; width: 90%;
margin: 0.4rem auto; margin: 0.4rem auto;
.van-row { .van-row {
font-size: 0.4rem; font-size: 0.4rem;
line-height: 0.8rem; line-height: 0.8rem;
margin-bottom: 0; margin-bottom: 0;
} }
.van-overlay { }
position: absolute; }
.wrapper {
.wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: center;
height: 100%; height: 100%;
} }
} </style>
}
}
/deep/.van-tab__pane{
min-height: 8rem;
}
</style>
\ No newline at end of file
<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,18 +138,40 @@ export default { ...@@ -137,18 +138,40 @@ 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 = {}
}
});
}, },
createdClick(){ onSearch() {
},
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);
} }
} }
...@@ -167,16 +190,19 @@ export default { ...@@ -167,16 +190,19 @@ 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 { /deep/ .van-grid-item__content--center {
// padding-left: 0px; // padding-left: 0px;
// padding-right: 0px; // padding-right: 0px;
padding: 0.22667rem 0px; padding: 0.22667rem 0px;
} }
/deep/ .van-icon__image { /deep/ .van-icon__image {
width: auto; width: auto;
height: 1rem; height: 1rem;
......
...@@ -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