<!--
  @description: 文件领购记录-文件不收费
  @Modifier: wxy
  @routerPath:/procurement/procurementDrive/supplierResponse/docRecordNoFreeList
  @date: 2020-6-3 14:53:31
-->
<template>
  <div class="main">
    <p class="page-title">
      1、参与项目情况
    </p>
    <table class="tableData mb16">
      <tr class="singleRow">
        <td>下载家数</td>
        <td>{{ tableObj.num }}</td>
      </tr>
    </table>
    <p v-if="isShowMessage === '01'" class="page-title">
      2、购标供应商列表
    </p>
    <div v-if="isShowMessage === '01'" style="padding:10px 0">
      <gx-button :code="'001_011_001'" @click="exportNameList">
        导出名单
      </gx-button>
    </div>
    <section v-if="isShowMessage === '01'">
      <el-table
        ref="smallTable"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          align="center"
          width="60"
        />
        <el-table-column
          prop="downloadOrgName"
          align="left"
          label="单位名称"
          header-align="center"
        />
        <el-table-column
          prop="downloadTime"
          align="center"
          label="下载时间"
          header-align="center"
        />
      </el-table>
      <!--分页组件-->
      <pagination :pagination-data="paginationData" @change="initData" />
    </section>
  </div>
</template>

<script>
/* 接口*/
import { documentAcquisitionPurchaseRecordNo, exportDocumentAcquisitionPurchaseRecordList } from '@/api/procurement/procurementSignup'// 获取信息
import pagination from '@comp/common/pagination/pagination'// 分页
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'// 分页
/* 公共方法 */
import { download } from '@/assets/js/utils/index'
export default {
  name: 'DocRecordFree',
  inject: ['getTenderBase'],
  components: {
    pagination // 分页
  },
  mixins: [ListMixin],
  data() {
    return {
      tableData: [], // 邀请供应商列表
      tableObj: {
        num: '' // 下载家数
      }, // 参与情况
      formData: [],
      isShowMessage: '', // 是否显示购标供应商列表
      tenderBase: this.getTenderBase()
    }
  },
  created() {
    this.initData() // 查询文件不收费信息
  },
  methods: {
    initData() {
      const params = {
        packId: this.tenderBase.packId,
        pageNo: this.paginationData.pageNo,
        pageSize: this.paginationData.pageSize
      }
      documentAcquisitionPurchaseRecordNo(params).then(res => {
        this.tableObj.num = res.data.num
        this.tableData = res.data.documentAcquisitionPurchaseRecordNoList.records
        this.isShowMessage = res.data.isShowMessage // 是否显示购标供应商列表
        this.paginationData.total = res.data.num
      }).catch(() => {})
    },
    // 导出名单
    exportNameList() {
      exportDocumentAcquisitionPurchaseRecordList(this.tenderBase.packId).then(res => {
        download(res, '名单.xls')
      })
    }
  }
}
</script>

<style>
</style>
