<!--
  @description: 立项信息-预览
  @Modifier: 肖文龙
  @routerPath:/bidding/projectDrive/tenderProject
  @date: 2019-12-18 15:29:26
-->
<template>
  <!--driveIntoView 驱动进入查看招标项目信息 添加main样式-->
  <div :class="driveIntoView?'main':''">
    <!--项目基本信息-->
    <dl class="projectInfoDetail">
      <dt>
        <p class="projectInfoDetail_icon">
          <i class="iconfont icon-xiangmujibenxinxi" />
        </p>
        项目基本信息
      </dt>
      <dd>
        <bidProjectBase :project-data="projectData" />
      </dd>
    </dl>

    <!--相关机构信息-->
    <dl class="projectInfoDetail">
      <dt>
        <p class="projectInfoDetail_icon">
          <i class="iconfont icon-xiangguanjigouxinxi" />
        </p>
        相关机构信息
      </dt>
      <dd>
        <bidProjectDepart :project-data="projectData" />
      </dd>
    </dl>
    <!--标的清单-->
    <dl v-if="!this.$store.getters.systemConfigSourceVo.systemSourceType" class="projectInfoDetail">
      <dt>
        <p class="projectInfoDetail_icon">
          <i class="iconfont icon-biaodeqingdan" />
        </p>
        标的清单
      </dt>
      <dd>
        <bidProjectMateriel :project-data="projectData" />
      </dd>
    </dl>

    <!--标段（包）信息-->
    <dl class="projectInfoDetail">
      <dt>
        <p class="projectInfoDetail_icon">
          <i class="iconfont icon-biaoduanbaoxinxi" />
        </p>
        标段（包）信息
      </dt>
      <dd>
        <!--不分包-->
        <noPackageDetail v-if="isPack==='00'" :project-data="projectData" />
        <!--分包-->
        <packageDetail v-if="isPack==='01'" :project-data="projectData" />
      </dd>
    </dl>
    <!--附件信息-->
    <dl class="projectInfoDetail">
      <dt>
        <p class="projectInfoDetail_icon">
          <i class="iconfont icon-fujianxinxi" />
        </p>
        附件信息
      </dt>
      <dd>
        <bidProjectOtherDetail :project-data="projectData" />
      </dd>
    </dl>
  </div>
</template>

<script>
import bidProjectBase from '../bidProjectBase/bidProjectBase-detail'// 项目信息
import bidProjectDepart from '../bidProjectDepart/bidProjectDepart-detail'// 相关机构信息
import bidProjectOtherDetail from '../bidProjectOther/bidProjectOther-detail'// 附件信息
import bidProjectMateriel from '../bidProjectMateriel/bidProjectMateriel-detail'// 标的清单
import packageDetail from '../bidProjectPackage/package-detail'// 标段（包）信息 分包
import noPackageDetail from '../bidProjectPackage/noPackage-detail'// 标段（包）信息 不分包
/* 接口*/
import { queryTenderProjectIsPack } from '@/api/bidding/biddingProject'

export default {
  name: 'BidProjectPreview',
  components: {
    bidProjectBase,
    bidProjectDepart,
    bidProjectOtherDetail,
    bidProjectMateriel,
    packageDetail,
    noPackageDetail
  },
  props: {
    // 接收步骤条父页面信息
    projectData: {
      type: Object,
      default: function() {
        return {
          id: '',
          qualificationMethod: '', // 00资格预审 01资格后审
          tenderOrgMethod: '', // 组织形式 01 委托招标 00 自主招标
          agentServiceFeeMethod: '', // 招标代理服务费收取方式 差额定率累进制00 固定金额01 固定比例02
          isProcurementPlan: '' // 修改父组件传给是否有招标计划 00 否 01是
        }
      }
    }
  },
  data() {
    return {
      driveIntoView: this.$route.meta.driveIntoView, // driveIntoView为true驱动进入查看
      isPack: '' // 是否分包状态 00 不分包 01 分包
    }
  },
  created() {
    this.$store.dispatch('getSystemSourceConfig')
  },
  mounted() {
    // 获取分标段不分标段状态
    this.getPack()
  },
  methods: {
    // 获取分标段不分标段状态
    getPack() {
      let tenderId = ''
      if (this.projectData.id) tenderId = this.projectData.id
      if (this.$route.params.id) tenderId = this.$route.params.id // 传参方式都改完删除
      if (this.$route.query.id) tenderId = this.$route.query.id // 传参方式都改完删除
      queryTenderProjectIsPack(tenderId).then(res => {
        this.isPack = res.data.isPack
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>
