<template>
  <div class="customer-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>
          <edit-content v-if="item.formBusinessName === '资料提交'" :details-info="item.obj" :disabled="true"></edit-content>
          <examine-content v-if="item.formBusinessName === '资料审核'" :details-info="item.obj" :disabled="true"></examine-content>
        </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 collapseSeeMix from '@/mixins/collapseSeeMix'

export default {
  components: {
    EditContent: () => import('./EditContent.vue'),
    ExamineContent: () => import('./ExamineContent.vue')
  },
  mixins: [collapseSeeMix],
  data() {
    return {
      activeNames: [],
      advanceViewList: [],
      loading: true
    }
  },
  created() {
    this.featchData()
  },
  methods: {
    featchData() {
      this.loading = true
      const { businessKey } = this.$route.query
      doBusinessHistoryView({ businessKey, businessType: 'FinancialCustomer' }).then(({ data }) => {
        this.loading = false
        this.advanceViewList = data
      })
    }
  }
}
</script>

<style scoped>

</style>
