Commit febf2825 authored by wei's avatar wei

add.

parent e1ca3828
......@@ -183,7 +183,7 @@
<van-popover v-model="showPopoveSetRank" trigger="click" :actions="columnsSetRank"
@select="onSelectSetRank">
<template #reference>
<van-field v-model="severityValue" readonly required name="level" label="发生的可能性"
<van-field v-model="severityValue" readonly required name="level" label="后果严重程度"
placeholder="请选择" />
</template>
</van-popover>
......
......@@ -86,7 +86,7 @@
:rules="[{ required: true, message: '准事故类型不能为空' }]"
/>
<van-field
<!-- <van-field
readonly
v-model="form.level"
required
......@@ -95,7 +95,9 @@
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
required
......@@ -295,7 +297,7 @@
</van-uploader>
</template>
</van-field>
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" >
<div v-if="this.$route.params.isView" 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>
......@@ -330,13 +332,42 @@
/>
</van-popup>
<div style="margin: 16px 16px 0">
<div style="margin: 16px 16px 0" v-if="this.$route.params.isView" >
<van-button round block type="info" native-type="submit"
>上报</van-button
>
</div>
</van-form>
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<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 type="info" @click="showGradeDialog = false">取消</van-button></van-col>
<van-col span="6"><van-button size="small" type="info" @click="goResultPage">开始测评</van-button></van-col>
</van-row>
</div>
</van-dialog>
<div v-if="this.$route.params.isView" style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
......@@ -393,6 +424,10 @@ export default {
},
data() {
return {
showPopoveSetRank: false,
activeNames: ["1"],
showPopover: false,
showGradeDialog: false,
taskId: "",
text: "添加现状风险",
id: "",
......@@ -459,6 +494,10 @@ export default {
urgentImg: [], //应急措施图片
returnCause: "", // 退回原因
isShowreturnCause: false,
possibleValue: "",
possibleScore:0,
severityValue: "",
severityScore:0,
};
},
created() {
......@@ -546,22 +585,42 @@ export default {
]
},
seletGrade(name){
this.showTrouble=true
this.riskName=name
this.columnsTrouble=[
{
name:'重大风险',
},
{
name:'较大风险',
},
{
name:'一般风险',
},
{
name:'较小风险',
},
]
this.getGradeList('possibility')
this.getGradeList('severity')
this.showGradeDialog = 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
}
})
},
onSelect(data) {
this.possibleValue = data.text
this.possibleScore = data.score
},
onSelectSetRank(data) {
this.severityValue = data.text
this.severityScore = data.score
},
//开始测评
goResultPage(){
this.$router.push({
name:'resultPage',
params:{
score:this.severityScore * this.possibleScore
}
})
},
performTasks(){
......
This diff is collapsed.
......@@ -4,13 +4,13 @@
<LHeader :text="text"></LHeader>
</van-sticky>
<div class="section">
<van-tabs v-model="activeName" color="#2980f7" animated>
<van-tabs v-model="activeName" color="#2980f7" animated @click="onClick">
<van-tab title="固有风险信息" name="a">
<TabDetail :InherentRisk="InherentRisk"/>
</van-tab>
<van-tab title="现状风险" name="b">
<div class="quolist">
<van-cell-group style="padding: 10px;box-sizing: border-box;background-color: #fff;margin: 8px;border-radius: 10px;" v-for="(item, index) in quoRiskList" :key="index">
<van-cell-group style="padding: 10px;box-sizing: border-box;background-color: #fff;margin: 8px;border-radius: 10px;" v-for="(item, index) in quoRiskList" :key="index" @click="goDetail(item)">
<div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.name }}
</div>
......@@ -61,6 +61,7 @@
<script type="text/ecmascript-6">
import LHeader from "@/components/header.vue";
import drawCanvas from '@/views/drawCanvas/riskView.vue'
import TabDetail from "./tabDetail.vue"
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime } from "@/utils/format";
export default {
......@@ -70,13 +71,14 @@ export default {
text: "固有风险列表",
activeName: 'a',
quoRiskList: [],//现状风险列表
InherentRisk: [],//固有风险
InherentRisk: {},//固有风险
inherentId: ''
}
},
components: {
LHeader,
drawCanvas
drawCanvas,
TabDetail
},
created() {
this.inherentId = this.$route.params.id
......@@ -88,7 +90,7 @@ export default {
methods: {
getInherentRiskList(inherentId){
getFun(`/risk/plan/inherent/details/${inherentId}`).then(res=>{
console.log(res.data,'lllll')
this.InherentRisk= res.data
})
},
getQuoRiskList(inherentId) {
......@@ -99,6 +101,28 @@ export default {
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
goDetail(item){
console.log(item,'???')
this.$router.push({
name:'addPresent',
params:{
isView:false,
// buildingId:,
// planId:,
// floorId:,
// roomId:,
// inherentId:,
// roomName:,
}
})
},
onClick(name){
if(name==='a'){
this.getQuoRiskList(this.$route.params.id)
}else if(name==='b'){
this.getInherentRiskList(this.$route.params.id)
}
}
},
}
</script>
......
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