import request from '@/utils/request'

// 查询月销售目标明细列表
export function listMonthSaleGoalDetails(query) {
  return request({
    url: '/goal_management/monthSaleGoalDetails/list',
    method: 'get',
    params: query
  })
}

// 查询月销售目标明细详细
export function getMonthSaleGoalDetails(id) {
  return request({
    url: '/goal_management/monthSaleGoalDetails/parent/' + id,
    method: 'get'
  })
}

// 新增月销售目标明细
export function addMonthSaleGoalDetails(data) {
  return request({
    url: '/goal_management/monthSaleGoalDetails',
    method: 'post',
    data: data
  })
}

// 修改月销售目标明细
export function updateMonthSaleGoalDetails(data) {
  return request({
    url: '/goal_management/monthSaleGoalDetails',
    method: 'put',
    data: data
  })
}

// 删除月销售目标明细
export function delMonthSaleGoalDetails(ids) {
  return request({
    url: '/goal_management/monthSaleGoalDetails/delete',
    method: 'post',
    data: ids
  })
}

//导入明细
export function importData(data) {
  return request({
    url: `/goal_management/monthSaleGoalDetails/importData`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

//查询物料
export function getMaterialRangeList(data) {
  return request({
    url: `/goal_management/monthSaleGoalDetails/getMaterialRangeList`,
    method: 'post',
    data: data
  })
}

export function getDeptIds(data) {
  return request({
    url: `/goal_management/monthSaleGoalDetails/getDeptIds`,
    method: 'post',
    data: data
  })
}