import request from '../request.js';

/** 接口管理 */
const Api = {
  page: '/api/wms/customer/page',
  save: '/api/wms/customer/save',
  edit: '/api/wms/customer/edit',
  list: '/api/wms/customer/list',
  remove: '/api/wms/customer/remove',
  removeBatch: '/api/wms/customer/removeBatch',
  getCustomerByCode: '/api/wms/customer/getCustomerListByCode',
}

/** 任务列表 (分页) */
export const page = data => {
  return request.request({
    url: Api.page,
    params: data,
    method: 'GET'
  })
}

/** 保存 */
export const save = data => {
  return request.request({
    url: Api.save,
    data: data,
    method: 'POST'
  })
}

/** 修改 */
export const edit = data => {
  return request.request({
    url: Api.edit,
    data: data,
    method: 'PUT'
  })
}

/** 删除 */
export const remove = data => {
  return request.request({
    url: Api.remove,
    params: data,
    method: 'DELETE'
  })
}

/** 批量删除 */
export const removeBatch = data => {
  return request.request({
    url: Api.removeBatch,
    params: data,
    method: 'DELETE'
  })
}

/** 获取customerCode */
export const getCustomerListByCode = data => {
  return request.request({
    url: Api.getCustomerByCode,
    params: data,
    method: 'GET'
  })
}
