浏览代码

Merge branch 'http_mock' into http_test

洪海涛 4 年之前
父节点
当前提交
2daae19501
共有 1 个文件被更改,包括 14 次插入14 次删除
  1. 14 14
      src/views/monthlyReport/index.vue

+ 14 - 14
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-show="isShowPdfPushDow() && tagData.status === 20" @click="downloadFile(true)" style="margin-left: 10px;display: inline-block"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
-        <a v-show="isShowPdfDow()" target="blank" @click="downloadFile" style="margin-left: 10px;display: inline-block"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
+        <a v-show="isShowPdfPushDow() && tagData.status === 20" style="margin-left: 10px;display: inline-block" @click="downloadFile(true)"><svg-icon icon-class="monthlyReport下载" class="icon" /></a>
+        <a v-show="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">
@@ -98,7 +98,7 @@ import monthlyEards from './components/monthlyEards'
 import { getAvaliableInfo, monthlyReportIndex, getReportBizInfo, createMonthlyReport, downloadMonthlyReport } from '@/api/qualityMonthlyReport'
 // import { downloadMonthlyReport } from '@/api/qualityMonthlyReport/edit'
 import { projectManagementUrl } from '@/apiConfig/api'
-import { Encrypt } from '@/utils/crypto-js.js'
+// import { Encrypt } from '@/utils/crypto-js.js'
 
 export default {
   name: '',
@@ -226,7 +226,7 @@ export default {
       this.reportValue = e.id
       this.reportStatus = e
     },
-    downloadFile ( refrash = false ) {
+    downloadFile(refrash = false) {
       console.log(this.projectManagementUrl)
       // fetch(`${this.projectManagementUrl}/monthlyReport/downloadMonthlyReport?id=${this.reportValue}&refrash=true`, {
       //   method: 'POST',
@@ -240,16 +240,16 @@ export default {
         refrash
       }).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) {