<template>
  <div class="video-due">
    <cy-up-down-drag>
      <div slot="top">
        <supplier-manage-view></supplier-manage-view>
      </div>
      <div slot="bar">
        <div>
          视频尽调
        </div>
      </div>
      <div slot="bottom">
        <video-due-main ref="videoDueMain" />
        <div class="submit-btn">
          <el-button @click="$router.go(-1)">关闭</el-button>
          <el-button type="primary" @click="submitClick('temp')">暂存</el-button>
          <el-button type="primary" @click="submitClick('submit')">提交</el-button>
        </div>
      </div>
    </cy-up-down-drag>
  </div>
</template>

<script>
import { videoSubmit } from '@/api/creditManage/supplierManage'
export default {
  components: {
    videoDueMain: () => import('./videoDueMain'),
    SupplierManageView: () => import('../components/SupplierManageView.vue')
  },
  data() {
    return {
      submitType: 'false'
    }
  },
  methods: {
    async submitClick(type) {
      const params = await this.$refs.videoDueMain.submit(type)
      videoSubmit({ ...params, visible: type === 'submit' }).then(() => {
        this.$message.success(`${type === 'temp' ? '暂存成功' : '提交成功'}`)
        this.$router.go(-1)
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.video-due {

}
</style>
