import request from '@/utils/request'

// 获取列表
export function getList(params) {
  return request({
    url: '/cashFlow/select',
    method: 'get',
    params
  })
}

// 删除列表
export function delteRowData(id) {
  return request({
    url: 'cashFlow/doDelete?id=' + id,
    method: 'get'
  })
}

// 获取企业名称
export function getEnterprises(params) {
  return request({
    url: '/cashFlow/enterprises',
    method: 'get',
    params
  })
}

// 获取账户归属
export const getAttributionOfAccount = (params) => (
  request({
    url: '/dictionary/do_findByParentCode',
    method: 'get',
    params
  })
)

// 获取公司归属
export const getCompanyOwnership = (params) => (
  request({
    url: '/dictionary/do_findByParentCode',
    method: 'get',
    params
  })
)

// 获取资方公司归属
export const getInstitutionName = (params) => (
  request({
    url: '/cashFlow/billingRecord/doFindByCreditStatus',
    method: 'get',
    params
  })
)

// 获取业务类型
export const getBusinessType = (params) => (
  request({
    url: '/cashFlow/billingRecord/doFindBusinessTypeByManagementId',
    method: 'get',
    params
  })
)

// 非资方获取银行信息名称
export const getNocapitalBankName = (params) => (
  request({
    url: '/cashFlow/billingRecord/do_findBankName',
    method: 'get',
    params
  })
)

// 资方获取银行信息名称
export const getCpitalBankName = (params) => (
  request({
    url: '/cashFlow/billingRecord/do_findCapitalBankCard',
    method: 'get',
    params
  })
)

// 获取账号
export const getBankCardNo = (params) => (
  request({
    url: '/cashFlow//billingRecord/do_findBankCardNo',
    method: 'get',
    params
  })
)

// 入账提交
export function onSubmit(data) {
  return request({
    url: '/cashFlow/doAdd',
    method: 'post',
    data
  })
}

// 修改获取详情 -- 获取入账详情
export function cashFlowGetEntryDetail(params) {
  return request({
    url: '/cashFlow/getEntryDetail/' + params,
    method: 'get'
  })
}

// 获取出账详情
export function cashFlowGetExitDetail(params) {
  return request({
    url: '/cashFlow/getOutDetail/' + params,
    method: 'get'
  })
}
