<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>
          <member-info-details
            v-if="item.formBusinessName === '用户录入' || item.formBusinessName === '修改' || item.formBusinessName === '审核' || item.formBusinessName === '变更'"
            :process-see-status="true"
            :process-see-details-info="item.obj"
            :process-see-disabled="true"
            :approve-status="item.formBusinessName === '审核'"
          ></member-info-details>
        </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: {
    MemberInfoDetails: () => import('../details.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: 'BocomBasicInfo'
      }).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>
