<!--
  @description: 单一来源公示预览（非紧急采购，需要对外发单一来源公示的项目）
  @Modifier: haofengxian
  @routerPath:
  @date: 2021-3-19-16:44
-->
<template>
  <el-dialog
    :visible.sync="dialogVisible"
    :lock-scroll="false"
    append-to-body
    title="单一来源公示预览"
    width="1200px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <div v-html="contentText" />
    <!--底部操作按钮-->
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible=false">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
/* api接口*/
import { queryBaseProcurementProjectInfo } from '@/api/procurement/procurementProject'
import { getInvitaitonPublicityHtmlByPackId } from '@api/procurement/procurementInvitation'

export default {
  name: 'ProcurementProjectLetterDialog',
  data() {
    return {
      dialogVisible: false, // 弹框是否打开
      tenderBase: {
        tenderType: '',
        packId: ''
      },
      contentText: '' // html 文件
    }
  },
  methods: {
    // 获取项目信息
    projectNoticeLoad() {
      this.dialogVisible = true
      const tenderId = this.$route.query.id
      queryBaseProcurementProjectInfo({ tenderId: tenderId }).then(res => {
        this.tenderBase = res.data
        this.getProjectNotice(this.tenderBase.packId)
      })
    },
    // 获取采购公告项目信息
    async getProjectNotice(packId) {
      const res = await getInvitaitonPublicityHtmlByPackId(packId)
      // 获取公告html文本
      this.contentText = res.data
    }
  }
}
</script>

<style scoped>

</style>
