import request from '@/utils/request'

// 查询施工单元列表
export function listConsUnitInfo(query) {
  return request({
    url: '/cons/consUnitInfo/list',
    method: 'get',
    params: query
  })
}

export function listAllConsUnitExcludeChild(id) {
  return request({
    url: `/cons/consUnitInfo/list/exclude/${id}`,
    method: 'get'
  })
}

// 查询施工单元详细
export function getConsUnitInfo(id) {
  return request({
    url: '/cons/consUnitInfo/' + id,
    method: 'get'
  })
}

// 新增施工单元
export function addConsUnitInfo(data) {
  return request({
    url: '/cons/consUnitInfo',
    method: 'post',
    data: data
  })
}

// 修改施工单元
export function updateConsUnitInfo(data) {
  return request({
    url: '/cons/consUnitInfo',
    method: 'put',
    data: data
  })
}

// 删除施工单元
export function delConsUnitInfo(id) {
  return request({
    url: '/cons/consUnitInfo/' + id,
    method: 'delete'
  })
}


export function importCad(data) {
  return request({
    url: '/cons/consUnitInfo/import/cad',
    method: 'post',
    data: data
  })
}

export function assignMachine(data) {
  return request({
    url: '/cons/consUnitInfo/assign/machine',
    method: 'post',
    data: data
  })
}
