Parcourir la source

月报:部门数据获取路径修改

洪海涛 il y a 4 ans
Parent
commit
9461ff81cc

+ 16 - 9
src/store/modules/monthlyReport/edit/index.js

@@ -95,7 +95,7 @@ export default {
       const subReports = [...params.subReports]
       // 设置部门数据
       // state.selectEnum = [...params.dependence.deptArch.children]
-      setDeptArch(state.selectEnum)
+      // setDeptArch(state.selectEnum)
       // 设置端数据
       if (params.dependence.clientType) {
         state.clientTypeList = [...params.dependence.clientType]
@@ -405,8 +405,10 @@ export default {
     },
     // 获取部门数据
     SET_SELECT_ENUM(state, params) {
+      console.log(params);
       state.selectEnum = params
-      setDeptArch(state.selectEnum)
+      console.log(state.selectEnum);
+      // setDeptArch(state.selectEnum)
     },
     // 标记为本月重点问题
     MARK_ISSUES(state, { cascaderValue, normalAreaName, multiplePeople }) {
@@ -650,11 +652,11 @@ export default {
         // 单个月报与完整月报数据梳理
         if (pageType === 'read' || pageType === 'edit') {
           commit('SET_CLIENT_TYPE_LIST', res.data.dependence.clientType)
-          commit('SET_SELECT_ENUM', res.data.dependence.deptArch.children)
+          // commit('SET_SELECT_ENUM', res.data.dependence.deptArch.children)
           commit('SET_PAGE_DATA', res.data)
         }
         console.log(res);
-        if (params.catalogTitle.search(/服务端详情|客户端详情/) > -1 && pageType === 'readAll') {
+        if (pageType === 'readAll' && params.catalogTitle.search(/服务端详情|客户端详情/) > -1) {
           res.data.splice(0,0,{depth: 1, fromUser: false, hiddenAncestor: null, isVisible: true, subTitles: null, title: "整体概览", type: "Head1", content: []})
           console.log(params)
         }
@@ -721,11 +723,16 @@ export default {
     },
     // 获取部门数据
     async setSelectEnum({ commit }, reportId) {
-      const res = await getDeptArch({
-        reportId
-      })
-      if (res.code === 200) {
-        commit('SET_SELECT_ENUM', res.data.children)
+      const depth = JSON.parse(window.localStorage.getItem('depth'))
+      console.log(depth);
+      if(!depth){
+          const res = await getDeptArch({ reportId })
+        if (res.code === 200) {
+          window.localStorage.setItem('depth', JSON.stringify(res.data.children))
+          commit('SET_SELECT_ENUM', res.data.children)
+        }
+      } else{
+        commit('SET_SELECT_ENUM', depth)
       }
     },
     // 删除月报

+ 12 - 2
src/views/monthlyReport/childrenPage/editReport/components/CascaderInfo.vue

@@ -54,14 +54,24 @@ export default {
   },
   methods: {
     init() {
-      if (this.teamData && this.teamData.length) {
+      // console.log(this.selectEnum);
+      // console.log(this.teamData);
+      if (this.teamData && this.teamData.length && this.selectEnum) {
         const itemName = []
         const onlyId = []
         this.teamData.forEach((elm) => {
           if (onlyId.indexOf(elm) < 0) {
             const item = this.find(elm)
+            // console.log(item);
+            // console.log({
+            //   label: item.label,
+            //   deptPath: item.deptPath
+            // })
             onlyId.push(elm)
-            itemName.push(item)
+            itemName.push({
+              label: item.label,
+              deptPath: item.deptPath
+            })
           }
         })
         // 数组去重

+ 1 - 1
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <headTitle style="margin-top: 40px; margin-bottom: 10px" :title="title" />
+    <!--<headTitle style="margin-top: 40px; margin-bottom: 10px" :title="title" />-->
     <div class="OverallOverviewOfTheClient">
       <onlineQuestion />
       <qualityProcess />

+ 2 - 2
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/onlineQuestion.vue

@@ -150,7 +150,7 @@ export default {
     width: 50%;
     .total-wrapper {
       color: #666;
-
+      margin-top: 10px;
       .total {
         color: #409eff;
         font-size: 18px;
@@ -161,7 +161,7 @@ export default {
   .detail-wrapper {
     width: 50%;
     padding: 10px;
-    height: 220px;
+    height: 240px;
     overflow-y: scroll;
   }
 }

+ 2 - 1
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/qualityProcess.vue

@@ -250,6 +250,7 @@ export default {
     width: 50%;
     .total-wrapper {
       color: #666;
+      margin-top: 10px;
 
       .total {
         color: #409eff;
@@ -261,7 +262,7 @@ export default {
   .detail-wrapper {
     width: 50%;
     padding: 10px;
-    height: 200px;
+    height: 240px;
     overflow-y: scroll;
   }
 }

+ 2 - 2
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheServer.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="OverallOverviewOfTheServer">
-    <div>
+<!--     <div>
       <headTitle style="margin-top: 40px; margin-bottom: 10px;" title="整体概览" />
-    </div>
+    </div> -->
     <table>
       <tr>
         <td class="first" colspan="1" rowspan="2">

+ 6 - 1
src/views/monthlyReport/childrenPage/editReport/components/core.vue

@@ -8,7 +8,6 @@
       >
       <Refresh v-if="pageDate && pageDate.status < 20" slot="refresh" :title="baseData.title" :tab-key="tabKey" :active-name="activeName" :dom-key="baseData.domKey" />
       </headTitle>
-
     </div>
     <div
       v-if="baseData.type.search(/Head2|Head3/) > -1"
@@ -84,6 +83,8 @@
         />
       </div>
     </div>
+    <OverallOverviewOfTheServer v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/服务端/) > -1" />
+    <OverallOverviewOfTheClient v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/客户端/) > -1" />
     <markingIssues ref="markingIssues" />
   </div>
 </template>
@@ -91,6 +92,8 @@
 <script>
 import _ from 'lodash'
 import headTitle from '@/components/headTitle'
+import OverallOverviewOfTheServer from './OverallOverviewOfTheServer'
+import OverallOverviewOfTheClient from './OverallOverviewOfTheClient/index'
 import contentDom from './content'
 import SubTitle from './SubTitle'
 import PushAndBanck from './PushAndBanck'
@@ -106,6 +109,8 @@ export default {
     markingIssues,
     SubTitle,
     PushAndBanck,
+    OverallOverviewOfTheServer,
+    OverallOverviewOfTheClient,
     Refresh
   },
   props: {

+ 1 - 7
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -58,8 +58,6 @@
       </el-tabs>
       <div class="body-wrapper">
         <div class="left-wrapper">
-          <OverallOverviewOfTheServer v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/服务端/) > -1" />
-          <OverallOverviewOfTheClient v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/客户端/) > -1" />
           <div v-if="tabPageShow">
             <Core v-for="(item, index) in tabPageData.children" :key="item.domKey" :dom-index="index" :base-data="item" />
           </div>
@@ -114,8 +112,6 @@ import Affix from '@/components/affix/affix'
 import Anchor from './components/anchor'
 import Menu from './components/menu'
 import Core from './components/core'
-import OverallOverviewOfTheServer from './components/OverallOverviewOfTheServer'
-import OverallOverviewOfTheClient from './components/OverallOverviewOfTheClient/index'
 import Clickoutside from 'element-ui/src/utils/clickoutside'
 import normalDialog from '@/components/dialog/normalDialog'
 
@@ -127,8 +123,6 @@ export default {
     Anchor,
     Menu,
     Core,
-    OverallOverviewOfTheServer,
-    OverallOverviewOfTheClient,
     normalDialog
   },
   directives: { Clickoutside },
@@ -201,6 +195,7 @@ export default {
     }
   },
   created() {
+    this.$store.commit('monthlyReportEdit/INIT_STATE_DATA')
     this.indexShow = true
     // 默认获取用户权限
     this.$store.dispatch('monthlyReportEdit/getUserPermission')
@@ -208,7 +203,6 @@ export default {
     this.$store.dispatch('monthlyReportEdit/setSelectEnum')
   },
   mounted() {
-    this.$store.commit('monthlyReportEdit/INIT_STATE_DATA')
     /*
      * read: 查看子月报
      * readAll:查看完整月报