import service from '@/utils/request'
// 查询费用列表
export const queryCostList = (data) => {
  return service({
    url: '/expenses/queryExpensesList',
    method: 'post',
    data: data
  })
}

export const querySurplus = () => {
  return service({
    url: '/expenses/querySurplus',
    method: 'get',
  })
}

// 新增费用
export const createCost = (data) => {
  return service({
    url: '/expenses/createExpenses',
    method: 'post',
    data: data
  })
}
// 修改费用
export const updateCost = (data) => {
  return service({
    url: '/expenses/updateExpenses',
    method: 'put',
    data: data
  })
}
// 删除费用
export const deleteCost = (data) => {
  return service({
    url: '/expenses/deleteExpenses',
    method: 'delete',
    data: data
  })
}

// 查询费用按人
export const peopleCost = (data) => {
  return service({
    url: '/expenses/queryExpensesSumByPeople',
    method: 'post',
    data: data
  })
}

// 查询项目月费用
export const queryProjectMonthFee = (month, year, code) => {
  return service({
    url: '/expenses/queryProjectMonthFee?monthTime=' + month + '&yearTime=' + year + '&code=' + code,
    method: 'get',
  })
}

// 查询公司月费用
export const queryMonthExpenses = (month, year, genre) => {
  return service({
    url: '/expenses/queryMonthExpenses?monthTime=' + month + '&yearTime=' + year + '&genre=' + genre,
    method: 'get',
  })
}

// 查询项目费用列表
export const queryProjectCost = (data) => {
  return service({
    url: '/expenses/queryProjectFeeList',
    method: 'post',
    data: data
  })
}

// 新增项目费用
export const createProjectCost = (data) => {
  return service({
    url: '/expenses/createProjectFee',
    method: 'post',
    data: data
  })
}

// 修改项目费用
export const updateProjectCost = (data) => {
  return service({
    url: '/expenses/updateProjectFee',
    method: 'put',
    data: data
  })
}

// 删除项目费用
export const deleteProjectCost = (data) => {
  return service({
    url: '/expenses/deleteProjectFee',
    method: 'delete',
    data: data
  })
}

// 查询项目费用类型
export const projectCostTypeList = () => {
  return service({
    url: '/finance/queryProjectFeeGenre',
    method: 'get'
  })
}

// 新增项目费用类型
export const postProjectCostType = (data) => {
  return service({
    url: '/finance/createProjectFeeGenre',
    method: 'post',
    data
  })
}

// 修改项目费用类型
export const putProjectCostType = (data) => {
  return service({
    url: '/finance/updateProjectFeeGenre',
    method: 'put',
    data
  })
}

// 删除项目费用类型
export const delProjectCostType = (data) => {
  return service({
    url: '/finance/deleteProjectFeeGenre',
    method: 'delete',
    data
  })
}

// 查询备用金信息
export const getStandbyMoney = () => {
  return service({
    url: '/finance/queryReserveBalance',
    method: 'GET'
  })
}

