Browse Source

月报:历史记录

洪海涛 4 years ago
parent
commit
09b7be1e48

+ 6 - 5
src/store/modules/monthlyReport/baseMixin/actions.js

@@ -35,7 +35,7 @@ export default {
   // 月报数据获取
   // 月报数据获取
   async initPageData(
   async initPageData(
     { commit, state, dispatch },
     { commit, state, dispatch },
-    { id, subReportId, subActive, windowHref }
+    { id, subReportId, subActive, windowHref, historyId }
   ) {
   ) {
     dispatch('setSubReportInfo', id)
     dispatch('setSubReportInfo', id)
     const { pageType } = state
     const { pageType } = state
@@ -49,7 +49,8 @@ export default {
         id,
         id,
         subReportId,
         subReportId,
         tabsActive: `tab_${subActive || '上月问题跟进'}`,
         tabsActive: `tab_${subActive || '上月问题跟进'}`,
-        windowHref
+        windowHref,
+        historyId
       })
       })
     } else {
     } else {
       const res = await getMonthlyReport(id)
       const res = await getMonthlyReport(id)
@@ -76,7 +77,7 @@ export default {
     }
     }
   },
   },
   // 获取查看月报数据
   // 获取查看月报数据
-  async getSubReportData({ dispatch, commit, state }, { id, subReportId, tabsActive, windowHref }) {
+  async getSubReportData({ dispatch, commit, state }, { id, subReportId, tabsActive, windowHref, historyId }) {
     const { pageType } = state
     const { pageType } = state
     let params = {}
     let params = {}
     let method = pageType === 'readAll' ? getAllSubReportCatalog : getSubReport
     let method = pageType === 'readAll' ? getAllSubReportCatalog : getSubReport
@@ -97,7 +98,7 @@ export default {
     if (windowHref.indexOf('isHistory=new') > -1) {
     if (windowHref.indexOf('isHistory=new') > -1) {
       method = getHistoryDetail
       method = getHistoryDetail
       params = {
       params = {
-        historyId: subReportId
+        historyId: historyId
       }
       }
     }
     }
     const res = await method(params)
     const res = await method(params)
@@ -106,7 +107,7 @@ export default {
     if (res.code === 200) {
     if (res.code === 200) {
       // 单个月报与完整月报数据梳理
       // 单个月报与完整月报数据梳理
       if (pageType === 'read' || pageType === 'edit') {
       if (pageType === 'read' || pageType === 'edit') {
-        commit('SET_CLIENT_TYPE_LIST', res.data.dependence.clientType)
+        // 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)
         commit('SET_PAGE_DATA', res.data)
       }
       }

+ 7 - 0
src/store/modules/monthlyReport/baseMixin/mutations.js

@@ -353,6 +353,13 @@ export default {
     // console.log(state.selectEnum)
     // console.log(state.selectEnum)
     // setDeptArch(state.selectEnum)
     // setDeptArch(state.selectEnum)
   },
   },
+  // 获取isHistory数据
+  SETISHISTORY(state, isHistory) {
+    // console.log(params)
+    state.isHistory = isHistory
+    // console.log(state.selectEnum)
+    // setDeptArch(state.selectEnum)
+  },
   // 标记为本月重点问题
   // 标记为本月重点问题
   MARK_ISSUES(state, { cascaderValue, normalAreaName, multiplePeople }) {
   MARK_ISSUES(state, { cascaderValue, normalAreaName, multiplePeople }) {
     let isAdd = true
     let isAdd = true

+ 1 - 0
src/store/modules/monthlyReport/baseMixin/state.js

@@ -19,6 +19,7 @@ export default {
   peopleLists: [], // 人员账号数据
   peopleLists: [], // 人员账号数据
   subTitle: '新建月报',
   subTitle: '新建月报',
   subReportName: '',
   subReportName: '',
+  isHistory: '',
   version: '', // 月报版本
   version: '', // 月报版本
   subReportInfo: null, // 为回退时,当前页面为查看完整时,无法获取子月报数据情况设置
   subReportInfo: null, // 为回退时,当前页面为查看完整时,无法获取子月报数据情况设置
   timeout: null, // 函数防抖/节流
   timeout: null, // 函数防抖/节流

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

@@ -35,7 +35,7 @@
           <template slot-scope="scope">
           <template slot-scope="scope">
             <!--    展开    -->
             <!--    展开    -->
             <div v-if="item.type === 'expand'">
             <div v-if="item.type === 'expand'">
-<!--              <div @click="showItem(item, scope)">item</div>-->
+              <!-- <div @click="showItem(item, scope)">item</div>-->
               <TableExpandRowList
               <TableExpandRowList
                 v-if="scope.row.analyticFeedbackList"
                 v-if="scope.row.analyticFeedbackList"
                 :columns="columns"
                 :columns="columns"
@@ -87,7 +87,7 @@
                     </el-dropdown>
                     </el-dropdown>
                   </span>
                   </span>
                   <!--链接-->
                   <!--链接-->
-                  <span v-else-if="btnItem.value === '链接' && isShowButton(scope.row, item)" @click.stop>
+                  <span v-else-if="btnItem.value === '链接' && isShowButton(scope.row, item) && pageType.search(/edit/) > -1" @click.stop>
                     <el-popover v-if="scope.row.operationTarget" placement="bottom-start" trigger="hover">
                     <el-popover v-if="scope.row.operationTarget" placement="bottom-start" trigger="hover">
                       <el-button-group>
                       <el-button-group>
                         <el-button
                         <el-button
@@ -261,7 +261,7 @@
     </span>
     </span>
 
 
     <div class="plus-table-data" :style="{ marginBottom: plusTableDataBottom }" @click.stop>
     <div class="plus-table-data" :style="{ marginBottom: plusTableDataBottom }" @click.stop>
-      <el-button v-if="pageDate && pageDate.status < 20" type="text" @click.stop="addTableData">
+      <el-button v-if="pageDate && pageDate.status < 20 && !isHistory" type="text" @click.stop="addTableData">
         <svg-icon icon-class="data-plus" class="icon" />
         <svg-icon icon-class="data-plus" class="icon" />
         新增
         新增
       </el-button>
       </el-button>
@@ -424,6 +424,9 @@ export default {
     },
     },
     version() {
     version() {
       return this.$store.state.monthlyReportEdit.version
       return this.$store.state.monthlyReportEdit.version
+    },
+    isHistory() {
+      return this.$store.state.monthlyReportEdit.isHistory
     }
     }
   },
   },
   watch: {
   watch: {
@@ -655,8 +658,9 @@ export default {
         }
         }
       })
       })
       // if (this.pageDate.status > 10 && this.tabsActive.indexOf('本月重点问题') < 0) {
       // if (this.pageDate.status > 10 && this.tabsActive.indexOf('本月重点问题') < 0) {
+      const { isHistory } = this.$route.query
       // 非编辑状态,并且不是·本月重点问题·,删除操作按钮
       // 非编辑状态,并且不是·本月重点问题·,删除操作按钮
-      if (this.pageDate && this.pageDate.status > 10 && !this.isExpand) {
+      if (this.pageDate && this.pageDate.status > 10 && !this.isExpand || isHistory) {
         newColumns.splice(newColumns.length - 1, 1)
         newColumns.splice(newColumns.length - 1, 1)
       }
       }
       return newColumns
       return newColumns
@@ -806,6 +810,7 @@ export default {
       ) {
       ) {
         return true
         return true
       }
       }
+
       if (row.analyticFeedback && row.analyticFeedback.isCommitted) {
       if (row.analyticFeedback && row.analyticFeedback.isCommitted) {
         return false
         return false
       }
       }

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

@@ -6,15 +6,15 @@
       </div>
       </div>
       <div class="value">
       <div class="value">
         <el-input
         <el-input
-          v-if="pageDate.status < 20"
+          v-if="pageDate.status < 20 && !isHistory"
           v-model="textValue"
           v-model="textValue"
           type="textarea"
           type="textarea"
           :placeholder="headerTitleType === 'Head2' ? `请针对${headerTitle}进行分析` : '请输入'"
           :placeholder="headerTitleType === 'Head2' ? `请针对${headerTitle}进行分析` : '请输入'"
           show-word-limit
           show-word-limit
         />
         />
         <span
         <span
-          v-if="pageDate.status > 10 && textValue"
-          style="display: inline-block;line-height: 1.65;    background-color: #f7f7f7; padding: 10px; border-radius: 5px;"
+          v-if="pageDate.status > 10 && textValue || isHistory && textValue"
+          style="display: inline-block;line-height: 1.65;background-color: #f7f7f7; padding: 10px; border-radius: 5px;"
           v-html="textValue.replace(/\n/g, '<br />')"
           v-html="textValue.replace(/\n/g, '<br />')"
           />
           />
       </div>
       </div>
@@ -62,7 +62,7 @@ export default {
     }
     }
   },
   },
   computed: {
   computed: {
-    ...mapState('monthlyReportEdit', ['pageType', 'pageDate'])
+    ...mapState('monthlyReportEdit', ['pageType', 'pageDate', 'isHistory'])
     // pageType() {
     // pageType() {
     //   return this.$store.state.monthlyReportEditV2.pageType
     //   return this.$store.state.monthlyReportEditV2.pageType
     // },
     // },

+ 7 - 4
src/views/monthlyReport/childrenPage/editReport/components/core.vue

@@ -7,7 +7,7 @@
         @click.native.stop="baseDataShow"
         @click.native.stop="baseDataShow"
       >
       >
         <Refresh
         <Refresh
-          v-if="pageDate && pageDate.status < 20"
+          v-if="pageDate && pageDate.status < 20 && !isHistory"
           slot="refresh"
           slot="refresh"
           :title="baseData.title"
           :title="baseData.title"
           :tab-key="tabKey"
           :tab-key="tabKey"
@@ -48,7 +48,7 @@
         style="margin-bottom: 10px"
         style="margin-bottom: 10px"
       />
       />
       <PushAndBanck
       <PushAndBanck
-        v-else-if="baseData.title.indexOf('发布&回滚') > -1"
+        v-else-if="baseData.title.indexOf('发布&回滚') > -1 && !isHistory"
         :title="baseData.title"
         :title="baseData.title"
         :sub-title="baseData.subTitles"
         :sub-title="baseData.subTitles"
         style="margin-bottom: 5px"
         style="margin-bottom: 5px"
@@ -69,13 +69,13 @@
         :sub-title="baseData.subTitles"
         :sub-title="baseData.subTitles"
         style="margin-bottom: 10px" /><span v-if="baseData.title.search(/提测打回|增发/) > -1">。</span>
         style="margin-bottom: 10px" /><span v-if="baseData.title.search(/提测打回|增发/) > -1">。</span>
       <Refresh
       <Refresh
-        v-if="pageDate && pageDate.status < 20"
+        v-if="pageDate && pageDate.status < 20 && !isHistory"
         slot="refresh"
         slot="refresh"
         :title="baseData.title"
         :title="baseData.title"
         :dom-key="baseData.domKey"
         :dom-key="baseData.domKey"
         :style="{marginLeft: baseData.title.search(/线上问题/) > -1 ? '5px' : '5px'}" />
         :style="{marginLeft: baseData.title.search(/线上问题/) > -1 ? '5px' : '5px'}" />
       <span><el-button
       <span><el-button
-        v-if="headerTitle.indexOf('线下缺陷') > -1 && pageDate.status < 20"
+        v-if="headerTitle.indexOf('线下缺陷') > -1 && pageDate.status < 20 && !isHistory"
         type="text"
         type="text"
         style="margin-left: 15px;font-weight: 400;"
         style="margin-left: 15px;font-weight: 400;"
         @click.stop="marking">标记</el-button></span>
         @click.stop="marking">标记</el-button></span>
@@ -212,6 +212,9 @@ export default {
     },
     },
     pageDate() {
     pageDate() {
       return this.$store.state.monthlyReportEdit.pageDate
       return this.$store.state.monthlyReportEdit.pageDate
+    },
+    isHistory() {
+      return this.$store.state.monthlyReportEdit.isHistory
     }
     }
   },
   },
   watch: {
   watch: {

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

@@ -35,7 +35,6 @@
 <script>
 <script>
 import { getHistory } from '@/api/qualityMonthlyReport/edit'
 import { getHistory } from '@/api/qualityMonthlyReport/edit'
 import commentsAndChanges from '@/components/commentsAndChanges/index.vue'
 import commentsAndChanges from '@/components/commentsAndChanges/index.vue'
-import { locale } from 'dayjs'
 
 
 export default {
 export default {
   name: 'History',
   name: 'History',
@@ -87,7 +86,7 @@ export default {
     },
     },
     // 查看历史月报详情
     // 查看历史月报详情
     showHistory(item) {
     showHistory(item) {
-      const url = `${location.origin}/#/monthlyReport/edit?pageType=read&reportId=334&subReportId=${item.historyId}&isHistory=new`
+      const url = `${location.origin}/#/monthlyReport/edit?pageType=read&reportId=334&subReportId=${this.$route.query.subReportId}&isHistory=new&historyId=${item.historyId}`
       window.open(url, '_blank')
       window.open(url, '_blank')
     }
     }
   }
   }

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

@@ -7,7 +7,7 @@
     @click.stop="$store.commit('monthlyReportEdit/INIT_EDIT_KEYS')"
     @click.stop="$store.commit('monthlyReportEdit/INIT_EDIT_KEYS')"
   >
   >
     <headerCom :key="subTitle" title="月报" :sub-title="subTitle" :address="address">
     <headerCom :key="subTitle" title="月报" :sub-title="subTitle" :address="address">
-      <template v-if="pageDate" slot="content">
+      <template v-if="pageDate && !isHistory" slot="content">
         <el-button
         <el-button
           v-if="pageDate && pageDate.status < 20 && (roleCode === 100 || roleCode === 50 || roleCode === 0)"
           v-if="pageDate && pageDate.status < 20 && (roleCode === 100 || roleCode === 50 || roleCode === 0)"
           type="primary"
           type="primary"
@@ -264,7 +264,7 @@ export default {
       return pathName
       return pathName
     },
     },
     ...mapState('monthlyReportEdit',
     ...mapState('monthlyReportEdit',
-      ['pageDate', 'tabPageData', 'subTitle', 'tabsList', 'tabsActive', 'treeData', 'subTabsActive', 'domKeys', 'offsetList', 'pageType', 'subReportInfo', 'roleCode', 'loading', 'version']
+      ['pageDate', 'tabPageData', 'subTitle', 'tabsList', 'tabsActive', 'treeData', 'subTabsActive', 'domKeys', 'offsetList', 'pageType', 'subReportInfo', 'roleCode', 'loading', 'version', 'isHistory']
     )
     )
   },
   },
   watch: {
   watch: {
@@ -273,6 +273,7 @@ export default {
     }
     }
   },
   },
   created() {
   created() {
+    this.SETISHISTORY(this.$route.query.isHistory)
     this.INIT_STATE_DATA()
     this.INIT_STATE_DATA()
     this.SET_LOADING(true)
     this.SET_LOADING(true)
     this.indexShow = true
     this.indexShow = true
@@ -301,6 +302,7 @@ export default {
         id: this.$route.query.reportId,
         id: this.$route.query.reportId,
         subActive: this.$route.query.subActive,
         subActive: this.$route.query.subActive,
         subReportId: this.$route.query.subReportId,
         subReportId: this.$route.query.subReportId,
+        historyId: this.$route.query.historyId,
         windowHref: window.location.href
         windowHref: window.location.href
       })
       })
     }
     }
@@ -328,7 +330,7 @@ export default {
   },
   },
   methods: {
   methods: {
     ...mapMutations('monthlyReportEdit',
     ...mapMutations('monthlyReportEdit',
-      ['INIT_STATE_DATA', 'SET_LOADING', 'SET_PAGE_TYPE', 'SET_SUB_TITLE']
+      ['INIT_STATE_DATA', 'SET_LOADING', 'SET_PAGE_TYPE', 'SET_SUB_TITLE', 'SETISHISTORY']
     ),
     ),
     ...mapActions('monthlyReportEdit',
     ...mapActions('monthlyReportEdit',
       ['getUserPermission', 'deleteReport', 'setSelectEnum', 'initPageData', 'upDateReport', 'upDateSubReport', 'confirmReport']
       ['getUserPermission', 'deleteReport', 'setSelectEnum', 'initPageData', 'upDateReport', 'upDateSubReport', 'confirmReport']