<!--
  @description: 评标澄清
  @Modifier:肖文龙
  @routerPath:/bidding/projectDrive/evaluateClarify/evaluateClarify-list
  @date: 2020/05/07 09：47
-->
<template>
  <section>
    <div>
      <el-table
        v-loading="loading"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60px"
          align="center"
        />
        <el-table-column
          header-align="center"
          label="澄清标题"
          prop="clarificationTitle"
          align="left"
          min-width="200"
        />
        <el-table-column
          header-align="center"
          label="标段编号"
          prop="packNo"
          align="left"
          min-width="200"
        />
        <el-table-column
          prop="clarificationEndTime"
          align="center"
          label="最晚澄清时间"
          min-width="160"
        >
          <template slot-scope="scope">
            {{ scope.row.clarificationEndTime && $Moment(scope.row.clarificationEndTime).format(momentDateTime) }}
          </template>
        </el-table-column>
        <el-table-column
          prop="clarificationSendTime"
          align="center"
          label="提交时间"
          min-width="160"
        >
          <template slot-scope="scope">
            {{ scope.row.clarificationSendTime && $Moment(scope.row.clarificationSendTime).format(momentDateTime) }}
          </template>
        </el-table-column>
        <el-table-column
          header-align="center"
          label="操作"
          align="left"
          width="160"
        >
          <template slot-scope="scope">
            <el-link
              type="primary"
              @click.stop="preview(scope.row)"
            >
              [查看]
            </el-link>
            <el-link
              type="primary"
              @click.stop="seeReceipt(scope.row)"
            >
              [查看回复机构]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination :pagination-data="paginationData" @change="loadData" />
    </div>
  </section>
</template>

<script>
/* 接口*/
import { listBidClarificationPages } from '@/api/bidding/bidClarification'// 澄清
/* 组件*/
import pagination from '@comp/common/pagination/pagination'// 分页
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'// 分页
import { clarificationGroupMixin } from '../../mixins/clarificationGroupMixin'// 澄清质疑-字典信息
export default {
  name: 'EvaluateClarifyList',
  components: {
    pagination// 分页
  },
  mixins: [ListMixin, clarificationGroupMixin],
  data() {
    return {
      loading: true,
      tableData: []
    }
  },
  created() {
    // 获取列表信息
    this.loadData()
  },
  methods: {
    // 获取数据
    loadData() {
      const params = {
        tenderId: this.$store.getters.tenderBase.tenderId,
        pageNo: this.paginationData.pageNo,
        pageSize: this.paginationData.pageSize
      }
      listBidClarificationPages(params).then(response => {
        this.loading = false
        this.tableData = response.data.records
        this.paginationData.total = response.data.total
      }).catch(() => {

      })
    },
    // 查看
    preview(row) {
      this.$router.push({
        path: '/bidding/projectDrive/evaluateClarify/evaluateClarifyPdf-detail',
        query: {
          ...this.$route.query,
          bidClarificationId: row.bidClarificationId// 投标文件澄清
        }
      })
    },
    // 查看回复机构
    seeReceipt(row) {
      this.$router.push({
        path: '/bidding/projectDrive/evaluateClarify/evaluateClarifyAnswer-detail',
        query: {
          ...this.$route.query,
          bidClarificationId: row.bidClarificationId// 投标文件澄清
        }
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
