import request from '@/utils/request'

// 查询生产BOM列表
export function listProdBomInfo(query) {
  return request({
    url: '/mes/prod/prodBomInfo/list',
    method: 'get',
    params: query
  })
}

// 查询生产BOM详细
export function getProdBomInfo(objId) {
  return request({
    url: '/mes/prod/prodBomInfo/' + objId,
    method: 'get'
  })
}

// 新增生产BOM
export function addProdBomInfo(data) {
  return request({
    url: '/mes/prod/prodBomInfo',
    method: 'post',
    data: data
  })
}

// 修改生产BOM
export function updateProdBomInfo(data) {
  return request({
    url: '/mes/prod/prodBomInfo',
    method: 'put',
    data: data
  })
}

// 删除生产BOM
export function delProdBomInfo(objId) {
  return request({
    url: '/mes/prod/prodBomInfo/' + objId,
    method: 'delete'
  })
}

// 查询订单BOM下拉框列表
export function findOrderBomList(query) {
  return request({
    url: '/mes/prod/prodBomInfo/findOrderBomList',
    method: 'get',
    params: query
  })
}

// 查询生产BOM树列表
export function productionBomTreeList(query) {
  return request({
    url: '/mes/prod/prodBomInfo/productionBomTreeList',
    method: 'get',
    params: query
  })
}

// 通过生产BOM生成工单
export function generateTickets(query) {
  return request({
    url: '/mes/prod/prodBomInfo/generateTickets',
    method: 'get',
    params: query
  })
}
