import request from "@/utils/request";

// 仓库基础设置
export function listWarehouse(query) {
  return request({
    url: "/stock/warehouse/list",
    method: "get",
    params: query
  });
}

export function getWarehouse(id) {
  return request({
    url: `/stock/warehouse/${id}`,
    method: "get"
  });
}

export function addWarehouse(data) {
  return request({
    url: "/stock/warehouse",
    method: "post",
    data
  });
}

export function updateWarehouse(data) {
  return request({
    url: "/stock/warehouse",
    method: "put",
    data
  });
}

export function delWarehouse(id) {
  return request({
    url: `/stock/warehouse/${id}`,
    method: "delete"
  });
}

export function listWarehouseOptions() {
  return request({
    url: "/stock/warehouse/options",
    method: "get"
  });
}

// 仓库库存
export function listInventory(query) {
  return request({
    url: "/stock/inventory/list",
    method: "get",
    params: query
  });
}

export function getInventory(id) {
  return request({
    url: `/stock/inventory/${id}`,
    method: "get"
  });
}

export function addInventory(data) {
  return request({
    url: "/stock/inventory",
    method: "post",
    data
  });
}

export function updateInventory(data) {
  return request({
    url: "/stock/inventory",
    method: "put",
    data
  });
}

export function delInventory(id) {
  return request({
    url: `/stock/inventory/${id}`,
    method: "delete"
  });
}

export function listMaterialOptions() {
  return request({
    url: "/stock/inventory/materials/options",
    method: "get"
  });
}

// 生产入库
export function listInbound(query) {
  return request({
    url: "/stock/inbound/list",
    method: "get",
    params: query
  });
}

export function getInbound(id) {
  return request({
    url: `/stock/inbound/${id}`,
    method: "get"
  });
}

export function addInbound(data) {
  return request({
    url: "/stock/inbound",
    method: "post",
    data
  });
}

export function delInbound(id) {
  return request({
    url: `/stock/inbound/${id}`,
    method: "delete"
  });
}

export function listInboundMaterialOptions() {
  return request({
    url: "/stock/inbound/materials/options",
    method: "get"
  });
}

// 仓库盘点
export function listStockCheck(query) {
  return request({
    url: "/stock/check/list",
    method: "get",
    params: query
  });
}

export function getStockCheck(id) {
  return request({
    url: `/stock/check/${id}`,
    method: "get"
  });
}

export function addStockCheck(data) {
  return request({
    url: "/stock/check",
    method: "post",
    data
  });
}

export function delStockCheck(id) {
  return request({
    url: `/stock/check/${id}`,
    method: "delete"
  });
}

export function listStockCheckInventoryOptions() {
  return request({
    url: "/stock/check/inventory/options",
    method: "get"
  });
}

// 仓库调整
export function listStockAdjust(query) {
  return request({
    url: "/stock/adjust/list",
    method: "get",
    params: query
  });
}

export function getStockAdjust(id) {
  return request({
    url: `/stock/adjust/${id}`,
    method: "get"
  });
}

export function addStockAdjust(data) {
  return request({
    url: "/stock/adjust",
    method: "post",
    data
  });
}

export function delStockAdjust(id) {
  return request({
    url: `/stock/adjust/${id}`,
    method: "delete"
  });
}

export function listStockAdjustInventoryOptions() {
  return request({
    url: "/stock/adjust/inventory/options",
    method: "get"
  });
}

// 仓库调拨
export function listStockTransfer(query) {
  return request({
    url: "/stock/transfer/list",
    method: "get",
    params: query
  });
}

export function getStockTransfer(id) {
  return request({
    url: `/stock/transfer/${id}`,
    method: "get"
  });
}

export function addStockTransfer(data) {
  return request({
    url: "/stock/transfer",
    method: "post",
    data
  });
}

export function delStockTransfer(id) {
  return request({
    url: `/stock/transfer/${id}`,
    method: "delete"
  });
}

export function listStockTransferInventoryOptions() {
  return request({
    url: "/stock/transfer/inventory/options",
    method: "get"
  });
}

// 相关费用维护
export function listRelatedFee(query) {
  return request({
    url: "/stock/relatedFee/list",
    method: "get",
    params: query
  });
}

export function getRelatedFee(id) {
  return request({
    url: `/stock/relatedFee/${id}`,
    method: "get"
  });
}

export function addRelatedFee(data) {
  return request({
    url: "/stock/relatedFee",
    method: "post",
    data
  });
}

export function delRelatedFee(id) {
  return request({
    url: `/stock/relatedFee/${id}`,
    method: "delete"
  });
}

// 相经营业绩填报
export function listOperPerf(query) {
  return request({
    url: "/stock/operPerf/list",
    method: "get",
    params: query
  });
}

export function getOperPerf(id) {
  return request({
    url: `/stock/operPerf/${id}`,
    method: "get"
  });
}

export function addOperPerf(data) {
  return request({
    url: "/stock/operPerf",
    method: "post",
    data
  });
}

export function editOperPerf(data) {
  return request({
    url: "/stock/operPerf",
    method: "put",
    data
  });
}

export function delOperPerf(id) {
  return request({
    url: `/stock/operPerf/${id}`,
    method: "delete"
  });
}

// 仓库领料
export function listStockIssue(query) {
  return request({
    url: "/stock/issue/list",
    method: "get",
    params: query
  });
}

export function getStockIssue(id) {
  return request({
    url: `/stock/issue/${id}`,
    method: "get"
  });
}

export function addStockIssue(data) {
  return request({
    url: "/stock/issue",
    method: "post",
    data
  });
}

export function delStockIssue(id) {
  return request({
    url: `/stock/issue/${id}`,
    method: "delete"
  });
}

export function listStockIssueInventoryOptions() {
  return request({
    url: "/stock/issue/inventory/options",
    method: "get"
  });
}

// 核算指导价
export function listAccountingGuide(query) {
  return request({
    url: "/stock/guide/list",
    method: "get",
    params: query
  });
}

export function getAccountingGuide(id) {
  return request({
    url: `/stock/guide/${id}`,
    method: "get"
  });
}

export function addAccountingGuide(data) {
  return request({
    url: "/stock/guide",
    method: "post",
    data
  });
}

export function delAccountingGuide(id) {
  return request({
    url: `/stock/guide/${id}`,
    method: "delete"
  });
}

export function listAccountingGuideMaterialOptions() {
  return request({
    url: "/stock/guide/materials/options",
    method: "get"
  });
}
