<template>
  <div>
    <h4 class="table_title">
      合格供应商认证情况
    </h4>
    <el-table ref="smallTable" v-loading="loading" :data="tableData">
      <el-table-column
        header-align="center"
        prop="areaIndustryCompany"
        label="合格供应商家数"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="buyersName"
        label="制造企业家数"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="tenderNo"
        label="占比（%）"
        min-width="160"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="tenderName"
        label="贸易企业家数"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="tenderName"
        label="占比(%)"
        min-width="160"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="packName"
        label="平均注册资金（万元）"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="packName"
        label="大型供应商家数"
        min-width="170"
        align="right"
      />
    </el-table>
  </div>
</template>

<script>
/* 公共方法*/
import { filterDictText, numFilter, moneyFormat } from '@/assets/js/utils' // 字典方法
export default {
  name: 'QualifiedSupplierCertificationTableComp',
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    loading: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      /* --------------字典----------------*/
      tender_methodList: [], // 采购方式
      collectionTypeList: [], // 是否集采
      purchaseUnitList: [], // 计量单位
      taxRateList: [], // 税率
      dictionaryType: ['tender_method', 'collectionType', 'purchaseUnit', 'taxRate'] // 字典请求参数
    }
  },
  created() {
    this.getGroupType() // 字典请求初始化
  },
  methods: {
    filterDictText, // 字典
    numFilter, // 金额
    moneyFormat, // 金额千分位
    // 字典请求
    getGroupType() {
      this.$store.dispatch('getGroupType', this.dictionaryType).then((data) => {
        // 遍历key存储相应的数据
        for (const key in data.bidTypeData) {
          /* 是否有数据*/
          if (data.bidTypeData[key]) {
            this[key] = data.bidTypeData[key]
          }
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
.table_title{
  text-align: center;
  margin: 0px 0 10px 0;
}
</style>
