Browse Source

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

qymljy 3 years ago
parent
commit
5dcf202a86

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

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

+ 1 - 1
src/components/dynamic-table/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini" :height="height" @row-click="rowClick" style="width:100%;min-height:300px"  border>
-      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width && col.width === 0 ? 150 : col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : ''">
+      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width && col.width === 0 ? 150 : col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
         <template slot-scope="scope">
           <!-- 自定义表格显示内容 -->
           <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>

+ 4 - 2
src/components/normal-basic-layout/details/index.vue

@@ -25,7 +25,7 @@
       </div>
     </div>
     <div style="box-sizing: border-box;padding:10px">
-      <el-row class="flex-align-stretch no-wrap" :gutter="10">
+      <el-row class="flex-align-stretch no-wrap" :gutter="0">
         <el-col style="flex:1 0 auto;" :span="activeApp.isdatateam?18:activeApp.isdatafollowup?18:24">
           <slot name="customBefore"></slot>
           <tabTemp :tabs="tabs" :editData="editData" :idname="idname" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" @onTabClick="onTabClick">
@@ -36,7 +36,9 @@
           <slot name="custom"></slot>
         </el-col>
         <el-col v-if="collapse" style="width:400px;" :span="6">
-          <taskTemp :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)"></taskTemp>
+          <taskTemp v-if="activeApp.isdatateam" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)">
+            <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
+          </taskTemp>
           <group v-if="activeApp.isdatateam" ref="group" style="margin-bottom:10px" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" @onSuccess="onSuccess">
             <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
           </group>

+ 14 - 2
src/components/normal-basic-layout/details/modules/task/index.vue

@@ -2,9 +2,15 @@
 <template>
     <div class="normal-panel mt-10">
       <div class="flex-align-center flex-between " style="border-bottom:1px solid #f1f2f3;padding:10px">
-        任务事项
+        <div>
+          <slot name="collapse"></slot>
+          任务事项
+        </div>
         <addTask :ownertable="ownertable" @onSuccess="listData"></addTask>
       </div>
+      <div v-if="list.length === 0">
+        <el-empty description="暂无记录" :image-size="40"></el-empty>
+      </div>
       <div class="task_list__panel" v-for="item in list" :key="item.sys_taskid">
         <div class="flex-align-center flex-between">
           <p class="task_title" @click="taskDetail(item)"><b>{{item.title}}</b></p>
@@ -24,7 +30,8 @@
     },
     data () {
       return {
-        list:[]
+        list:[],
+        oldRoute:[]
       }
     },
     methods:{
@@ -39,6 +46,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) {
+    }
   },
 
   // 操作响应提示