import request from '@/utils/request'

// 查询客户列表
export function listCustomers(query) {
  return request({
    url: '/cm/customers/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getCustomers(id) {
  return request({
    url: '/cm/customers/' + id,
    method: 'get'
  })
}

// 新增客户
export function addCustomers(data) {
  return request({
    url: '/cm/customers',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomers(data) {
  return request({
    url: '/cm/customers',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomers(ids) {
  return request({
    url: '/cm/customers/delete',
    method: 'post',
    data: ids
  })
}

// 查询客户联系人信息
export function getContactInfo(id) {
  return request({
    url: '/cm/customers/getContactInfo/' + id,
    method: 'get',
  })
}

// 删除联系人
export function delContact(ids) {
  return request({
    url: '/cm/customers/deleteContact',
    method: 'post',
    data: ids
  })
}
