<!--
  @description: 项目经理澄清-查看回执机构
  @Modifier: 肖文龙
  @routerPath:/bidding/projectDrive/clarification/clarificationReceiptDetail
  @date: 2020/4/6-14:11
-->
<template>
  <section>
    <div class="page-title">
      回执机构列表
    </div>
    <div>
      <el-table
        v-loading="loading"
        :data="tableData"

        width="100%"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60px"
          align="center"
        />
        <el-table-column
          header-align="center"
          label="投标人供应商"
          prop="supplierName"
          align="left"
          min-width="200"
        />
        <el-table-column
          header-align="center"
          label="联系人"
          prop="linkName"
          align="left"
          min-width="100"
        />
        <el-table-column
          prop="linkPhone"
          align="center"
          label="联系电话"
          width="110"
        />
        <el-table-column
          prop="receiptStatus"
          align="center"
          label="状态"
          width="100"
        >
          <template slot-scope="scope">
            <span v-for="(item,index) in receiptStatusList" v-if="scope.row.receiptStatus===item.typecode" :key="index" :class="item.class">
              {{ item.typename }}
            </span>
          </template>
        </el-table-column>
        <el-table-column
          header-align="center"
          label="查看时间"
          prop="firstCheckTime"
          align="center"
          width="130"
        >
          <template slot-scope="scope">
            {{ scope.row.firstCheckTime && $Moment(scope.row.firstCheckTime).format(momentDateTime) }}
          </template>
        </el-table-column>
        <el-table-column
          prop="receiptTime"
          align="center"
          label="回执时间"
          width="160"
        >
          <template slot-scope="scope">
            {{ scope.row.receiptTime && $Moment(scope.row.receiptTime).format(momentDateTime) }}
          </template>
        </el-table-column>
        <el-table-column
          header-align="center"
          label="操作"
          align="left"
          width="120"
        >
          <template slot-scope="scope">
            <!--
            receiptStatus 01 已回执
            -->
            <el-link
              v-if="scope.row.receiptStatus==='01'"
              type="primary"
              @click.stop="seeReceipt(scope.row)"
            >
              [查看回执]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!--保存按钮-->
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="back">
          返 回
        </el-button>
      </div>
    </div>
  </section>
</template>

<script>
/* 接口*/
import { listClarificationReceipt } from '@/api/bidding/bidClarification'// 澄清
/* 混合开发方法-参数字段*/
import { clarificationGroupMixin } from '../../mixins/clarificationGroupMixin'// 澄清质疑-字典信息
export default {
  name: 'ClarificationReceiptDetail',
  mixins: [clarificationGroupMixin],
  data() {
    return {
      loading: true,
      tableData: []
    }
  },
  created() {
    // 获取列表信息
    this.loadData()
  },
  methods: {
    // 返回
    back() {
      this.$router.push({
        path: '/bidding/projectDrive/clarification/clarificationList',
        query: {
          ...this.$route.query
        }
      })
    },
    // 获取数据
    loadData() {
      const data = {
        clarificationId: this.$route.query.clarificationId // 澄清Id
      }
      listClarificationReceipt(data).then(response => {
        this.loading = false
        this.tableData = response.data
      }).catch(() => {

      })
    },
    // 查看回执详情
    seeReceipt(row) {
      this.$router.push({
        path: '/bidding/projectDrive/clarification/clarificationReceiptPdfDetail',
        query: {
          ...this.$route.query,
          clarificationReceiptId: row.clarificationReceiptId// 回执详情Id
        }
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
