import request from '@/utils/request'

// 创建客户
export function createCustomer(data) {
  return request({
    url: '/ecw/customer/create',
    method: 'post',
    data: data
  })
}

// 更新客户
export function updateCustomer(data) {
  return request({
    url: '/ecw/customer/update',
    method: 'put',
    data: data
  })
}

// 删除客户
export function deleteCustomer(id) {
  return request({
    url: '/ecw/customer/delete?id=' + id,
    method: 'delete'
  })
}

// 获得客户
export function getCustomer(id) {
  return request({
    url: '/ecw/customer/get?id=' + id,
    method: 'get'
  })
}

// 获得客户分页
export function getCustomerPage(query) {
  return request({
    url: '/ecw/customer/page',
    method: 'get',
    params: query
  })
}

// 获得客户下来
export function getCustomerSelect(query) {
  return request({
    url: '/ecw/customer/select',
    method: 'get',
    params: query
  })
}

// 导出客户 Excel
export function exportCustomerExcel(query) {
  return request({
    url: '/ecw/customer/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 待接收客户列表
export function getWaitForConfirmList(query) {
  return request({
    url: '/ecw/customer/get-wait-for-confirm',
    method: 'get',
    params: query
  })
}

// 确认
export function confirm(data) {
  return request({
    url: '/ecw/customer/confirm',
    method: 'put',
    data: data
  })
}

// 待分配客户
export function getWaitForDistributionList(query) {
  return request({
    url: '/ecw/customer/get-wait-for-distribution',
    method: 'get',
    params: query
  })
}

// 移交
export function handOverCustomer(data) {
  return request({
    url: '/ecw/customer/handOver',
    method: 'put',
    data: data
  })
}

// 公海池客户
export function getPublicList(query) {
  return request({
    url: '/ecw/customer/get-public',
    method: 'get',
    params: query
  })
}

//捞取
export function setFishing(query){
  return request({
    url:'',

  })
}
//待分配 客户列表
export function getCustomerToBeAssigned(query){
  return request(
    {
      url:'ecw/customer/get-wait-for-distribution',
      method: 'get',
      params: query

    }
  )
}
//我的客户列表
export function getMyCustomerService(query){
  return request({
    url:'/ecw/customer/get-mine',
    method:'get',
    params:query,
  })
}
