<!--
  @description: 计划归集统计情况
  @Modifier: haoFx
  @routerPath:
  @date: 2021-05-25-12:04
-->
<template>
  <div>
    <el-table
      ref="smallTable"
      v-loading="loading"
      :data="tableData"
    >
      <el-table-column type="index" label="序号" width="60px" align="center" />
      <el-table-column
        header-align="center"
        prop="tenderNo"
        label="采购单编号"
        width="170"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="purchaseNo"
        label="行项目编号"
        width="170"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="tenderMethod"
        label="采购方式"
        width="170"
      >
        <template slot-scope="scope">
          {{ filterDictText(tender_methodList, scope.row.tenderMethod) }}
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        prop="tenderType"
        label="公开/邀请"
        width="170"
      >
        <template slot-scope="scope">
          {{ filterDictText(tenderTypeList, scope.row.tenderType) }}
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        prop="supplierCategory"
        label="供应商分类"
        min-width="170"
      />
      <el-table-column
        header-align="center"
        prop="supplierAttribute"
        label="供应商属性"
        min-width="170"
      />
      <el-table-column
        header-align="center"
        prop="reviewMethod"
        label="评审办法"
        min-width="170"
      >
        <template slot-scope="scope">
          {{ filterDictText(reviewMethodList, scope.row.reviewMethod) }}
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        prop="budgetTotalMoney"
        label="采购单净预算(元)"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="budgetTotalTaxMoney"
        label="采购单含税总预算(元)"
        min-width="170"
        align="right"
      />
      <el-table-column
        header-align="center"
        prop="createUserRealName"
        label="计划员"
        min-width="170"
      />
      <el-table-column
        header-align="center"
        prop="bizAuditStatus"
        label="审批状态"
        min-width="170"
      >
        <template slot-scope="scope">
          {{ filterDictText(planAuditStatusList, scope.row.bizAuditStatus) }}
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        prop="packWaitTime"
        label="上报审批时间"
        min-width="170"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="packSubmitTime"
        label="打包提交时间"
        min-width="170"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="packauditpasstime"
        label="打包完成时间"
        min-width="170"
        align="center"
      />
      <el-table-column
        header-align="center"
        prop="durationDate"
        label="打包天数"
        min-width="170"
        align="right"
      />
    </el-table>
  </div>
</template>

<script>
/* 公共方法*/
import { filterDictText, numFilter, moneyFormat } from '@/assets/js/utils' // 字典方法
import { statisticalMixins } from '../../mixins/statisticalMixins'// 字典信息
export default {
  name: 'ProcurementMethodHandlingTableComp',
  mixins: [statisticalMixins],
  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>

</style>
