import request from '@/utils/request'

// 创建供应商
export function createBaseSupplier(data) {
  return request({
    url: '/supplier/baseSupplier/create',
    method: 'post',
    data: data
  })
}

// 更新供应商
export function updateBaseSupplier(data) {
  return request({
    url: '/supplier/baseSupplier/update',
    method: 'put',
    data: data
  })
}

// 删除供应商
export function deleteBaseSupplier(id) {
  return request({
    url: '/supplier/baseSupplier/delete?id=' + id,
    method: 'delete'
  })
}

// 获得供应商
export function getBaseSupplier(id) {
  return request({
    url: '/supplier/baseSupplier/get?id=' + id,
    method: 'get'
  })
}

// 获得供应商分页
export function getBaseSupplierPage(params) {
  return request({
    url: '/supplier/baseSupplier/page',
    method: 'get',
    params
  })
}
// 导出供应商 Excel
export function exportBaseSupplierExcel(params) {
  return request({
    url: '/supplier/baseSupplier/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获得所有供应商
export function getBaseSupplierList(){
  return request({
    url: '/supplier/baseSupplier/list',
    method: 'get'
  })
}
