import request from "@/api";

// 获取全部仓库
export function getDeptTypeListCk() {
  return request({
    url: "/admin/dept/getDeptTypeList/3",
    method: "get"
  });
}

// 获取全部垂管局
export function getDeptTypeListCgj() {
  return request({
    url: "/admin/dept/getDeptTypeList/2",
    method: "get"
  });
}

// 根据垂管局获取仓库名称
export function getDeptParentIdList(data: any) {
  return request({
    url: "/admin/dept/getDeptParentIdList",
    method: "post",
    data
  });
}

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

// 新增
export function insert(data: any) {
  return request({
    url: "/admin/materials-failure/insert",
    method: "post",
    data
  });
}

// 列表分页
export function getListPage(data: any) {
  return request({
    url: "/admin/materials-failure/page",
    method: "get",
    params: data
  });
}

// 根据id删除列表
export function deleteData(id: string) {
  return request({
    url: `/admin/materials-failure/delete?id=${id}`,
    method: "get"
  });
}

// 根据id获取详情
export function getData(id: string) {
  return request({
    url: `/admin/materials-failure/get?id=${id}`,
    method: "get"
  });
}

// 修改
export function update(data: any) {
  return request({
    url: "/admin/materials-failure/update",
    method: "post",
    data
  });
}
