<!--
  @description: 公告信息弹框-采购单审核及中选结果审批时，增加一个“公告预览”的按钮，点击后弹出展示对外的公告页面
  @Modifier: haofengxian
  @routerPath:
  @date: 2021-3-5-15:03
-->
<template>
  <el-dialog
    :visible.sync="dialogVisible"
    :lock-scroll="false"
    append-to-body
    :title="dialogTitle"
    width="1200px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <!--公告信息组件-->
    <procurementProjectLetterComp v-if="tenderBase.packId" :tender-type="tenderBase.tenderType" :pack-id="tenderBase.packId" />
    <!--底部操作按钮-->
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible=false">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
/* 组件*/
import procurementProjectLetterComp from './procurementProjectLetterComp'
/* api接口*/
import { queryBaseProcurementProjectInfo } from '@/api/procurement/procurementProject'
export default {
  name: 'ProcurementProjectLetterDialog',
  components: {
    procurementProjectLetterComp // 公告信息
  },
  data() {
    return {
      dialogVisible: false, // 弹框是否打开
      dialogTitle: '', // 公告/邀请函标题
      tenderBase: {
        tenderType: '',
        packId: ''
      }
    }
  },
  methods: {
    // 获取项目信息
    projectNoticeLoad() {
      this.dialogVisible = true
      const tenderId = this.$route.query.id
      queryBaseProcurementProjectInfo({ tenderId: tenderId }).then(res => {
        this.tenderBase = res.data
        // 00 公开 01邀请
        if (this.tenderBase.tenderType === '00') {
          this.dialogTitle = '公告信息'
        } else {
          this.dialogTitle = '邀请函信息'
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
