import request from '@/utils/request'

export function listLineCustomer(query) {
  return request({
    url: '/crm/customer/lineList',
    method: 'get',
    params: query
  })
}
export function listCustomerAll(query) {
  return request({
    url: '/crm/customer/listAll',
    method: 'get',
    params: query
  })
}
export function getCustomerListByIds(query) {
  return request({
    url: '/crm/customer/getCustomerListByIds',
    method: 'get',
    params: query
  })
}
export function addLineCustomer(data) {
  return request({
    url: '/crm/customer/addLine',
    method: 'post',
    data: data
  })
}

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

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



// 删除客户
export function delLineCustomer(customerId) {
  return request({
    url: '/crm/customer/removeLine/' + customerId,
    method: 'delete'
  })
}


// 查询客户详细
export function getLineCustomer(customerId) {
  return request({
    url: '/crm/customer/queryLine/' + customerId,
    method: 'get'
  })
}

// 导出客户
export function exportLineCustomer(query) {
  return request({
    url: '/crm/customer/exportLine',
    method: 'get',
    params: query
  })
}
export function exportCustomer(query) {
  return request({
    url: '/crm/customer/export',
    method: 'get',
    params: query
  })
}




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

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


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

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

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




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

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

// 删除客户
export function delCustomer(customerId) {
  return request({
    url: '/crm/customer/' + customerId,
    method: 'delete'
  })
}

export function getCustomerDetails1(data) {
  return request({
    url: '/crm/customer/query/' + data.customerId,
    method: 'get'
  })
}

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