import request from '@/utils/request';

// 查询线索列表
export function getClueList(query) {
  return request({
    url: '/zs/clue/list',
    method: 'get',
    params: query
  });
}

// 查询线索列表
export function getClueInfo(id) {
  return request({
    url: '/zs/clue/' + id,
    method: 'get',
  });
}


// 新增线索
export function addClue(data) {
  return request({
    url: '/zs/clue',
    method: 'post',
    data: data
  });
}

// 修改线索
export function updateClue(data) {
  return request({
    url: '/zs/clue',
    method: 'put',
    data: data
  });
}

// 删除
export function deleteClue(data) {
  return request({
    url: '/zs/clue',
    method: 'delete',
    params: data
  });
}
// 导出
export function exportData(query) {
  return request({
    url: '/zs/clue/export',
    method: 'post',
    data: query
  });
}

// 导入模板
export function importTemplate(param) {
  return request({
    url: '/zs/clue/importTemplate',
    method: 'get',
    params: param
  });
}
// 导入
export function importData(data) {
  return request({
    url: '/zs/clue/importData',
    method: 'post',
    data: data
  });
}

// 查询登记getSign
export function getSign(query) {
  return request({
    url: '/zs/clue/sign',
    method: 'get',
    params: query
  });
}
// 保存登记
export function saveSign(data) {
  return request({
    url: '/zs/clue/sign',
    method: 'post',
    data: data
  });
}

// 甩单
export function saveDistribute(data) {
  return request({
    url: '/zs/clue/distribute',
    method: 'put',
    data: data
  });
}

// 驳回
export function refuse(data) {
  return request({
    url: '/zs/clue/refuse',
    method: 'put',
    data: data
  });
}

// 查询甩单记录
export function getDistributeRecord(param) {
  return request({
    url: '/zs/clue/distributerecord',
    method: 'get',
    params: param
  });
}

// 查询跟踪记录
export function getFollowRecord(param) {
  return request({
    url: '/zs/followrecord/list',
    method: 'get',
    params: param
  });
}

//查询咨询记录
export function getConsultRecord(param) {
  return request({
    url: '/zs/consultrecord/list',
    method: 'get',
    params: param
  });
}
// 获取已过期
export function getClueCountBadge() {
  return request({
    url: `/zs/clue/badgeCount`,
    method: 'get'
  });
}

// 批量更新
export function batchUpdate(data) {
  return request({
    url: `/zs/clue/batchUpdate`,
    method: 'put',
    data: data
  });
}

// 公海线索 getPublicList
export function getPublicList(param) {
  return request({
    url: `/zs/clue/public/list`,
    method: 'get',
    params: param
  });
}

// 拾取线索
export function pickupClue(data) {
  return request({
    url: `/zs/clue/public/pickup`,
    method: 'put',
    data: data
  });
}

// 丢弃线索
export function discardClue(data) {
  return request({
    url: `/zs/clue/public/discard`,
    method: 'put',
    data: data
  });
}

// 查询接收
export function getAccept() {
  return request({
    url: `/zs/clue/accept`,
    method: 'get'
  });
}

// 丢弃线索
export function updateAccept(data) {
  return request({
    url: `/zs/clue/accept`,
    method: 'put',
    data: data
  });
}


//查询线索分发信息
export function getCluePlaceList(data) {
  return request({
    url: `/zs/clue/place/info`,
    method: 'get',
    params: data
  });
}

//保存线索分发信息
export function saveCluePlace(data) {
  return request({
    url: `/zs/clue/place`,
    method: 'post',
    data: data
  });
}
