import request from '@/utils/request'

// 查询流产记录列表
export function listMiscarriage(query) {
  return request({
    url: '/miscarriage/miscarriage/list',
    method: 'get',
    params: query
  })
}

// 查询流产记录详细
export function getMiscarriage(id) {
  return request({
    url: '/miscarriage/miscarriage/' + id,
    method: 'get'
  })
}

// 根据耳号查询羊只信息
export function getSheepInfo(manageTags) {
  return request({
    url: '/miscarriage/miscarriage/sheep/' + manageTags,
    method: 'get'
  })
}

// 获取流产原因选项
export function getReasonOptions() {
  return request({
    url: '/miscarriage/miscarriage/reasonOptions',
    method: 'get'
  })
}

// 新增流产记录
export function addMiscarriage(data) {
  return request({
    url: '/miscarriage/miscarriage',
    method: 'post',
    data: data
  })
}

// 修改流产记录
export function updateMiscarriage(data) {
  return request({
    url: '/miscarriage/miscarriage',
    method: 'put',
    data: data
  })
}

// 删除流产记录
export function delMiscarriage(id) {
  return request({
    url: '/miscarriage/miscarriage/' + id,
    method: 'delete'
  })
}