Browse Source

Merge remote-tracking branch 'origin/monthly_report_daily_0.0.8' into http_test

洪海涛 4 years ago
parent
commit
8eb71d10b7

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

@@ -163,15 +163,12 @@ export default {
       this.paging.pageSize = 10
       this.paging.tableData = [...this.tableData].splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)
       this.paging.pageTotal = this.tableData.length
-      console.log('init', this.paging)
       setTimeout(() => {
         this.paging.loading = false
       }, this.paging.timer)
     },
     print(row, index) {
       [this.otherColumns.all, this.otherColumns.p0, this.otherColumns.p1] = this.columns.map(elm => elm).splice(1, 3)
-      console.log(row, index, this.columns)
-      console.log(this.otherColumns)
     },
     // 添加插入
     setColumns(columns) {
@@ -216,9 +213,6 @@ export default {
         }
         return elm
       }).filter(elm => elm)
-      // console.log('newColumns', newColumns)
-      // console.log('oldPlugin', oldPlugin)
-      // return newColumns
     },
     // 设置表格列宽度
     setMinWidth(item) {
@@ -347,7 +341,6 @@ export default {
     /* S 分页 */
     handleSizeChange(value) {
       this.paging.loading = true
-      console.log('handleSizeChange', value)
       this.paging.pageSize = value
       this.paging.tableData = [...this.tableData].splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)
       setTimeout(() => {
@@ -356,7 +349,6 @@ export default {
     },
     handleCurrentChange(value) {
       this.paging.loading = true
-      console.log('handleCurrentChange', value)
       this.paging.curIndex = value
       this.paging.tableData = [...this.tableData].splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)
       setTimeout(() => {

+ 12 - 8
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">
@@ -152,7 +152,6 @@ export default {
             }
           })
         }
-        // console.log(this.$route.query.reportId, index, 146)
         this.reportValue = res.data.reportList[index].id
         this.reportName = res.data.reportList[index].reportName
         this.reportStatus = res.data.reportList[index]
@@ -160,7 +159,6 @@ export default {
       }
     },
     async monthlyReportIndex(id) {
-      // console.log(id)
       const res = await monthlyReportIndex(id)
       if (res.code === 200) {
         this.tagData = res.data
@@ -207,6 +205,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)