<template>
  <div class="bidding-management-view">
    <div v-if="advanceViewList.length" class="view-steps-box">
      <cy-steps :steps-data="advanceViewList" />
    </div>
    <div v-loading="loading" class="tempalte-content">
      <el-collapse v-if="advanceViewList.length" v-model="activeNames" @change="handleChange">
        <el-collapse-item v-for="(item, index) in advanceViewList" :id="index" :key="index" :name="index">
          <template slot="title">
            <cy-view-bar
              :view-bar-data="{ ...item.businessProcessingLogVo, formBusinessName: item.formBusinessName, index: index + 1 }"
            />
          </template>
          <create-bidding v-if="item.formBusinessName === '业务创建'" :deatails-info="item.obj" :disabled="true" />
        </el-collapse-item>
      </el-collapse>
      <!-- <el-empty v-else style="height: calc(100vh - 0.85rem - 90px)"></el-empty> -->
    </div>
  </div>
</template>

<script>
import { getMyBiddingView } from '@/api/myTrade/biddingManagement/biddingManagement'
import collapseSeeMix from '@/mixins/collapseSeeMix'

export default {
  components: {
    CreateBidding: () => import('../createBidding.vue')
  },
  mixins: [collapseSeeMix],
  data() {
    return {
      activeNames: [],
      advanceViewList: [],
      loading: true
    }
  },
  created() {
    this.featchDat()
  },
  methods: {
    featchDat() {
      this.loading = true
      const { id } = this.$route.query
      getMyBiddingView({ businessKey: id, businessType: 'BiddingBasicInfo' }).then(({ data }) => {
        this.loading = false
        this.advanceViewList = data
      })
    }
  }
}
</script>

<style scoped>
.bidding-management-view .tempalte-content {
  min-height: calc(100vh - 0.85rem - 120px);
}
</style>
