import request from '@/utils/request'
// 【 ezhizao-dms-production 】这个名字对应的就是 nacos 中的服务的 id，必须用“-”分割
// 开发时，在 vite.config.js 中配置 /ezhizao-dms-production，参考 /dev-api 的配置
// 生产时，在nginx中配置 /ezhizao-dms-production，指定对应的 nacos 中的服务 id：/ezhizao-dms-production
const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API

// 查询生产计划明细列表
export function listProductionPlanDetail(query) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/list',
    method: 'get',
    params: query
  })
}

// 查询生产计划明细报表列表
export function reportListPlanDetail(query) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/reportList',
    method: 'get',
    params: query
  })
}
export function addLot(data) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/addLot',
    method: 'post',
    data: data
  })
}

// 查询生产计划明细列表
export function listProductionPlanDetailList(query) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/getList',
    method: 'get',
    params: query
  })
}

export function getTechnologicalVersion(query) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/getTechnologicalVersion',
    method: 'get',
    params: query
  })
}

export function getTechnologicalProcessDetailList(query) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/getTechnologicalProcessDetailList',
    method: 'get',
    params: query
  })
}

// 查询生产计划明细详细
export function getProductionPlanDetail(id) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/' + id,
    method: 'get'
  })
}

// 新增生产计划明细
export function addProductionPlanDetail(data) {
  return request({
    url: baseUrl + '/business/productionPlanDetail',
    method: 'post',
    data: data
  })
}

// 修改生产计划明细
export function updateProductionPlanDetail(data) {
  return request({
    url: baseUrl + '/business/productionPlanDetail',
    method: 'put',
    data: data
  })
}

//修改生产计划批号状态
export function updateLotCodeStatus(data) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/updateLotCodeStatus',
    method: 'put',
    data: data
  })
}

// 删除生产计划明细
export function delProductionPlanDetail(id) {
  return request({
    url: baseUrl + '/business/productionPlanDetail/' + id,
    method: 'delete'
  })
}
