import request from '@/utils/request'

// 查询生产计划列表
export function listPlan(query) {
  return request({
    url: '/system/plan/allList',
    method: 'get',
    params: query
  })
}

// 查询生产计划详细
export function getPlan(id) {
  return request({
    url: '/system/plan/' + id,
    method: 'get'
  })
}

// 新增生产计划
export function addPlan(data) {
  return request({
    url: '/system/plan/addAll',
    method: 'post',
    data: data
  })
}

// 修改生产计划
export function updatePlan(data) {
  return request({
    url: '/system/plan/update',
    method: 'post',
    data: data
  })
}
///点击修改获取list
export function getUpdateList(query) {
  return request({
    url: '/system/plan/list',
    method: 'get',
    params: query
  })
}
// 删除生产计划
export function delPlan(data) {
  return request({
    url: '/system/plan/delete' ,
    method: 'post',
    data
  })
}
//修改开采量/点击开采量的确定按钮
export function addMin(data) {
  return request({
    url: '/system/plan/addMin',
    method: 'post',
    data: data
  })
}

//新增生产计划月份不可重复
export function testAdd(query) {
  console.log(query)
  return request({
    url: '/system/plan/testAdd',
    method: 'post',
    data: query
  })
}