浏览代码

代码上传

zhangqiOMG 2 年之前
父节点
当前提交
482bab5651

+ 2 - 3
src/HDrpManagement/projectChange/modules/detail.vue

@@ -348,9 +348,9 @@ export default {
         {
           label:'项目状态',
           value: this.mainData.status,
-          style:function () {
+          style: ()=> {
             let style = {}
-            switch (that.mainData.tradingstatus) {
+            switch (that.mainData.status) {
               case '已成交':
                 style = {color:'#fa8c16'}
                 break;
@@ -364,7 +364,6 @@ export default {
                 break;
             }
             return style
-
           }
         },
         {

+ 7 - 1
src/components/normal-basic-layout/details/modules/task/index.vue

@@ -24,7 +24,8 @@
     },
     data () {
       return {
-        list:[]
+        list:[],
+        oldRoute:[]
       }
     },
     methods:{
@@ -39,6 +40,11 @@
         this.list = res.data
       },
       taskDetail (item) {
+        let route = this.$route
+        if (route.path !== '/taskDetails') {
+          this.oldRoute = {path:route.path,query:route.query}
+          this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        }
         this.$router.replace({path:'/taskDetails',query:{id:item.sys_taskid,rowindex:item.rowindex}})
       }
     },

+ 10 - 4
src/components/normal-basic-layout/drawerDetail/drawer.vue

@@ -18,7 +18,8 @@ import  {mapGetters} from 'vuex'
 export default {
   computed:{
     ...mapGetters({
-      closeDrawerTemp:'closeDrawerTemp'
+      closeDrawerTemp:'closeDrawerTemp',
+      historyRouter:'historyRouter'
     })
 	},
   data () {
@@ -33,9 +34,14 @@ export default {
   },
   methods:{
     closeDrawer (done) {
-      this.$router.go(-1)
-      
-      this.$store.dispatch('changeDetailDrawer',false)
+      if (this.historyRouter) {
+        console.log(this.historyRouter)
+        this.$router.replace(this.historyRouter)
+        this.$store.dispatch('setHistoryRouter',null)
+      } else {
+        this.$store.dispatch('changeDetailDrawer',false)
+        this.$router.go(-1)
+      }
     }
   },
   mounted () {

+ 10 - 6
src/components/normal-basic-layout/index.vue

@@ -271,12 +271,16 @@ export default {
     this.autoQuery === false?'':this.listData()
   },
   created () {
-    this.routerName = this.$route.meta.title
-    this.layout = this.tool.tabelCol(this.$route.name)[this.tableName].tablecols
-    this.tableLayout = this.layout
-    this.$emit('listCreate',this.param)
-
-    this.getSystemAppid()
+    try {
+      this.routerName = this.$route.meta.title
+      this.layout = this.tool.tabelCol(this.$route.name)[this.tableName].tablecols
+      this.tableLayout = this.layout
+      this.$emit('listCreate',this.param)
+      this.getSystemAppid()
+    } catch (error) {
+      
+    }
+   
   }
 }
 

+ 12 - 2
src/store/index.js

@@ -25,7 +25,8 @@ export default new Vuex.Store({
     sys_modules:[],
     searchValue:'',
     closeDrawerTemp:false,
-    DrawerShow:false
+    DrawerShow:false,
+    historyRouter:null
   },
   getters: {
     siteinfo:state => state.siteinfo,
@@ -43,7 +44,8 @@ export default new Vuex.Store({
     searchValue:state => state.searchValue,
     closeDrawerTemp:state => state.closeDrawerTemp,
     DrawerShow:state => state.DrawerShow,
-    sys_modules:state => state.sys_modules
+    sys_modules:state => state.sys_modules,
+    historyRouter:state => state.historyRouter
     
   },
   mutations: {
@@ -97,6 +99,9 @@ export default new Vuex.Store({
     },
     DrawerShowChange (state,bool) {
       state.DrawerShow = bool
+    },
+    setHistoryRouter (state,route) {
+      state.historyRouter = route
     }
   },
   actions: {
@@ -252,6 +257,11 @@ export default new Vuex.Store({
         const res = await api.requested(obj)
         reslove(res)
       })
+    },
+
+    // 设置历史路由用于返回记录的地址
+    setHistoryRouter ({commit},route) {
+      commit('setHistoryRouter',route)
     }
   },
   modules: {

+ 14 - 13
src/utils/tool.js

@@ -19,8 +19,6 @@ export default {
       return _haveAuth
       
     } catch (error) {
-      // console.log(error)
-      // router.replace('/home')
     }
     
    
@@ -28,17 +26,20 @@ export default {
 
   // 获取应用表格
   tabelCol (appname) {
-    // 获取应用数据
-    let apps = JSON.parse(sessionStorage.getItem('active_modules'))
-    
-    let module_list =  apps.apps
-    // 获取当前应用数据
-    let active_modules = module_list.filter(item => {
-      return item.name === appname
-    })
-    // 获取当前应用表格数据
-    let tablecols = active_modules[0].meta.tables
-    return tablecols
+    try {
+      // 获取应用数据
+      let apps = JSON.parse(sessionStorage.getItem('active_modules'))
+      
+      let module_list =  apps.apps
+      // 获取当前应用数据
+      let active_modules = module_list.filter(item => {
+        return item.name === appname
+      })
+      // 获取当前应用表格数据
+      let tablecols = active_modules[0].meta.tables
+      return tablecols
+    } catch (error) {
+    }
   },
 
   // 操作响应提示