<!--
  @description:项目管理-招标文件/资审文件下载列表
  @Modifier: 肖文龙
  @routerPath:
  @date: 2020/1/15-11:15
-->
<template>
  <div>
    <section class="main">
      <dl class="projectInfoDetail">
        <dt>
          <p class="projectInfoDetail_icon">
            <i class="iconfont icon-biaoduanbaoxinxi" />
          </p>
          {{ dict.examinationFileName }}文件下载列表
        </dt>
        <dd>
          <el-table
            ref="smallTable"
            :data="tableData"
            size="small"
          >
            <el-table-column
              type="index"
              label="序号"
              align="center"
              width="60"
            />
            <el-table-column
              prop="downloadOrgName"
              label="招标人名称"
              min-width="300px"
              header-align="center"
            />
            <el-table-column
              prop="downloadTime"
              label="下载时间"
              align="center"
              min-width="200"
            >
              <template slot-scope="scope">
                {{ scope.row.downloadTime && $Moment(scope.row.downloadTime).format(momentSaveFormat) }}
              </template>
            </el-table-column>
          </el-table>
          <!--分页组件-->
          <pagination :pagination-data="paginationData" @change="initData" />
        </dd>
      </dl>
    </section>
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="back()">
          返 回
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
/* api*/
import { listTenderDocDownloadPages } from '@api/bidding/tenderDoc'
/* 公共方法*/
import { filterObj } from '@/assets/js/utils'
/* 混合开发*/
import { ListMixin } from '@/mixins/ListMixin'
import { tenderDoc } from './../mixins/tenderDoc'// 招标文件/资审文件
/* 组件*/
import pagination from '@comp/common/pagination/pagination'// 分页
export default {
  name: 'TenderProcfileDownloadDetail',
  components: {
    pagination
  },
  mixins: [ListMixin, tenderDoc],
  data() {
    return {
      tableData: [
        /* {
          downloadOrgName: '', // 下载单位名称
          downloadTime: ''// 下载时间
        }*/
      ],
      searchFrom: {
        pageNo: 1, // 当前页
        pageSize: 10, // 每页条数
        procfileId: this.$route.query.procfileId// 文件Id
      }
    }
  },
  created() {
    this.initData()// 初始化
  },
  methods: {
    // 初始化
    initData() {
      const params = this.getQueryParams()// 查询条件
      listTenderDocDownloadPages(params).then(res => {
        this.tableData = res.data.records
        this.paginationData.total = res.data.total
      })
    },
    // 查询条件
    getQueryParams() {
      const param = Object.assign({}, this.searchFrom)
      param.pageNo = this.paginationData.pageNo
      param.pageSize = this.paginationData.pageSize
      return filterObj(param)
    },
    // 返回
    back() {
      this.$router.push({
        path: '/bidding/projectDrive/tenderDoc/tenderProcfilePack-add',
        query: this.$route.query
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>
