洪海涛 4 năm trước cách đây
mục cha
commit
08732842ea
2 tập tin đã thay đổi với 14 bổ sung14 xóa
  1. 1 1
      src/api/qualityMonthlyReport/index.js
  2. 13 13
      src/views/monthlyReport/index.vue

+ 1 - 1
src/api/qualityMonthlyReport/index.js

@@ -204,4 +204,4 @@ export function downloadMonthlyReport(params) {
     responseType: 'blob',
     params
   })
-}
+}

+ 13 - 13
src/views/monthlyReport/index.vue

@@ -26,8 +26,8 @@
         <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}&refrash=true`" :download="`${reportName}.pdf`" style="margin-left: 10px;display: inline-block"><svg-icon icon-class="monthlyReport下载" class="icon" /></a> -->
-        <a v-if="isShowPdfPushDow() && tagData.status === 20" @click="downloadFile" style="margin-left: 10px;display: inline-block"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
-        <a v-if="isShowPdfDow()" target="blank" @click="downloadFile" style="margin-left: 10px;display: inline-block"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
+        <a v-if="isShowPdfPushDow() && tagData.status === 20" style="margin-left: 10px;display: inline-block" @click="downloadFile"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
+        <a v-if="isShowPdfDow()" target="blank" style="margin-left: 10px;display: inline-block" @click="downloadFile"><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="tagData.status === 30" class="report-bottom">
@@ -226,7 +226,7 @@ export default {
       this.reportValue = e.id
       this.reportStatus = e
     },
-    downloadFile () {
+    downloadFile() {
       console.log(this.projectManagementUrl)
       // fetch(`${this.projectManagementUrl}/monthlyReport/downloadMonthlyReport?id=${this.reportValue}&refrash=true`, {
       //   method: 'POST',
@@ -240,16 +240,16 @@ export default {
         refrash: false
       }).then((res) => {
         this.convertRes2Blob(res)
-       // console.log(blob)
-       //  const link = document.createElement('a')
-       //  link.style.display = 'none'
-       //  link.setAttribute('target', 'blank')
-       //  link.href = URL.createObjectURL(blob)
-       //  document.body.appendChild(link)
-       //  link.click()
-       //  // 释放的 URL 对象以及移除 a 标签
-       //  URL.revokeObjectURL(link.href)
-       //  document.body.removeChild(link)
+        // console.log(blob)
+        //  const link = document.createElement('a')
+        //  link.style.display = 'none'
+        //  link.setAttribute('target', 'blank')
+        //  link.href = URL.createObjectURL(blob)
+        //  document.body.appendChild(link)
+        //  link.click()
+        //  // 释放的 URL 对象以及移除 a 标签
+        //  URL.revokeObjectURL(link.href)
+        //  document.body.removeChild(link)
       })
     },
     convertRes2Blob(response) {