Browse Source

优化产品和项目路由问题

master
陈裕财 4 years ago
parent
commit
a624c4a4c5
  1. 2
      src/views/mdp/sys/user/UsersSelect.vue
  2. 11
      src/views/xm/core/xmProduct/XmProductInfo.vue
  3. 50
      src/views/xm/core/xmProduct/XmProductInfoRoute.vue
  4. 3
      src/views/xm/core/xmProduct/XmProductMng.vue
  5. 27
      src/views/xm/core/xmProject/XmProjectInfo.vue
  6. 48
      src/views/xm/core/xmProject/XmProjectInfoRoute.vue
  7. 5
      src/views/xm/core/xmProject/XmProjectMng.vue

2
src/views/mdp/sys/user/UsersSelect.vue

@ -1,5 +1,5 @@
<template> <template>
<section>
<section class="padding-left">
<el-tabs v-model="activeTabPane"> <el-tabs v-model="activeTabPane">
<el-tab-pane name="1" label="常用"> <el-tab-pane name="1" label="常用">
<el-row style="height:30px;"> <el-row style="height:30px;">

11
src/views/xm/core/xmProduct/XmProductInfo.vue

@ -302,6 +302,8 @@
this.infotype=infotype; this.infotype=infotype;
if(infotype=='返回'){ if(infotype=='返回'){
this.goBack() this.goBack()
}else{
localStorage.setItem('product-infotype',infotype);
} }
}, },
handleExport() { handleExport() {
@ -417,7 +419,8 @@
return dateStr.substr(0,10); return dateStr.substr(0,10);
} }
}, },
goBack(){
goBack(){
localStorage.setItem('product-infotype',"产品概览");
this.$router.back() this.$router.back()
} }
@ -451,7 +454,11 @@
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
var infotype=localStorage.getItem('product-infotype');
if(infotype){
this.infotype=infotype
}
}); });
} }
} }

50
src/views/xm/core/xmProduct/XmProductInfoRoute.vue

@ -7,6 +7,7 @@
<script> <script>
import util from '@/common/js/util';// import util from '@/common/js/util';//
import { listXmProductWithState } from '@/api/xm/core/xmProduct';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import XmProductInfo from './XmProductInfo' import XmProductInfo from './XmProductInfo'
@ -28,31 +29,46 @@
methods: { methods: {
initByQueryId(){
if(this.$route.query && this.$route.query.id){
var localStorageProduct=localStorage.getItem("xm-product-info-route")
var product=null;
if(localStorageProduct){
product=JSON.parse(localStorageProduct)
if(product && product.id==this.$route.query.id){
this.xmProduct=product
this.showInfo=true;
}else{
this.getProduct(this.$route.query.id);
}
}else{
this.getProduct(this.$route.query.id);
}
}
},
getProduct(id){
listXmProductWithState({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmProduct=res.data.data[0]
localStorage.setItem("xm-product-info-route",JSON.stringify(this.xmProduct))
this.showInfo=true;
}else{
}
})
}
},//end methods },//end methods
components: { components: {
XmProductInfo, XmProductInfo,
// //
},
},
activated(){ activated(){
if(this.$route.params && this.$route.params.id){
this.xmProduct=this.$route.params
this.showInfo=true;
localStorage.setItem('xm-product-info-route',JSON.stringify(this.xmProduct));
}else{
this.xmProduct=JSON.parse(localStorage.getItem("xm-product-info-route"))
this.showInfo=true;
}
this.initByQueryId();
}, },
mounted() { mounted() {
if(this.$route.params && this.$route.params.id){
this.xmProduct=this.$route.params
this.showInfo=true;
localStorage.setItem('xm-product-info-route',JSON.stringify(this.xmProduct));
}else{
this.xmProduct=JSON.parse(localStorage.getItem("xm-product-info-route"))
this.showInfo=true;
}
this.initByQueryId();
} }
} }
</script> </script>

3
src/views/xm/core/xmProduct/XmProductMng.vue

@ -532,7 +532,8 @@
//info //info
intoInfo(row) { intoInfo(row) {
this.editForm = row; this.editForm = row;
this.$router.push({ name:'XmProductInfoRoute', params: row })
this.$router.push({ name:'XmProductInfoRoute', query: {id:row.id} })
localStorage.setItem("xm-product-info-route",JSON.stringify(row));
//this.showInfo = true; //this.showInfo = true;
}, },
//xmProduct //xmProduct

27
src/views/xm/core/xmProject/XmProjectInfo.vue

