import request from '@/utils/request'

// 查询订单信息列表
export function listProdOrderInfo(query) {
  return request({
    url: '/mes/prod/prodOrderInfo/list',
    method: 'get',
    params: query
  })
}

// 查询订单信息详细
export function getProdOrderInfo(objId) {
  return request({
    url: '/mes/prod/prodOrderInfo/' + objId,
    method: 'get'
  })
}

// 新增订单信息
export function addProdOrderInfo(data) {
  return request({
    url: '/mes/prod/prodOrderInfo',
    method: 'post',
    data: data
  })
}

// 修改订单信息
export function updateProdOrderInfo(data) {
  return request({
    url: '/mes/prod/prodOrderInfo',
    method: 'put',
    data: data
  })
}

// 删除订单信息
export function delProdOrderInfo(objId) {
  return request({
    url: '/mes/prod/prodOrderInfo/' + objId,
    method: 'delete'
  })
}

// 根据订单生成工单
export function generateWorkOrder(query) {
  return request({
    url: '/mes/prod/prodOrderInfo/generateWorkOrder',
    method: 'get',
    params: query
  })
}

// ERP获取生产计划管理
export function getERPProductionPlan(objId) {
  return request({
    url: '/mes/prod/prodOrderInfo/getERPProductionPlan/' + objId,
    method: 'get'
  })
}

//获取ERP生产订单
export function getERPWorkOrder(orderCode) {
  return request({
    url: '/mes/prod/prodOrderInfo/getERPWorkOrder/' + orderCode,
    method: 'get'
  })
}
