import request from '@/utils/request'

// 查询供应商管理列表
export function listProvider(query) {
  return request({
    url: '/system/provider/list',
    method: 'get',
    params: query
  })
}

// 查询供应商管理详细
export function getProvider(id) {
  return request({
    url: '/system/provider/' + id,
    method: 'get'
  })
}

// 新增供应商管理
export function addProvider(data) {
  return request({
    url: '/system/provider',
    method: 'post',
    data: data
  })
}

// 修改供应商管理
export function updateProvider(data) {
  return request({
    url: '/system/provider',
    method: 'put',
    data: data
  })
}

// 删除供应商管理
export function delProvider(id) {
  return request({
    url: '/system/provider/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/provider/enable/' + id,
    method: 'delete'
  })
}

// 禁用
export function disabled(id) {
  return request({
    url: '/system/provider/disable/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/provider/changeStatus',
    method: 'put',
    data: data
  })
}