import request from '@/config/axios'
// 查询列表
export const getSupplierPage = async (params) => {
  return await request.get({ url: '/admin-api/crm/erp-supplier/page', params })
}

export const getSupplierSimpleList = async (params) => {
  return await request.get({ url: '/admin-api/crm/erp-supplier/simple-list', params })
}

// 查询详情
export const getSupplier = async (id) => {
  return await request.get({ url: '/admin-api/crm/erp-supplier/get?id=' + id })
}

// 新增
export const createSupplier = async (data) => {
  return await request.post({
    url: '/admin-api/crm/erp-supplier/create',
    data: data,
    isSubmitForm: true
  })
}

// 修改
export const updateSupplier = async (params) => {
  return await request.put({ url: '/admin-api/crm/erp-supplier/update', data: params })
}

// 删除
export const deleteSupplier = async (id) => {
  return await request.delete({ url: '/admin-api/crm/erp-supplier/delete?id=' + id })
}
