소스 검색

月报问题修复2

洪海涛 4 년 전
부모
커밋
25b859a213
1개의 변경된 파일14개의 추가작업 그리고 2개의 파일을 삭제
  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
       let { subReportId } = route.query
       const { pageType } = route.query
       const { pageType } = route.query
       const [tabKey, subTabKey] = state.subTabsActive
       const [tabKey, subTabKey] = state.subTabsActive
+      console.log(state, 1016)
+      // 查询
       if (!subReportId) {
       if (!subReportId) {
         if (pageType !== 'readAll') {
         if (pageType !== 'readAll') {
           subReportId = state.tabsActive.replace(/tab_/, '')
           subReportId = state.tabsActive.replace(/tab_/, '')
         }
         }
         if (pageType === 'readAll') {
         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 => {
           state.subReportInfo.forEach(elm => {
-            if (elm.reportName === tabName) {
+            if(elm.reportName === tabName) {
               subReportId = elm.id
               subReportId = elm.id
             }
             }
           })
           })