import request from "@/api";

// 获取表头数据
export function getOutPage(data: any) {
  return request({
    url: `/admin/out/page`,
    method: "get",
    params: data
  });
}

// 添加数据
export function addOutData(data: any) {
  return request({
    url: `/admin/out`,
    method: "post",
    data
  });
}

// 修改数据
export function updateOutData(data: any) {
  return request({
    url: `/admin/out`,
    method: "put",
    data
  });
}
// 删除数据
export function deleteOutData(id: string) {
  return request({
    url: `/admin/out/${id}`,
    method: "delete"
  });
}
// 查看数据
export function lookOutData(id: string) {
  return request({
    url: `/admin/out/outdound/${id}`,
    method: "get"
  });
}

// 物资类别
export function dictTree(data: any) {
  return request({
    url: `/admin/sys/dict/tree/1`,
    method: "get",
    params: data
  });
}

// 物资类别
export function getDeptTypeList() {
  return request({
    url: `/admin/dept/getDeptTypeList/3`,
    method: "get"
  });
}

// 出库导出模板
export function outExport() {
  return request({
    url: `/admin/out/export`,
    method: "get",
    responseType: "blob"
  });
}
// 出库导入
export function outImport(data: any) {
  return request({
    url: `/admin/out/fill/import`,
    method: "post",
    data
  });
}

//导出---出库管理，出库信息下发
export function exportcjxxxf(data: any) {
  return request({
    url: `/admin/order/export`,
    method: "get",
    params: data,
    responseType: "blob"
  });
}

export function addInOrderData(data: any) {
  return request({
    url: `/admin/order`,
    method: "post",
    data
  });
}

export function getOutPageNew(data: any) {
  return request({
    url: `/admin/order/page`,
    method: "get",
    params: data
  });
}

export function deleteOutDataNew(id: string) {
  return request({
    url: `/admin/order/${id}`,
    method: "delete"
  });
}

export function lookOutDataNew(id: string) {
  return request({
    url: `/admin/order/${id}`,
    method: "get"
  });
}

//获取仓库下的物资信息
export function materialsTree(data: any) {
  return request({
    url: `/admin/in/materials-tree`,
    method: "get",
    params: data
  });
}

// 获取入库日期与单价
export function getTimeAndUnitPriceForOutbound(data: any) {
  return request({
    url: "/admin/maintenance/getTimeAndUnitPriceForOutbound",
    method: "post",
    data
  });
}

