<!--
  @description: 立项-预览-项目基本信息-国信新产品详情
  @Modifier: 肖文龙
  @routerPath:
  @date: 2019-12-18 16:32:31
-->
<template>
  <table class="tableData">
    <tr>
      <td>招标项目编号</td>
      <td colspan="3">
        {{ formData.tenderNo }}
      </td>
    </tr>
    <tr>
      <td>招标项目名称</td>
      <td colspan="3">
        {{ formData.tenderName }}
      </td>
    </tr>
    <tr>
      <!--采购人登录展示-->
      <template v-if="roleCode==='10'">
        <td>组织形式</td>
        <td>
          {{ filterDictText(orgMethodList,formData.tenderOrgMethod) }}
        </td>
      </template>
    </tr>
    <tr>
      <td>招标方式</td>
      <td>
        {{ filterDictText(bidTypeList,formData.tenderMethod) }}
      </td>
      <td>资格审查方式</td>
      <td>
        {{ filterDictText(phaseTypeList,formData.qualificationMethod) }}
      </td>
    </tr>
    <tr>
      <td>招标项目类型</td>
      <td>
        <!--父级-->
        <span
          v-for="(item,index) in projectClassificationList"
          v-if="formData.industryName === item.typecode"
          :key="index"
        >{{ item.typename }}
          <!--子级-->
          <span
            v-for="(child,childIndex) in item.child"
            v-if="formData.projectIndustryCode === child.typecode"
            :key="childIndex"
          >{{ child.typename }}
          </span>
        </span>
      </td>
      <td>项目性质</td>
      <td>
        {{ filterDictText(projectNatureList,formData.projectNature) }}
      </td>
    </tr>
    <tr>
      <!--委托招标时 && 委托合同配置（00 否 01是）为01有委托合同则展示-委托合同-->
      <template v-if="formData.tenderOrgMethod=='01'&& isShowContract==='01'">
        <td>委托合同</td>
        <td :colspan="isShowConstructionProject==='00'?'3':'0'">
          {{ formData.contractName }}
        </td>
      </template>
      <!--根据配置是否显示建设项目--配置00 否 01是-->
      <template v-if="isShowConstructionProject==='01'">
        <td>建设项目</td>
        <td :colspan="isShowContract==='00'?'3':'0'">
          {{ formData.constructionProjectName }}
        </td>
      </template>
    </tr>
    <!--<tr>
        <td>系统内/外</td>
        <td>
          {{ filterDictText(systemSourceList,formData.systemSource) }}
        </td>
        <td>采购类别</td>
        <td>
          {{ filterDictText(purchaseTypeList,formData.purchaseType) }}
        </td>
      </tr>
      <tr>
        <td>采购分类</td>
        <td>
          {{ filterDictText(purchaseClassificationList,formData.purchaseClassification) }}
        </td>
        <td>采购内容分类</td>
        <td>
          {{ filterDictText(purchaseContentClassList,formData.purchaseContentClassification) }}
        </td>
      </tr>-->
    <tr>
      <td>年度协议</td>
      <td colspan="3">
        {{ filterDictText(annualAgreementTypeList,formData.isAnnualAgreement) }}
      </td>
    </tr>
    <tr>
      <!-- <td>系统内/外</td>
      <td :colspan="formData.projectNature==='00'?'':'3'">
        {{ filterDictText(systemSourceList,formData.systemSource) }}
      </td> -->
      <td v-if="formData.projectNature==='00'">
        采购分类
      </td>
      <td v-if="formData.projectNature==='00'" colspan="3">
        {{ filterDictText(purchaseClassificationList,formData.purchaseClassification) }}
      </td>
    </tr>
    <tr>
      <!-- <td>采购级别</td>
      <td>
        {{ filterDictText(purchaseLevelList,formData.purchaseLevel) }}
      </td> -->
      <td>项目行业</td>
      <td colspan="3">
        {{ filterDictText(projectIndustryList,formData.projectIndustry) }}
      </td>
    </tr>
    <tr>
      <td>是否依法必招</td>
      <td :colspan="formData.projectNature==='00'?'':'3'">
        {{ filterDictText(isLegalTenderList,formData.isLegalTender) }}
      </td>
      <td v-if="formData.projectNature==='00'">
        是否限额以下
      </td>
      <td v-if="formData.projectNature==='00'">
        {{ filterDictText(beyondLegalLimitList,formData.beyondLegalLimit) }}
      </td>
    </tr>
    <tr>
      <td>项目所在区域</td>
      <td colspan="3">
        {{ formData.projectAreaName | filterAddress }} {{ formData.palceAddress }}
      </td>
    </tr>
    <tr>
      <td>项目总概算</td>
      <td colspan="3">
        {{ formData.budgetTotalMoney?moneyFormat(formData.budgetTotalMoney.toFixed(2)):formData.budgetTotalMoney }} 元
        <p class="amount_words">
          （ 大写：<span>{{ numberChinese(formData.budgetTotalMoney) }} </span>）
        </p>
      </td>
      <!--<td>实施地点</td>
        <td>{{ formData.palceAddress }}</td>-->
    </tr>
    <tr>
      <td>项目内容范围</td>
      <td colspan="3">
        {{ formData.tenderingArea }}
      </td>
    </tr>
  </table>
</template>

<script>
/* 接口*/
import { queryBaseTenderProjectInfo } from '@/api/bidding/biddingProject'// 获取信息
import { bidProjectInfo } from './mixins/bidProject'
import { bidProjectCommon } from '../mixins/bidProjectCommon'

import { numberChinese, moneyFormat, filterDictText } from '@assets/js/utils'// 常用方法
export default {
  name: 'BidProjectBaseDetail',
  filters: {
    filterAddress(val) {
      if (val)val = val.replace(/,/g, '')// 取消字符串中出现的所有逗号
      return val
    }
  },
  mixins: [bidProjectInfo, bidProjectCommon],
  created() {
    let tenderId = ''
    tenderId = this.projectData.id ? this.projectData.id : this.$route.params.id
    if (this.$route.query.id) tenderId = this.$route.query.id // 传参方式都改完删除
    this.initData(tenderId)// 查询招标项目基本信息
  },
  methods: {
    filterDictText, // 字典值替换文本通用方法
    moneyFormat, // 金额添加千分位
    numberChinese, // 金额转大写
    // 查询招标项目基本信息
    initData(tenderId) {
      queryBaseTenderProjectInfo(tenderId).then(response => {
        this.formData = response.data
        this.setProjectType(this.formData)
      }).catch(() => {
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>
