<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;">
          <contract-content ref="contractContent"></contract-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 { customerDisburseInfoContract } from '@/api/capitalManage/customerDisburseInfo/index.js'

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

    }
  },
  methods: {
    onSubmit() {
      this.$refs.contractContent.getSubmit().then(data => {
        const { businessKey } = this.$route.query
        const params = {
          id: businessKey,
          ...data
        }
        customerDisburseInfoContract(params).then(() => {
          this.$message.success('客户支用上传合同成功')
          this.$router.push({ path: '/capitalManage/customerDisburseInfo' })
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
