<template>
  <div class="supplier-manage-view">
    <div v-if="advanceViewList.length" class="view-steps-box">
      <cy-steps :steps-data="advanceViewList"></cy-steps>
    </div>
    <div v-loading="loading">
      <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 }"
            >
            </cy-view-bar>
          </template>
          <supplementary-info-content v-if="item.formBusinessName === '资料补充'" :details-info="item.obj" disabled></supplementary-info-content>
          <data-review-content v-if="item.formBusinessName === '资料审批'" :details-info="item.obj" disabled></data-review-content>
        </el-collapse-item>
      </el-collapse>
      <!-- <el-empty style="height: calc(100vh - 0.85rem - 90px)"></el-empty> -->
    </div>
  </div>
</template>

<script>
import { doBusinessHistoryView } from '@/api/dictionary'
import collapseSeeMix from '@/mixins/collapseSeeMix'

export default {
  components: {
    SupplementaryInfoContent: () => import('./SupplementaryInfoContent.vue'),
    DataReviewContent: () => import('./DataReviewContent.vue')
  },
  mixins: [collapseSeeMix],
  provide() {
    return {
      disabled: true
    }
  },
  data() {
    return {
      activeNames: [],
      advanceViewList: [],
      loading: true,
      disabled: true
    }
  },
  created() {
    this.featchData()
  },
  methods: {
    featchData() {
      const { id } = this.$route.params
      doBusinessHistoryView({ businessKey: id, businessType: 'ExemptionMatters' }).then(({ data }) => {
        this.loading = false
        this.advanceViewList = data
      })
    }
  }
}
</script>

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