Forráskód Böngészése

月报设置:分析反馈修复

洪海涛 4 éve
szülő
commit
2b834e6522

+ 8 - 13
src/store/modules/monthlyReport/edit/index.js

@@ -91,7 +91,6 @@ export default {
         state.tabsActive = state.tabsList[0].name
         // table页签
         state.reportData = [...subReports]
-        // console.log(state.reportData)
       }
     },
     // 设置页面的是否为编辑页面
@@ -100,7 +99,6 @@ export default {
     },
     // 单个tab页面数据初始化设置
     INIT_TAB_PAGE_DATA(state, tabsActive = '') {
-      console.log()
       const { pageType } = state
 
       const setKey = (arr, depth) => {
@@ -131,7 +129,6 @@ export default {
           `${elm.id}` === setTabActive('tab_', tabsActive || state.tabsActive)
         )
       })
-      // console.log(tabPageData)
       if (tabsActive) {
         state.tabsActive = `tab_${tabsActive}`
       }
@@ -183,7 +180,6 @@ export default {
     ADD_EDIT_KEYS(state, key) {
       state.editKeys.push(key)
       // const index = state.editKeys.indexOf(key)
-      // console.log(state.editKeys, key, index)
       // if (index < 0) {
       //   state.editKeys.push(key)
       // }
@@ -213,7 +209,6 @@ export default {
     // 子页签数据切换
     SUB_TABS_ACTIVE(state, { key, oldKey }) {
       const index = state.subTabsActive.indexOf(oldKey)
-      // console.log(index, key, oldKey)
       if (index < 0) {
         state.subTabsActive.push(key)
       } else {
@@ -411,13 +406,11 @@ export default {
     },
     // 设置右侧树的提示内容
     SET_HEADER_TITLE(state, { domKey, headerTitle }) {
-      // console.log(domKey, headerTitle)
       let isAdd = true
       const run = (arr) => {
         arr.forEach((elm) => {
           if (isAdd && elm.domKey === domKey) {
             elm.headerTitle = headerTitle
-            // console.log(elm)
             isAdd = false
           }
           if (isAdd && elm.content && elm.content.length) {
@@ -441,15 +434,16 @@ export default {
     //   state.subTitle = name
     // },
     SET_SUB_TITLE(state, { id, name }) {
-      console.log({ id, name })
       // commit('SET_SUB_TITLE', {
       //   parentId: res.data.parentId,
       //   name: res.data.reportName
       // })
       state.reportList && state.reportList.forEach(elm => {
         if (`${elm.id}` === id) {
-          state.pageDate = {
-            status: elm.status
+          if (!name) {
+            state.pageDate = {
+              status: elm.status
+            }
           }
           // 如果是
           if (elm.status === 30) {
@@ -569,7 +563,6 @@ export default {
         return elm
       })
       // 转换数据结构
-      // console.log(params)
       const res = await updateMonthlyReport(params)
       if (res.code === 200) {
         cb()
@@ -613,9 +606,11 @@ export default {
       }
     },
     // 月报确认
-    async confirmReport({ state }, cb) {
+    async confirmReport({ state }, {
+      id, cb
+    }) {
       const res = await sendSubConfirm({
-        subReportId: state.pageDate.id
+        subReportId: id
       })
       if (res.code === 200) {
         cb()

+ 4 - 3
src/views/monthlyReport/childrenPage/editReport/components/MrTable.vue

@@ -284,7 +284,7 @@ export default {
   },
   computed: {
     isExpand() {
-      return (this.tabsActive.search(/本月重点问题/) > -1 && this.pageType === 'readAll') || (this.pageType === 'read' && this.title === '本月重点问题')
+      return this.pageDate.status === 30 && ((this.tabsActive.search(/本月重点问题/) > -1 && this.pageType === 'readAll') || (this.pageType === 'read' && this.title === '本月重点问题'))
     },
     selectEnum() {
       return this.$store.state.monthlyReportEdit.selectEnum
@@ -434,8 +434,9 @@ export default {
     setAnalyticFeedback() {
       if (
         // this.pageType.search(/edit/) < 0 &&
-        this.pageDate.status > 10 &&
-        this.tabsActive.indexOf('本月重点问题') > -1
+        // this.pageDate.status > 10 &&
+        // this.tabsActive.indexOf('本月重点问题') > -1
+        this.isExpand
       ) {
         const tabPageData = reportDataBack(_.cloneDeep(this.tabPageData))
         let obj = null

+ 5 - 2
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -390,8 +390,11 @@ export default {
     },
     // 月报确认
     confirmReport() {
-      this.$store.dispatch('monthlyReportEdit/confirmReport', () => {
-        this.$router.push({ path: '/monthlyReport/index' })
+      this.$store.dispatch('monthlyReportEdit/confirmReport', {
+        id: this.$route.query.subReportId,
+        cb:() => {
+          this.$router.push({ path: '/monthlyReport/index' })
+        }
       })
     },
     deleteReport(key) {

+ 2 - 2
src/views/monthlyReport/components/monthlyEards.vue

@@ -2,8 +2,8 @@
   <el-card shadow="always" class="card">
     <div class="Layout-flex report-header">
       <span>{{ data.bizName }}</span>
-      <el-button v-show="data.status === 20 || data.status === 30" type="text" @click="$router.push({ path: '/monthlyReport/edit', query: { pageType: data.status === 0 ? 'edit' : 'read', subReportId: data.subReportId }})">查看更多</el-button>
-      <el-button v-show="data.status < 20" type="text" @click="$router.push({ path: '/monthlyReport/edit', query: { pageType: 'edit', subReportId: data.subReportId }})">填写</el-button>
+      <el-button v-show="data.status === 20 || data.status === 30" type="text" @click="$router.push({ path: '/monthlyReport/edit', query: { pageType: data.status === 0 ? 'edit' : 'read', reportId: data.parentId, subReportId: data.subReportId }})">查看更多</el-button>
+      <el-button v-show="data.status < 20" type="text" @click="$router.push({ path: '/monthlyReport/edit', query: { pageType: 'edit', subReportId: data.subReportId, reportId: data.parentId }})">填写</el-button>
     </div>
     <div class="report-title">
       <svg-icon class="report-icon-title" icon-class="icon-red" />重点问题