import request from "@/utils/request";

export function getWarehouse(query) {
  return request({
    url: "/system/storage/getStorageList",
    method: "get",
    params: query,
  });
}

export function saveAll(params) {
  return request({
    url: "/system/pan/order/saveAll",
    method: "post",
    data: params,
  });
}
export function importCurrStock(params) {
  return request({
    url: "/system/pan/order/importCurrStock",
    method: "get",
    params,
  });
}
// 查询盘点单列表
export function listPanOrder(query) {
  return request({
    url: "/system/pan/order/list",
    method: "get",
    params: query,
  });
}

// 查询盘点单详细
export function getPanOrder(id) {
  return request({
    url: "/system/pan/order/" + id,
    method: "get",
  });
}

// 新增盘点单
export function addPanOrder(data) {
  return request({
    url: "/system/pan/order",
    method: "post",
    data: data,
  });
}

// 修改盘点单
export function updatePanOrder(data) {
  return request({
    url: "/system/pan/order",
    method: "put",
    data: data,
  });
}

// 删除盘点单
export function delPanOrder(id) {
  return request({
    url: "/system/pan/order/" + id,
    method: "delete",
  });
}
// 启用
export function enabledOrder(id) {
  return request({
    url: "/system/pan/order/enable/" + id,
    method: "delete",
  });
}

// 禁用
export function disabledOrder(id) {
  return request({
    url: "/system/pan/order/disable/" + id,
    method: "delete",
  });
}

// 状态修改
export function changeStatusOrder(id, status) {
  const data = {
    id,
    status,
  };
  return request({
    url: "/system/pan/order/changeStatus",
    method: "put",
    data: data,
  });
}
