<!--
  @description: 计划数据统计
  @Modifier: haoFx
  @routerPath:
  @date: 2021-05-25-12:03
-->
<template>
  <div class="sum_Wrap">
    <el-table ref="smallTable" v-loading="loading" :data="tableData">
      <el-table-column
        header-align="center"
        prop="belongName"
        label="所属板块"
        width="170"
      />
      <el-table-column
        header-align="center"
        prop="reportPlanNum"
        label="本时间段上报计划行项目数"
        width="220"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="reportPlanMoney"
        label="计划预算净总价（万元）"
        width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="reportPlanTotalNum"
        label="目前总上报行项目数"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="reportPlanTotalMoney"
        label="目前总上报计划预算净总价（万元）"
        min-width="220"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="orderPlanDetailNum"
        label="成单行项目数"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="orderPlanTotalBudget"
        label="成单计划预算金额（万元）"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="orderTotalMoney"
        label="成单实际金额（万元）"
        min-width="170"
        align="right"
      />
    </el-table>
  </div>
</template>

<script>
/* 公共方法*/
import { filterDictText, numFilter, moneyFormat } from '@/assets/js/utils' // 字典方法
export default {
  name: 'PlanDataStatisticsTableComp',
  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">
</style>
