import request from '@/utils/request'

// 创建申请单
export function createExpenseApply(data) {
  return request({
    url: '/bs/expense-apply/create',
    method: 'post',
    data: data
  })
}

// 更新申请单
export function updateExpenseApply(data) {
  return request({
    url: '/bs/expense-apply/update',
    method: 'put',
    data: data
  })
}

// 删除申请单
export function deleteExpenseApply(id) {
  return request({
    url: '/bs/expense-apply/delete?id=' + id,
    method: 'delete'
  })
}

// 获得申请单
export function getExpenseApply(id) {
  return request({
    url: '/bs/expense-apply/get?id=' + id,
    method: 'get'
  })
}

// 获得申请单分页
export function getExpenseApplyPage(query) {
  return request({
    url: '/bs/expense-apply/page',
    method: 'get',
    params: query
  })
}

// 导出申请单 Excel
export function exportExpenseApplyExcel(query) {
  return request({
    url: '/bs/expense-apply/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
