<!--
  @description: 询比、谈判-项目基本信息编辑组件
  @Modifier: haofengxian
  @routerPath:
  @date: 2021-1-11-18:57
-->
<template>
  <div>
    <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>
            <span v-if="formData.tenderOrgMethod === '00'">自行招标</span>
            <span v-else-if="formData.tenderOrgMethod === '01'">委托招标</span>
          </td>
        </template>
      </tr>
      <tr>
        <td>采购方式</td>
        <td>
          {{ filterDictText(allTenderMethodTypeList,formData.tenderMethod) }}
        </td>
        <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>
      </tr>
      <tr>
        <!--委托招标时 && 委托合同配置（00 否 01是）为01有委托合同则展示-委托合同-->
        <template v-if="formData.tenderOrgMethod=='01'&& isShowContract==='01'">
          <td>委托合同</td>
          <td>{{ formData.contractName }}</td>
        </template>
        <!--根据配置是否显示建设项目--配置00 否 01是-->
        <template v-if="isShowConstructionProject==='01'">
          <td>建设项目</td>
          <td>{{ formData.constructionProjectName }}</td>
        </template>
      </tr>
      <tr>
        <!-- <td>采购组织形式</td>
        <td>
          {{ filterDictText(purchaseLevelList,formData.purchaseLevel) }}
        </td> -->
        <td>项目行业</td>
        <td>
          {{ filterDictText(projectIndustryList,formData.projectIndustry) }}
        </td>
        <td>
          政府采购网采购编码
        </td>
        <td>{{ formData.hebeiPlancode }}</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>
  </div>
</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.initGroup()
    this.initData(tenderId)// 查询招标项目基本信息
  },
  methods: {
    filterDictText, // 字典值替换文本通用方法
    moneyFormat, // 金额添加千分位
    numberChinese, // 金额转大写
    // 查询招标项目基本信息
    initData(tenderId) {
      queryBaseTenderProjectInfo(tenderId).then(response => {
        this.formData = response.data
      }).catch(() => {
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>
