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 listPlanDetailSubDetail(query) {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/list',
    method: 'get',
    params: query
  })
}

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

//查询生产子计划是否含有尾批
export function getLastLotStatus(id) {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/getLastLotStatus/' + id,
    method: 'get'
  })
}

// 登陆人员工段
export function getDept() {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/getDept',
    method: 'get'
  })
}
export function getDeptList() {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/getDeptList',
    method: 'get'
  })
}
export function getDeptListByUserIdInPackage() {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/getDeptListByUserIdInPackage',
    method: 'get'
  })
}
export function specialGetDeptList() {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/specialGetDeptList',
    method: 'get'
  })
}



export function getDeptListByUserId() {
  return request({
    url: baseUrl + '/business/planDetailSubDetail/getDeptListByUserId',
    method: 'get'
  })
}


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

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

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