<!--
  @description: 澄清回执pdf预览
  @Modifier: haoFx/肖文龙
  @routerPath:/bidding/projectDrive/evaluateClarify/evaluateClarifyAnswerPdf-detail
  @date: 2020/3/13-15:48
-->
<template>
  <div>
    <pdf :pdf-url="pdfUrl" />
    <div class="p16-0">
      澄清回执附件：
      <downloadFile :data="bidClarificationReceiptAttachment" />
    </div>
    <!--保存按钮-->
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="back">
          返 回
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
/* api*/
import { readImageRoot } from '@api/common/uploadCenter'
import { getFileDetail } from '@/api/common/uploadCenter'
/* 混合开发方法-参数字段*/
import { clarificationMixin } from '../../mixins/clarificationMixin'// 澄清质疑-公用参数
/* 组件*/
import pdf from '@comp/common/pdf/pdf'
import downloadFile from '@comp/common/updownload/downloadFile'
export default {
  name: 'EvaluateClarifyAnswerPdfDetail',
  components: {
    pdf,
    downloadFile
  },
  mixins: [clarificationMixin],
  data() {
    return {
      readImageUrl: readImageRoot, // 预览图片
      pdfUrl: ''
    }
  },
  created() {
    // 获取公告内容pdf
    this.getBulletinContentPdf()
  },
  methods: {
    // 返回
    back() {
      this.$router.push({
        path: '/bidding/projectDrive/evaluateClarify/evaluateClarifyAnswer-detail',
        query: {
          ...this.$route.query
        }
      })
    },
    // 评标澄清查看回复-回执pdf
    getBulletinContentPdf() {
      getFileDetail(this.bidClarificationReceiptContent).then(response => {
        const url = this.readImageUrl + response.data[0].path
        this.pdfUrl = encodeURIComponent(url)
      }).catch(() => {
      })
    }
  }
}
</script>

<style scoped>

</style>
