import request from '@/utils/request'

// 查询转场列表
export function listTransition_info(query) {
  return request({
    url: 'produce/manage_sheep/transition_info/list',
    method: 'get',
    params: query
  })
}

// 查询牧场列表（用于下拉框）
export function listRanch() {
  return request({
    url: '/ranch/ranch/list', 
    method: 'get',
    params: { pageNum: 1, pageSize: 9999 } 
  });
}

// 查询指定牧场下的所有羊只耳号
export function getSheepByRanchId(ranchId) {
  return request({
    url: `/ranch/ranch/getSheepByRanchId/${ranchId}`,
    method: 'get'
  });
}

// 查询转场详细
export function getTransition_info(id) {
  return request({
    url: 'produce/manage_sheep/transition_info/' + id,
    method: 'get'
  })
}


// 新增转场
export function addTransition_info(data) {
  return request({
    url: '/produce/manage_sheep/transition_info/batch', 
    method: 'post',
    data: data 
  })
}
// 修改转场
export function updateTransition_info(data) {
  return request({
    url: 'produce/manage_sheep/transition_info',
    method: 'put',
    data: data
  })
}

// 删除转场
export function delTransition_info(id) {
  return request({
    url: 'produce/manage_sheep/transition_info/' + id,
    method: 'delete'
  })
}

/**
 * 审批转场记录
 */
export function approveTransitionInfo(data) {
  return request({
    url: '/produce/manage_sheep/transition_info/approve',
    method: 'put',
    data
  })
}
