Browse Source

月报问题修复2

洪海涛 4 years ago
parent
commit
25b859a213
1 changed files with 14 additions and 2 deletions
  1. 14 2
      src/store/modules/monthlyReport/edit/index.js

+ 14 - 2
src/store/modules/monthlyReport/edit/index.js

@@ -1012,14 +1012,26 @@ export default {
       let { subReportId } = route.query
       const { pageType } = route.query
       const [tabKey, subTabKey] = state.subTabsActive
+      console.log(state, 1016)
+      // 查询
       if (!subReportId) {
         if (pageType !== 'readAll') {
           subReportId = state.tabsActive.replace(/tab_/, '')
         }
         if (pageType === 'readAll') {
-          const tabName = state.tabsActive.replace(/tab_/, '')
+          let tabName = ''
+          console.log(tabName)
+          // 找到当前 domkey 对应的业务线名称
+          state.tabPageData.children.forEach(elm => {
+            elm.children && elm.children.forEach(item => {
+              if (item.domKey === domKey && !tabName) {
+                tabName = elm.title
+              }
+            })
+          })
+          // 根据找到的业务线名称查询业务线ID
           state.subReportInfo.forEach(elm => {
-            if (elm.reportName === tabName) {
+            if(elm.reportName === tabName) {
               subReportId = elm.id
             }
           })