import { axios } from '@/utils/request'

// 供应商列表
export const supplierList = (params) => {
  const url = `/supplier/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 供应商列表 - 不分页
export const supplierQueryList = (params) => {
  return axios.request({
    url: '/supplier/queryList',
    data: params,
    method: 'post'
  })
}
// 保存供应商
export const supplierSave = (params) => {
  return axios.request({
    url: '/supplier/save',
    data: params,
    method: 'post'
  })
}
// 供应商详情
export const supplierFind = (params) => {
  return axios.request({
    url: `/supplier/findById/${params.id}`,
    method: 'get'
  })
}
// 供应商启禁用
export const supplierEnable = (params) => {
  return axios.request({
    url: `/supplier/enable/${params.id}/${params.flag}`,
    method: 'get'
  })
}
