import axios from "@/utils/request";

export function getDeviceMAOrderList(params) {
    return axios({
        url: "/device/MA/order/filterList",
        method: "get",
        params: params
    });
}

export function addDeviceMAOrder(data) {
    return axios({
        url: "/device/MA/order/addMAOrder",
        method: "post",
        data: data
    });
}

export function updateDeviceMAOrder(data) {
    return axios({
        url: "/device/MA/order/updateMAOrder",
        method: "post",
        data: data
    });
}

export function deleteDeviceMAOrder(data) {
    return axios({
        url: "/device/MA/order/deleteMAOrder",
        method: "post",
        data: data
    });
}

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

export function addDeviceMAOrderDetail(data) {
    return axios({
        url: "/device/MA/order/detail/addOrderDetail",
        method: "post",
        data: data
    });
}

export function updateDeviceMAOrderDetail(data) {
    return axios({
        url: "/device/MA/order/detail/updateOrderDetail",
        method: "post",
        data: data
    });
}

export function deleteDeviceMAOrderDetail(data) {
    return axios({
        url: "/device/MA/order/detail/deleteOrderDetail",
        method: "post",
        data: data
    });
}

export function verifyTemplateFile(data) {
    return axios({
        url: "/device/MA/order/verifyTemplateFile",
        method: "post",
        data: data
    });
}

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

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