import request from '@/utils/request'

// 查询盘点主列表
export function listCheck(query) {
  return request({
    url: '/system/check/list',
    method: 'get',
    params: query
  })
}

// 查询盘点主详细
export function getCheck(id) {
  return request({
    url: '/system/check/' + id,
    method: 'get'
  })
}

// 新增盘点主
export function addCheck(data) {
  return request({
    url: '/system/check',
    method: 'post',
    data: data
  })
}

// 修改盘点主
export function updateCheck(data) {
  return request({
    url: '/system/check',
    method: 'put',
    data: data
  })
}

// 删除盘点主
export function delCheck(id) {
  return request({
    url: '/system/check/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/check/enable/' + id,
    method: 'delete'
  })
}

// 禁用
export function disabled(id) {
  return request({
    url: '/system/check/disable/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/check/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询盘点库存数据列表
export function listCheckStock(query) {
  return request({
    url: '/system/checkStock/list',
    method: 'get',
    params: query
  })
}

export function pushCheck(data) {
  return request({
    url: '/system/LargeScreen/sendMqtt',
    method: 'post',
    data: data
  })
}
