import request from '@/utils/request'

export function getMaterialPage(data) {
  return request({
    url: '/base-material/page',
    method: 'get',
    params: data
  })
}

export function getMaterialList(data) {
  return request({
    url: '/base-material/list',
    method: 'post',
    data: data
  })
}

export function getMaterialById(data) {
  return request({
    url: '/base-material/listById',
    method: 'post',
    data: data
  })
}

export function addMaterial(data) {
  return request({
    url: '/base-material/add',
    method: 'post',
    data: data
  })
}

export function editMaterial(data) {
  return request({
    url: '/base-material/edit',
    method: 'post',
    data: data
  })
}

export function delMaterial(data) {
  return request({
    url: '/base-material/delete',
    method: 'post',
    data: data
  })
}

// 根据货品类别拿到所属的物料
export function getGoodsByMaterial(data) {
  return request({
    url: '/base-product-category/listMaterialByGoodsType',
    method: 'post',
    data: data
  })
}
