import request from '@/utils/request'

// 分页查询费用核销记录列表
export function pageListWriteoff(query) {
  return request({
    url: '/finance/writeoff/pageList',
    method: 'get',
    params: query
  })
}

// 查询费用核销记录列表
export function listWriteoff(query) {
  return request({
    url: '/finance/writeoff/list',
    method: 'get',
    params: query
  })
}

// 查询费用核销记录详细
export function getWriteoff(ID) {
  return request({
    url: '/finance/writeoff/' + ID,
    method: 'get'
  })
}

// 新增费用核销记录
export function addWriteoff(data) {
  return request({
    url: '/finance/writeoff',
    method: 'post',
    data: data
  })
}

// 修改费用核销记录
export function updateWriteoff(data) {
  return request({
    url: '/finance/writeoff',
    method: 'put',
    data: data
  })
}

// 删除费用核销记录
export function delWriteoff(ID) {
  return request({
    url: '/finance/writeoff/' + ID,
    method: 'delete'
  })
}

// 导出费用核销记录
export function exportWriteoff(query) {
  return request({
    url: '/finance/writeoff/' + 'export',
    method: 'post',
    params: query
  })
}

// 根据现金日记账核销
export function autoWriteoffByCash(data) {
  return request({
    url: '/finance/writeoff/autoWriteoffByCash',
    method: 'post',
    data: data
  })
}

// 根据费用核销
export function autoWriteoffByCost(data) {
  return request({
    url: '/finance/writeoff/autoWriteoffByCost',
    method: 'post',
    data: data
  })
}

// 根据现金日记账反核销
export function cancelWriteoffByCash(data) {
  return request({
    url: '/finance/writeoff/cancelWriteoffByCash',
    method: 'post',
    data: data
  })
}

// 根据费用核销
export function cancelWriteoffByCost(data) {
  return request({
    url: '/finance/writeoff/cancelWriteoffByCost',
    method: 'post',
    data: data
  })
}