<!--
  @description: 供应商-标中澄清列表
  @Modifier:杨胜国
  @routerPath:/procurement/procurementDriveSupplier/procEvaluateClarifySupplier/procEvaluateClarifySupList
  @date: 2020/05/07 09：47
-->
<template>
  <section>
    <div>
      <!-- v-loading="loading" -->
      <el-table
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60px"
          align="center"
        />
        <el-table-column
          header-align="center"
          label="澄清标题"
          prop="bidClarificationTitle"
          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="center"
          width="160"
        >
          <template slot-scope="scope">
            <!-- receiptStatus 00 未回执 01 已回执 -->
            <el-link
              v-if="scope.row.receiptStatus === '00'"
              type="primary"
              @click.stop="seeReceipt(scope.row)"
            >
              [澄清]
            </el-link>
            <el-link
              v-if="scope.row.receiptStatus === '01'"
              type="primary"
              @click.stop="preview(scope.row)"
            >
              [查看]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination :pagination-data="paginationData" @change="loadData" />
    </div>
  </section>
</template>

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

      })
    },
    // 查看
    preview(row) {
      this.$router.push({
        name: 'procEvaluateClarifySupDetail',
        params: {
          bidClarificationSupplierId: row.bidClarificationSupplierId, // 澄清问题Id
          bidClarificationTitle: row.bidClarificationTitle, // 标题
          bidClarificationId: row.bidClarificationId // 采购方附件id
        }
      })
    },
    // 澄清
    seeReceipt(row) {
      this.$router.push({
        name: 'procEvaluateClarifySupAdd',
        params: {
          // questionId: row.questionId, // 澄清问题Id
          bidClarificationSupplierId: row.bidClarificationSupplierId, // 澄清问题Id
          bidClarificationTitle: row.bidClarificationTitle, // 标题
          bidClarificationId: row.bidClarificationId // 采购方附件id
        }
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
