import request from '@/utils/request'

// 查询物资列表
export function listMaterial(query) {
  return request({
    url: '/business/material/list',
    method: 'get',
    params: query
  })
}

// 查询物资列表(自定义查询用于查询库存大于0的物料)
export function customListMaterial(query) {
  return request({
    url: '/business/material/customList',
    method: 'get',
    params: query
  })
}

// 查询物资列表(自定义查询用于物料盘点)
export function customListAll(query) {
  return request({
    url: '/business/material/customListAll',
    method: 'get',
    params: query
  })
}

// 查询物资库存列表
export function listMaterialInventory(query) {
  return request({
    url: '/business/materialInventoryRecord/list',
    method: 'get',
    params: query
  })
}

// 查询物资库存列表
export function listByMaterialId(query) {
  return request({
    url: '/business/materialInventoryRecord/listByMaterialId',
    method: 'get',
    params: query
  })
}

// 查询物资详细
export function getMaterial(id) {
  return request({
    url: '/business/material/' + id,
    method: 'get'
  })
}

// 新增物资
export function addMaterial(data) {
  return request({
    url: '/business/material',
    method: 'post',
    data: data
  })
}

// 修改物资
export function updateMaterial(data) {
  return request({
    url: '/business/material',
    method: 'put',
    data: data
  })
}

// 删除物资
export function delMaterial(id) {
  return request({
    url: '/business/material/' + id,
    method: 'delete'
  })
}
