import axios from "@/utils/request";
import request from "@/utils/request";


export function createQueueCode(query) {
  return axios({
    url: "/udiwms/sysWorkplace/createQueueCode",
    method: "post",
    data: query
  });
}


export function addQueue(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/addQueue",
    method: "post",
    data: query
  });
}

export function updateQueue(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/update",
    method: "post",
    data: query
  });
}

export function deleteQueue(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/delete",
    method: "post",
    data: query
  });
}


export function getByCode(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/getByCode",
    method: "get",
    params: query
  });
}

export function printQueueLabel(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/label/print",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}

export function addLayer(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/add/layer",
    method: "post",
    data: query
  });
}

export function getInfoByCode(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/getInfoByCode",
    method: "post",
    data: query
  });
}

export function getProductByCode(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/getProductByCode",
    method: "post",
    data: query
  });
}

export function bind(query) {
  return axios({
    url: "/udiwms/WorkplaceQueue/bind",
    method: "post",
    data: query
  });
}

export function getQueueListPage(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/getQueueBindList",
    method: "get",
    params: query
  });
}


export function removeProduct(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/removeProduct",
    method: "post",
    data: query
  });
}


export function binding(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/bindingLed",
    method: "post",
    data: query
  });
}

export function removeLed(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/removeLed",
    method: "post",
    data: query
  });
}



export function getLedDataByCode(query) {
  return axios({
    url: "/udiwms/sysWorkplaceQueue/getLedDataByCode",
    method: "post",
    data: query
  });
}
