<template>
  <div class="customer-disburse-approval">
    <cy-up-down-drag>
      <div slot="top">
        <customer-disburse-view></customer-disburse-view>
      </div>
      <div slot="bar">
        <div>
          审核
        </div>
      </div>
      <div slot="bottom">
        <div style="min-height: auto;">
          <approval-content ref="approvalContent"></approval-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 { customerDisburseInfoExamineSubmit } from '@/api/capitalManage/customerDisburseInfo/index.js'

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

    }
  },
  methods: {
    onSubmit() {
      this.$refs.approvalContent.getSubmit().then(data => {
        const { taskId, businessKey } = this.$route.query
        const params = {
          Loading: true,
          ...data,
          taskId,
          financialCustomerExpenditureInfoId: businessKey
        }
        customerDisburseInfoExamineSubmit(params).then(() => {
          this.$message.success('客户支用审核成功')
          this.$router.push({ path: '/capitalManage/customerDisburseInfo' })
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
