洪海涛 4 жил өмнө
parent
commit
ad06ecc4bd

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

@@ -661,10 +661,10 @@ export default {
           // commit('SET_SELECT_ENUM', res.data.dependence.deptArch.children)
           commit('SET_PAGE_DATA', res.data)
         }
-        console.log(res)
+        // console.log(res)
         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: [{ type: 'overallOverviewo' }] })
-          console.log(params)
+          // console.log(params)
         }
         commit('SET_TAB_PAGE_DATA', {
           data:

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

@@ -661,10 +661,10 @@ export default {
           // commit('SET_SELECT_ENUM', res.data.dependence.deptArch.children)
           commit('SET_PAGE_DATA', res.data)
         }
-        console.log(res)
+        // console.log(res)
         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: [{ type: 'overallOverviewo' }] })
-          console.log(params)
+          // console.log(params)
         }
         commit('SET_TAB_PAGE_DATA', {
           data:

+ 26 - 14
src/views/monthlyReport/v2/childrenPage/editReport/components/core.vue

@@ -144,6 +144,7 @@
 
 <script>
 import _ from 'lodash'
+import { mapState, mapMutations } from 'vuex'
 import headTitle from '@/components/headTitle'
 import contentDom from './content'
 import SubTitle from './SubTitle'
@@ -198,22 +199,27 @@ export default {
       }
       return `${this.baseData.domIndexKey + 1}、`
     },
-    tabsActive() {
-      return this.$store.state.monthlyReportEditV2.tabsActive
-    },
-    pageType() {
-      return this.$store.state.monthlyReportEditV2.pageType
-    },
-    pageDate() {
-      return this.$store.state.monthlyReportEditV2.pageDate
-    }
+    ...mapState('monthlyReportEditV2', ['tabsActive', 'pageType', 'pageDate'])
+    // tabsActive() {
+    //   return this.$store.state.monthlyReportEditV2.tabsActive
+    // },
+    // pageType() {
+    //   return this.$store.state.monthlyReportEditV2.pageType
+    // },
+    // pageDate() {
+    //   return this.$store.state.monthlyReportEditV2.pageDate
+    // }
   },
   watch: {
     activeName(val, old) {
-      this.$store.commit('monthlyReportEditV2/SUB_TABS_ACTIVE', {
+      this.SUB_TABS_ACTIVE({
         key: val,
         oldKey: old
       })
+      // this.$store.commit('monthlyReportEditV2/SUB_TABS_ACTIVE', {
+      //   key: val,
+      //   oldKey: old
+      // })
     },
     'baseData.content': {
       handler() {
@@ -224,7 +230,6 @@ export default {
     }
   },
   mounted() {
-    console.log(212)
     if (
       this.baseData &&
       this.baseData.children &&
@@ -240,6 +245,7 @@ export default {
     this.pushAndBanckheadle()
   },
   methods: {
+    ...mapMutations('monthlyReportEditV2', ['SUB_TABS_ACTIVE', 'GET_ALL_OFFSETTOP', 'INIT_EDIT_KEYS', 'SET_HEADER_TITLE']),
     // 发布&回滚 标题设置
     pushAndBanckheadle() {
       const [elm] = this.baseData.content
@@ -262,8 +268,10 @@ export default {
       this.loading = true
       // console.log(tab, event)
       this.$nextTick(() => {
-        this.$store.commit('monthlyReportEditV2/GET_ALL_OFFSETTOP')
-        this.$store.commit('monthlyReportEditV2/INIT_EDIT_KEYS')
+        this.GET_ALL_OFFSETTOP()
+        this.INIT_EDIT_KEYS()
+        // this.$store.commit('monthlyReportEditV2/GET_ALL_OFFSETTOP')
+        // this.$store.commit('monthlyReportEditV2/INIT_EDIT_KEYS')
       })
       setTimeout(() => {
         this.domKey = new Date().getTime()
@@ -280,10 +288,14 @@ export default {
       // }
       if (title.search(/\{param\}/) > -1) {
         this.headerTitle = this.generalDelayTitle(title)
-        this.$store.commit('monthlyReportEditV2/SET_HEADER_TITLE', {
+        this.SET_HEADER_TITLE({
           domKey: this.baseData.domKey,
           headerTitle: `${this.headerTitle}`
         })
+        // this.$store.commit('monthlyReportEditV2/SET_HEADER_TITLE', {
+        //   domKey: this.baseData.domKey,
+        //   headerTitle: `${this.headerTitle}`
+        // })
         return
       }
       // 得到3的,得到23的

+ 22 - 28
src/views/monthlyReport/v2/components/monthlyEards.vue

@@ -1,34 +1,42 @@
 <template>
   <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="jump('report_home_SeeMore', '/monthlyReport/edit', { pageType: data.status === 0 ? 'edit' : 'read', reportId: data.parentId, subReportId: data.subReportId })">查看更多</el-button>
-      <el-button v-show="data.status === 10" type="text" @click="jump('report_home_Edit', '/monthlyReport/edit', { pageType: 'edit', subReportId: data.subReportId, reportId: data.parentId })">填写</el-button>
+      <span>{{ datas.bizName }}</span>
+      <el-button v-show="datas.status === 20 || datas.status === 30" type="text" @click="jump('report_home_SeeMore', '/monthlyReport/edit_v2', { pageType: datas.status === 0 ? 'edit' : 'read', reportId: datas.parentId, subReportId: datas.subReportId })">查看更多</el-button>
+      <el-button v-show="datas.status === 10" type="text" @click="jump('report_home_Edit', '/monthlyReport/edit_v2', { pageType: 'edit', subReportId: datas.subReportId, reportId: datas.parentId })">填写</el-button>
     </div>
     <div class="report-title">
       <svg-icon class="report-icon-title" icon-class="icon-red" />重点问题
     </div>
     <section class="report-content-data">
       <div style="color: #FAAD14;">
-        待反馈:{{ data.feedback || '无' }};
-        改进项:{{ data.improveNum }},
-        已完成:{{ data.finishNum }}
+        待反馈:{{ datas.feedback || '无' }};
+        改进项:{{ datas.improveNum }},
+        已完成:{{ datas.finishNum }}
       </div>
-      <div v-for="(i, v) in data.keyProblems" :key="v">
-        <span>{{ `${v + 1}、${i.name}` }}</span>
-        归属:<span>{{ i.team ? i.team + '团队' : '' }} {{ i.charge && i.team ? '-' : '' }} {{ i.charge || '' }}</span>
+
+      <div v-if="datas && datas.keyProblems && datas.keyProblems.length">
+        <div v-for="(item, index) in datas.keyProblems" :key="index">
+          <span>{{ `${index + 1}、${item.name}` }}</span>
+          归属:<span>{{ item.team ? item.team + '团队' : '' }} {{
+            item.charge && item.team ? '-' : ''
+          }} {{ item.charge || '' }}</span>
+        </div>
       </div>
-      <div v-for="(q, index) in data.returnBackDataList" :key="index">
-        <span>{{ `${data.keyProblems.length + index + 1}、${q.name}` }}</span>
-        <span>{{ q.team }}</span>
+      <div v-if="datas && datas.returnBackDataList && datas.returnBackDataList.length">
+        <div v-for="(item, index) in datas.returnBackDataList" :key="index">
+          <span>{{ `${datas.keyProblems.length + index + 1}、${item.name}` }}</span>
+          <span>{{ item.team }}</span>
+        </div>
       </div>
+
     </section>
     <div class="report-title">
       <svg-icon class="report-icon-title" icon-class="icon-yellow" />上月改进
     </div>
     <section class="report-content-data" style="margin-bottom: 20px;">
-      <div v-if="data.lastMonthImprovmentList && !data.lastMonthImprovmentList[0]">暂无数据</div>
-      <div v-for="(item, index) in data.lastMonthImprovmentList" v-else :key="index">
+      <div v-if="datas.lastMonthImprovmentList && !datas.lastMonthImprovmentList[0]">暂无数据</div>
+      <div v-for="(item, index) in datas.lastMonthImprovmentList" v-else :key="index">
         <span>{{ `${index + 1}、${item.name}` }}</span>
         归属团队:<span>{{ item.team || '无' }}</span>
         达成情况:<span>{{ item.process || '无' }}</span>
@@ -42,20 +50,6 @@ export default {
   props: {
     datas: { type: Object, required: true }
   },
-  data() {
-    return {
-      data: {}
-    }
-  },
-  watch: {
-    datas: {
-      handler(newV) {
-        this.data = newV
-      },
-      deep: true,
-      immediate: true
-    }
-  },
   methods: {
     jump(str, path, query) {
       window.log({ c: 'report_home', d: str })

+ 9 - 9
src/views/monthlyReport/v2/index.vue

@@ -14,7 +14,7 @@
       <template slot="content">
         <div v-if="reportData.roleCode !== 30">
           <el-button type="primary" size="small" @click="createReport">新建月报</el-button>
-          <el-button plain size="small" @click="jump('report_home_set', '/monthlyReport/set', {})">月报设置</el-button>
+          <el-button plain size="small" @click="jump('report_home_set', '/monthlyReport/set_v2', {})">月报设置</el-button>
         </div>
       </template>
     </headerCom>
@@ -22,8 +22,8 @@
     <div v-loading="contentLoading" class="content-wrapper">
       <div class="content-reportName">
         {{ reportName }}
-        <el-button v-if="reportStatus.status === 20" type="text" @click="jump('report_home_Publication', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 月报发布</el-button>
-        <el-button v-if="reportStatus.status === 30" type="text" @click="jump('report_home_viewReport', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 查看完整报告</el-button>
+        <el-button v-if="reportStatus.status === 20" type="text" @click="jump('report_home_Publication', '/monthlyReport/edit_v2', { pageType: 'readAll', reportId: reportStatus.id })"> 月报发布</el-button>
+        <el-button v-if="reportStatus.status === 30" type="text" @click="jump('report_home_viewReport', '/monthlyReport/edit_v2', { pageType: 'readAll', reportId: reportStatus.id })"> 查看完整报告</el-button>
         <el-button v-if="reportStatus.status === 0" type="text" @click="sendConfirm(reportData)"> 发送确认</el-button>
       </div>
       <div v-show="reportStatus.status === 30" class="report-bottom">
@@ -32,9 +32,9 @@
       <div v-show="reportStatus.status === 10" class="report-bottom">
         <span v-if="tagData.confirmeList || tagData.toBeConfirmList "><i class="el-icon-warning report-icon-warning" /> 已确认业务线<b>{{ tagData.confirmeList || '无' }}</b> ,未确认业务线<b>{{ tagData.toBeConfirmList || '无' }}</b>。 </span>
       </div>
-      <el-row v-if="tagData && tagData.subReportList" :gutter="12">
-        <el-col v-for="(i, k) in tagData.subReportList" :key="k + 'yh'" :span="innerWidth">
-          <monthlyEards :datas="i" />
+      <el-row v-if="tagData && tagData.subReportList && tagData.subReportList.length" :gutter="12">
+        <el-col v-for="(item, index) in tagData.subReportList" :key="index + 'yh'" :span="innerWidth">
+          <monthlyEards :datas="item" />
         </el-col>
       </el-row>
     </div>
@@ -148,7 +148,7 @@ export default {
             }
           })
         }
-        console.log(this.$route.query.reportId, index, 146)
+        // console.log(this.$route.query.reportId, index, 146)
         this.reportValue = res.data.reportList[index].id
         this.reportName = res.data.reportList[index].reportName
         this.reportStatus = res.data.reportList[index]
@@ -188,7 +188,7 @@ export default {
           createMonthlyReport(data).then(res => {
             if (res.code === 200) {
               this.loading = false
-              this.$router.push({ path: '/monthlyReport/edit', query: { pageType: 'editAll', reportId: res.data.id, type: 'create' }})
+              this.$router.push({ path: '/monthlyReport/edit_v2', query: { pageType: 'editAll', reportId: res.data.id, type: 'create' }})
               window.log({ c: 'report_home', d: 'report_home_create' })
             }
           })
@@ -196,7 +196,7 @@ export default {
       })
     },
     async sendConfirm() {
-      this.$router.push({ path: '/monthlyReport/edit', query: { pageType: 'editAll', reportId: this.reportStatus.id }})
+      this.$router.push({ path: '/monthlyReport/edit_v2', query: { pageType: 'editAll', reportId: this.reportStatus.id }})
     },
     getReportStatus(e) {
       this.contentLoading = true