|
@@ -36,6 +36,15 @@
|
|
|
>
|
|
|
取消
|
|
|
</el-button>
|
|
|
+ <!-- <el-button
|
|
|
+ v-if="pageType.search(/All/) > -1 && pageDate && pageDate.status === 20 && (roleCode === 100 || roleCode === 0)"
|
|
|
+ slot="reference"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="dialogOpen('dialogViewPdf')"
|
|
|
+ >
|
|
|
+ PDF预览
|
|
|
+ </el-button> -->
|
|
|
<el-button
|
|
|
v-if="pageType.search(/All/) > -1 && pageDate && pageDate.status === 20 && (roleCode === 100 || roleCode === 0)"
|
|
|
slot="reference"
|
|
@@ -166,6 +175,7 @@
|
|
|
is-succes
|
|
|
:show-dialog="false"
|
|
|
:title="'邮件预览'"
|
|
|
+ submit-button="发布"
|
|
|
width="70%"
|
|
|
@succes="publishAllReport">
|
|
|
<div class="report-delete" style="text-align: initial;min-height: 30vh;max-height: 70vh;overflow-y: scroll;">
|
|
@@ -173,6 +183,22 @@
|
|
|
<div v-if="monthlyReportPreView" style="" v-html="monthlyReportPreView.content" />
|
|
|
</div>
|
|
|
</normal-dialog>
|
|
|
+ <!-- 月报pdf预览 -->
|
|
|
+ <normal-dialog
|
|
|
+ ref="dialogViewPdf"
|
|
|
+ class="view-report"
|
|
|
+ style="margin-top: 5vh"
|
|
|
+ is-succes
|
|
|
+ :show-dialog="false"
|
|
|
+ :title="'PDF预览'"
|
|
|
+ submit-button="下载"
|
|
|
+ width="70%"
|
|
|
+ @succes="downloadReportPdf">
|
|
|
+ <div class="report-delete" style="text-align: initial;min-height: 30vh;max-height: 70vh;overflow-y: scroll;">
|
|
|
+ <!-- 月报数据已检查无误,确认发布?-->
|
|
|
+ <div v-if="monthlyReportPrePdfView" style="" v-html="monthlyReportPrePdfView" />
|
|
|
+ </div>
|
|
|
+ </normal-dialog>
|
|
|
<!-- 月报确认 -->
|
|
|
<normal-dialog
|
|
|
ref="dialogConfirm"
|
|
@@ -197,7 +223,8 @@ import Menu from './components/menu'
|
|
|
import Core from './components/core'
|
|
|
import Clickoutside from 'element-ui/src/utils/clickoutside'
|
|
|
import normalDialog from '@/components/dialog/normalDialog'
|
|
|
-import { getMonthlyReportPreView } from '@/api/qualityMonthlyReport/edit'
|
|
|
+import { projectManagementUrl } from '@/apiConfig/api'
|
|
|
+import { getMonthlyReportPreView, getMonthlyReportPrePdfView } from '@/api/qualityMonthlyReport/edit'
|
|
|
|
|
|
export default {
|
|
|
name: '',
|
|
@@ -217,6 +244,7 @@ export default {
|
|
|
anchorActive: '',
|
|
|
bodyLoading: false,
|
|
|
monthlyReportPreView: null,
|
|
|
+ monthlyReportPrePdfView: null,
|
|
|
scrollTop: 0
|
|
|
}
|
|
|
},
|
|
@@ -271,6 +299,15 @@ export default {
|
|
|
subReportId: this.$route.query.subReportId
|
|
|
})
|
|
|
}
|
|
|
+ // 数据埋点
|
|
|
+ this.monthlyReportBuriedPoint()
|
|
|
+ // 防止页面后退
|
|
|
+ if (this.$route.query.pageType.search(/edit/) > -1) {
|
|
|
+ history.pushState(null, null, document.URL)
|
|
|
+ window.addEventListener('popstate', function() {
|
|
|
+ history.pushState(null, null, document.URL)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
destroyed() {
|
|
|
this.indexShow = false
|
|
@@ -279,6 +316,10 @@ export default {
|
|
|
if (this.$route.query.type && this.$route.query.type === 'create') {
|
|
|
this.deleteReport({ isMsg: false })
|
|
|
}
|
|
|
+ // 销毁组件时,取消浏览器前进后端拦截事件
|
|
|
+ window.removeEventListener('popstate', function() {
|
|
|
+ history.pushState(null, null, document.URL)
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations('monthlyReportEdit',
|
|
@@ -422,6 +463,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 下载月报pdf
|
|
|
+ downloadReportPdf(key) {
|
|
|
+ this.$refs['dialogViewPdf'].visible = false
|
|
|
+ const { reportId } = this.$route.query
|
|
|
+ const url = `${projectManagementUrl}/monthlyReport/downloadMonthlyReport?id=${reportId}&refrash=true`
|
|
|
+ window.open(url, '_blank')
|
|
|
+ },
|
|
|
tabClick(tab, event) {
|
|
|
this.bodyLoading = true
|
|
|
this.$store.dispatch('monthlyReportEdit/tabActiveChange', {
|
|
@@ -437,6 +485,9 @@ export default {
|
|
|
if (key === 'dialogPublishAll') {
|
|
|
this.setMonthlyReportPreView()
|
|
|
}
|
|
|
+ if (key === 'dialogViewPdf') {
|
|
|
+ this.setMonthlyReportPrePdfView()
|
|
|
+ }
|
|
|
this.$refs[key].visible = true
|
|
|
},
|
|
|
sendReport(key) {
|
|
@@ -489,7 +540,37 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.monthlyReportPreView = res.data
|
|
|
}
|
|
|
+ },
|
|
|
+ // 月报Pdf预览
|
|
|
+ async setMonthlyReportPrePdfView() {
|
|
|
+ const res = await getMonthlyReportPrePdfView(this.$route.query.reportId)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.monthlyReportPrePdfView = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 埋点
|
|
|
+ monthlyReportBuriedPoint() {
|
|
|
+ const { pageType, type } = this.$route.query
|
|
|
+ if (type !== 'create') {
|
|
|
+ // 月报编辑
|
|
|
+ if (pageType === 'editAll') {
|
|
|
+ window.log({ c: 'report_view', d: 'report_view_edit' })
|
|
|
+ }
|
|
|
+ // 月报浏览
|
|
|
+ if (pageType === 'readAll') {
|
|
|
+ window.log({ c: 'report_view', d: 'report_view_only' })
|
|
|
+ }
|
|
|
+ // 单业务线编辑
|
|
|
+ if (pageType === 'edit') {
|
|
|
+ window.log({ c: 'report_view', d: 'report_view_only_edit' })
|
|
|
+ }
|
|
|
+ // 单业务线浏览
|
|
|
+ if (pageType === 'read') {
|
|
|
+ window.log({ c: 'report_view', d: 'report_view' })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|