import request from "@/utils/request"

// 创建跟进
export function createCustomerFollow(data) {
  return request({
    url: "/ecw/customer-follow/create",
    method: "post",
    data: data
  })
}

// 更新跟进
export function updateCustomerFollow(data) {
  return request({
    url: "/ecw/customer-follow/update",
    method: "put",
    data: data
  })
}

// 删除跟进
export function deleteCustomerFollow(id) {
  return request({
    url: "/ecw/customer-follow/delete?id=" + id,
    method: "delete"
  })
}

// 获得跟进
export function getCustomerFollow(id) {
  return request({
    url: "/ecw/customer-follow/get?id=" + id,
    method: "get"
  })
}

// 获得跟进分页
export function getCustomerFollowPage(query) {
  return request({
    url: "/customer/detail/infoList/followPage",
    method: "get",
    params: query
  })
}
export function getCustomerFollowPage2(query) {
  return request({
    url: "/ecw/customer-follow/page",
    method: "get",
    params: query
  })
}

// 导出跟进 Excel
export function exportCustomerFollowExcel(query) {
  return request({
    url: "/ecw/customer-follow/export-excel",
    method: "get",
    params: query,
    responseType: "blob"
  })
}

// 跟进分页列表
export function getCustomerFollowupList(params) {
  return request({
    url: "/customer/followup/page",
    method: "get",
    params
  })
}
// 数据权限跟进分页列表
export function getDataSpaceCustomerFollowupList(params) {
  return request({
    url: "/customer/followup/data/space/page",
    method: "get",
    params
  })
}

export function getCustomerFollowDetail(params) {
  return request({
    url: "/customer/followup/get",
    method: "get",
    params
  })
}

export function addCustomerFollow(data) {
  return request({
    url: "/customer/followup/create",
    method: "post",
    data
  })
}

export function editCustomerFollow(data) {
  return request({
    url: "/customer/followup/update",
    method: "put",
    data
  })
}
export function updateCustomerFollowupStatus(data) {
  return request({
    url: "/customer/followup/update-status",
    method: "put",
    data
  })
}

export function exportCustomerFollowup(params) {
  return request({
    url: "/customer/followup/export-excel",
    method: "get",
    params
  })
}

// 数据权限导出跟进 Excel
export function exportDataSpaceCustomerFollowup(query) {
  return request({
    url: "/customer/followup/data/space/export-excel",
    method: "get",
    params: query,
    responseType: "blob"
  })
}

export function getFollowupNewNumber() {
  return request({
    url: "/customer/followup/getFollowupNewNumber",
    method: "get"
  })
}
