Commit e1a196e2 authored by p-wanping.song's avatar p-wanping.song

Merge branch 'dev-swp' into develop

parents 77a7fd4e c8cbf7c3
......@@ -63,7 +63,8 @@ export default {
"riskAssess",
"riskApprove",
"taskList",
"taskDetail"
"taskDetail",
"modelResult"
],
// cachePage预先定义的缓存页面
otherCache: [],
......
......@@ -235,6 +235,12 @@ const routes = [
name: "assessModelStep2",
component: () => import("../views/riskProject/assess/model/step2.vue"),
},
// 评估模型二
{
path: "/assess/model/result",
name: "modelResult",
component: () => import("../views/riskProject/assess/model/result.vue"),
},
];
const router = new VueRouter({
......
......@@ -31,4 +31,8 @@ export default {
SET_ASSESS_STEP2_FORM(state, data) {
state.assessModel.step2Form = data;
},
// 现状风险模型 第二步(表单数据)
SET_ASSESS_RESULT(state, data) {
state.assessModel.result = data;
},
};
......@@ -7,5 +7,9 @@ export default {
assessModel: {
step1: "", //影响因素
step2: "", //影响因子
result: {
level: "",
score: "",
},
},
};
......@@ -69,7 +69,7 @@
<span class="riskTab type1"></span>重大风险
<span class="riskTab type2"></span>较大风险
<span class="riskTab type3"></span>一般风险
<span class="riskTab type4"></span>较小风险
<span class="riskTab type4"></span>风险
</van-grid>
</div>
<van-dialog
......@@ -353,6 +353,7 @@ export default {
},
// 修改名称
changeName(item){
debugger
this.editItem = item;
switch(item.type){
case '基础设施':
......@@ -473,7 +474,11 @@ export default {
return;
}
if(this.editItem){
const editItem = this.layout.find(x=>x.i==this.editItem.i)
const editItem = this.layout.find(x=>x.i==this.editItem.i);
const layoutData = this.layoutData.find(x=>x.position.id==editItem.i);
if(layoutData){
layoutData.name = this.roomName
}
if(editItem){
editItem.name = this.roomName;
editItem.type = this.roomType;
......
......@@ -29,6 +29,9 @@
<van-field v-model="password" type="password" name="password" placeholder="密码"
:rules="[{ required: true, message: '请填写密码' }]" />
</div>
<div style="margin: 16px 0;">
<van-checkbox v-model="remember" shape="square">记住密码</van-checkbox>
</div>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit">登录</van-button>
</div>
......@@ -50,10 +53,27 @@ export default {
bg: require("@/assets/login/login-bg.png"),
conBg: require("@/assets/login/login-center.png"),
username: "",
password: ""
password: "",
remember:localStorage.getItem('isRemember')&&localStorage.getItem('isRemember')!=='false'?true:false
};
},
watch:{
remember(newVal,oldVal){
if(newVal){
localStorage.setItem('isRemember',true)
}else{
localStorage.setItem('isRemember',false)
}
}
},
mounted() {
const store = window.localStorage;
if (store.getItem('isRemember')&&store.getItem('isRemember')!=='false') {
if(getLocalUserInfo()){
this.username = getLocalUserInfo().loginName
this.password =Base64.decode(getLocalUserInfo().loginPassword)
}
}
let height = document.documentElement.clientHeight; //获取当前可视区域的高度
document.getElementsByClassName('login')[0].style.height = height + 'px'//给根布局设置高度
// 判断localStorage中是否有用户信息
......@@ -74,7 +94,10 @@ export default {
postFun('/login', values).then((Response) => {
if (Response.code == 200) {
this.$toast.clear()
// setLocalUserInfo(user)
setLocalUserInfo({
loginName: values.username,
loginPassword: Base64.encode(values.password)
})
setToken(Response.token)
getFun('/getInfo').then((Response2) => {
console.log('%c [ Response2 ]-89', 'font-size:13px; background:pink; color:#bf2c9f;', Response2)
......@@ -91,8 +114,6 @@ export default {
this.$router.push('/save-workbench')
})
/* 存储用户信息 */
} else {
this.$toast.clear()
this.$toast.fail({
......
......@@ -111,7 +111,7 @@ export default {
methods: {
logout() {
removeToken()
removeLocalUserInfo()
// removeLocalUserInfo()
removeUserInfo()
sessionStorage.clear()
this.$router.push("/login");
......
......@@ -683,6 +683,15 @@
@cancel="showTrouble = false"
/>
</van-popup>
<div style="margin: 16px 16px 0">
<van-button
round
block
type="info"
@click="onSubmit('save',$event)"
>保存</van-button
>
</div>
<div style="margin: 16px 16px 0">
<van-button
:loading="loadingStatus"
......@@ -1413,39 +1422,70 @@ export default {
});
return formData;
},
onSubmit(values) {
onSubmit(values,event) {
if(values=='save'){
event.preventDefault();
}
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson = this.jsonToFormData(this.form);
let url = "/risk/plan/inherent";
this.loadingStatus = true;
(values.hdPicture1 || []).forEach(item => {
this.uploaderImg.forEach(item => {
if (item.file) {
formDataJson.append("pictureFile[]", item.file);
} else {
formDataJson.append("pictureFile[]", item.fileId);
}
});
values["measuresProjectFile[]"].forEach(item => {
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file);
} else {
formDataJson.append("measuresProjectFile[]", item.fileId);
}
});
values["measuresEmergencyFile[]"].forEach(item => {
this.measuresEmergencyFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
} else {
formDataJson.append("measuresEmergencyFile[]", item.fileId);
}
});
values["measuresAdministrationFile[]"].forEach(item => {
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file);
} else {
formDataJson.append("measuresAdministrationFile[]", item.fileId);
}
});
// (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();
......
......@@ -6,6 +6,7 @@
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
ref="formEle"
>
<div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
......@@ -665,6 +666,17 @@
/>
</van-popup>
<div style="margin: 16px 16px 0">
<van-button
:loading="loadingStatus"
:loading-text="loadingTextSave"
round
block
type="info"
@click="onSubmit('save',$event)"
>保存</van-button
>
</div>
<div style="margin: 16px 16px 0">
<van-button
:loading="loadingStatus"
......@@ -854,6 +866,38 @@ export default {
methods: {
/* swp add */
toSave(e){ //保存
e.preventDefault();
var formDataJson = this.jsonToFormData(this.form);
this.uploaderImg.forEach(item => {
if (item.file) {
formDataJson.append("pictureFile[]", item.file);
} else {
formDataJson.append("pictureFile[]", item.fileId);
}
});
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file);
} else {
formDataJson.append("measuresProjectFile[]", item.fileId);
}
});
this.measuresEmergencyFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
} else {
formDataJson.append("measuresEmergencyFile[]", item.fileId);
}
});
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file);
} else {
formDataJson.append("measuresAdministrationFile[]", item.fileId);
}
});
},
closeFloor(data){
if(data){
this.getFloor().then(()=>{
......@@ -1077,7 +1121,9 @@ export default {
this.$router.push({
name: "resultPage",
params: {
score: this.severityScore * this.possibleScore
score: this.severityScore * this.possibleScore,
possibleValue:this.possibleValue,
severityValue:this.severityValue,
}
});
},
......@@ -1113,39 +1159,70 @@ export default {
});
return formData;
},
onSubmit(values) {
onSubmit(values,event) {
if(values=='save'){
event.preventDefault();
}
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson = this.jsonToFormData(this.form);
let url = "/risk/plan/inherent";
this.loadingStatus = true;
values.hdPicture1.forEach(item => {
this.uploaderImg.forEach(item => {
if (item.file) {
formDataJson.append("pictureFile[]", item.file);
} else {
formDataJson.append("pictureFile[]", item.fileId);
}
});
values["measuresProjectFile[]"].forEach(item => {
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file);
} else {
formDataJson.append("measuresProjectFile[]", item.fileId);
}
});
values["measuresEmergencyFile[]"].forEach(item => {
this.measuresEmergencyFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
} else {
formDataJson.append("measuresEmergencyFile[]", item.fileId);
}
});
values["measuresAdministrationFile[]"].forEach(item => {
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file);
} else {
formDataJson.append("measuresAdministrationFile[]", item.fileId);
}
});
// 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 => {
......
......@@ -533,7 +533,17 @@
@cancel="showTrouble = false"
/>
</van-popup>
<div style="margin: 16px 16px 0">
<van-button
:loading="loadingStatus"
:loading-text="loadingTextSave"
round
block
type="info"
@click="onSubmit('save',$event)"
>保存</van-button
>
</div>
<div style="margin: 16px 16px 0">
<van-button
:loading="loadingStatus"
......@@ -577,6 +587,10 @@ export default {
if(to.name!='assessModelStep1'){
this.$store.commit('SET_ASSESS_STEP2',"")
this.$store.commit('SET_ASSESS_STEP1',"")
this.$store.commit('SET_ASSESS_RESULT',{
level: "",
score: "",
})
}
next()
},
......@@ -584,6 +598,7 @@ export default {
return {
loadingStatus: false,
loadingText: "提交...",
loadingTextSave: "保存...",
measureNameList: [],
measureDeptList: [],
isEdit: false,
......@@ -633,7 +648,7 @@ export default {
columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级
showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"],
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "风险"],
showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
......@@ -676,9 +691,11 @@ export default {
mounted() {
if (sessionStorage.getItem("presentForm")) {
this.form = JSON.parse(sessionStorage.getItem("presentForm"));
this.form.level = sessionStorage.getItem("level");
const {level,score} = this.$store.state.assessModel.result
this.form.level =level;
this.form.levelScore =score;
const getImg = (key)=>this.$store.getters.present(key)
this.uploaderImg = getImg('uploaderImg');
this.uploaderImg = getImg('uploaderImg')||[];
this.measuresAdministrationFile = getImg('measuresAdministrationFile');
this.measuresEmergencyFile = getImg('measuresEmergencyFile');
this.measuresProjectFile = getImg('measuresProjectFile');
......@@ -749,8 +766,9 @@ export default {
getFun(`/risk/plan/existing/details/${this.existingId}`)
.then(res => {
this.form = res.data;
this.$store.commit('SET_ASSESS_STEP1',this.form.factorItems)
this.$store.commit('SET_ASSESS_STEP2',this.form.evaluationItemIds)
this.$store.commit('SET_ASSESS_STEP1',this.form.factorItems)
this.$store.commit('SET_ASSESS_STEP2',this.form.evaluationItemIds)
this.uploaderImg = (res.data.pictureFile || []).map(item => {
return {
...item,
......@@ -1054,7 +1072,10 @@ export default {
});
return formData;
},
onSubmit(values) {
onSubmit(values,event) {
if(values=='save'){
event.preventDefault();
}
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson = this.jsonToFormData(this.form);
......@@ -1064,28 +1085,56 @@ export default {
// let url = "/risk/plan/inherent";
this.loadingStatus = true;
let url = "/risk/plan/existing";
values.hdPicture1.forEach(item => {
// 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);
// }
// });
this.uploaderImg.forEach(item => {
if (item.file) {
formDataJson.append("pictureFile[]", item.file);
} else {
formDataJson.append("pictureFile[]", item.fileId);
}
});
values["measuresProjectFile[]"].forEach(item => {
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file);
} else {
formDataJson.append("measuresProjectFile[]", item.fileId);
}
});
values["measuresEmergencyFile[]"].forEach(item => {
this.measuresEmergencyFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file);
} else {
formDataJson.append("measuresEmergencyFile[]", item.fileId);
}
});
values["measuresAdministrationFile[]"].forEach(item => {
this.measuresAdministrationFile.forEach(item => {
if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file);
} else {
......
......@@ -63,6 +63,14 @@
@click="createProject"
/>
</div>
<van-field
required
name="projectBusiness"
v-model="form.projectBusiness"
label="业态"
placeholder="请输入"
:rules="[{ required: true, message: '业态不能为空' }]"
/>
<!-- <van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
......@@ -347,7 +355,8 @@ export default {
text: "创建任务",
id: "",
form: {
name: ""
name: "",
projectBusiness:''
},
projectId: "", // 所属工程
projectName: "", // 所属工程
......@@ -445,6 +454,7 @@ export default {
if( this.createComponentData.type ==='project'){
this.form.projectName = data.name
this.form.projectId = data.projectId
this.form.projectBusiness = ''
this.form.buildingNames = ''
this.form.buildingIds = ''
}
......@@ -735,6 +745,7 @@ export default {
this.projectId = value.id;
this.projectName = value.projectName;
this.showProjectName = false;
// this.projectBusiness
},
// 风险因素
onConFactor(value) {
......@@ -761,6 +772,7 @@ export default {
}
this.form.projectId = value.id;
this.form.projectName = value.name;
this.form.projectBusiness = value.business
this.showSource = false;
},
// 项目负责人
......@@ -842,6 +854,7 @@ export default {
}
this.form.projectId = e.id;
this.form.projectName = e.name;
this.form.projectBusiness = e.business;
this.show = false;
}
},
......
......@@ -51,51 +51,27 @@ import LHeader from "@/components/header.vue";
},
methods:{
getResult(){
// this.result = (()=> {
// // 较小风险:1-2,一般风险:2-3 较大风险:3-4 重大风险:>4
// // switch(this.score){
// // case '一般风险':
// // return '#FFFF00';
// // case "较小风险":
// // return "#0091EA";
// // case "较大风险":
// // return "FF9800";
// // case "重大风险":
// // return "FF4433";
// // default:
// // return "orange"
// // }
// if(this.score<=2){
// return {level:'较小风险',color:"#0091EA"}
// }else if(this.score>2&&this.score<=3){
// return {level:'一般风险',color:"#FFFF00"}
// }else if(this.score>3&&this.score<=4){
// return {level:'较大风险',color:"#FF9800"}
// }else if(this.score>4){
// return {level:'重大风险',color:"#FF4433"}
// }else{
// return {level:'',color:"orange"}
// }
// })()
const bgColor = ()=> {
switch(this.level){
const bgColor = (()=> {
// 低风险:1-2,一般风险:2-3 较大风险:3-4 重大风险:>4
switch(this.score){
case '一般风险':
return '#FFFF00';
case "较小风险":
case "风险":
return "#0091EA";
case "较大风险":
return "#FF9800";
return "FF9800";
case "重大风险":
return "#FF4433";
return "FF4433";
default:
return "orange"
}
}
})()
getFun(`/risk/plan/matrix/score/${this.$route.params.score}`).then(res=>{
this.level = res.data.level
this.backgroundColor=bgColor()
this.result = {
color:bgColor,
level: res.data.level
}
})
},
resetClose(){
......@@ -103,16 +79,8 @@ import LHeader from "@/components/header.vue";
history.go(-1)
},
sureClose(){
sessionStorage.setItem('level',this.level)
sessionStorage.setItem('level',this.result.level)
history.go(-1)
// sessionStorage.setItem('level',this.result.level)
// history.go(-3)
// this.$router.push({
// name:'addInherent',
// params:{
// level:this.level
// }
// })
}
}
}
......
<template>
<div class="wrapper">
<LHeader :text="text"></LHeader>
<div class="section">
<p>该次测评风险值为:</p>
<div class="resultScore" :style="{ background: result.color}" >
<p style="font-weight: bold;font-size: 20px;color: white;">{{ this.score }}</p>
</div>
<div>本次评估结果评定为:<h4 style="display: inline-block;">{{ result.level }}</h4></div>
<ul class="level-group">
<div>测评风险参考值:</div>
<li>0%-5% 重大风险</li>
<li>5%-20% 较大风险</li>
<li>20%-50% 一般风险</li>
<li>50%-100% 低风险</li>
</ul>
<!-- <van-image width="90vw" height="auto" :src="require('@/assets/workbench/sst.jpg')" /> -->
</div>
<div style="display: flex;margin: 10px 16px 0px; padding-bottom: 16px">
<van-button block type="info" @click="sureClose" style="margin-right: 4px;">确认本次测评结果</van-button>
<van-button block plain type="info" @click="resetClose" style="margin-left: 4px;">取消</van-button>
</div>
</div>
</template>
<script>
import { getFun, postFun } from "@/service/table.js";
import LHeader from "@/components/header.vue";
export default {
name:'modelResult',
components:{
LHeader
},
data(){
return{
text:'测评结果',
score:0,
result:null
}
},
created(){
this.score = this.$route.query.score-'';
this.getResult()
},
methods:{
getResult(){
this.result = (()=>{
if(this.score<=2){
return {level:'低风险',color:"#0091EA"}
}else if(this.score>2&&this.score<=3){
return {level:'一般风险',color:"#FFFF00"}
}else if(this.score>3&&this.score<=4){
return {level:'较大风险',color:"#FF9800"}
}else if(this.score>4){
return {level:'重大风险',color:"#FF4433"}
}else{
return {level:'',color:"orange"}
}
})()
getFun(`/risk/plan/matrix/score/${this.score}`).then(res=>{
if(res.data.score){
this.score = res.data.score;
}
if(res.data.level){
this.result.level = res.data.level;
}
})
},
resetClose(){
history.go(-1)
},
sureClose(){
this.$store.commit('SET_ASSESS_RESULT',{...this.result,score:this.score})
history.go(-3)
}
}
}
</script>
<style lang="less" scoped>
.wrapper {
width: 100%;
height: 100%;
.section {
width: 100%;
padding: 10px;
box-sizing: border-box;
background: #fff;
font-size: 14px;
padding-bottom: 50px;
}
.resultScore{
width: 48px;
height: 48px;
background: #ffc600;
text-align: center;
line-height: 48px;
border-radius: 50%;
margin: 0 auto;
}
.level-group{
>li{
padding:0 20px;
margin-top: 20px;
}
}
}
</style>
......@@ -17,10 +17,10 @@
<div class="van-cell__tip" v-if="item.remark">备注:{{ item.remark }}</div>
</template>
<van-radio-group v-model="item.value">
<van-radio v-for="(child) in item.factorItemsList" :key="item.name+child.indicatorItem" :name="child.id">{{ child.indicatorItem }}</van-radio>
<van-radio @click="choickImportant(child,item)" v-for="(child) in item.factorItemsList" :key="item.name+child.indicatorItem" :name="child.id">{{ child.indicatorItem }}</van-radio>
</van-radio-group>
<template slot="right-icon">
<span :class="{'active-value':item.value!=-1,'right-text':true}">{{getName(item)}}</span>
<span :class="{'active-value':item.value!=-1,'right-text':true,'important-text':getImportant(item)}">{{getName(item)}}</span>
<van-icon name="arrow" class="van-cell__right-icon"/>
</template>
</van-collapse-item>
......@@ -35,7 +35,7 @@
</div>
</div>
<footer class="assess-model-footer">
<van-button round type="info" @click="save">完成</van-button>
<van-button round type="info" @click="save(false)">完成</van-button>
</footer>
</div>
......@@ -54,7 +54,9 @@ import { getFun, postFun } from "@/service/table";
activeNames:[],
types:[],
ids:'', //人,机
assessModel:this.$store.state.assessModel
assessModel:this.$store.state.assessModel,
isImportant:false,
importantArray:new Map()
}
},
mounted(){
......@@ -73,11 +75,35 @@ import { getFun, postFun } from "@/service/table";
},
methods:{
choickImportant(child,parent){
if(child.isImportant=='1'){
this.importantArray.set(parent.factorSubName,child.id)
this.isImportant = this.importantArray.size
this.$dialog.confirm({
message:`当前评估为重大风险,是否确认?`,
confirmButtonText:'',
cancelButtonText:''
}).then(()=>{
this.save(true)
}).catch(()=>{
parent.value = -1;
})
}else{
if(this.importantArray.has(parent.factorSubName)){
this.importantArray.delete(parent.factorSubName)
this.isImportant = this.importantArray.size
}
}
},
getName(item){
const name = item.factorItemsList.find(x=>x.id===item.value)
// return ?.indicatorItem||''
return name?name.indicatorItem:''
},
getImportant(item){
const important = item.factorItemsList.find(x=>x.id===item.value)
return important?important.isImportant==='1':0
},
// 根据ids获取列表
getList(){
getFun('/risk/plan/evaluation/getFactorListByType',{
......@@ -107,14 +133,18 @@ import { getFun, postFun } from "@/service/table";
const has = factor.factorItemsList.find(x=>x.id==data);
if(has){
factor.value = data;
if(has.isImportant==='1'){
this.importantArray.set(factor.factorSubName,data)
}
}
});
})
})
this.isImportant = this.importantArray.size;
},
// 保存 数据处理和进行下一步操作
save(){
save(isImportant=false){
let unSelect = [];
// 只传输修改的
let types =JSON.parse(JSON.stringify(this.types));
......@@ -125,17 +155,19 @@ import { getFun, postFun } from "@/service/table";
unSelect.push(val.factorName)
}
})
if(unSelect.length){
var resultDeal = ()=>{
!this.isImportant? this.countScroe(types):this.average=5;
this.result(types)
}
if(unSelect.length&&!isImportant){
this.$dialog.confirm({
message:`${unSelect.join('')}未选择,是否继续?`
}).then(()=>{
this.countScroe(types);
this.result(types)
resultDeal()
}).catch(()=>{
})
}else{
this.countScroe(types);
this.result(types)
resultDeal()
}
},
// 计算分值
......@@ -163,7 +195,8 @@ import { getFun, postFun } from "@/service/table";
* */
this.average = 0; //平均分
this.averageTotal = 0;
types.forEach(val=>{
for(let i=0;i<types.length;i++){
const val = types[i];
// 计算 ’人、机‘大类的总值val.total
val.total = val.factorList.reduce((total,item)=>{
const sum = item.factorItemsList.find(idx=>idx.id===item.value);
......@@ -174,7 +207,7 @@ import { getFun, postFun } from "@/service/table";
// 计算 ’人+机‘ 的平均值总值
this.averageTotal+=val.average;
})
}
const len = types.filter(x=>x.total&&x.total!=0);
// 计算 ’人+机‘的平均值
this.average = len.length?this.averageTotal/len.length:0;
......@@ -190,7 +223,7 @@ import { getFun, postFun } from "@/service/table";
this.$store.commit('SET_ASSESS_STEP1',this.ids)
this.$store.commit('SET_ASSESS_STEP2',step2.join(',')) //需要往后端传递的数据
this.$router.push({
name: "resultPage",
name: "modelResult",
query: {
score: this.average
}
......@@ -238,6 +271,9 @@ import { getFun, postFun } from "@/service/table";
overflow: hidden;
white-space: nowrap;
}
.important-text{
color: red;
}
}
.van-cell__right-icon::before{
transform: rotate(90deg);
......
......@@ -580,7 +580,7 @@ export default {
columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级
showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"],
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "风险"],
showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
......@@ -830,7 +830,9 @@ export default {
this.$router.push({
name: "resultPage",
params: {
score: this.severityScore * this.possibleScore
score: this.severityScore * this.possibleScore,
possibleValue:this.possibleValue,
severityValue:this.severityValue,
}
});
},
......
......@@ -797,7 +797,9 @@ export default {
this.$router.push({
name: "resultPage",
params: {
score: this.severityScore * this.possibleScore
score: this.severityScore * this.possibleScore,
possibleValue:this.possibleValue,
severityValue:this.severityValue,
}
});
},
......
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