import request from '@/utils/request'

// 创建报销单
export function createExpenseClaim(data) {
  return request({
    url: '/bs/expense-claim/create',
    method: 'post',
    data: data
  })
}

// 更新报销单
export function updateExpenseClaim(data) {
  return request({
    url: '/bs/expense-claim/update',
    method: 'put',
    data: data
  })
}

// 删除报销单
export function deleteExpenseClaim(id) {
  return request({
    url: '/bs/expense-claim/delete?id=' + id,
    method: 'delete'
  })
}

// 获得报销单
export function getExpenseClaim(id) {
  return request({
    url: '/bs/expense-claim/get?id=' + id,
    method: 'get'
  })
}

// 获得报销单分页
export function getExpenseClaimPage(query) {
  return request({
    url: '/bs/expense-claim/page',
    method: 'get',
    params: query
  })
}

// 导出报销单 Excel
export function exportExpenseClaimExcel(query) {
  return request({
    url: '/bs/expense-claim/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}


// 结算
export function settleClaim(data) {
  return request({
    url: '/bs/expense-claim/settle',
    method: 'post',
    data
  })
}
