import request from '@/config/axios'

// 查询（精简)列表
export const getSimpleClueList = async () => {
  return await request.get({ url: '/admin-api/crm/sch-clue/list-all-simple' })
}

// 查询列表
export const getCluePage = async (params) => {
  return await request.get({ url: '/admin-api/crm/sch-clue/page', params })
}

// 查询详情
export const getClue = async (id) => {
  return await request.get({ url: '/admin-api/crm/sch-clue/get?id=' + id })
}

// 新增
export const createClue = async (data) => {
  return await request.post({
    url: '/admin-api/crm/sch-clue/create',
    data: data,
    isSubmitForm: true
  })
}

// 修改
export const updateClue = async (params) => {
  return await request.put({ url: '/admin-api/crm/sch-clue/update', data: params })
}

// 删除
export const deleteClue = async (id) => {
  return await request.delete({ url: '/admin-api/crm/sch-clue/delete?id=' + id })
}

// 释放
export const releaseClue = async (data) => {
  return await request.put({ url: '/admin-api/crm/sch-clue/public/save', data })
}

// 通用查询数量
export const getClueCount = async () => {
  return await request.get({ url: '/admin-api/crm/sch-clue/get-clue-num' })
}

// 获取操作记录
export const getOpearateRecord = async (params) => {
  return await request.get({ url: '/admin-api/crm/clue-operate-record/list', params })
}

// 获取公海线索
export const getPublicClue = async (data) => {
  return await request.put({ url: '/admin-api/crm/sch-clue/public/save', data })
}

// 获得线索跟进用户信息
export const getFollowUserList = async (params) => {
  return await request.get({ url: '/admin-api/crm/sch-clue/get-follow-user', params })
}

export const batchUpdateFollowUser = async (data) => {
  return await request.put({ url: '/admin-api/crm/sch-clue/batchUpdateFollowUser', data })
}
