import request from '@/utils/request'

export function getFullCustomerList(query) {
  return request({
    url: '/crm/customer/getFullCustomerList',
    method: 'get',
    params: query
  })
}

export function getLineCustomerList(query) {
  return request({
    url: '/crm/customer/getLineCustomerList',
    method: 'get',
    params: query
  })
}
export function listCustomerAll(query) {
  return request({
    url: '/crm/customer/listAll',
    method: 'get',
    params: query
  })
}
export function getCustomerList(query) {
  return request({
    url: '/crm/customer/getCustomerList',
    method: 'get',
    params: query
  })
}

export function getCustomerListByIds(query) {
  return request({
    url: '/crm/customer/getCustomerListByIds',
    method: 'get',
    params: query
  })
}



export function getMyCustomerList(query) {
  return request({
    url: '/crm/customer/getMyCustomerList',
    method: 'get',
    params: query
  })
}

export function getCustomerDetails(query) {
  return request({
    url: '/crm/customer/getCustomerDetails/',
    method: 'get',
    params: query
  })
}
export function getCustomerDetails1(query) {
  return request({
    url: '/crm/customer/getCustomerDetails1/',
    method: 'get',
    params: query
  })
}

export function getLineCustomerDetails(query) {
  return request({
    url: '/crm/customer/getLineCustomerDetails/',
    method: 'get',
    params: query
  })
}
export function getCustomer1(customerId) {
  return request({
    url: '/crm/customer/query1/' + customerId,
    method: 'get'
  })
}

export function getCustomerListBySearch(query) {
  return request({
    url: '/crm/customer/getCustomerListBySearch',
    method: 'get',
    params: query
  })
}


export function exportCustomer(query) {
  return request({
    url: '/crm/customer/export',
    method: 'get',
    params: query
  })
}

export function exportCustomerByIds(customerId) {
  return request({
    url: '/crm/customer/'+ customerId,
    method: 'post',
  })
}

export function assignToUser(data) {
  return request({
    url: '/crm/customer/assignToUser',
    method: 'post',
    data: data
  })
}
export function assignUser(data) {
  return request({
    url: '/crm/customer/assignUser',
    method: 'post',
    data: data
  })
}



export function receive(data) {
  return request({
    url: '/crm/customer/receive',
    method: 'post',
    data: data
  })
}

export function recover(data) {
  return request({
    url: '/crm/customer/recover',
    method: 'post',
    data: data
  })
}






// 下载用户导入模板
export function importLineTemplate() {
  return request({
    url: '/crm/customer/importLineTemplate',
    method: 'get'
  })
}

// 下载用户导入模板
export function importVisitTemplate() {
  return request({
    url: '/crm/customer/importVisitTemplate',
    method: 'get'
  })
}


export function addCustomer(data) {
  return request({
    url: '/crm/customer/add',
    method: 'post',
    data: data
  })
}

export function addMyCustomer(data) {
  return request({
    url: '/crm/customer/addMyCustomer',
    method: 'post',
    data: data
  })
}


// 修改客户
export function updateCustomer(data) {
  return request({
    url: '/crm/customer/edit',
    method: 'put',
    data: data
  })
}

export function updateCustomerSource(data) {
  return request({
    url: '/crm/customer/updateCustomerSource',
    method: 'post',
    data: data
  })
}
