Commit 0e99bda0 authored by 胡占生's avatar 胡占生 🇨🇳

fix: 固有风险、新建完房间和评估完等级 清空表单问题

parent 4ef48267
...@@ -162,7 +162,7 @@ const routes = [{ ...@@ -162,7 +162,7 @@ const routes = [{
component: () => import('../views/riskProject/add/addCurrent.vue'), component: () => import('../views/riskProject/add/addCurrent.vue'),
}, },
{//新增现状风险 {//新增现状风险
path: '/addPresent ', path: '/addPresent',
name: 'addPresent', name: 'addPresent',
component: () => import('../views/riskProject/add/addPresent.vue'), component: () => import('../views/riskProject/add/addPresent.vue'),
}, },
......
This diff is collapsed.
...@@ -297,7 +297,8 @@ ...@@ -297,7 +297,8 @@
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
<div v-if="this.$route.params.isView" style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" > <!-- v-if="this.$route.params.isView" -->
<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%);" > <img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" >
参考依据 参考依据
</div> </div>
...@@ -331,8 +332,8 @@ ...@@ -331,8 +332,8 @@
@cancel="showSource = false" @cancel="showSource = false"
/> />
</van-popup> </van-popup>
<!-- v-if="this.$route.params.isView" -->
<div style="margin: 16px 16px 0" v-if="this.$route.params.isView" > <div style="margin: 16px 16px 0" >
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>上报</van-button >上报</van-button
> >
...@@ -367,7 +368,8 @@ ...@@ -367,7 +368,8 @@
</van-row> </van-row>
</div> </div>
</van-dialog> </van-dialog>
<div v-if="this.$route.params.isView" style="margin: 10px 16px 0px; padding-bottom: 16px"> <!-- v-if="this.$route.params.isView" -->
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel" <van-button round block type="warning" @click.native="cancel"
>取消</van-button >取消</van-button
> >
...@@ -390,35 +392,23 @@ import { getFun, postFun } from "@/service/table.js"; ...@@ -390,35 +392,23 @@ import { getFun, postFun } from "@/service/table.js";
// postRiskShowMeasures, // postRiskShowMeasures,
// } from "@/service/risk"; // } from "@/service/risk";
export default { export default {
name: "risk-add", name: "addPresent",
components: { components: {
LHeader, LHeader,
}, },
activated() { activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一
if (this.$route.params.taskId) { },
this.isShowreturnCause = true; beforeRouteEnter(to, from, next){
this.text = "风险上报退回"; if(from.name=='addCurrent'){
this.taskId = this.$route.params.taskId; sessionStorage.setItem('presentForm','')
this.postReturnEcho(); sessionStorage.setItem('level','')
} }
this.getList(); next()
this.$bus.$on("riskLevelBus", (res) => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
if (res) {
this.riskRank = res;
} else {
this.setRank = "";
}
// 销毁一下监听事件 不然会越加越多
this.$bus.$off("riskLevelBus");
});
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") { if (to.name != "riskInherent") {
sessionStorage.setItem('presentForm',JSON.stringify(this.form))
} }
next(); next();
}, },
...@@ -445,15 +435,6 @@ export default { ...@@ -445,15 +435,6 @@ export default {
columnsProjectName: [], columnsProjectName: [],
factor: "", //风险因素 factor: "", //风险因素
showFactor: false, showFactor: false,
columnsFactor: [],
messageList: [
{
title:'回显风险源名称',
time:'2022-12-12',
name:'Mr.周',
state:1
}
],
source: "", //风险源 source: "", //风险源
userPrefix: "", //风险源 userPrefix: "", //风险源
showSource: false, showSource: false,
...@@ -515,6 +496,12 @@ export default { ...@@ -515,6 +496,12 @@ export default {
this.form.projectId='测试项目' this.form.projectId='测试项目'
}, },
mounted(){
if(sessionStorage.getItem('presentForm')!=''){
this.form=JSON.parse(sessionStorage.getItem('presentForm'))
this.form.level = sessionStorage.getItem('level')
}
},
methods: { methods: {
seletFloor(name){ seletFloor(name){
this.$toast.loading({ this.$toast.loading({
...@@ -709,27 +696,6 @@ export default { ...@@ -709,27 +696,6 @@ export default {
this.$toast.clear(); this.$toast.clear();
}, },
// 请求表单数据
getList() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFormList("/riskMain/add")
.then((res) => {
this.$toast.clear();
this.columnsProjectName = res.data.projectInformations;
this.columnsFactor = res.data.riskInventories;
this.columnsMainDutyDept = res.data.organizationList;
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
// 请求已退回详情数据 // 请求已退回详情数据
postReturnEcho() { postReturnEcho() {
this.$toast.loading({ this.$toast.loading({
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
<van-col span="15">{{ item.roomName }}</van-col> <van-col span="15">{{ item.roomName }}</van-col>
</van-row> </van-row>
</van-col> </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-col> -->
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
......
...@@ -47,15 +47,12 @@ import LHeader from "@/components/header.vue"; ...@@ -47,15 +47,12 @@ import LHeader from "@/components/header.vue";
}) })
}, },
resetClose(){ resetClose(){
this.$router.push({ sessionStorage.setItem('level','')
name:'addInherent', history.go(-1)
params:{
level:''
}
})
}, },
sureClose(){ sureClose(){
// this.$emit('',) // this.$emit('',)
sessionStorage.setItem('level',this.level)
history.go(-1) history.go(-1)
// this.$router.push({ // this.$router.push({
// name:'addInherent', // name:'addInherent',
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
/> />
<van-field <van-field
readonly
clickable clickable
name="workUserNames" name="workUserNames"
:value="form.workUserNames" :value="form.workUserNames"
......
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
goDetail(item){ goDetail(item){
console.log(item,'???') console.log(item,'???')
this.$router.push({ this.$router.push({
name:'addPresent', name:'taskDetail',
params:{ params:{
isView:false, isView:false,
// buildingId:, // buildingId:,
......
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