<template>
  <div class="customer-view">
    <div class="view-steps-box" v-if="advanceViewList.length">
      <cy-steps :steps-data="advanceViewList"></cy-steps>
    </div>
    <div class="tempalte-content" v-loading="loading">
      <el-collapse v-model="activeNames" @change="handleChange" v-if="advanceViewList.length">
        <el-collapse-item :name="index" v-for="(item, index) in advanceViewList" :key="index">
          <template slot="title">
            <cy-view-bar
              :view-bar-data="{ ...item.businessProcessingLogVo, formBusinessName: item.formBusinessName, index: index + 1 }">
            </cy-view-bar>
          </template>
          <edit-content :deatails-info="item.obj" :disabled="true" v-if="item.formBusinessName === '资料提交'"></edit-content>
          <examine-content :deatails-info="item.obj" :disabled="true" v-if="item.formBusinessName === '资料审核'"></examine-content>
        </el-collapse-item>
      </el-collapse>
      <el-empty v-else style="height: calc(100vh - 0.85rem - 90px)"></el-empty>
    </div>
  </div>
</template>

<script>
module.exports ={
  components: {
    EditContent: httpVueLoader('./EditContent.vue'),
    ExamineContent: httpVueLoader('./ExamineContent.vue'),
  },
  data() {
    return {
      activeNames: [],
      advanceViewList: [],
      loading: true
    }
  },
  created() {
    this.featchData()
  },
  methods: {
    handleChange(val) {
      // console.log(val);
    },
    featchData() {
      this.loading = true
      const { businessKey, type } = this.$route.query
      this.$api.dictionary.getProcessNodeInfo({ businessKey, businessType: 'FinancialCustomer' }).then(({ data }) => {
        this.loading = false
        this.advanceViewList = data
        // if(type === 'see') {
        //   this.activeNames = [0]
        // }
      })
    }
  },
}
</script>

<style scoped>

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