@ -186,15 +186,7 @@
]), ]),
}, },
watch:{ watch:{
selProject:function(selProject){
var oldInfotype=this.infotype
this.infotype=''
this.$nextTick(()=>{
this.infotype=oldInfotype
})
}
}, },
data() { data() {
return { return {
@ -229,10 +221,7 @@
sendContent:'咨询' sendContent:'咨询'
} }
}); });
},
handleMenuSelect(menuId){
this.infotype=menuId
},
},
onUserSelected:function(users){ onUserSelected:function(users){
if(this.groupUserVisible==true){ if(this.groupUserVisible==true){
var query={} var query={}
@ -261,7 +250,9 @@
if(infotype=='返回'){ if(infotype=='返回'){
this.goBack() this.goBack()
}
}else{
localStorage.setItem('project-infotype',infotype);
}
}, },
handleExport() { handleExport() {
this.downloadLoading = true this.downloadLoading = true
@ -376,7 +367,8 @@
return dateStr.substr(0,10); return dateStr.substr(0,10);
} }
}, },
goBack(){
goBack(){
localStorage.setItem('project-infotype',"项目概览");
this.$router.back() this.$router.back()
} }
@ -408,7 +400,10 @@
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
var infotype=localStorage.getItem('project-infotype');
if(infotype){
this.infotype=infotype
}
}); });
} }
} }

48
src/views/xm/core/xmProject/XmProjectInfoRoute.vue

@ -9,6 +9,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import XmProjectInfo from './XmProjectInfo' import XmProjectInfo from './XmProjectInfo'
import { listXmProject} from '@/api/xm/core/xmProject';
export default { export default {
computed: { computed: {
@ -30,6 +31,35 @@
this.selProject=project; this.selProject=project;
localStorage.setItem('xm-project-info-route',JSON.stringify(this.selProject)); localStorage.setItem('xm-project-info-route',JSON.stringify(this.selProject));
this.$emit('submit',project) this.$emit('submit',project)
},
initByQueryId(){
if(this.$route.query && this.$route.query.id){
var localStorageProject=localStorage.getItem("xm-project-info-route")
var project=null;
if(localStorageProject){
project=JSON.parse(localStorageProject)
if(project && project.id==this.$route.query.id){
this.selProject=project
this.showInfo=true;
}else{
this.getProject(this.$route.query.id);
}
}else{
this.getProject(this.$route.query.id);
}
}
},
getProject(id){
listXmProject({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.selProject=res.data.data[0]
localStorage.setItem("xm-project-info-route",JSON.stringify(this.selProject))
this.showInfo=true;
}else{
}
})
} }
@ -39,24 +69,10 @@
// //
}, },
activated(){ activated(){
if(this.$route.params && this.$route.params.id){
this.selProject=this.$route.params
this.showInfo=true;
localStorage.setItem('xm-project-info-route',JSON.stringify(this.selProject));
}else{
this.selProject=JSON.parse(localStorage.getItem("xm-project-info-route"))
this.showInfo=true;
}
this.initByQueryId();
}, },
mounted() { mounted() {
if(this.$route.params && this.$route.params.id){
this.selProject=this.$route.params
this.showInfo=true;
localStorage.setItem('xm-project-info-route',JSON.stringify(this.selProject));
}else{
this.selProject=JSON.parse(localStorage.getItem("xm-project-info-route"))
this.showInfo=true;
}
this.initByQueryId();
} }
} }
</script> </script>

5
src/views/xm/core/xmProject/XmProjectMng.vue

@ -202,7 +202,7 @@
{{scope.row.startTime? scope.row.startTime.substr(0,10) : ""}}~{{scope.row.endTime? scope.row.endTime.substr(0,10) : ""}} {{scope.row.startTime? scope.row.startTime.substr(0,10) : ""}}~{{scope.row.endTime? scope.row.endTime.substr(0,10) : ""}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="bizFlowState" label="审批状态"min-width="120" >
<el-table-column prop="bizFlowState" label="审批状态" min-width="120" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'bizFlowState',scope.row.bizFlowState)" :key="index" :type="item.className">{{item.name}}</el-tag> <el-tag v-for="(item,index) in formatDictsWithClass(dicts,'bizFlowState',scope.row.bizFlowState)" :key="index" :type="item.className">{{item.name}}</el-tag>
</template> </template>
@ -616,7 +616,8 @@
//info //info
intoInfo(row) { intoInfo(row) {
this.selectProject = row; this.selectProject = row;
this.$router.push({ name:'XmProjectInfoRoute', params: row })
this.$router.push({ name:'XmProjectInfoRoute', query: {id:row.id} })
localStorage.setItem("xm-project-info-route",JSON.stringify(row))
//this.showInfo = true; //this.showInfo = true;
}, },

Loading…
Cancel
Save