import { axios } from '@/utils/request'

// 电子秤
// 获取列表数据
export const getDeviceList = params => {
  const url = `device/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}

// 删除
export const delectDevice = params => {
  return axios({
    url: `device/deleteSteelyardById/${params.id}`,
    data: {},
    method: 'get'
  })
}

// 新增/编辑保存接口
export const saveDevice = params => {
  return axios({
    url: 'device/saveSteelyard',
    data: params,
    method: 'POST'
  })
}

// 查详情
export const deviceDetails = params => {
  return axios({
    url: `device/findBySrcDeviceNo/${params.srcDeviceCode}`,
    method: 'get'
  })
}
