import request from '@/utils/request'

// 创建采收入库
export function createHarvestInfo(data) {
  return request({
    url: '/product/harvest-info/create',
    method: 'post',
    data: data
  })
}

// 更新采收入库
export function updateHarvestInfo(data) {
  return request({
    url: '/product/harvest-info/update',
    method: 'put',
    data: data
  })
}

// 删除采收入库
export function deleteHarvestInfo(id) {
  return request({
    url: '/product/harvest-info/delete?id=' + id,
    method: 'delete'
  })
}

// 获得采收入库
export function getHarvestInfo(id) {
  return request({
    url: '/product/harvest-info/get?id=' + id,
    method: 'get'
  })
}

// 获得采收入库分页
export function getHarvestInfoPage(query) {
  return request({
    url: '/product/harvest-info/page',
    method: 'get',
    params: query
  })
}

// 导出采收入库 Excel
export function exportHarvestInfoExcel(query) {
  return request({
    url: '/product/harvest-info/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得采收入库编号列表
export function getHarverstIdList(query) {
  return request({
    url: '/product/harvest-info/getHarverstIdList',
    method: 'get',
    params: query,
  })
}

// 激活
export function getHarverstActive(id) {
  return request({
    url: '/product/harvest-info/active?id='+id,
    method: 'put',
  })
}

// 冻结
export function getHarverstFreeze(id) {
  return request({
    url: '/product/harvest-info/freeze?id='+id,
    method: 'put',
  })
}

// 上链
export function getHarverstUpChain(id) {
  return request({
    url: '/product/harvest-info/upChain?id='+id,
    method: 'put',
  })
}
