Commit 14b930e3 authored by wei's avatar wei

edit

parent d85fa855
......@@ -3,143 +3,53 @@
<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.projectName" 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="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
v-model="form.factor"
required
name="factor"
label="风险因素"
placeholder="请选择"
@click="seletFactor('factor')"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-field v-model="form.factor" required name="factor" label="风险因素" placeholder="请选择"
@click="seletFactor('factor')" :rules="[{ required: true, message: '风险因素不能为空' }]" />
<van-field
v-model="form.type"
required
name="type"
label="准事故类型"
placeholder="请选择"
@click="seletType('type')"
: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.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('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">
<!-- 11111111111 -->
<div
style="
<div style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -147,13 +57,8 @@
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>
......@@ -161,39 +66,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.measuresProject"
name="measuresProject"
label="技术措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field v-model="form.measuresProject" name="measuresProject" label="技术措施" type="textarea" rows="1"
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">
<!-- 11111111111 -->
<div
style="
<div style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -201,13 +87,9 @@
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>
......@@ -215,39 +97,21 @@
</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.measuresAdministration"
name="measuresAdministration"
label="管理措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field v-model="form.measuresAdministration" name="measuresAdministration" label="管理措施"
type="textarea" rows="1" autosize 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">
<!-- 11111111111 -->
<div
style="
<div style="
width: 2.13333rem;
height: 2.13333rem;
background: #f7f8fa;
......@@ -255,13 +119,9 @@
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>
......@@ -269,39 +129,21 @@
</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.measuresEmergency"
name="measuresEmergency"
label="应急措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field v-model="form.measuresEmergency" name="measuresEmergency" label="应急措施" type="textarea"
rows="1" 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;
......@@ -309,13 +151,9 @@
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>
......@@ -323,13 +161,9 @@
</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
......@@ -345,24 +179,16 @@
/> -->
<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>
......@@ -382,51 +208,47 @@
<van-col span="15">{{ item.name }}</van-col>
</van-row>
</van-col>
<van-col
span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
<van-col 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-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-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;
......@@ -434,36 +256,27 @@
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-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>
</template>
<script>
import LHeader from "@/components/header.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { getFun, postFun } from "@/service/table.js";
// import {
......@@ -478,7 +291,9 @@ import { getFun, postFun } from "@/service/table.js";
export default {
name: "addCurrent",
components: {
LHeader
LHeader,
SelectList,
selectFloor
},
beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") {
......@@ -487,6 +302,11 @@ export default {
},
data() {
return {
ShowfloorList: false,
floorSource: [],
ShowAccidentList: false,
ShowSelectList: false,
columnsAccident: [],
inherentId: "",
text: "编辑固有风险",
id: "",
......@@ -555,7 +375,9 @@ export default {
this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.postReturnEcho();
}
// this.getList();
this.getFloor();
this.getFXYS();
this.getZSGLX();
},
methods: {
tabList(value) {
......@@ -568,24 +390,40 @@ export default {
this.getList();
}
},
seletFloor(name) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
getFloor() {
getFun(`/risk/plan/floor/list/${this.inherentId}`)
.then(res => {
// this.$toast.clear();
// this.showSource = true;
let newArr = this.renameKeyInTree(res.data, "name", "text");
this.floorSource = newArr;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
this.userPrefix = name;
getFun(`/risk/plan/floor/list/${this.buildingIds}`)
},
getFXYS() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
.then(res => {
this.$toast.clear();
this.showSource = true;
this.columnsSource = res.data;
this.columnsTrouble = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
getZSGLX() {
getFun(`/risk/plan/dict/data/list?dictType=risk_plan_type`)
.then(res => {
this.columnsAccident = res.data;
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
},
seletFloor(name) {
this.ShowfloorList = true;
this.userPrefix = name;
},
seletRoom(name) {
this.$toast.loading({
message: "加载中...",
......@@ -604,41 +442,17 @@ export default {
this.$toast.fail("加载失败,请稍后再试");
});
},
//风险因素
seletFactor(name) {
this.showTrouble = true;
// this.showTrouble = true;
this.riskName = name;
this.columnsTrouble = [
{
name: "人的因素"
},
{
name: "物的因素"
},
{
name: "环境因素"
},
{
name: "管理因素"
}
];
this.ShowSelectList = true;
},
//准事故类型
seletType(name) {
this.showTrouble = true;
// this.showTrouble = true;
this.riskName = name;
this.columnsTrouble = [
{
name: "物体打击"
},
{
name: "车辆伤害"
},
{
name: "起重伤害"
},
{
name: "机械伤害"
}
];
this.ShowAccidentList = true;
},
seletGrade(name) {
this.showTrouble = true;
......@@ -667,6 +481,7 @@ export default {
buildingId: this.buildingId,
planId: this.inherentId,
floorId: this.form.floorId,
floorName:this.form.floorName,
roomName: this.form.roomName,
roomId: this.form.roomId
}
......@@ -821,9 +636,9 @@ export default {
this.visiableSource = true;
},
//从风险清单列表导入
importFromList() {},
importFromList() { },
//输入风险源名称
nameByselfInput() {},
nameByselfInput() { },
//取消风险弹窗
cancleSource() {
this.visiableSource = false;
......@@ -905,7 +720,29 @@ 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) {
......@@ -954,6 +791,7 @@ export default {
}
}
}
.btns {
margin: 10px 10px 0 10px;
border: none;
......
......@@ -29,7 +29,7 @@
readonly
required
name="projectId"
:value="form.projectId"
:value="form.projectName"
label="所属项目"
placeholder="请输入"
/>
......
......@@ -29,7 +29,7 @@
readonly
required
name="projectId"
:value="form.projectId"
:value="form.projectName"
label="所属项目"
placeholder="请输入"
/>
......@@ -44,12 +44,11 @@
<van-field
required
clickable
readonly
name="floorName"
:value="form.floorName"
label="所属楼层"
placeholder="请选择"
@click="seletFloor('floor')"
:rules="[{ required: true, message: '所属楼层不能为空' }]"
/>
......@@ -60,7 +59,6 @@
:value="form.roomName"
label="所属房间"
placeholder="请输入"
@click="seletRoom('room')"
:rules="[{ required: true, message: '所属房间不能为空' }]"
/>
......@@ -616,6 +614,7 @@ export default {
this.form.deptName = userInfo.dept.deptName;
this.form.planId = this.$route.params.planId;
this.form.floorId = this.$route.params.floorId;
this.form.floorName = this.$route.params.floorName;
this.form.roomId = this.$route.params.roomId;
this.form.inherentId = this.$route.params.id;
this.form.roomName = this.$route.params.roomName;
......@@ -753,7 +752,7 @@ export default {
},
//开始测评
goResultPage() {
this.$router.push({
this.$router.replace({
name: "resultPage",
params: {
score: this.severityScore * this.possibleScore
......
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