import axios from "@/utils/request";

export function getDeptDeviceList(params) {
  return axios({
    url: "/udiwms/inv/deptDevice/filter",
    method: "get",
    params: params
  });
}

export function saveDeptDevice(data, formName) {
  return axios({
    url: formName === "add" ? "/udiwms/inv/deptDevice/add" : "/udiwms/inv/deptDevice/update",
    method: "post",
    data: data
  });
}

export function deleteDeptDevice(data) {
  return axios({
    url: "/udiwms/inv/deptDevice/delete",
    method: "post",
    data: data
  });
}

export function verifyTemplateFile(data) {
    return axios({
        url: "/udiwms/inv/deptDevice/verifyTemplateFile",
        method: "post",
        data: data
    });
}

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

export function selectProductByRelId(params) {
    return axios({
        url: "/device/receive/order/detail/selectProductByRelId",
        method: "get",
        params: params
    });
}



