<!--
  @description:供应商竞价大厅-物资明细组件
  @Modifier:gmy
  @routerPath:
  @date:2020/5/9-15:48
-->
<template>
  <div class="offer-goods-supplier">
    <p class="offer-detail" style="padding-left: 10px">
      物资明细
    </p>
    <!--  详细数据-->
    <section class="offer-goods-tables">
      <el-table
        :data="materialsData"
        max-height="180"
        border
      >
        <el-table-column
          header-align="center"
          type="index"
          fit
          label="序号"
          align="center"
          width="50"
        />
        <el-table-column
          header-align="center"
          prop="purchaseDesc"
          label="产品描述"
          align="left"
          min-width="560"
        />
        <el-table-column
          header-align="center"
          prop="quantity"
          label="数量"
          align="center"
          min-width="110"
        />
        <el-table-column
          header-align="center"
          prop="unitName"
          align="center"
          min-width="110"
          label="计量单位"
        />
      </el-table>
    </section>
  </div>
</template>

<script>
/* api */
import { listSubjectMatterByPackId } from '@/api/procurement/procurementProject' // 物资明细
/** 公共方法 */
import { procurementBiddingGroupMixin } from '../mixins/procurementBiddingGrounpMixins'
export default {
  name: 'OfferSupplierGoodsListVue',
  mixins: [procurementBiddingGroupMixin],
  inject: ['getTenderBase'],
  data() {
    return {
      materialsData: [],
      tenderBase: this.getTenderBase() // 获取项目信息
    }
  },
  created() {
    // 查询项目字典
    this.inCodes()
    // 获取物资明细
    this.getMaterialsData()
  },
  methods: {
    // 获取物资明细
    getMaterialsData() {
      const params = {
        packId: this.tenderBase.packId
      }
      listSubjectMatterByPackId(params).then(res => {
        // 获取物资明细数据
        this.materialsData = res.data
      })
    }
  }
}
</script>

<style lang="less" scoped>
 @import "~@assets/style/procurement/procurement.bidding.less";
</style>
