
<!--
 * @Description: 部门经理-审核采购单-中选审核-最低成交价工作流查看页
 * @Author: lxl/肖文龙
 * @routerPath:procurementOrder/hooseAuditFlowDetail/hooseAuditFlowDetail
 * @Date: 2020-07-14 11:55:32
-->
<template>
  <div>
    <div class="clearfix mb10">
      <div class="fr">
        <el-button type="primary" plain @click="getEnquiryHtml">
          {{ tenderType && tenderType === '00' ? '公告预览' : '邀请函预览' }}
        </el-button>
        <el-button type="primary" plain @click="getNoticeHtml">
          中选通知书预览
        </el-button>
        <el-button type="primary" plain @click="procurementMethod">
          采购方式
        </el-button>
        <el-button type="primary" plain @click="seeProjectNotice">
          中选公告预览
        </el-button>
      </div>
    </div>
    <!--中选页面组件-->
    <procurementResultGoodsAllotComp ref="resultGoodsAllotComp" :goods-data="goodsData" :is-detail="isDetail" />
    <!--采购结果公告-->
    <procurementClinchResultNoticeDialog ref="procurementClinchResultNotice" />
    <!--采购方式弹框-->
    <purPlanBaleDetailDialog ref="purPlanBaleDetail" :line-item-list="lineItemList" />
    <!--中选通知书预览-->
    <procurementWinningResultNoticeDialog ref="procurementWinningResultNotice" />
    <!--公告信息弹框-->
    <procurementProjectLetterDialog ref="procurementProjectLetter" />
  </div>
</template>

<script>
/* 组件 */
import procurementResultGoodsAllotComp from '@/views/procurement/procurementResult/procurementResultGoodsAllot/procurementResultGoodsAllotComp'
import procurementClinchResultNoticeDialog from '@/views/procurement/procurementClinchResultNotice/procurementClinchResultNotice-dialog.vue' // 查看结果公告信息
import purPlanBaleDetailDialog from
  '@/views/procurement/procurementPlan/purPlanAllocation/purPlanBaleDetail-dialog.vue' // 查看打包信息
import procurementWinningResultNoticeDialog from '../procurementResultGoodsAllot/procurementWinningResultNotice-dialog'
import procurementProjectLetterDialog from '@views/procurement/procurementProject/procurementProjectLetter/procurementProjectLetter-dialog' // 查看公告信息
import { queryBaseProcurementProjectInfo } from '@/api/procurement/procurementProject'

export default {
  name: 'HooseAuditDetaile',
  components: {
    procurementWinningResultNoticeDialog, // 中选通知书预览
    procurementResultGoodsAllotComp,
    purPlanBaleDetailDialog, // 查看（打包信息）采购方式
    procurementClinchResultNoticeDialog, // 查看公告信息
    procurementProjectLetterDialog
  },
  data() {
    return {
      isDetail: true,
      lineItemList: [], // 行项目列表
      tenderType: '', // 采购方式
      // 业务参数
      goodsData: {
        tenderId: ''// 项目id
      }
    }
  },
  created() {
    this.init()// 初始化
  },
  methods: {
    // 查询中选通知书
    getNoticeHtml() {
      this.$refs.procurementWinningResultNotice.winningResultNoticeLoad()
    },
    // 采购方式
    procurementMethod() {
      // 行项目列表
      this.lineItemList = this.$refs.resultGoodsAllotComp.tableData.tableList
      // 查看打包信息
      this.$refs.purPlanBaleDetail.openDialogPurPlanBaleDetail(this.goodsData.tenderId)
    },
    // 中选公告预览
    seeProjectNotice() {
      this.$refs.procurementClinchResultNotice.resultNoticeLoad()
    },
    // 公告预览
    getEnquiryHtml() {
      this.$refs.procurementProjectLetter.projectNoticeLoad()
    },
    // 初始化
    init() {
      this.goodsData.tenderId = this.$route.query.id// 项目id
      queryBaseProcurementProjectInfo({ tenderId: this.goodsData.tenderId }).then((res) => {
        this.tenderType = res.data.tenderType
      })
    }
  }
}
</script>

<style lang="less" scoped>
</style>
