<!--
  @description: 项目经理澄清-查看回执机构
  @Modifier: 郝定康
  @routerPath:/procurement/procurementDrive/procEvaluateClarify/bidClarificationReceiptDetail
  @date: 2021-02-15 14:59:51
-->
<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="linker"
          align="left"
          min-width="100"
        />
        <el-table-column
          prop="linkerTel"
          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="checkTime"
          align="center"
          width="130"
        >
          <template slot-scope="scope">
            {{ scope.row.checkTime && $Moment(scope.row.checkTime).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
          align="center"
          label="内容附件"
        >
          <template slot-scope="scope">
            <downloadFile :key="'i' + scope.$index" :data="scope.row.bidClarificationReceiptContent" />
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="澄清附件"
        >
          <template slot-scope="scope">
            <downloadFile :key="'i' + scope.$index +'11'" :data="scope.row.bidClarificationReceiptAttachment" />
          </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 { listBidClarificationReceipt } from '@/api/procurement/procurementProject'// 澄清
/* 组件 */
import downloadFile from '@comp/common/updownload/downloadFile'
/* 混合开发方法-参数字段*/
import { clarificationGroupMixin } from '../../mixins/clarificationGroupMixin'// 澄清质疑-公用参数
import { clarificationMixin } from '../../mixins/clarificationMixin'// 澄清质疑-公用参数
export default {
  name: 'BidClarificationReceiptDetail',
  components: {
    downloadFile
  },
  mixins: [clarificationGroupMixin, clarificationMixin],
  data() {
    return {
      loading: true,
      tableData: []
    }
  },
  created() {
    // 获取列表信息
    this.loadData()
  },
  methods: {
    // 返回
    back() {
      // 如果是专家评标-澄清质疑 roleCode 11 采购员  OFF_EXPERT 评标专家
      if (this.roleCode === 'OFF_EXPERT') {
        this.$router.push({
          name: 'procEvaluateClarifyExpertList'
        })
      } else {
        this.$router.push({
          name: 'procEvaluateClarifyList'
        })
      }
    },
    // 获取数据
    loadData() {
      const data = {
        bidClarificationId: this.$route.params.bidClarificationId, // 澄清Id
        packId: this.$route.params.packId
      }
      listBidClarificationReceipt(data).then(response => {
        this.loading = false
        this.tableData = response.data
        this.tableData.forEach((item, index) => {
          // 内容附件
          this.tableData[index].bidClarificationReceiptContent = { fileType: this.bidClarificationReceiptContent.fileType, bizId: item.bidClarificationSupplierId }
          // 澄清附件
          this.tableData[index].bidClarificationReceiptAttachment = { fileType: this.bidClarificationReceiptAttachment.fileType, bizId: item.bidClarificationSupplierId }
        })
      }).catch(() => {

      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
