import request from '@/utils/request'

export function listItems(query) {
  return request({
    url: '/items/list',
    method: 'post',
    data: query
  })
}

export function createItems(data) {
  return request({
    url: '/items/create',
    method: 'post',
    data: data
  })
}

export function detail(data) {
  return request({
    url: '/items/detail?id=' + data,
    method: 'get'
  })
}

export function updateItems(data) {
  return request({
    url: '/items/update',
    method: 'post',
    data: data
  })
}

export function deleteItems(data) {
  return request({
    url: '/items/delete?ids=' + data,
    method: 'post'
  })
}

export function parentTree(data) {
  return request({
    url: '/items/parentTree',
    method: 'post'
  })
}
export function createItemQrCode(id) {
  return request({
    url: '/items/createItemQrCode?id='+id,
    method: 'get'
  })
}
