import request from '@/utils/request'

// 查询维修站点-单位列表
export function listUnit(query) {
  return request({
    url: '/business/unit/list',
    method: 'get',
    params: query
  })
}

// 查询维修站点-单位详细
export function getUnit(id) {
  return request({
    url: '/business/unit/' + id,
    method: 'get'
  })
}

// 新增维修站点-单位
export function addUnit(data) {
  return request({
    url: '/business/unit',
    method: 'post',
    data: data
  })
}

// 修改维修站点-单位
export function updateUnit(data) {
  return request({
    url: '/business/unit',
    method: 'put',
    data: data
  })
}

// 删除维修站点-单位
export function delUnit(id) {
  return request({
    url: '/business/unit/' + id,
    method: 'delete'
  })
}

// 查询维修站点-单位树结构
export function getUnitTree(id) {
  return request({
    url: '/business/unit/tree',
    method: 'get'
  })
}

// 查询维修站点-单位-站点树结构
export function getCurrentDeptTree(query) {
  return request({
    url: '/system/dept/current/list',
    method: 'get',
    params: query
  })
}
