<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>
          <refund-apply-content v-if="item.formBusinessName === '退款申请'" ref="applyContent" :disabled="true" :details-info="item.obj"></refund-apply-content>
          <refund-approve-content v-if="item.formBusinessName === '退款审核'" ref="approveContent" :disabled="true" :details-info="item.obj"></refund-approve-content>
          <!-- <supplier-enterprise v-if="item.formBusinessName === '供应商C端录入' && !item.obj.constructionIndustry" :deatails-info="item.obj" :disabled="true"></supplier-enterprise> -->
        </el-collapse-item>
      </el-collapse>
      <el-empty v-else></el-empty>
    </div>
  </div>
</template>

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

export default {
  components: {
    refundApplyContent: () => import('./refundApplyContent'),
    refundApproveContent: () => import('./reFundApproveContent')
  },
  mixins: [collapseMix],
  provide() {
    return {
      disabled: true
    }
  },
  data() {
    return {
      activeNames: [],
      advanceViewList: [],
      loading: true,
      disabled: true
    }
  },
  created() {
    this.featchData()
  },
  methods: {
    featchData() {
      this.loading = true
      const { id } = this.$route.params
      doBusinessHistoryView({ businessKey: id, businessType: 'RefundManagement' }).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>
