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

0817问题清单修复

parent 26d2b72a
...@@ -63,7 +63,8 @@ export default { ...@@ -63,7 +63,8 @@ export default {
"riskAssess", "riskAssess",
"riskApprove", "riskApprove",
"taskList", "taskList",
"taskDetail" "taskDetail",
"modelResult"
], ],
// cachePage预先定义的缓存页面 // cachePage预先定义的缓存页面
otherCache: [], otherCache: [],
......
...@@ -235,6 +235,12 @@ const routes = [ ...@@ -235,6 +235,12 @@ const routes = [
name: "assessModelStep2", name: "assessModelStep2",
component: () => import("../views/riskProject/assess/model/step2.vue"), 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({ const router = new VueRouter({
......
...@@ -31,4 +31,8 @@ export default { ...@@ -31,4 +31,8 @@ export default {
SET_ASSESS_STEP2_FORM(state, data) { SET_ASSESS_STEP2_FORM(state, data) {
state.assessModel.step2Form = data; state.assessModel.step2Form = data;
}, },
// 现状风险模型 第二步(表单数据)
SET_ASSESS_RESULT(state, data) {
state.assessModel.result = data;
},
}; };
...@@ -7,5 +7,9 @@ export default { ...@@ -7,5 +7,9 @@ export default {
assessModel: { assessModel: {
step1: "", //影响因素 step1: "", //影响因素
step2: "", //影响因子 step2: "", //影响因子
result: {
level: "",
score: "",
},
}, },
}; };
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<span class="riskTab type1"></span>重大风险 <span class="riskTab type1"></span>重大风险
<span class="riskTab type2"></span>较大风险 <span class="riskTab type2"></span>较大风险
<span class="riskTab type3"></span>一般风险 <span class="riskTab type3"></span>一般风险
<span class="riskTab type4"></span>较小风险 <span class="riskTab type4"></span>风险
</van-grid> </van-grid>
</div> </div>
<van-dialog <van-dialog
...@@ -353,6 +353,7 @@ export default { ...@@ -353,6 +353,7 @@ export default {
}, },
// 修改名称 // 修改名称
changeName(item){ changeName(item){
debugger
this.editItem = item; this.editItem = item;
switch(item.type){ switch(item.type){
case '基础设施': case '基础设施':
...@@ -473,6 +474,7 @@ export default { ...@@ -473,6 +474,7 @@ export default {
return; return;
} }
if(this.editItem){ if(this.editItem){
console.log(this.editItem)
const editItem = this.layout.find(x=>x.i==this.editItem.i) const editItem = this.layout.find(x=>x.i==this.editItem.i)
if(editItem){ if(editItem){
editItem.name = this.roomName; editItem.name = this.roomName;
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
<van-field v-model="password" type="password" name="password" placeholder="密码" <van-field v-model="password" type="password" name="password" placeholder="密码"
:rules="[{ required: true, message: '请填写密码' }]" /> :rules="[{ required: true, message: '请填写密码' }]" />
</div> </div>
<div style="margin: 16px 0;">
<van-checkbox v-model="remember" shape="square">记住密码</van-checkbox>
</div>
<div style="margin: 16px;"> <div style="margin: 16px;">
<van-button round block type="info" native-type="submit">登录</van-button> <van-button round block type="info" native-type="submit">登录</van-button>
</div> </div>
...@@ -50,10 +53,27 @@ export default { ...@@ -50,10 +53,27 @@ export default {
bg: require("@/assets/login/login-bg.png"), bg: require("@/assets/login/login-bg.png"),
conBg: require("@/assets/login/login-center.png"), conBg: require("@/assets/login/login-center.png"),
username: "", 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() { 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; //获取当前可视区域的高度 let height = document.documentElement.clientHeight; //获取当前可视区域的高度
document.getElementsByClassName('login')[0].style.height = height + 'px'//给根布局设置高度 document.getElementsByClassName('login')[0].style.height = height + 'px'//给根布局设置高度
// 判断localStorage中是否有用户信息 // 判断localStorage中是否有用户信息
...@@ -74,7 +94,10 @@ export default { ...@@ -74,7 +94,10 @@ export default {
postFun('/login', values).then((Response) => { postFun('/login', values).then((Response) => {
if (Response.code == 200) { if (Response.code == 200) {
this.$toast.clear() this.$toast.clear()
// setLocalUserInfo(user) setLocalUserInfo({
loginName: values.username,
loginPassword: Base64.encode(values.password)
})
setToken(Response.token) setToken(Response.token)
getFun('/getInfo').then((Response2) => { getFun('/getInfo').then((Response2) => {
console.log('%c [ Response2 ]-89', 'font-size:13px; background:pink; color:#bf2c9f;', Response2) console.log('%c [ Response2 ]-89', 'font-size:13px; background:pink; color:#bf2c9f;', Response2)
...@@ -91,8 +114,6 @@ export default { ...@@ -91,8 +114,6 @@ export default {
this.$router.push('/save-workbench') this.$router.push('/save-workbench')
}) })
/* 存储用户信息 */ /* 存储用户信息 */
} else { } else {
this.$toast.clear() this.$toast.clear()
this.$toast.fail({ this.$toast.fail({
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
methods: { methods: {
logout() { logout() {
removeToken() removeToken()
removeLocalUserInfo() // removeLocalUserInfo()
removeUserInfo() removeUserInfo()
sessionStorage.clear() sessionStorage.clear()
this.$router.push("/login"); this.$router.push("/login");
......
...@@ -684,6 +684,15 @@ ...@@ -684,6 +684,15 @@
/> />
</van-popup> </van-popup>
<div style="margin: 16px 16px 0"> <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 <van-button
:loading="loadingStatus" :loading="loadingStatus"
:loading-text="loadingText" :loading-text="loadingText"
...@@ -1411,39 +1420,70 @@ export default { ...@@ -1411,39 +1420,70 @@ export default {
}); });
return formData; 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) // 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";
this.loadingStatus = true; this.loadingStatus = true;
(values.hdPicture1 || []).forEach(item => { this.uploaderImg.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 => { this.measuresAdministrationFile.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 => { this.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 => { this.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);
} }
}); });
// (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) postFun(url, formDataJson)
.then(res => { .then(res => {
this.$toast.clear(); this.$toast.clear();
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
:scroll-to-error="true" :scroll-to-error="true"
:show-error="false" :show-error="false"
validate-trigger="onSubmit" validate-trigger="onSubmit"
ref="formEle"
> >
<div <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;"
...@@ -665,6 +666,17 @@ ...@@ -665,6 +666,17 @@
/> />
</van-popup> </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"> <div style="margin: 16px 16px 0">
<van-button <van-button
:loading="loadingStatus" :loading="loadingStatus"
...@@ -854,6 +866,38 @@ export default { ...@@ -854,6 +866,38 @@ export default {
methods: { methods: {
/* swp add */ /* 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){ closeFloor(data){
if(data){ if(data){
this.getFloor().then(()=>{ this.getFloor().then(()=>{
...@@ -1113,39 +1157,70 @@ export default { ...@@ -1113,39 +1157,70 @@ export default {
}); });
return formData; 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) // 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";
this.loadingStatus = true; this.loadingStatus = true;
values.hdPicture1.forEach(item => { this.uploaderImg.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 => { this.measuresAdministrationFile.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 => { this.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 => { this.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);
} }
}); });
// 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) postFun(url, formDataJson)
.then(res => { .then(res => {
......
...@@ -532,7 +532,17 @@ ...@@ -532,7 +532,17 @@
@cancel="showTrouble = false" @cancel="showTrouble = false"
/> />
</van-popup> </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"> <div style="margin: 16px 16px 0">
<van-button <van-button
:loading="loadingStatus" :loading="loadingStatus"
...@@ -576,6 +586,10 @@ export default { ...@@ -576,6 +586,10 @@ export default {
if(to.name!='assessModelStep1'){ if(to.name!='assessModelStep1'){
this.$store.commit('SET_ASSESS_STEP2',"") this.$store.commit('SET_ASSESS_STEP2',"")
this.$store.commit('SET_ASSESS_STEP1',"") this.$store.commit('SET_ASSESS_STEP1',"")
this.$store.commit('SET_ASSESS_RESULT',{
level: "",
score: "",
})
} }
next() next()
}, },
...@@ -583,6 +597,7 @@ export default { ...@@ -583,6 +597,7 @@ export default {
return { return {
loadingStatus: false, loadingStatus: false,
loadingText: "提交...", loadingText: "提交...",
loadingTextSave: "保存...",
measureNameList: [], measureNameList: [],
measureDeptList: [], measureDeptList: [],
isEdit: false, isEdit: false,
...@@ -632,7 +647,7 @@ export default { ...@@ -632,7 +647,7 @@ export default {
columnsSetRank: ["矩阵式定级", "其他定级方式"], columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级 riskRank: "", // 风险等级
showRiskRank: false, showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"], columnsRiskRank: ["重大风险", "较大风险", "一般风险", "风险"],
showSetRankMode: false, // 是否显示定级方式 showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字 setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片 setRankModeImg: [], // 定级方式图片
...@@ -675,9 +690,11 @@ export default { ...@@ -675,9 +690,11 @@ export default {
mounted() { mounted() {
if (sessionStorage.getItem("presentForm")) { if (sessionStorage.getItem("presentForm")) {
this.form = JSON.parse(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) const getImg = (key)=>this.$store.getters.present(key)
this.uploaderImg = getImg('uploaderImg'); this.uploaderImg = getImg('uploaderImg')||[];
this.measuresAdministrationFile = getImg('measuresAdministrationFile'); this.measuresAdministrationFile = getImg('measuresAdministrationFile');
this.measuresEmergencyFile = getImg('measuresEmergencyFile'); this.measuresEmergencyFile = getImg('measuresEmergencyFile');
this.measuresProjectFile = getImg('measuresProjectFile'); this.measuresProjectFile = getImg('measuresProjectFile');
...@@ -721,6 +738,7 @@ export default { ...@@ -721,6 +738,7 @@ export default {
this.form = res.data; this.form = res.data;
this.$store.commit('SET_ASSESS_STEP1',this.form.factorItems) this.$store.commit('SET_ASSESS_STEP1',this.form.factorItems)
this.$store.commit('SET_ASSESS_STEP2',this.form.evaluationItemIds) this.$store.commit('SET_ASSESS_STEP2',this.form.evaluationItemIds)
this.uploaderImg = (res.data.pictureFile || []).map(item => { this.uploaderImg = (res.data.pictureFile || []).map(item => {
return { return {
...item, ...item,
...@@ -1024,7 +1042,10 @@ export default { ...@@ -1024,7 +1042,10 @@ export default {
}); });
return formData; 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) // 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);
...@@ -1034,28 +1055,56 @@ export default { ...@@ -1034,28 +1055,56 @@ export default {
// let url = "/risk/plan/inherent"; // let url = "/risk/plan/inherent";
this.loadingStatus = true; this.loadingStatus = true;
let url = "/risk/plan/existing"; 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) { 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 => { this.measuresAdministrationFile.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 => { this.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 => { this.measuresAdministrationFile.forEach(item => {
if (item.file) { if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file); formDataJson.append("measuresAdministrationFile[]", item.file);
} else { } else {
......
...@@ -63,6 +63,14 @@ ...@@ -63,6 +63,14 @@
@click="createProject" @click="createProject"
/> />
</div> </div>
<van-field
required
name="projectBusiness"
v-model="form.projectBusiness"
label="业态"
placeholder="请输入"
:rules="[{ required: true, message: '业态不能为空' }]"
/>
<!-- <van-popup v-model="showSource" position="bottom"> <!-- <van-popup v-model="showSource" position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
...@@ -347,7 +355,8 @@ export default { ...@@ -347,7 +355,8 @@ export default {
text: "创建任务", text: "创建任务",
id: "", id: "",
form: { form: {
name: "" name: "",
projectBusiness:''
}, },
projectId: "", // 所属工程 projectId: "", // 所属工程
projectName: "", // 所属工程 projectName: "", // 所属工程
...@@ -445,6 +454,7 @@ export default { ...@@ -445,6 +454,7 @@ export default {
if( this.createComponentData.type ==='project'){ if( this.createComponentData.type ==='project'){
this.form.projectName = data.name this.form.projectName = data.name
this.form.projectId = data.projectId this.form.projectId = data.projectId
this.form.projectBusiness = ''
this.form.buildingNames = '' this.form.buildingNames = ''
this.form.buildingIds = '' this.form.buildingIds = ''
} }
...@@ -735,6 +745,7 @@ export default { ...@@ -735,6 +745,7 @@ export default {
this.projectId = value.id; this.projectId = value.id;
this.projectName = value.projectName; this.projectName = value.projectName;
this.showProjectName = false; this.showProjectName = false;
// this.projectBusiness
}, },
// 风险因素 // 风险因素
onConFactor(value) { onConFactor(value) {
...@@ -761,6 +772,7 @@ export default { ...@@ -761,6 +772,7 @@ export default {
} }
this.form.projectId = value.id; this.form.projectId = value.id;
this.form.projectName = value.name; this.form.projectName = value.name;
this.form.projectBusiness = value.business
this.showSource = false; this.showSource = false;
}, },
// 项目负责人 // 项目负责人
...@@ -842,6 +854,7 @@ export default { ...@@ -842,6 +854,7 @@ export default {
} }
this.form.projectId = e.id; this.form.projectId = e.id;
this.form.projectName = e.name; this.form.projectName = e.name;
this.form.projectBusiness = e.business;
this.show = false; this.show = false;
} }
}, },
......
...@@ -34,47 +34,40 @@ import LHeader from "@/components/header.vue"; ...@@ -34,47 +34,40 @@ import LHeader from "@/components/header.vue";
return{ return{
text:'测评结果', text:'测评结果',
score:0, score:0,
result:null result:{
level:'',
color:''
}
} }
}, },
created(){ created(){
this.score = this.$route.query.score-''; this.score = this.$route.params.score-'';
this.getResult() this.getResult()
}, },
methods:{ methods:{
getResult(){ getResult(){
const bgColor = (()=> {
this.result = (()=> { // 低风险:1-2,一般风险:2-3 较大风险:3-4 重大风险:>4
// 较小风险:1-2,一般风险:2-3 较大风险:3-4 重大风险:>4 switch(this.score){
// switch(this.score){ case '一般风险':
// case '一般风险': return '#FFFF00';
// return '#FFFF00'; case "低风险":
// case "较小风险": return "#0091EA";
// return "#0091EA"; case "较大风险":
// case "较大风险": return "FF9800";
// return "FF9800"; case "重大风险":
// case "重大风险": return "FF4433";
// return "FF4433"; default:
// default: return "orange"
// 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"}
} }
})() })()
// getFun(`/risk/plan/matrix/score/${this.$route.params.score}`).then(res=>{ getFun(`/risk/plan/matrix/score/${this.$route.params.score}`).then(res=>{
// this.level = res.data.level this.result = {
// this.score = res.data.max color:bgColor,
// this.backgroundColor=bgColor() level: res.data.level
// }) }
})
}, },
resetClose(){ resetClose(){
sessionStorage.setItem('level','') sessionStorage.setItem('level','')
...@@ -83,7 +76,7 @@ import LHeader from "@/components/header.vue"; ...@@ -83,7 +76,7 @@ import LHeader from "@/components/header.vue";
sureClose(){ sureClose(){
// this.$emit('',) // this.$emit('',)
sessionStorage.setItem('level',this.result.level) sessionStorage.setItem('level',this.result.level)
history.go(-3) history.go(-1)
// this.$router.push({ // this.$router.push({
// name:'addInherent', // name:'addInherent',
// params:{ // params:{
......
<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:'resultPage',
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 @@ ...@@ -17,10 +17,10 @@
<div class="van-cell__tip" v-if="item.remark">备注:{{ item.remark }}</div> <div class="van-cell__tip" v-if="item.remark">备注:{{ item.remark }}</div>
</template> </template>
<van-radio-group v-model="item.value"> <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> </van-radio-group>
<template slot="right-icon"> <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"/> <van-icon name="arrow" class="van-cell__right-icon"/>
</template> </template>
</van-collapse-item> </van-collapse-item>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</div> </div>
</div> </div>
<footer class="assess-model-footer"> <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> </footer>
</div> </div>
...@@ -54,7 +54,9 @@ import { getFun, postFun } from "@/service/table"; ...@@ -54,7 +54,9 @@ import { getFun, postFun } from "@/service/table";
activeNames:[], activeNames:[],
types:[], types:[],
ids:'', //人,机 ids:'', //人,机
assessModel:this.$store.state.assessModel assessModel:this.$store.state.assessModel,
isImportant:false,
importantArray:new Map()
} }
}, },
mounted(){ mounted(){
...@@ -73,11 +75,35 @@ import { getFun, postFun } from "@/service/table"; ...@@ -73,11 +75,35 @@ import { getFun, postFun } from "@/service/table";
}, },
methods:{ 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){ getName(item){
const name = item.factorItemsList.find(x=>x.id===item.value) const name = item.factorItemsList.find(x=>x.id===item.value)
// return ?.indicatorItem||''
return name?name.indicatorItem:'' return name?name.indicatorItem:''
}, },
getImportant(item){
const important = item.factorItemsList.find(x=>x.id===item.value)
return important?important.isImportant==='1':0
},
// 根据ids获取列表 // 根据ids获取列表
getList(){ getList(){
getFun('/risk/plan/evaluation/getFactorListByType',{ getFun('/risk/plan/evaluation/getFactorListByType',{
...@@ -107,14 +133,18 @@ import { getFun, postFun } from "@/service/table"; ...@@ -107,14 +133,18 @@ import { getFun, postFun } from "@/service/table";
const has = factor.factorItemsList.find(x=>x.id==data); const has = factor.factorItemsList.find(x=>x.id==data);
if(has){ if(has){
factor.value = data; 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 unSelect = [];
// 只传输修改的 // 只传输修改的
let types =JSON.parse(JSON.stringify(this.types)); let types =JSON.parse(JSON.stringify(this.types));
...@@ -125,17 +155,19 @@ import { getFun, postFun } from "@/service/table"; ...@@ -125,17 +155,19 @@ import { getFun, postFun } from "@/service/table";
unSelect.push(val.factorName) 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({ this.$dialog.confirm({
message:`${unSelect.join('')}未选择,是否继续?` message:`${unSelect.join('')}未选择,是否继续?`
}).then(()=>{ }).then(()=>{
this.countScroe(types); resultDeal()
this.result(types)
}).catch(()=>{ }).catch(()=>{
}) })
}else{ }else{
this.countScroe(types); resultDeal()
this.result(types)
} }
}, },
// 计算分值 // 计算分值
...@@ -163,7 +195,8 @@ import { getFun, postFun } from "@/service/table"; ...@@ -163,7 +195,8 @@ import { getFun, postFun } from "@/service/table";
* */ * */
this.average = 0; //平均分 this.average = 0; //平均分
this.averageTotal = 0; this.averageTotal = 0;
types.forEach(val=>{ for(let i=0;i<types.length;i++){
const val = types[i];
// 计算 ’人、机‘大类的总值val.total // 计算 ’人、机‘大类的总值val.total
val.total = val.factorList.reduce((total,item)=>{ val.total = val.factorList.reduce((total,item)=>{
const sum = item.factorItemsList.find(idx=>idx.id===item.value); const sum = item.factorItemsList.find(idx=>idx.id===item.value);
...@@ -174,7 +207,7 @@ import { getFun, postFun } from "@/service/table"; ...@@ -174,7 +207,7 @@ import { getFun, postFun } from "@/service/table";
// 计算 ’人+机‘ 的平均值总值 // 计算 ’人+机‘ 的平均值总值
this.averageTotal+=val.average; this.averageTotal+=val.average;
}) }
const len = types.filter(x=>x.total&&x.total!=0); const len = types.filter(x=>x.total&&x.total!=0);
// 计算 ’人+机‘的平均值 // 计算 ’人+机‘的平均值
this.average = len.length?this.averageTotal/len.length:0; this.average = len.length?this.averageTotal/len.length:0;
...@@ -190,7 +223,7 @@ import { getFun, postFun } from "@/service/table"; ...@@ -190,7 +223,7 @@ import { getFun, postFun } from "@/service/table";
this.$store.commit('SET_ASSESS_STEP1',this.ids) this.$store.commit('SET_ASSESS_STEP1',this.ids)
this.$store.commit('SET_ASSESS_STEP2',step2.join(',')) //需要往后端传递的数据 this.$store.commit('SET_ASSESS_STEP2',step2.join(',')) //需要往后端传递的数据
this.$router.push({ this.$router.push({
name: "resultPage", name: "modelResult",
query: { query: {
score: this.average score: this.average
} }
...@@ -238,6 +271,9 @@ import { getFun, postFun } from "@/service/table"; ...@@ -238,6 +271,9 @@ import { getFun, postFun } from "@/service/table";
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
.important-text{
color: red;
}
} }
.van-cell__right-icon::before{ .van-cell__right-icon::before{
transform: rotate(90deg); transform: rotate(90deg);
......
...@@ -580,7 +580,7 @@ export default { ...@@ -580,7 +580,7 @@ export default {
columnsSetRank: ["矩阵式定级", "其他定级方式"], columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级 riskRank: "", // 风险等级
showRiskRank: false, showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险"], columnsRiskRank: ["重大风险", "较大风险", "一般风险", "风险"],
showSetRankMode: false, // 是否显示定级方式 showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字 setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片 setRankModeImg: [], // 定级方式图片
......
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