import request from "@/api";

//获取库存物资信息
export function getInOptions(data: any) {
  return request({
    url: `/admin/maintenance/getTimeAndUnitPrice`,
    method: "post",
    data
  });
}

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

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

// 修改数据
export function updateInData(data: any) {
  return request({
    url: `/admin/maintenance`,
    method: "put",
    data
  });
}
// 删除数据
export function deleteInData(id: string) {
  return request({
    url: `/admin/maintenance/${id}`,
    method: "delete"
  });
}
// 查看数据
export function lookInData(id: string) {
  return request({
    url: `/admin/maintenance/${id}`,
    method: "get"
  });
}

// 物资类别
export function dictTree(data: any) {
  return request({
    url: `/admin/sys/dict/tree/1`,
    method: "get",
    params: data
  });
}
// 预览
export function sysFile(filePart: string) {
  return request({
    url: `/admin/sysFile/${filePart}`,
    method: "get",
    responseType: "blob"
  });
}
// 入库导出模板
export function inExport() {
  return request({
    url: `/admin/out/export`,
    method: "get",
    responseType: "blob"
  });
}
// 入库导入
export function inImport(data: any) {
  return request({
    url: `/admin/out/fill/import`,
    method: "post",
    data
  });
}

//物资维护审核
export function Auditing(data: any) {
  return request({
    url: `/admin/maintenance/auditing`,
    method: "put",
    data
  });
}

//物资统计列表
export function getStatistics(data: any) {
  return request({
    url: `/admin/maintenance/getStatistics`,
    method: "post",
    data
  });
}
