import request from '@/utils/request'

// 获取列表
export function getList(data) {
  return request({
    url: '/businessProcessingTask/doMyPendingList',
    method: 'post',
    data
  })
}

// 获取列表
export function getAllList(params) {
  return request({
    url: '/businessProcessingTask/doList',
    method: 'get',
    params
  })
}

// 获取额度支用详情
export function getLimitExpenditureDatails(params) {
  return request({
    url: '/financing/apply',
    method: 'get',
    params
  })
}

// 获取根据资方信息获取对应业务类型、业务类型编号
export function getBusinessTypeByManagement(params) {
  return request({
    url: '/cashFlow/billingRecord/doFindBusinessTypeByManagementId',
    method: 'get',
    params
  })
}

// 获取根据业务类型、业务类型编号查询资方银行账号
export function getBankCard(params) {
  return request({
    url: '/cashFlow/billingRecord/do_findCapitalBankCard',
    method: 'get',
    params
  })
}

// 获取根根据资方信息获取对应支用到期日
export function getExpiration(params) {
  return request({
    url: '/cashFlow/billingRecord/do_findExpirationDateByManagementId',
    method: 'get',
    params
  })
}

// 根据融资信息生成收支计划
export function getExpenditurePlan(data) {
  return request({
    url: '/reviewQuotaDisburse/doGenerateIncomeExpenditurePlan',
    method: 'post',
    data
  })
}

// 根据融资信息生成收支计划
export function getTrr(data) {
  return request({
    url: '/reviewQuotaDisburse/doCalculateIrr',
    method: 'post',
    data
  })
}

// 获取相关还款责任人类型
export function getArlpType(params) {
  return request({
    url: '/reviewQuotaDisburse/doFindArlpType',
    method: 'get',
    params
  })
}

// 获取相关还款责任人类型
export function reviewQuotaDisburseSubmit(data) {
  return request({
    url: '/reviewQuotaDisburse/doEdit',
    method: 'post',
    data
  })
}

// 额度支用审批获取详情
export function reviewQuotaDisburseApprovalDetails(params) {
  return request({
    url: '/reviewQuotaDisburseApproval/editPage',
    method: 'get',
    params
  })
}

// 额度支用审批提交
export function reviewQuotaDisburseApprovalSubmit(data) {
  return request({
    url: '/reviewQuotaDisburseApproval/doEdit',
    method: 'post',
    data
  })
}

// 获取合同制作详情
export function contractMakingDetails(params) {
  return request({
    url: '/contractMaking/edit',
    method: 'get',
    params
  })
}

// 获取合同制作-签署合同文件
export function getSignContract(params) {
  return request({
    url: '/contractMaking/uploadContractList',
    method: 'get',
    params
  })
}

// 获取合同制作-线上签署文件
export function getSignFiles(params) {
  return request({
    url: '/contractMaking/electronicList',
    method: 'get',
    params
  })
}

// 获取合同制作-提交
export function contractMakingSubmit(data) {
  return request({
    url: '/contractMaking/doEdit',
    method: 'post',
    data
  })
}

// 获取合同审批详情
export function getContractApprovalDetails(params) {
  return request({
    url: '/contractLegalFinalApproval/edit',
    method: 'get',
    params
  })
}

// 获取合同审批文件下载
export function contractApprovalDownload(params) {
  return request({
    url: '/contractLegalFinalApproval/downloadAll',
    method: 'get',
    params,
    responseType: 'arraybuffer'
  })
}

// 获取合同审批提交
export function contractApprovalSubmit(data) {
  return request({
    url: '/contractLegalFinalApproval/doEdit',
    method: 'post',
    data
  })
}

// 获取合同审批提交
export function paymentApplyDetails(params) {
  return request({
    url: '/paymentApply/edit',
    method: 'get',
    params
  })
}

// 获取合同审批提交
export function paymentApplySubmit(data) {
  return request({
    url: '/paymentApply/doEdit',
    method: 'post',
    data
  })
}

// 豁免审批（业务）提交
export function businessReviewSubmit(data) {
  return request({
    url: '/paymentApply/exemptionBusiness/edit',
    method: 'post',
    data
  })
}

// 豁免审批（风控）提交
export function businessRiskControlSubmit(data) {
  return request({
    url: '/paymentApply/exemptionRisk/edit',
    method: 'post',
    data
  })
}

// 付款审核获取详情
export function getPaymentReviewDetails(params) {
  return request({
    url: '/paymentApply/editApproval',
    method: 'get',
    params
  })
}

// 付款审核获取详情
export function paymentReviewSubmit(data) {
  return request({
    url: '/paymentApply/doEditApproval',
    method: 'post',
    data
  })
}
