<!--
  @description: 今日开标列表主页面-数字点击标段列表-点击查看投标人显示投标供应商弹框
  @Modifier: haoFx
  @routerPath:
  @date: 2020/3/18-11:57
-->
<template>
  <el-dialog
    :visible.sync="dialogTableVisible"
    :fullscreen="true"
    custom-class="el-dialog__body-p8"
    title="投标供应商列表"
  >
    <div>
      <el-table
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60px"
          align="center"
        />
        <el-table-column
          header-align="center"
          prop="supplierName"
          label="投标单位名称"
          min-width="230"
        />
        <el-table-column
          prop="bidTime"
          label="投标时间"
          align="center"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          prop="fileSize"
          label="投标文件大小"
          width="100"
          align="right"
        >
          <template slot-scope="scope">
            <span>{{ scope.row.fileSize }}KB</span>
          </template>
        </el-table-column>
        <!--投标人解密显示 否则不显示-->
        <template v-if="iShowSignInfo">
          <el-table-column
            header-align="center"
            prop="signStatus"
            label="签到状态"
            min-width="75"
            align="center"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.signStatus==='00'">未签到</span>
              <span v-if="scope.row.signStatus==='01'">已签到</span>
            </template>
          </el-table-column>
          <el-table-column
            prop="signPerson"
            align="center"
            label="签到人"
            min-width="75"
          />
          <el-table-column
            align="center"
            label="签到时间"
            prop="signTime"
            min-width="200"
          />
        </template>
        <el-table-column
          label="解密状态"
          prop="decryptionStatus"
          align="center"
          min-width="110"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.decryptionStatus==='00'">未解密</span>
            <span v-if="scope.row.decryptionStatus==='01'">解密成功</span>
            <span v-if="scope.row.decryptionStatus==='02'">解密失败</span>
          </template>
        </el-table-column>
        <!--        <el-table-column
          label="解密时长"
          prop="decryptionUseTime"
          align="center"
          min-width="110"
        />-->
        <el-table-column
          label="签字确认时间"
          prop="confirmTime"
          align="center"
          min-width="110"
        />
      </el-table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogTableVisible = false">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
/* 接口*/
import { getTenderBidderListByStageId } from '@api/bidding/bidOpening'
export default {
  name: 'BiddingSuppliersList',
  data() {
    return {
      dialogTableVisible: false, // 弹框是否打开
      tableData: [],
      params: {}, // 获取投标人信息列表参数
      iShowSignInfo: true // 是否显示签到信息
    }
  },
  methods: {
    // 打开弹框
    openDialog(data) {
      /* bidDocumentDecryptionMethod // 投标文件解密方式 00:投标人解密 01:服务端集中解密*/
      if (data.bidDocumentDecryptionMethod === '01') {
        this.iShowSignInfo = false
      }
      this.dialogTableVisible = true
      this.params.openStageType = data.openStageType
      this.params.stageId = data.stageId
      // 获取投标人信息列表
      this.loadData()
    },
    // 获取投标人信息列表
    loadData() {
      delete this.params.isSatisfyThreeBidder // 删除不保存数据
      getTenderBidderListByStageId(this.params).then(response => {
        this.tableData = response.data
      }).catch(() => {
      })
    }
  }
}
</script>

<style scoped lang="less">
  @import "../index";
/deep/.el-dialog__footer{
  position: absolute;
  bottom: 0;
  width: 100%;
}
</style>
