<!--
  @description: 项目规则之公开竟价组件
  @author: gmy
  @date: 2020-8-4 10:31:58
-->
<template>
  <div>
    <table class="tableData">
      <!--    收取标书费 标书费金额      -->
      <!-- <tr>
        <td>收取标书费</td>
        <td v-if="dataRule.isReceiveTenderDocumentPrice === '00'" colspan="3">
          <span
            v-for="(item,index) in documentPrice"
            v-if=" dataRule.isReceiveTenderDocumentPrice===item.typecode"
            :key="index">{{ item.typename }}</span></td>
        <td v-if="dataRule.isReceiveTenderDocumentPrice === '01'">
          <span
            v-for="(item,index) in documentPrice"
            v-if=" dataRule.isReceiveTenderDocumentPrice===item.typecode"
            :key="index">{{ item.typename }}</span></td>
        <td v-if="dataRule.isReceiveTenderDocumentPrice === '01'">
          标书费金额(元)
        </td>
        <td v-if="dataRule.isReceiveTenderDocumentPrice === '01'">
          {{ dataRule.protProjectDocumentPriceList[0].documentPrice }}
        </td>
      </tr> -->
      <!-- 收取保证金-保证金金额 -->
      <!-- <tr>
        <td>收取保证金</td>
        <td v-if="dataRule.isReceiveTenderBailPrice === '00'" colspan="3">
          <span
            v-for="(item,index) in bailPrice"
            v-if=" dataRule.isReceiveTenderBailPrice===item.typecode"
            :key="index">{{ item.typename }}</span></td>
        <td v-if="dataRule.isReceiveTenderBailPrice === '01'">
          <span
            v-for="(item,index) in bailPrice"
            v-if=" dataRule.isReceiveTenderBailPrice===item.typecode"
            :key="index">{{ item.typename }}</span></td>
        <td v-if="dataRule.isReceiveTenderBailPrice === '01'">
          保证金金额(元)
        </td>
        <td v-if="dataRule.isReceiveTenderBailPrice === '01'">
          {{ dataRule.protProjectBailPriceList[0].bailPrice }}
        </td>
      </tr> -->
      <!-- 币种-付款方式 -->
      <tr>
        <td>
          币种
        </td>
        <td>
          {{ filterDictText(currencyList, dataRule.currency) }}
        </td>
        <td>
          付款方式
        </td>
        <td>
          {{ filterDictText(payTypelist, dataRule.payType) }}
        </td>
      </tr>
      <!--     强制上传应答文件  是否含运费      -->
      <tr>
        <td>
          强制上传应答文件
        </td>
        <td>
          {{ filterDictText(uploadReplyFileList, dataRule.isUploadReplyFile) }}
        </td>
        <td>
          是否含运费
        </td>
        <td>
          {{ filterDictText(containsFreightList, dataRule.isContainsFreight) }}
        </td>
      </tr>
      <!--    审核报名       -->
      <tr>
        <td>
          审核报名
        </td>
        <td colspan="3">
          {{ filterDictText(signupAudit, dataRule.signupAudit) }}
        </td>
      </tr>
    </table>
    <div class="page-title">
      竞价规则
    </div>
    <table class="from_table">
      <!--    竞价开始时间-竞价时长        -->
      <tr>
        <td>
          竞价开始时间
        </td>
        <td>
          {{ dataRule.quoteStartTime }}
        </td>
        <td>
          竞价时长
        </td>
        <td>
          {{ dataRule.quoteTime }}
          {{ filterDictText(quoteTimeUnit, dataRule.quoteTimeUnit) }}
        </td>
      </tr>
      <!--    竞价类型-控制价格（元）       -->
      <tr>
        <td>
          竞价类型
        </td>
        <td>
          {{ filterDictText(comparePriceType, dataRule.comparePriceType) }}
        </td>
        <td>
          {{ comparePriceTitle }}
        </td>
        <td>
          {{ dataRule.comparePrice }}
        </td>
      </tr>
      <!--    报价次数-报价最小幅度       -->
      <tr>
        <td>
          报价次数（次）
        </td>
        <td>
          {{ filterDictText(quoteCountType, dataRule.quoteCountType) }}
          <span v-if="dataRule.quoteRangeType === '01'">{{ dataRule.quoteCount }}</span>
        </td>
        <td>
          {{ quoteRangeTypeTitle }}
        </td>
        <td>
          {{ filterDictText(quoteRangeType, dataRule.quoteRangeType) }}
          <span v-if="dataRule.quoteRangeType === '01'">{{ dataRule.quoteRangePrice }}</span>
        </td>
      </tr>
      <!--     超时竞价-超时竞价延长       -->
      <tr>
        <td>
          超时竞价
        </td>
        <td>
          竞价倒计时
          {{ dataRule.quoteOutTime }}
          {{ filterDictText(quoteOutTimeUnit, dataRule.quoteOutTimeUnit) }}内,有人报价进入超时竞价
        </td>
        <td>
          超时竞价延长
        </td>
        <td>
          {{ dataRule.quoteOutTimeAddTime }}
          {{ filterDictText(quoteOutTimeAddTimeUnit, dataRule.quoteOutTimeAddTimeUnit) }}
        </td>
      </tr>
      <!--     是否公开参与的竞价家数-是否公开排名      -->
      <tr>
        <td>
          是否公开参与的竞价家数
        </td>
        <td>
          {{ filterDictText(isPublicSupplierCount, dataRule.isPublicSupplierCount) }}
        </td>
        <td>
          是否公开竞价排名
        </td>
        <td>
          {{ filterDictText(isPublicSupplierRanking, dataRule.isPublicSupplierRanking) }}
        </td>
      </tr>
      <!--   是否公开竞价方名称-是否公开报价金额      -->
      <tr>
        <td>
          是否公开竞价方名称
        </td>
        <td>
          {{ filterDictText(isPublicSupplierName, dataRule.isPublicSupplierName) }}
        </td>
        <td>
          是否公开报价金额
        </td>
        <td>
          {{ filterDictText(isPublicSupplierPrice, dataRule.isPublicSupplierPrice) }}
        </td>
      </tr>
      <tr>
        <td>
          竞价方式
        </td>
        <td colspan="3">
          {{ filterDictText(comparePriceMethod, dataRule.comparePriceMethod) }}
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
/* 公用方法*/
import { filterDictText } from '@/assets/js/utils'
/* 混合开发*/
import { procurementProjectGroupMixin } from '@/views/procurement/procurementProject/mixins/procurementProjectGroupMixin'// 立项采购-字典
import { procurementProjectMixins } from '@/views/procurement/procurementProject/mixins/procurementProjectMixins'// 立项采购-公用方法参数
export default {
  name: 'ProcurementProjectAdd',
  mixins: [procurementProjectGroupMixin, procurementProjectMixins],
  props: {
    dataRule: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      comparePriceTitle: '起拍价格(元)', // 限价
      quoteRangeTypeTitle: '报价最小幅度(元)' // 价格幅度
    }
  },
  watch: {
    'dataRule.comparePriceType'(val) {
      // 竞价方式转换字
      if (val === '01') {
        this.comparePriceTitle = '起拍折扣率(%)'
        this.quoteRangeTypeTitle = '报价最小幅度(%)'
      } else {
        this.comparePriceTitle = '起拍价格(元)'
        this.quoteRangeTypeTitle = '报价最小幅度(元)'
      }
    }
  },
  created() {
    // 调用项目规则字典方法
    this.initqueryProcurementProjectRuleInitInfo()
  },
  methods: {
    filterDictText // 公共数据字典替换方法
  }
}
</script>

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