import request from '@/utils/request'

// 创建供应商信息
export function createSupplierCompany(data) {
  return request({
    url: '/bs/supplier-company/create',
    method: 'post',
    data: data
  })
}

// 更新供应商信息
export function updateSupplierCompany(data) {
  return request({
    url: '/bs/supplier-company/update',
    method: 'put',
    data: data
  })
}

// 删除供应商信息
export function deleteSupplierCompany(id) {
  return request({
    url: '/bs/supplier-company/delete?id=' + id,
    method: 'delete'
  })
}

// 获得供应商信息
export function getSupplierCompany(id) {
  return request({
    url: '/bs/supplier-company/get?id=' + id,
    method: 'get'
  })
}

// 获得供应商信息分页
export function getSupplierCompanyPage(query) {
  return request({
    url: '/bs/supplier-company/page',
    method: 'get',
    params: query
  })
}

// 导出供应商信息 Excel
export function exportSupplierCompanyExcel(query) {
  return request({
    url: '/bs/supplier-company/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 百度云接口识别
export function baiduScanApi(data) {
  return request({
    url: '/bs/supplier-company/buildBusinessLicense',
    method: 'post',
    data
  })
}
