|
@@ -10,7 +10,8 @@ import {
|
|
|
returnReport,
|
|
|
sendSubConfirm,
|
|
|
publishReport,
|
|
|
- getSubReportInfo
|
|
|
+ getSubReportInfo,
|
|
|
+ updateSubReport
|
|
|
} from '@/api/qualityMonthlyReport/edit'
|
|
|
import { getAvaliableInfo } from '@/api/qualityMonthlyReport'
|
|
|
|
|
@@ -463,7 +464,11 @@ export default {
|
|
|
}
|
|
|
console.log(elm.reportName)
|
|
|
// 如果是
|
|
|
- if (elm.status === 30) {
|
|
|
+ if (elm.status === 10) {
|
|
|
+ state.subTitle = `确认月报|${elm.reportName}`
|
|
|
+ } else if (elm.status === 20) {
|
|
|
+ state.subTitle = `发布月报|${elm.reportName}`
|
|
|
+ } else if (elm.status === 30) {
|
|
|
state.subTitle = `查看|${elm.reportName}`
|
|
|
} else {
|
|
|
state.subTitle = `${elm.statueStr}|${elm.reportName}`
|
|
@@ -570,8 +575,28 @@ export default {
|
|
|
}, 700)
|
|
|
}
|
|
|
},
|
|
|
+ // 子月报更新
|
|
|
+ async upDateSubReport({ state }, callback) {
|
|
|
+ const params = _.cloneDeep(state.pageDate)
|
|
|
+ params.reportCatalog = {
|
|
|
+ children: _.cloneDeep(state.tabPageData.children),
|
|
|
+ content: [],
|
|
|
+ depth: 0,
|
|
|
+ fromUser: false,
|
|
|
+ hiddenAncestor: null,
|
|
|
+ isVisible: true,
|
|
|
+ subTitles: null,
|
|
|
+ title: params.reportName,
|
|
|
+ type: 'Tag'
|
|
|
+ }
|
|
|
+ params.reportCatalog = reportDataBack(params.reportCatalog)
|
|
|
+ const res = await updateSubReport(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 月报更新
|
|
|
- async upDateReport({ commit, state }, cb) {
|
|
|
+ async upDateReport({ dispatch, state }, callback) {
|
|
|
const params = _.cloneDeep(state.pageDate)
|
|
|
const tabPageData = _.cloneDeep(state.tabPageData)
|
|
|
const tabsActive = setTabActive('tab_', state.tabsActive)
|
|
@@ -588,7 +613,7 @@ export default {
|
|
|
// 转换数据结构
|
|
|
const res = await updateMonthlyReport(params)
|
|
|
if (res.code === 200) {
|
|
|
- cb()
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
// 获取部门数据
|
|
@@ -601,49 +626,49 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 删除月报
|
|
|
- async deleteReport({ commit, state, context }, { key, cb }) {
|
|
|
+ async deleteReport({ commit, state, context }, { key, callback }) {
|
|
|
const res = await delMonthlyReport(state.pageDate.id)
|
|
|
if (res.code === 200) {
|
|
|
message.success('删除成功!')
|
|
|
- cb()
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
// 月报发送
|
|
|
- async sendReport({ commit, state, context }, { id, cb }) {
|
|
|
+ async sendReport({ commit, state, context }, { id, callback }) {
|
|
|
const res = await sendConfirm({
|
|
|
id
|
|
|
})
|
|
|
if (res.code === 200) {
|
|
|
message.success('发送成功!')
|
|
|
- cb()
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
// 月报发布
|
|
|
- async publishAllReport({ commit, state, context }, { id, cb }) {
|
|
|
+ async publishAllReport({ commit, state, context }, { id, callback }) {
|
|
|
const res = await publishReport({
|
|
|
id
|
|
|
})
|
|
|
if (res.code === 200) {
|
|
|
message.success('发布成功!')
|
|
|
- cb()
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
// 月报确认
|
|
|
async confirmReport({ state }, {
|
|
|
- id, cb
|
|
|
+ id, callback
|
|
|
}) {
|
|
|
const res = await sendSubConfirm({
|
|
|
subReportId: id
|
|
|
})
|
|
|
if (res.code === 200) {
|
|
|
- cb()
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
// 月报回退
|
|
|
- async returnReport({ commit, state, context }, { data, cb }) {
|
|
|
+ async returnReport({ commit, state, context }, { data, callback }) {
|
|
|
const res = await returnReport(data)
|
|
|
if (res.code === 200) {
|
|
|
- cb()
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
// 获取用户月报操作区域权限
|