<!--
  @description: 标段开启及启动解密及完成情况列表
  @Modifier: yangzy
  @routerPath: /bidding/bidOpening/bidOpeningMonitor/bidOpeningMonitorDetail/bidDecryptData-detail
  @date: 2021/02/04 16:58:01
-->
<template>
  <div>
    <dl class="projectInfoDetail">
      <dd>
        <el-table
          v-loading="loading"
          :data="tableData"
        >
          <el-table-column
            type="index"
            label="序号"
            min-width="60px"
            align="center"
          />
          <el-table-column
            prop="packNo"
            label="标段（包）编号"
            header-align="center"
            min-width="140px"
          />
          <el-table-column
            prop="packName"
            label="标段（包）名称"
            header-align="center"
            min-width="140px"
          />
          <!-- isTwoBidOpening为00 一步开标展示开启和解密数据 -->
          <template v-if="this.$route.params.isTwoBidOpening === '00'">
            <el-table-column
              prop="isStartTechnicalOpeningStatus"
              label="开启情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in openStatusList"
                  v-if="item.typecode===scope.row.isStartTechnicalOpeningStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="isStartTechnicalOpeningDecryptStatus"
              label="启动解密情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in decryptStatusList"
                  v-if="item.typecode===scope.row.isStartTechnicalOpeningDecryptStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="technicalOpeningStatus"
              label="开标情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in openingStatusList"
                  v-if="item.typecode===scope.row.technicalOpeningStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
          </template>
          <!-- isTwoBidOpening为01 两步开标展示商务技术和经济标开启和解密数据 -->
          <template v-if="this.$route.params.isTwoBidOpening === '01'">
            <el-table-column
              prop="isStartTechnicalOpeningStatus"
              label="商务技术开启情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in openStatusList"
                  v-if="item.typecode===scope.row.isStartTechnicalOpeningStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="isStartTechnicalOpeningDecryptStatus"
              label="商务技术启动解密情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in decryptStatusList"
                  v-if="item.typecode===scope.row.isStartTechnicalOpeningDecryptStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="technicalOpeningStatus"
              label="商务技术开标情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in openingStatusList"
                  v-if="item.typecode===scope.row.technicalOpeningStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="isStartOpeningStatus"
              label="经济开启情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in openStatusList"
                  v-if="item.typecode===scope.row.isStartOpeningStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="isStartOpeningDecryptStatus"
              label="经济启动解密情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in decryptStatusList"
                  v-if="item.typecode===scope.row.isStartOpeningDecryptStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
            <el-table-column
              prop="openingStatus"
              label="经济开标情况"
              min-width="140px"
              header-align="center"
            >
              <template slot-scope="scope">
                <span
                  v-for="(item, index) in openingStatusList"
                  v-if="item.typecode===scope.row.openingStatus"
                  :key="index"
                  :class="item.class"
                >
                  {{ item.typename }}
                </span>
              </template>
            </el-table-column>
          </template>
          <el-table-column
            prop="queryTime"
            label="查询时间"
            align="center"
            min-width="140px"
          />
        </el-table>
      </dd>
    </dl>
  </div>
</template>
<script>
/* api */
import { filterDictText } from '@/assets/js/utils'// 常用方法
import { getOpenBidProjectOpening } from '@/api/bidding/bidOpening' // 标段开启及启动解密及完成情况列表
import { bidOpeningGroupMixin } from '@/views/bidding/bidOpening/mixins/bidOpeningGroupMixin'// 全局公共方法》时间转换格式

export default {
  name: 'BidDecryptDataDetail',
  mixins: [bidOpeningGroupMixin],
  props: {
    bidDecrypt: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      loading: false, // 列表loading
      tableData: [] // 列表
    }
  },
  methods: {
    filterDictText,
    // 查询数据
    bidDecryptData() {
      this.tableData = []
      this.loading = true
      getOpenBidProjectOpening(this.bidDecrypt).then(response => {
        this.loading = false
        this.tableData = response.data
      }).catch(() => {
        this.loading = false
      })
    }
  }
}
</script>
<style lang="less" scoped>
</style>
