Commit f5f4a238 authored by yf's avatar yf

固定风险修改界面

parent d7a95d2f
......@@ -3,56 +3,176 @@
<LHeader :text="text"></LHeader>
<van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
<van-tab title="固有风险信息">
<van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit">
<van-form
@submit="onSubmit"
:scroll-to-error="true"
: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%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险信息
</div>
<van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" />
<van-field readonly required name="projectId" :value="form.projectName" label="所属项目"
placeholder="请输入" />
<van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物"
placeholder="请输入" />
<van-field
readonly
required
name="userName"
:value="form.userName"
label="评估人"
placeholder="请输入"
/>
<van-field
readonly
required
name="projectId"
:value="form.projectId"
label="所属项目"
placeholder="请输入"
/>
<van-field
readonly
required
name="buildingName"
:value="form.buildingName"
label="所属建筑物"
placeholder="请输入 "
/>
<van-field required clickable name="floorName" :value="form.floorName" label="所属楼层" placeholder="请选择"
@click="seletFloor('floor')" :rules="[{ required: true, message: '所属楼层不能为空' }]" />
<van-field
required
clickable
name="floorName"
:value="form.floorName"
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="name" v-model="form.name" label="风险源名称" placeholder="请输入"
:rules="[{ required: true, message: '风险源名称不能为空' }]" @click="seletSource()" />
<van-field readonly required name="name" v-model="form.name" label="风险点类型" placeholder="请输入"
:rules="[{ required: true, message: '风险点类型不能为空' }]" @click="seletSource()" />
<van-field readonly required name="name" v-model="form.name" label="安全警示标志" placeholder="请输入"
:rules="[{ required: true, message: '安全警示标志不能为空' }]" @click="seletSource()" />
<div style="display: flex;">
<van-field
readonly
required
name="roomName"
:value="form.roomName"
label="所属房间"
placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
icon="plus"
type="info"
native-type="button"
@click="tjfjClcik"
/>
</div>
<van-field v-model="form.factor" required name="factor" label="风险因素" placeholder="请选择"
@click="seletFactor('factor')" :rules="[{ required: true, message: '风险因素不能为空' }]" />
<van-field
required
clickable
name="name"
v-model="form.name"
label="危险源名称"
placeholder="请输入"
:rules="[{ required: true, message: '危险源名称不能为空' }]"
/>
<!-- 单选 -->
<van-field
required
clickable
name="pointType"
v-model="form.pointType"
label="风险点类型"
placeholder="请选择"
@click="selectData('pointType', true)"
:rules="[{ required: true, message: '风险点类型不能为空' }]"
/>
<!-- 多选 -->
<van-field
v-model="form.safetyWarningSigns"
readonly
required
name="safetyWarningSigns"
label="安全警示标志"
placeholder="请选择"
@click="selectData('safetyWarningSigns', false)"
:rules="[{ required: true, message: '安全警示标志不能为空' }]"
/>
<van-field
v-model="form.factor"
readonly
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="selectData('factor', false)"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field v-model="form.type" required name="type" label="准事故类型" placeholder="请选择"
@click="seletType('type')" :rules="[{ required: true, message: '准事故类型不能为空' }]" />
<van-field
readonly
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="selectData('type', false)"
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择"
@click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" />
<van-field
readonly
v-model="form.level"
required
name="level"
label="风险等级"
placeholder="请选择"
@click="seletGrade"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<!-- <van-field readonly v-model="form.level" required name="level" label="风险等级" placeholder="请选择"
@click="seletGrade('level')" :rules="[{ required: true, message: '风险等级不能为空' }]" /> -->
<van-field required name="presenceLocation" v-model="form.presenceLocation" label="存在部位"
placeholder="请输入" :rules="[{ required: true, message: '存在部位不能为空' }]" />
<van-field
required
name="presenceLocation"
v-model="form.presenceLocation"
label="存在部位"
placeholder="请输入"
:rules="[{ required: true, message: '存在部位不能为空' }]"
/>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
风险源图片
</div>
<van-field name="hdPicture1" label="风险源图片">
<template #input>
<van-uploader @delete="deleteFile(...arguments, 'uploaderImg')" multiple :max-count="5"
upload-text="最多上传五个" v-model="uploaderImg">
<van-uploader
@delete="deleteFile(...arguments, 'uploaderImg')"
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
>
<template slot="default">
<div style="
<!-- 11111111111 -->
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -60,8 +180,13 @@
align-items: center;
justify-content: center;
flex-direction: column;
">
<img src="@/assets/upload/pic.png" alt="" style="width: 0.64rem; height: 0.64rem" />
"
>
<img
src="@/assets/upload/pic.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
......@@ -69,19 +194,38 @@
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
技术措施
</div>
<van-field v-model="form.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1"
autosize placeholder="请输入" />
<van-field name="measuresProjectFile[]" label=" ">
<van-field
v-model="form.measuresProject"
name="measuresProject"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresProjectFile[]" label="上传附件">
<template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresProjectFile"
accept="file" result-type="file" @delete="deleteFile(...arguments, 'measuresProjectFile')">
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresProjectFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresProjectFile')"
>
<template slot="default">
<div style="
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -89,42 +233,81 @@
align-items: center;
justify-content: center;
flex-direction: column;
">
<img src="@/assets/upload/file.png" alt=""
style="width: 0.64rem; height: 0.64rem" />
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<!-- <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
应采取的管控措施
</div>
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="" type="textarea"
rows="3" autosize placeholder="请输入" /> -->
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应采取的管控措施
</div>
<van-field v-model="form.takenMeasuresAdministration" name="takenMeasuresAdministration" label=""
type="textarea" rows="3" autosize placeholder="请输入" />
<van-field required v-model="form.measuresDeptId" name="measuresDeptId" label="管控责任单位 " type="textarea"
rows="1" autosize placeholder="请输入" />
<van-field required v-model="form.measuresUserId" name="measuresUserId" label="管控责任人 " type="textarea"
rows="1" autosize placeholder="请输入" />
<van-field name="measuresAdministrationFile[]" label=" ">
<van-field
v-model="form.takenMeasuresAdministration"
name="takenMeasuresAdministration"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field
required
v-model="form.measuresDeptName"
name="measuresDeptName"
label="管控责任单位 "
type="textarea"
rows="1"
autosize
@click="
{
measuresDept = true;
}
"
placeholder="请选择"
/>
<van-field
required
v-model="form.measuresUserName"
name="measuresUserName"
label="管控责任人 "
type="textarea"
rows="1"
autosize
@click="getUserData('measuresUser')"
placeholder="请选择"
/>
<van-field name="measuresAdministrationFile[]" label="上传附件">
<template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresAdministrationFile"
accept="file" result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')">
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresAdministrationFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresAdministrationFile')"
>
<template slot="default">
<div style="
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -132,9 +315,13 @@
align-items: center;
justify-content: center;
flex-direction: column;
">
<img src="@/assets/upload/file.png" alt=""
style="width: 0.64rem; height: 0.64rem" />
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
......@@ -142,59 +329,83 @@
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
危险源管理
</div>
<van-field required v-model="form.hazardSourceName" name="hazardSourceName" label="危险源名称 "
type="textarea" rows="1" autosize placeholder="请输入" />
<van-field required v-model="form.majorHazardSource" name="majorHazardSource" label="是否存在重大危险源 "
type="textarea" rows="1" autosize placeholder="请输入" />
<van-field required v-model="form.measuresUserId" name="measuresUserId" label="重大危险源描述" type="textarea"
rows="3" autosize placeholder="请输入" />
<van-field v-model="form.majorHazardSourceDescription" name="majorHazardSourceDescription" label="应急措施"
type="textarea" rows="1" autosize placeholder="请输入" />
<van-field name="measuresEmergencyFile[]" label=" ">
<van-field
v-model="form.hazardSourceName"
name="hazardSourceName"
label="危险源名称 "
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field name="majorHazardSource" label="是否存在重大危险源">
<template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile"
accept="file" result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')">
<template slot="default">
<div style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
">
<img src="@/assets/upload/file.png" alt=""
style="width: 0.64rem; height: 0.64rem" />
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
<van-switch v-model="form.majorHazardSource" size="20" />
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
重大危险源描述
</div>
<van-field
v-model="form.majorHazardSourceDescription"
name="majorHazardSourceDescription"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
应急措施
</div>
<van-field v-model="form.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea"
rows="1" autosize placeholder="请输入" />
<van-field name="measuresEmergencyFile[]" label=" ">
<van-field
v-model="form.measuresEmergency"
name="measuresEmergency"
label=""
type="textarea"
rows="3"
autosize
placeholder="请输入"
/>
<van-field name="measuresEmergencyFile[]" label="上传附件">
<template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="measuresEmergencyFile"
accept="file" result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')">
<van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="measuresEmergencyFile"
accept="file"
result-type="file"
@delete="deleteFile(...arguments, 'measuresEmergencyFile')"
>
<template slot="default">
<!-- 11111111111 -->
<div style="
<div
style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -202,35 +413,226 @@
align-items: center;
justify-content: center;
flex-direction: column;
">
<img src="@/assets/upload/file.png" alt=""
style="width: 0.64rem; height: 0.64rem" />
"
>
<img
src="@/assets/upload/file.png"
alt=""
style="width: 0.64rem; height: 0.64rem"
/>
<span class="van-uploader__upload-text">最多上传五个</span>
</div>
</template>
</van-uploader>
</template>
</van-field>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;">
<img src="@/assets/accidentIcon/bookmark.svg" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" />
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
>
<img
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
/>
参考依据
</div>
<van-field readonly required clickable name="trouble" :value="form.trouble" label="参考依据"
placeholder="请选择" @click="showTrouble = true" :rules="[{ required: true, message: '事故类型不能为空' }]" />
<van-field
readonly
required
clickable
name="referenceBasis"
:value="form.referenceBasis"
label="参考依据"
placeholder="请选择"
@click="selectData('referenceBasis', false)"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
<van-dialog
v-model="showGradeDialog"
title="风险评测配置"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="dialogContain">
<van-collapse v-model="activeNames">
<van-collapse-item title="风险模型" name="1">
<van-field
readonly
required
name="level"
label="当前风险模型"
placeholder="LS风险矩阵评估模型"
/>
</van-collapse-item>
<van-collapse-item title="风险模型配置" name="2">
<van-popover
v-model="showPopover"
trigger="click"
:actions="columnsRiskRank"
@select="onSelect"
>
<template #reference>
<van-field
v-model="possibleValue"
readonly
required
name="level"
label="发生的可能性"
placeholder="请选择"
/>
</template>
</van-popover>
<van-popover
v-model="showPopoveSetRank"
trigger="click"
:actions="columnsSetRank"
@select="onSelectSetRank"
>
<template #reference>
<van-field
v-model="severityValue"
readonly
required
name="level"
label="后果严重程度"
placeholder="请选择"
/>
</template>
</van-popover>
</van-collapse-item>
</van-collapse>
<van-row type="flex" justify="center" style="margin-top:10px">
<van-col span="6"
><van-button
size="small"
plain
native-type="button"
type="info"
@click="showGradeDialog = false"
>取消</van-button
></van-col
>
<van-col span="6"
><van-button
size="small"
type="info"
native-type="button"
@click="goResultPage"
>开始测评</van-button
></van-col
>
</van-row>
</div>
</van-dialog>
<!-- 楼层弹出层 -->
<van-popup
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
show-toolbar
value-key="dictValue"
:columns="columnsData"
@confirm="saveSelect"
@cancel="showSelect = false"
/>
</van-popup>
<!-- 复选弹出层 -->
<van-popup
v-model="showCheckSelect"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
></selectList>
</van-popup>
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup>
<!-- 管控责任单位 -->
<van-popup
v-model="measuresDept"
position="bottom"
:style="{ height: '100%' }"
>
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
>
<button
type="button"
class="van-picker__cancel"
v-on:click="
{
form.measuresDeptId = 0;
projectDept = false;
}
"
>
取消</button
><button
type="button"
class="van-picker__confirm"
@click="closeDept"
>
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit">提交</van-button>
<van-button round block type="info" native-type="submit"
>提交</van-button
>
</div>
</van-form>
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel">取消</van-button>
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
</div>
</van-tab>
<van-tab title="现状风险">
<div class="con-list" @touchmove="showIndex = null">
<van-cell-group inset v-for="(item, index) in messageList" :key="index">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
>
<div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.title }}
</div>
......@@ -243,54 +645,42 @@
</van-row>
<van-row gutter="">
<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 gutter="">
<van-col span="9">风险描述:</van-col>
<van-col span="15">{{ item.describe }}</van-col>
</van-row>
</van-col>
<van-col span="7" :style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }">
<van-col
span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
{{ "●待审批" }}
</van-col>
</van-row>
</van-cell-group>
<div style="
<div
style="
width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
" v-if="messageList['length'] == 0">
"
v-if="messageList['length'] == 0"
>
暂无数据
</div>
</div>
</van-tab>
</van-tabs>
<van-popup v-model="showTrouble" position="bottom">
<van-picker show-toolbar value-key="name" :columns="columnsTrouble" @confirm="onConTrouble"
@cancel="showTrouble = false" />
</van-popup>
<!-- 楼层弹出层 -->
<van-popup v-model="ShowfloorList" position="bottom" :style="{ height: '100%' }">
<selectFloor :listdata="floorSource" @closeSlect="closeSlectfloor" @saveSlect="saveSlectfloor"></selectFloor>
</van-popup>
<!-- 风险源弹出层 -->
<van-popup v-model="ShowSelectList" position="bottom" :style="{ height: '100%' }">
<selectList :listdata="columnsTrouble" @closeSlect="closeSlect" @saveSlect="saveSlect"></selectList>
</van-popup>
<!-- 准事故类型 -->
<van-popup v-model="ShowAccidentList" position="bottom" :style="{ height: '100%' }">
<selectList :listdata="columnsAccident" @closeSlect="closeSlectAccident" @saveSlect="saveSlectAccident">
</selectList>
</van-popup>
<van-popup v-model="showSource" position="bottom">
<van-picker show-toolbar value-key="name" :columns="columnsSource" @confirm="onConSource"
@cancel="showSource = false" />
</van-popup>
<div v-if="active != 0" style="display: flex;
<div
v-if="active != 0"
style="display: flex;
justify-content: space-around;
background-color: #fff;
border-top: 1px solid #e3e3e3;
......@@ -298,60 +688,170 @@
width: 100%;
text-align: center;
position: fixed;
bottom: 0;">
<div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;">
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>
<!-- 风险源 -->
<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
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
show-toolbar
value-key="dictValue"
:columns="columnsData"
@confirm="saveSelect"
@cancel="showSelect = false"
/>
</van-popup>
<!-- 复选弹出层 -->
<van-popup
v-model="showCheckSelect"
position="bottom"
:style="{ height: '100%' }"
>
<selectList
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
></selectList>
</van-popup>
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
value-key="name"
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup>
<!-- 管控责任单位 -->
<van-popup
v-model="measuresDept"
position="bottom"
:style="{ height: '100%' }"
>
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
>
<button
type="button"
class="van-picker__cancel"
v-on:click="
{
form.measuresDeptId = 0;
projectDept = false;
}
"
>
取消</button
><button type="button" class="van-picker__confirm" @click="closeDept">
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import selectDept from "@/components/selectDept/index.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
import { timestampToTime, generateId } from "@/utils/format";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
// import {
// getFormList,
// postHdSource,
// postHdType,
// postHdPeople,
// postReAdd,
// postriskConiCause,
// postRiskShowMeasures,
// } from "@/service/risk";
export default {
name: "addCurrent",
components: {
LHeader,
selectDept,
SelectList,
selectFloor
},
activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一
this.getList();
this.$bus.$on("riskLevelBus", res => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
if (res) {
this.riskRank = res;
} else {
this.setRank = "";
}
// 销毁一下监听事件 不然会越加越多
this.$bus.$off("riskLevelBus");
});
},
beforeRouteEnter(to, from, next) {
if (from.name == "riskInherent") {
sessionStorage.setItem("inherenForm", "");
sessionStorage.setItem("level", "");
}
next();
},
beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") {
if (to.name != "riskInherent") {
sessionStorage.setItem("inherenForm", JSON.stringify(this.form));
}
next();
},
data() {
return {
measuresDept: false,
ShowfloorList: false,
floorSource: [],
dataName: "",
// 单选
showSelect: false,
columnsData: [],
// 多选
showCheckSelect: false,
columnsCheckData: [],
ShowAccidentList: false,
ShowSelectList: false,
columnsAccident: [],
inherentId: "",
text: "编辑固有风险",
showPopoveSetRank: false,
activeNames: ["1"],
showPopover: false,
showGradeDialog: false,
taskId: "",
text: "添加固有风险",
id: "",
isTimely: 1,
active: 0,
......@@ -366,20 +866,20 @@ export default {
factor: "", //风险因素
showFactor: false,
columnsFactor: [],
messageList: [],
source: "", //风险源
userPrefix: "", //风险源
showSource: false,
columnsSource: [],
trouble: "", //事故类型
columnsAccident: [],
showTrouble: false,
columnsTrouble: [],
setRank: "", //风险定级
showSetRank: false,
columnsSetRank: ["矩阵式定级", "其他定级方式"],
columnsSetRank: ["矩阵式定级", "其他定级方式"], //严重程度
riskRank: "", // 风险等级
showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"],
columnsRiskRank: [], //发生可能性
showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
......@@ -405,9 +905,15 @@ export default {
measuresEmergencyFile: [], //管理措施图片
urgent: "", //应急措施文字
urgentImg: [], //应急措施图片
buildingIds: "", // 退回原因
returnCause: "", // 退回原因
isShowreturnCause: false,
visiableSource: false
possibleValue: "",
possibleScore: 0,
severityValue: "",
severityScore: 0,
messageList: [],
inherentId: 0,
buildingIds: ""
};
},
created() {
......@@ -418,9 +924,12 @@ export default {
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postReturnEcho();
}
this.getFloor();
this.getFXYS();
this.getZSGLX();
},
mounted() {
if (sessionStorage.getItem("inherenForm") != "") {
this.form = JSON.parse(sessionStorage.getItem("inherenForm"));
this.form.level = sessionStorage.getItem("level");
}
},
methods: {
timestampToTimes(time) {
......@@ -436,34 +945,173 @@ export default {
this.getList();
}
},
getFloor() {
getFun(`/risk/plan/floor/list/${this.buildingIds}`)
// 请求表单数据
getList() {
getFun(`/risk/plan/existing/list/${this.inherentId}`)
.then(res => {
// this.$toast.clear();
// this.showSource = true;
let newArr = this.renameKeyInTree(res.data, "name", "text");
this.floorSource = newArr;
console.log(
"%c [ res ]-670",
"font-size:13px; background:pink; color:#bf2c9f;",
res
);
this.messageList = res.data;
})
.catch(() => {
// this.$toast.fail("加载失败,请稍后再试");
this.$toast.fail("加载失败,请稍后再试");
});
},
getFXYS() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
// 请求详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then(res => {
this.form = res.data;
this.getFloor();
this.uploaderImg = (res.data.pictureFile || []).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresProjectFile = (res.data.measuresProjectFile || []).map(
item => {
return {
...item,
url: item.filePath
};
}
);
this.measuresAdministrationFile = (
res.data.measuresAdministrationFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresEmergencyFile = (
res.data.measuresEmergencyFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
})
.catch(() => {
this.$toast.clear();
});
},
// 项目负责人
onConTrouble(value) {
if (!value) {
this.showTrouble = false;
return;
}
this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
console.log("this.form :>> ", this.form);
this.showTrouble = false;
},
getUserData(e) {
this.userPrefix = e;
if (!this.form.measuresDeptId) {
this.$toast({
title: "提示",
message: "请选择管控责任单位!"
});
return false;
}
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/user/list/${this.form.measuresDeptId}`).then(res => {
if (res.code == 200) {
this.columnsTrouble = res.data;
// 对数据进行赋值
this.$toast.clear();
this.showTrouble = true;
} else {
this.$toast.clear();
}
});
},
changeDept(id, name) {
console.log(id);
this.form.measuresDeptId = id;
this.form.measuresDeptName = name;
},
closeDept() {
console.log(this.form.deptId);
this.measuresDept = false;
},
selectData(dataName, isSinge) {
this.dataName = dataName;
getFun(
`/risk/plan/dict/data/list?dictType=risk_plan_${dataName.toLowerCase()}`
)
.then(res => {
if (isSinge) {
this.columnsData = res.data;
this.showSelect = true;
} else {
this.columnsCheckData = res.data;
this.showCheckSelect = true;
}
})
.catch(() => {
// this.$toast.fail("加载失败,请稍后再试");
this.$toast.fail("加载失败,请稍后再试");
});
},
saveSelect(data) {
this.form[this.dataName] = data.dictValue;
this.showSelect = false;
},
saveCheckSelect(data) {
this.form[this.dataName] = data.join(",");
this.showCheckSelect = false;
},
renameKeyInTree(data, oldKey, newKey) {
let arr = data.map(item => {
const newItem = { ...item };
if (item.hasOwnProperty(oldKey)) {
newItem[newKey] = newItem[oldKey];
delete newItem[oldKey];
}
if (newItem.children && newItem.children.length > 0) {
newItem.children = this.renameKeyInTree(
newItem.children,
oldKey,
newKey
);
}
return newItem;
});
return arr;
},
getZSGLX() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
getFloor() {
console.log(this.form, 111);
getFun(`/risk/plan/floor/list/${this.form.buildingId}`)
.then(res => {
this.columnsAccident = res.data;
// this.$toast.clear();
// this.showSource = true;
let newArr = this.renameKeyInTree(res.data, "name", "text");
this.floorSource = newArr;
})
.catch(() => {
// this.$toast.fail("加载失败,请稍后再试");
this.$toast.fail("加载失败,请稍后再试");
});
},
seletFloor(name) {
......@@ -485,56 +1133,66 @@ export default {
this.columnsSource = res.data;
})
.catch(() => {
// this.$toast.fail("加载失败,请稍后再试");
this.$toast.fail("加载失败,请稍后再试");
});
},
//风险因素
seletFactor(name) {
// this.showTrouble = true;
this.riskName = name;
this.ShowSelectList = true;
//风险等级
seletGrade(name) {
this.getGradeList("possibility");
this.getGradeList("severity");
this.showGradeDialog = true;
},
//准事故类型
seletType(name) {
// this.showTrouble = true;
this.riskName = name;
this.ShowAccidentList = true;
//风险模型配置
getGradeList(type) {
// possibility 可能性 severity 严重性
getFun(`/risk/plan/matrix/${type}/list`).then(res => {
let arr = [];
res.data.forEach(item => {
arr.push({
text: item.title,
type: item.type,
sort: item.sort,
score: item.score
});
});
if (type === "possibility") {
this.columnsRiskRank = arr;
} else {
this.columnsSetRank = arr;
}
});
},
seletGrade(name) {
this.showTrouble = true;
this.riskName = name;
this.columnsTrouble = [
{
name: "重大风险"
closeSlectfloor() {
this.ShowfloorList = false;
},
{
name: "较大风险"
saveSlectfloor(data) {
this.form.floorId = data.id;
this.form.floorName = data.text;
this.ShowfloorList = false;
},
{
name: "一般风险"
onSelect(data) {
this.possibleValue = data.text;
this.possibleScore = data.score;
},
{
name: "较小风险"
}
];
onSelectSetRank(data) {
this.severityValue = data.text;
this.severityScore = data.score;
},
performTasks() {
//开始测评
goResultPage() {
this.$router.push({
name: "addPresent",
name: "resultPage",
params: {
id: this.inherentId,
// planId:this.planId
buildingId: this.buildingId,
planId: this.inherentId,
floorId: this.form.floorId,
floorName: this.form.floorName,
projectName: this.form.projectName,
projectId: this.form.projectId,
roomName: this.form.roomName,
roomId: this.form.roomId
score: this.severityScore * this.possibleScore
}
});
},
performTasks() {
console.log("1233213 :>> ", 1233213);
},
// 点击预览图
clickPre(e) {
console.log(e);
......@@ -562,9 +1220,47 @@ export default {
}
}
},
jsonToFormData(config) {
const formData = new FormData();
//循环传入的值转换formData
Object.keys(config).forEach(key => {
formData.append(key, config[key]);
});
return formData;
},
onSubmit(values) {
let url = "/riskMain/add";
postReAdd(url, formdata)
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson = this.jsonToFormData(this.form);
let url = "/risk/plan/inherent";
values.hdPicture1.forEach(item => {
if (item.file) {
formDataJson.append("pictureFile[]", item.file);
} else {
formDataJson.append("pictureFile[]", item.fileId);
}
});
values["measuresProjectFile[]"].forEach(item => {
if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file);
} else {
formDataJson.append("measuresProjectFile[]", item.fileId);
}
});
values["measuresEmergencyFile[]"].forEach(item => {
if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
} else {
formDataJson.append("measuresEmergencyFile[]", item.fileId);
}
});
values["measuresAdministrationFile[]"].forEach(item => {
if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file);
} else {
formDataJson.append("measuresAdministrationFile[]", item.fileId);
}
});
postFun(url, formDataJson)
.then(res => {
this.$toast.clear();
this.$toast.success({
......@@ -580,69 +1276,6 @@ export default {
this.$toast.clear();
},
// 请求表单数据
getList() {
getFun(`/risk/plan/existing/list/${this.inherentId}`)
.then(res => {
console.log(
"%c [ res ]-670",
"font-size:13px; background:pink; color:#bf2c9f;",
res
);
this.messageList = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
// 请求已退回详情数据
postReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then(res => {
this.form = res.data;
this.uploaderImg = (res.data.pictureFile || []).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresProjectFile = (res.data.measuresProjectFile || []).map(
item => {
return {
...item,
url: item.filePath
};
}
);
this.measuresAdministrationFile = (
res.data.measuresAdministrationFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
this.measuresEmergencyFile = (
res.data.measuresEmergencyFile || []
).map(item => {
return {
...item,
url: item.filePath
};
});
})
.catch(() => {
this.$toast.clear();
});
},
// 所属项目
onConProjectName(value) {
if (!value) {
......@@ -670,7 +1303,7 @@ export default {
}
);
},
// 风险源
// 房间
onConSource(value) {
if (!value) {
this.showSource = false;
......@@ -680,27 +1313,6 @@ export default {
this.form[this.userPrefix + "Name"] = value.name;
this.showSource = false;
},
seletSource() {
this.visiableSource = true;
},
//从风险清单列表导入
importFromList() { },
//输入风险源名称
nameByselfInput() { },
//取消风险弹窗
cancleSource() {
this.visiableSource = false;
},
// 事故类型
onConTrouble(value) {
if (!value) {
this.showTrouble = false;
return;
}
this.form[this.riskName] = value.name;
this.showTrouble = false;
},
// 风险定级
onConSetRank(value) {
this.showSetRank = false;
......@@ -751,6 +1363,16 @@ export default {
this.mainDutyPeopLe = value.userName;
this.showMainDutyPeopLe = false;
},
//添加房间
tjfjClcik() {
this.$router.push({
name: "riskView",
params: {
floorId: this.form.floorId,
isView: false
}
});
},
cancel() {
this.$router.go(-1);
......@@ -768,45 +1390,14 @@ export default {
this.projectDirector = e[0].loginName;
this.projectDirectorName = e[0].userName;
this.show = false;
},
closeSlectfloor() {
this.ShowfloorList = false;
},
saveSlectfloor(data) {
this.form.floorId = data.id;
this.form.floorName = data.text;
this.ShowfloorList = false;
},
closeSlect() {
this.ShowSelectList = false;
},
saveSlect(data) {
this.form.factor = data.join(",");
this.ShowSelectList = false;
},
closeSlectAccident() {
this.ShowAccidentList = false;
},
saveSlectAccident(data) {
this.form.type = data.join(",");
this.ShowAccidentList = false;
},
},
watch: {
// setRank(newVal, oldVal) {
// if (newVal == "其他定级方式") {
// this.showSetRankMode = true;
// } else {
// this.showSetRankMode = false;
// }
// },
}
},
watch: {}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
.con-list {
margin-bottom: 1.5rem;
padding: 0;
background-color: #f0f1f5;
......@@ -840,10 +1431,10 @@ export default {
}
}
.btns {
margin: 10px 10px 0 10px;
border: none;
border-bottom: 1px solid #efefef;
color: #2980f7;
.dialogContain {
width: 100%;
height: 100%;
padding: 10px;
box-sizing: border-box;
}
</style>
......@@ -627,7 +627,6 @@ import LHeader from "@/components/header.vue";
import selectDept from "@/components/selectDept/index.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
......
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