<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>
          <supplier-enterprise v-if="item.formBusinessName === '供应商C端录入' && !item.obj.constructionIndustry" :deatails-info="item.obj" :disabled="true"></supplier-enterprise>
          <supplementary-info v-if="item.formBusinessName === '供应商C端录入' && item.obj.constructionIndustry" :deatails-info="item.obj" :disabled="true"></supplementary-info>
          <due-distribution-content v-if="item.formBusinessName === '尽调分配'" :details-info="item.obj" :disabled="true"></due-distribution-content>
          <auditing-main v-if="item.formBusinessName === '尽调审核(第一步)'" :deatails-info="item.obj"></auditing-main>
          <auditing-two-main v-if="item.formBusinessName === '尽调审核(第二步)'" :deatails-info="item.obj"></auditing-two-main>
          <due-diligence v-if="item.formBusinessName === '尽调预约'" :due-info="item.obj"></due-diligence>
          <time-confirm-content v-if="item.formBusinessName === '尽调时间确认'" :details-info="item.obj" :disabled="disabled"></time-confirm-content>
          <video-due-main v-if="item.formBusinessName === '视频尽调'" :details-info="item.obj" :disabled="disabled"></video-due-main>
        </el-collapse-item>
      </el-collapse>
      <!-- <el-empty v-else style="height: calc(100vh - 0.85rem - 90px)"></el-empty> -->
    </div>
  </div>
</template>

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

export default {
  components: {
    SupplierEnterprise: () => import('../supplierEnterprise/index.vue'),
    SupplementaryInfo: () => import('../supplementaryInfo/index.vue'),
    DueDistributionContent: () => import('./DueDistributionContent.vue'),
    AuditingMain: () => import('../auditing/auditingMain.vue'),
    AuditingTwoMain: () => import('../auditingTwo/auditingTwoMain.vue'),
    DueDiligence: () => import('./DueDiligence.vue'),
    TimeConfirmContent: () => import('./TimeConfirmContent.vue'),
    VideoDueMain: () => import('../videoDue/videoDueMain.vue')
    // SignReviewContent: () => import('./SignReviewContent.vue')
  },
  mixins: [collapseMix],
  provide() {
    return {
      disabled: true
    }
  },
  data() {
    return {
      activeNames: [],
      advanceViewList: [],
      loading: true,
      disabled: true
    }
  },
  created() {
    this.featchData()
  },
  methods: {
    featchData() {
      this.loading = true
      const { id: asId, type } = this.$route.query
      const { id } = this.$route.params
      doBusinessHistoryView({ businessKey: id || asId, businessType: 'SupplierInfo' }).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>
