import request from '@/utils/request'
const baseUrl = import.meta.env.VITE_APP_BASE_API
const productionUrl = import.meta.env.VITE_APP_PRODUCTION_API

// 查询工段资源组明细列表
export function listGroupDetail(query) {
  return request({
   url: baseUrl + '/business/detail/list',
    method: 'get',
    params: query
  })
}
// 查询工段资源组明细列表
export function groupDetailEquipmentList(query) {
  return request({
   url: baseUrl + '/business/detail/equipmentList',
    method: 'get',
    params: query
  })
}
export function getUserInfoByDeptIdAndProductionPlanDetailId(query) {
  return request({
    url: productionUrl + '/business/detail/getUserInfoByDeptIdAndProductionPlanDetailId',
    method: 'get',
    params: query
  })
}
// 查询工段资源组明细详细
export function getDetail(id) {
  return request({
   url: baseUrl + '/business/detail/' + id,
    method: 'get'
  })
}

// 新增工段资源组明细
export function addDetail(data) {
  return request({
   url: baseUrl + '/business/detail',
    method: 'post',
    data: data
  })
}

// 修改工段资源组明细
export function updateDetail(data) {
  return request({
   url: baseUrl + '/business/detail',
    method: 'put',
    data: data
  })
}

// 删除工段资源组明细
export function delGroupDetail(id) {
  return request({
   url: baseUrl + '/business/detail/' + id,
    method: 'delete'
  })
}
// 删除工段资源组明细(当从部门管理删除人员时)
export function deleteGroupDetail(data) {
  return request({
   url: baseUrl + '/business/detail/deleteGroupDetail' ,
    method: 'post',
    data: data
  })
}
