|
@@ -4,7 +4,7 @@
|
|
|
ref="pageWrapper"
|
|
|
v-loading="loading"
|
|
|
class="page-wrapper"
|
|
|
- @click.stop="$store.commit('monthlyReportEditV2/INIT_EDIT_KEYS')"
|
|
|
+ @click.stop="$store.commit('monthlyReportEdit/INIT_EDIT_KEYS')"
|
|
|
>
|
|
|
<headerCom :key="subTitle" title="月报" :sub-title="subTitle" :address="address">
|
|
|
<template v-if="pageDate" slot="content">
|
|
@@ -55,7 +55,7 @@
|
|
|
>
|
|
|
回退
|
|
|
</el-button>
|
|
|
- <el-dropdown v-else @command="returnReportFn">
|
|
|
+ <el-dropdown v-else @command="returnReport">
|
|
|
<el-button size="small"> 回退<i class="el-icon-arrow-down el-icon--right" /> </el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item command="all">全部</el-dropdown-item>
|
|
@@ -167,7 +167,7 @@
|
|
|
:show-dialog="false"
|
|
|
:title="'邮件预览'"
|
|
|
width="70%"
|
|
|
- @succes="publishAllReportFn">
|
|
|
+ @succes="publishAllReport">
|
|
|
<div class="report-delete" style="text-align: initial;min-height: 30vh;max-height: 70vh;overflow-y: scroll;">
|
|
|
<!-- 月报数据已检查无误,确认发布?-->
|
|
|
<div v-if="monthlyReportPreView" style="" v-html="monthlyReportPreView.content" />
|
|
@@ -188,8 +188,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script type='text/javascript'>
|
|
|
-import { mapState, mapActions, mapMutations } from 'vuex'
|
|
|
+<script type="text/javascript">
|
|
|
import headerCom from '../../components/header'
|
|
|
import Affix from '@/components/affix/affix'
|
|
|
import Anchor from './components/anchor'
|
|
@@ -231,8 +230,45 @@ export default {
|
|
|
}
|
|
|
return pathName
|
|
|
},
|
|
|
- // 使用对象展开运算符将 getter 混入 computed 对象中
|
|
|
- ...mapState('monthlyReportEditV2', ['pageDate', 'tabPageData', 'subTitle', 'tabsList', 'tabsActive', 'treeData', 'subTabsActive', 'domKeys', 'offsetList', 'pageType', 'subReportInfo', 'roleCode', 'loading'])
|
|
|
+ pageDate() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.pageDate
|
|
|
+ },
|
|
|
+ tabPageData() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.tabPageData
|
|
|
+ },
|
|
|
+ subTitle() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.subTitle
|
|
|
+ },
|
|
|
+ tabsList() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.tabsList
|
|
|
+ },
|
|
|
+ tabsActive() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.tabsActive
|
|
|
+ },
|
|
|
+ treeData() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.treeData
|
|
|
+ },
|
|
|
+ subTabsActive() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.subTabsActive
|
|
|
+ },
|
|
|
+ domKeys() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.domKeys
|
|
|
+ },
|
|
|
+ offsetList() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.offsetList
|
|
|
+ },
|
|
|
+ pageType() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.pageType
|
|
|
+ },
|
|
|
+ subReportInfo() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.subReportInfo
|
|
|
+ },
|
|
|
+ roleCode() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.roleCode
|
|
|
+ },
|
|
|
+ loading() {
|
|
|
+ return this.$store.state.monthlyReportEditV2.loading
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
subTabsActive() {
|
|
@@ -240,17 +276,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.INIT_STATE_DATA()
|
|
|
- // this.$store.commit('monthlyReportEditV2/INIT_STATE_DATA')
|
|
|
- this.SET_LOADING(true)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
+ this.$store.commit('monthlyReportEditV2/INIT_STATE_DATA')
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
this.indexShow = true
|
|
|
// 默认获取用户权限
|
|
|
- this.getUserPermission()
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/getUserPermission')
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/getUserPermission')
|
|
|
// 获取部门数据
|
|
|
- this.setSelectEnum()
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/setSelectEnum')
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/setSelectEnum')
|
|
|
},
|
|
|
mounted() {
|
|
|
/*
|
|
@@ -260,8 +292,7 @@ export default {
|
|
|
* editAll:编辑完整月报
|
|
|
* */
|
|
|
if (this.$route.query.pageType) {
|
|
|
- this.SET_PAGE_TYPE(this.$route.query.pageType)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_PAGE_TYPE', this.$route.query.pageType)
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_PAGE_TYPE', this.$route.query.pageType)
|
|
|
}
|
|
|
// 获取部门数据;只有查看但业务线时,才需要单独获取部门数据
|
|
|
// if (
|
|
@@ -275,21 +306,15 @@ export default {
|
|
|
// }
|
|
|
// 查看
|
|
|
if (this.$route.query.pageType === 'readAll') {
|
|
|
- this.SET_SUB_TITLE('查看完整月报')
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_SUB_TITLE', '查看完整月报')
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_SUB_TITLE', '查看完整月报')
|
|
|
}
|
|
|
|
|
|
if (this.$route.query.reportId || this.$route.query.subReportId) {
|
|
|
- this.initPageData({
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/initPageData', {
|
|
|
id: this.$route.query.reportId,
|
|
|
subActive: this.$route.query.subActive,
|
|
|
subReportId: this.$route.query.subReportId
|
|
|
})
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/initPageData', {
|
|
|
- // id: this.$route.query.reportId,
|
|
|
- // subActive: this.$route.query.subActive,
|
|
|
- // subReportId: this.$route.query.subReportId
|
|
|
- // })
|
|
|
// this.getPageData(this.$route.query.reportId)
|
|
|
}
|
|
|
// setTimeout(() => {
|
|
@@ -298,17 +323,13 @@ export default {
|
|
|
},
|
|
|
destroyed() {
|
|
|
this.indexShow = false
|
|
|
- this.INIT_STATE_DATA()
|
|
|
- // this.$store.commit('monthlyReportEditV2/INIT_STATE_DATA')
|
|
|
+ this.$store.commit('monthlyReportEditV2/INIT_STATE_DATA')
|
|
|
// 判断当前页面是否为新建页面
|
|
|
if (this.$route.query.type && this.$route.query.type === 'create') {
|
|
|
- this.deleteReport({ isMsg: false })
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/deleteReport', { isMsg: false })
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/deleteReport', { isMsg: false })
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations('monthlyReportEditV2', ['INIT_STATE_DATA', 'SET_LOADING', 'SET_PAGE_TYPE', 'SET_SUB_TITLE', 'INIT_EDIT_KEYS']),
|
|
|
- ...mapActions('monthlyReportEditV2', ['getUserPermission', 'setSelectEnum', 'initPageData', 'deleteReport', 'upDateReport', 'upDateSubReport', 'confirmReport', 'publishAllReport', 'tabActiveChange', 'sendReport', 'returnReport']),
|
|
|
setInit() {
|
|
|
// this.$store.commit('monthlyReportEditV2/INIT_EDIT_KEYS')
|
|
|
// window.addEventListener('click', () => {
|
|
@@ -389,14 +410,11 @@ export default {
|
|
|
},
|
|
|
// 月报更新
|
|
|
upDateReport(key = 'cb', confirmReportBack) {
|
|
|
- this.SET_LOADING(true)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
- const method = this.pageType.search(/All/) > -1 ? 'upDateReport' : 'upDateSubReport'
|
|
|
- this[method](() => {
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
+ this.$store.dispatch(`monthlyReportEditV2/${this.pageType.search(/All/) > -1 ? 'upDateReport' : 'upDateSubReport'}`, () => {
|
|
|
confirmReportBack && confirmReportBack()
|
|
|
if (!confirmReportBack) {
|
|
|
- this.SET_LOADING(false)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
}
|
|
|
if (key === 'cb') {
|
|
|
window.log({ c: 'report_edit', d: 'report_edit_save' })
|
|
@@ -404,98 +422,56 @@ export default {
|
|
|
// this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}
|
|
|
})
|
|
|
- // this.$store.dispatch(`monthlyReportEditV2/${this.pageType.search(/All/) > -1 ? 'upDateReport' : 'upDateSubReport'}`, () => {
|
|
|
- // confirmReportBack && confirmReportBack()
|
|
|
- // if (!confirmReportBack) {
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
- // }
|
|
|
- // if (key === 'cb') {
|
|
|
- // window.log({ c: 'report_edit', d: 'report_edit_save' })
|
|
|
- // this.$message.success('保存成功!')
|
|
|
- // // this.$router.push({ path: '/monthlyReport/index' })
|
|
|
- // }
|
|
|
- // })
|
|
|
},
|
|
|
// 月报确认
|
|
|
confirmReport() {
|
|
|
this.$refs['dialogConfirm'].visible = false
|
|
|
this.upDateReport('nocb', () => {
|
|
|
- this.confirmReport({
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/confirmReport', {
|
|
|
id: this.$route.query.subReportId,
|
|
|
callback: () => {
|
|
|
window.log({ c: 'report_edit', d: 'report_edit_confirm' })
|
|
|
- this.SET_LOADING(false)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}
|
|
|
})
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/confirmReport', {
|
|
|
- // id: this.$route.query.subReportId,
|
|
|
- // callback: () => {
|
|
|
- // window.log({ c: 'report_edit', d: 'report_edit_confirm' })
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
- // this.$router.push({ path: '/monthlyReport/index' })
|
|
|
- // }
|
|
|
- // })
|
|
|
})
|
|
|
},
|
|
|
// 删除月报
|
|
|
deleteReport(key) {
|
|
|
this.$refs['dialogDelete'].visible = false
|
|
|
if (key === '删除') {
|
|
|
- this.deleteReport({
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/deleteReport', {
|
|
|
key,
|
|
|
callback: () => {
|
|
|
window.log({ c: 'report_edit', d: 'report_edit_delete' })
|
|
|
this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}
|
|
|
})
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/deleteReport', {
|
|
|
- // key,
|
|
|
- // callback: () => {
|
|
|
- // window.log({ c: 'report_edit', d: 'report_edit_delete' })
|
|
|
- // this.$router.push({ path: '/monthlyReport/index' })
|
|
|
- // }
|
|
|
- // })
|
|
|
} else {
|
|
|
// this.$message('删除操作已取消!')
|
|
|
}
|
|
|
},
|
|
|
// 月报发布确认
|
|
|
- publishAllReportFn(key) {
|
|
|
+ publishAllReport(key) {
|
|
|
this.$refs['dialogPublishAll'].visible = false
|
|
|
- this.SET_LOADING(true)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
- this.publishAllReport({
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/publishAllReport', {
|
|
|
id: this.$route.query.reportId,
|
|
|
callback: () => {
|
|
|
window.log({ c: 'report_edit', d: 'report_edit_push' })
|
|
|
- this.SET_LOADING(false)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}
|
|
|
})
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/publishAllReport', {
|
|
|
- // id: this.$route.query.reportId,
|
|
|
- // callback: () => {
|
|
|
- // window.log({ c: 'report_edit', d: 'report_edit_push' })
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
- // this.$router.push({ path: '/monthlyReport/index' })
|
|
|
- // }
|
|
|
- // })
|
|
|
},
|
|
|
tabClick(tab, event) {
|
|
|
this.bodyLoading = true
|
|
|
- this.tabActiveChange({
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/tabActiveChange', {
|
|
|
...this.$route.query,
|
|
|
id: this.$route.query.reportId,
|
|
|
tabsActive: tab.name
|
|
|
})
|
|
|
- // this.$store.dispatch('monthlyReportEditV2/tabActiveChange', {
|
|
|
- // ...this.$route.query,
|
|
|
- // id: this.$route.query.reportId,
|
|
|
- // tabsActive: tab.name
|
|
|
- // })
|
|
|
setTimeout(() => {
|
|
|
this.bodyLoading = false
|
|
|
}, 700)
|
|
@@ -512,21 +488,8 @@ export default {
|
|
|
// this.$message('发送操作已取消!')
|
|
|
return
|
|
|
}
|
|
|
- this.SET_LOADING(true)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
- this.sendReport({
|
|
|
- id: this.$route.query.reportId,
|
|
|
- callback: () => {
|
|
|
- setTimeout(() => {
|
|
|
- window.log({ c: 'report_edit', d: 'report_edit_send' })
|
|
|
- this.SET_LOADING(false)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
- // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
- this.$router.push({ path: '/monthlyReport/index' })
|
|
|
- }, 500)
|
|
|
- }
|
|
|
- })
|
|
|
- /* this.$store.dispatch('monthlyReportEditV2/sendReport', {
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/sendReport', {
|
|
|
id: this.$route.query.reportId,
|
|
|
callback: () => {
|
|
|
setTimeout(() => {
|
|
@@ -536,23 +499,22 @@ export default {
|
|
|
this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}, 500)
|
|
|
}
|
|
|
- })*/
|
|
|
+ })
|
|
|
// this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
/* this.upDateReport('nocb', () => {
|
|
|
this.$store.dispatch('monthlyReportEditV2/sendReport', {
|
|
|
id: this.$route.query.reportId,
|
|
|
callback: () => {
|
|
|
this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
- // this.$store.commit('monthlyReportEdit/SET_LOADING', false)
|
|
|
+ // this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}
|
|
|
})
|
|
|
}) */
|
|
|
},
|
|
|
// 月报退回
|
|
|
- returnReportFn(command) {
|
|
|
- this.SET_LOADING(true)
|
|
|
- // this.$store.commit('monthlyReportEdit/SET_LOADING', true)
|
|
|
+ returnReport(command) {
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', true)
|
|
|
let list = []
|
|
|
if (command === 'all') {
|
|
|
list = this.subReportInfo.map((elm) => {
|
|
@@ -564,29 +526,17 @@ export default {
|
|
|
if (command === 'only' && this.$route.query.subReportId) {
|
|
|
list = [Number.parseInt(this.$route.query.subReportId)]
|
|
|
}
|
|
|
- this.returnReport({
|
|
|
+ this.$store.dispatch('monthlyReportEditV2/returnReport', {
|
|
|
data: {
|
|
|
subReportIds: list
|
|
|
},
|
|
|
callback: () => {
|
|
|
window.log({ c: 'report_edit', d: 'report_edit_return' })
|
|
|
- this.SET_LOADING(false)
|
|
|
- // this.$store.commit('monthlyReportEdit/SET_LOADING', false)
|
|
|
+ this.$store.commit('monthlyReportEditV2/SET_LOADING', false)
|
|
|
this.$message.success('退回成功!')
|
|
|
this.$router.push({ path: '/monthlyReport/index' })
|
|
|
}
|
|
|
})
|
|
|
- /* this.$store.dispatch('monthlyReportEdit/returnReport', {
|
|
|
- data: {
|
|
|
- subReportIds: list
|
|
|
- },
|
|
|
- callback: () => {
|
|
|
- window.log({ c: 'report_edit', d: 'report_edit_return' })
|
|
|
- this.$store.commit('monthlyReportEdit/SET_LOADING', false)
|
|
|
- this.$message.success('退回成功!')
|
|
|
- this.$router.push({ path: '/monthlyReport/index' })
|
|
|
- }
|
|
|
- })*/
|
|
|
},
|
|
|
// 月报预览
|
|
|
async setMonthlyReportPreView() {
|
|
@@ -598,7 +548,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style scoped lang='less'>
|
|
|
+<style scoped lang="less">
|
|
|
@import '../../style';
|
|
|
// setscroll
|
|
|
.set_scroll {
|