diff --git a/src/views/xm/core/xmIteration/XmIterationInfo.vue b/src/views/xm/core/xmIteration/XmIterationInfo.vue index 0f579213..f1a9f6b7 100644 --- a/src/views/xm/core/xmIteration/XmIterationInfo.vue +++ b/src/views/xm/core/xmIteration/XmIterationInfo.vue @@ -161,6 +161,7 @@ if(infotype=='返回'){ this.goBack() } + localStorage.setItem('iteration-infotype',infotype); }, handleExport() { this.downloadLoading = true @@ -276,6 +277,7 @@ } }, goBack(){ + localStorage.setItem('iteration-infotype',"迭代概览"); this.$router.back() } @@ -308,7 +310,11 @@ }, mounted() { this.$nextTick(() => { - + + var infotype=localStorage.getItem('iteration-infotype'); + if(infotype){ + this.infotype=infotype + } }); } } diff --git a/src/views/xm/core/xmIteration/XmIterationInfoRoute.vue b/src/views/xm/core/xmIteration/XmIterationInfoRoute.vue index 2b790321..80d34c03 100644 --- a/src/views/xm/core/xmIteration/XmIterationInfoRoute.vue +++ b/src/views/xm/core/xmIteration/XmIterationInfoRoute.vue @@ -9,6 +9,7 @@ import { mapGetters } from 'vuex'; import XmIterationInfo from './XmIterationInfo' + import { listXmIterationWithState } from '@/api/xm/core/xmIteration'; export default { computed: { @@ -26,7 +27,35 @@ } },//end data methods: { - + initByQueryId(){ + if(this.$route.query && this.$route.query.id){ + var localStorageIteration=localStorage.getItem("xm-iteration-info-route") + var iteration=null; + if(localStorageIteration){ + iteration=JSON.parse(localStorageIteration) + if(iteration && iteration.id==this.$route.query.id){ + this.xmIteration=iteration + this.showInfo=true; + }else{ + this.getIteration(this.$route.query.id); + } + }else{ + this.getIteration(this.$route.query.id); + } + } + }, + getIteration(id){ + listXmIterationWithState({id:id}).then(res=>{ + var tips = res.data.tips; + if(tips.isOk){ + this.xmIteration=res.data.data[0] + localStorage.setItem("xm-iteration-info-route",JSON.stringify(this.xmIteration)) + this.showInfo=true; + }else{ + + } + }) + } },//end methods @@ -35,24 +64,10 @@ //在下面添加其它组件 }, activated(){ - if(this.$route.params && this.$route.params.id){ - this.xmIteration=this.$route.params - this.showInfo=true; - localStorage.setItem('xm-iteration-info-route',JSON.stringify(this.xmIteration)); - }else{ - this.xmIteration=JSON.parse(localStorage.getItem("xm-iteration-info-route")) - this.showInfo=true; - } + this.initByQueryId(); }, mounted() { - if(this.$route.params && this.$route.params.id){ - this.xmIteration=this.$route.params - this.showInfo=true; - localStorage.setItem('xm-iteration-info-route',JSON.stringify(this.xmIteration)); - }else{ - this.xmIteration=JSON.parse(localStorage.getItem("xm-iteration-info-route")) - this.showInfo=true; - } + this.initByQueryId(); } } diff --git a/src/views/xm/core/xmIteration/XmIterationMng.vue b/src/views/xm/core/xmIteration/XmIterationMng.vue index 9dd24c2a..1edcf0f6 100644 --- a/src/views/xm/core/xmIteration/XmIterationMng.vue +++ b/src/views/xm/core/xmIteration/XmIterationMng.vue @@ -329,8 +329,9 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue' //进入info界面 intoInfo(row) { - this.editForm = row; - this.$router.push({ name:'XmIterationInfoRoute', params: row }) + this.editForm = row; + localStorage.setItem("xm-iteration-info-route",JSON.stringify(row)) + this.$router.push({ name:'XmIterationInfoRoute', query: {id:row.id} }) //this.showInfo = true; }, //选择行xmIteration