<template>
  <div class="customer-info-examine">
    <cy-up-down-drag>
      <div slot="top">
        <customer-view></customer-view>
      </div>
      <div slot="bar">
        <div>
          审核
        </div>
      </div>
      <div slot="bottom">
        <div style="min-height: auto; padding: 0px 20px ">
          <examine-content ref="examineContent"></examine-content>
          <div class="submit-btn">
            <el-button type="primary" style="width: 150px;" @click="onSubmit">确定</el-button>
            <el-button style="width: 150px;" @click="() => { $router.go(-1) }">取消</el-button>
          </div>
        </div>
      </div>
    </cy-up-down-drag>
  </div>
</template>

<script>
import { customerInfoExamineSubmit } from '@/api/capitalManage/customerInfo/index'

export default {
  components: {
    ExamineContent: () => import('./components/ExamineContent.vue'),
    CustomerView: () => import('./components/CustomerView.vue')
  },
  data() {
    return {

    }
  },
  methods: {
    onSubmit() {
      this.$refs.examineContent.getSubmit().then(data => {
        const { taskId, businessKey } = this.$route.query
        const params = {
          Loading: true,
          ...data,
          taskId,
          financialCustomerInfoId: businessKey
        }
        customerInfoExamineSubmit(params).then(() => {
          this.$message.success('客户管理审核成功')
          this.$router.push({ path: '/capitalManage/customerInfo' })
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
