浏览代码

月报2.0改造(2.6)pdf

洪海涛 4 年之前
父节点
当前提交
f2b33d21d4

+ 2 - 0
src/views/monthlyReport/childrenPage/editReport/components/ReadOnlyTable.vue

@@ -279,8 +279,10 @@ export default {
     query({ row, column }, lIndex) {
       const index = lIndex - 1 || 0
       const data = row[column.property]
+      console.log(index)
       // return
       if (index <= 2) {
+        console.log(284)
         const yaxis = this.setList(data, index)
         this.requireList = { toType: '缺陷', xaxis: this.bugPriority, title: '新增缺陷', yaxis: yaxis, dataIndex: index }
       } else if (index === 3) {

+ 12 - 6
src/views/monthlyReport/index.vue

@@ -22,16 +22,16 @@
     <div v-loading="contentLoading" class="content-wrapper">
       <div class="content-reportName">
         {{ reportName }}
-        <el-button v-if="reportStatus.status === 20" type="text" @click="jump('report_home_Publication', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 月报发布</el-button>
-        <el-button v-if="reportStatus.status === 30" type="text" @click="jump('report_home_viewReport', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 查看完整报告</el-button>
+        <el-button v-if="tagData.status === 20" type="text" @click="jump('report_home_Publication', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 月报发布</el-button>
+        <el-button v-if="tagData.status === 30" type="text" @click="jump('report_home_viewReport', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 查看完整报告</el-button>
         <!--    @click="downloadMonthlyReportFn"    -->
-<!--        <a target="blank" :href="`${projectManagementUrl}/monthlyReport/downloadMonthlyReport?id=${reportValue}`" :download="`${reportName}.pdf`" style="margin-left: 10px;display: inline-block"><svg-icon v-if="reportStatus.status === 30" icon-class="monthlyReport下载" class="icon" /></a>-->
-        <el-button v-if="reportStatus.status === 0" type="text" @click="sendConfirm(reportData)"> 发送确认</el-button>
+        <a v-if="isShowPdfDow()" target="blank" :href="`${projectManagementUrl}/monthlyReport/downloadMonthlyReport?id=${reportValue}`" :download="`${reportName}.pdf`" style="margin-left: 10px;display: inline-block"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
+        <el-button v-if="tagData.status === 0" type="text" @click="sendConfirm(reportData)"> 发送确认</el-button>
       </div>
-      <div v-show="reportStatus.status === 30" class="report-bottom">
+      <div v-show="tagData.status === 30" class="report-bottom">
         <span v-if="tagData.analysisList"><i class="el-icon-warning report-icon-warning" /> 本月质量月报<b>{{ tagData.analysisList }}</b>有您负责的重点问题需要分析反馈,请点击<b>{{ tagData.analysisList }}</b>的"查看更多"按钮进入填写!</span>
       </div>
-      <div v-show="reportStatus.status === 10" class="report-bottom">
+      <div v-show="tagData.status === 10" class="report-bottom">
         <span v-if="tagData.confirmeList || tagData.toBeConfirmList "><i class="el-icon-warning report-icon-warning" /> 已确认业务线<b>{{ tagData.confirmeList || '无' }}</b> ,未确认业务线<b>{{ tagData.toBeConfirmList || '无' }}</b>。 </span>
       </div>
       <el-row v-if="tagData && tagData.subReportList && tagData.subReportList.length" :gutter="12">
@@ -207,6 +207,12 @@ export default {
         console.log(res)
       })
     },
+    // 是否显示下载pdf链接
+    isShowPdfDow() {
+      const { status, version } = this.tagData
+      // tagData.status === 30 && tagData.version !== 'v1' && tagData.version
+      return status === 30 && version !== 'v1' && `${version}`.replace(/v/, '') > 1
+    },
     getReportStatus(e) {
       this.contentLoading = true
       this.monthlyReportIndex(e.id)