import request from '@/utils/request'

// 查询供应商列表
export function listSupplier(query) {
  return request({
    url: '/app/supplier/list',
    method: 'get',
    params: query
  })
}

// 查询供应商全部列表
export function getAllSupplier() {
  return request({
    url: '/app/supplier/optionselect',
    method: 'get'
  })
}

// 查询供应商详细
export function getSupplier(id) {
  return request({
    url: '/app/supplier/' + id,
    method: 'get'
  })
}

// 新增供应商
export function addSupplier(data) {
  return request({
    url: '/app/supplier',
    method: 'post',
    data: data
  })
}

// 修改供应商
export function updateSupplier(data) {
  return request({
    url: '/app/supplier',
    method: 'put',
    data: data
  })
}

// 删除供应商
export function delSupplier(id) {
  return request({
    url: '/app/supplier/' + id,
    method: 'delete'
  })
}

// 获取供应商编号
export function getSupplierNo() {
  return request({
    url: '/app/supplier/nextNo',
    method: 'get'
  })
}

// 新增评分
export function addSupplierEvaluate(data) {
  return request({
    url: '/supplier-eva/add',
    method: 'post',
    data: data
  })
}

export function editSupplierEvaluate(data) {
  return request({
    url: '/supplier-eva/edit',
    method: 'post',
    data: data
  })
}

export function getSupplierEvaluateList(data) {
  return request({
    url: '/supplier-eva/list',
    method: 'post',
    data: data
  })
}

export function getSupplierEvaluatePage(data) {
  return request({
    url: '/app/dataReport/gysReport',
    method: 'get',
    params: data
  })
}

export function getSupplierEvaluateLast(data) {
  return request({
    url: '/supplier-eva/getLastOne',
    method: 'post',
    data: data
  })
}
