import request, { postBlob, handleImport } from "@/utils/request";

export function partsOldOutList(data) {
  return request({
    url: `/parts/old-out/list?moduleId=${data.moduleId}`,
    method: "post",
    data
  });
}

export function partsOldOutDel(params) {
  return request({
    url: `/parts/old-out/del`,
    method: "post",
    params
  });
}

export function partsOldOutExport(data, name) {
  return postBlob({
    url: "/parts/old-out/list/export",
    data,
    name
  });
}

export function partsOldOutAdd(data) {
  return request({
    url: `/parts/old-out/add`,
    method: "post",
    data
  });
}

export function partsOldOutConfirm(data) {
  return request({
    url: `/parts/old-out/confirm`,
    method: "post",
    data
  });
}

export function partsOldOutImport(data) {
  return handleImport("parts/old-out/import", data.formdata, data.id || "");
}
