|
@@ -13,7 +13,8 @@ import {
|
|
|
getSubReportInfo,
|
|
|
updateSubReport,
|
|
|
pullDataAgain,
|
|
|
- pullSubTitle
|
|
|
+ pullSubTitle,
|
|
|
+ getHistoryDetail
|
|
|
} from '@/api/qualityMonthlyReport/edit'
|
|
|
// import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
|
|
|
import { getAvaliableInfo, getMonthlyReportVersion } from '@/api/qualityMonthlyReport'
|
|
@@ -34,7 +35,7 @@ export default {
|
|
|
// 月报数据获取
|
|
|
async initPageData(
|
|
|
{ commit, state, dispatch },
|
|
|
- { id, subReportId, subActive }
|
|
|
+ { id, subReportId, subActive, windowHref }
|
|
|
) {
|
|
|
dispatch('setSubReportInfo', id)
|
|
|
const { pageType } = state
|
|
@@ -47,7 +48,8 @@ export default {
|
|
|
dispatch('getSubReportData', {
|
|
|
id,
|
|
|
subReportId,
|
|
|
- tabsActive: `tab_${subActive || '上月问题跟进'}`
|
|
|
+ tabsActive: `tab_${subActive || '上月问题跟进'}`,
|
|
|
+ windowHref
|
|
|
})
|
|
|
} else {
|
|
|
const res = await getMonthlyReport(id)
|
|
@@ -64,21 +66,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 页面切换 TAB_ACTIVE_CHANGE
|
|
|
- tabActiveChange({ commit, state, dispatch }, { id, tabsActive }) {
|
|
|
+ tabActiveChange({ commit, state, dispatch }, { id, tabsActive, windowHref }) {
|
|
|
const { pageType } = state
|
|
|
if (pageType === 'editAll') {
|
|
|
return commit('TAB_ACTIVE_CHANGE', tabsActive)
|
|
|
}
|
|
|
if (pageType === 'readAll') {
|
|
|
- dispatch('getSubReportData', { id, tabsActive })
|
|
|
+ dispatch('getSubReportData', { id, tabsActive, windowHref })
|
|
|
}
|
|
|
},
|
|
|
// 获取查看月报数据
|
|
|
- async getSubReportData({ dispatch, commit, state }, { id, subReportId, tabsActive }) {
|
|
|
+ async getSubReportData({ dispatch, commit, state }, { id, subReportId, tabsActive, windowHref }) {
|
|
|
const { pageType } = state
|
|
|
let params = {}
|
|
|
- const method =
|
|
|
- pageType === 'readAll' ? getAllSubReportCatalog : getSubReport
|
|
|
+ let method = pageType === 'readAll' ? getAllSubReportCatalog : getSubReport
|
|
|
if (pageType === 'read' || pageType === 'edit') {
|
|
|
params = {
|
|
|
subReportId
|
|
@@ -93,6 +94,12 @@ export default {
|
|
|
catalogTitle: setTabActive('tab_', tabsActive)
|
|
|
}
|
|
|
}
|
|
|
+ if (windowHref.indexOf('isHistory=new') > -1) {
|
|
|
+ method = getHistoryDetail
|
|
|
+ params = {
|
|
|
+ historyId: subReportId
|
|
|
+ }
|
|
|
+ }
|
|
|
const res = await method(params)
|
|
|
if (res.code === 200) {
|
|
|
// 单个月报与完整月报数据梳理
|
|
@@ -142,6 +149,7 @@ export default {
|
|
|
params.saveAsTargetList = _.cloneDeep(state.saveAsTargetList)
|
|
|
}
|
|
|
params.dependence = null
|
|
|
+ console.log(params)
|
|
|
const res = await updateSubReport(params)
|
|
|
if (res.code === 200) {
|
|
|
callback()
|