import request from '@/utils/request'

// 查询固资折旧列表
export function listDepreciation(query) {
  return request({
    url: '/asset/depreciation/list',
    method: 'get',
    params: query
  })
}

// 查询固资列表
export function listPermanent(query) {
  return request({
    url: '/asset/permanent/listPermanentByDepreciationType',
    method: 'get',
    params: query
  })
}

// 查询固资折旧详细
export function getDepreciation(id) {
  return request({
    url: '/asset/depreciation/get/' + id,
    method: 'get'
  })
}

// 新增固资折旧
export function addDepreciation(data) {
  return request({
    url: '/asset/depreciation/add',
    method: 'post',
    data: data
  })
}

export function autoAddDepreciation(data) {
  return request({
    url: '/asset/depreciation/autoAdd',
    method: 'post',
    params: data,
  })
}

// 修改固资折旧
export function updateDepreciation(data) {
  return request({
    url: '/asset/depreciation/edit',
    method: 'post',
    data: data
  })
}

// 删除固资折旧
export function delDepreciation(id) {
  return request({
    url: '/asset/depreciation/remove/' + id,
    method: 'get'
  })
}

// 导出固资折旧
export function exportDepreciation(query) {
  return request({
    url: '/asset/depreciation/export',
    method: 'get',
    params: query
  })
}
