sop.js 5.78 KB
import { http } from '@/main'

// 获取客户列表
const getCustomerListApi = params => {
  params.method = 'entmicro.api.customer.page'
  params.source = 'scrm-home'
  return http({
    url: 'rop-scrm-entmicro/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 标签获取客户列表
const getCustomerByTagListApi = params => {
  params.method = 'entmicro.api.customer.getCustomerPageByTag'
  return http({
    url: 'rop-scrm-entmicro/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

//群标签获取客户列表
const getCustomerByGroupTagListApi = params => {
  params.method = 'entmicro.api.customer.base.getCustomerBasePageByTag'
  return http({
    url: 'rop-scrm-entmicro/router',
    method: 'POST',
    data: params,
    sign: true
  })
}
// 人群获取客户列表
const getCustomerCrowdApi = params => {
  params.method = 'entmicro.api.customer.crowd.page'
  return http({
    url: 'rop-scrm-entmicro/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getSopInfoListApi = params => {
  params.method = 'scrm.api.sop.sopInfo.listWithPage'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// sop基本信息
const getSopBaseInfoApi = params => {
  params.method = 'scrm.api.sop.sopInfo.getBaseBySopId'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

//sop分析-触达率-筛选框
const getEventListApi = params => {
  params.method = 'scrm.api.sop.sopEvent.listWithPage'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// sop分析-触达率列表
const getSopCustomerStatisticsListApi = params => {
  params.method = 'scrm.api.sop.sopCustomer.listStatisticsWithPage'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// sop分析-员工完成率列表
const getSopStaffTaskListApi = params => {
  params.method = 'scrm.api.sop.staffTaskStatistics.listWithPage'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// sop-完成率-根据evnetid获取失败事件列表
const getFailEventList = params => {
  params.method = 'scrm.api.sop.sopEvent.listEventFailByEventId'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 校验当前商户的企微群发任务情况
const getTaskStatusApi = params => {
  params.method = 'scrm.api.sop.task.merchantWWMsgTaskStatusCheck'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// sop营销事件次数分析
const parseEventCountApi = params => {
  params.method = 'scrm.api.sop.sopEvent.parseEventCount'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 删除sop事件
const deleteSopEventApi = params => {
  params.method = 'scrm.api.sop.sopInfo.delete'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

// 结束sop事件
const endSopEventApi = params => {
  params.method = 'scrm.api.sop.sopInfo.updateEndStatus'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

// 事件进行中,修改sop事件列表
// const insertOrUpdateSopEventApi = params => {
//   params.method = 'scrm.api.sop.sopEvent.insertOrUpdate'
//   return http({
//     url: 'rop-scrm-sop/router',
//     method: 'POST',
//     data: params,
//     sign: true,
//     returnAll: true
//   })
// }

// 事件进行中,批量编辑sop
const batchEditSopEventApi = params => {
  params.method = 'scrm.api.sop.sopEvent.batchEdit'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

// 新增或者事件未开始,新增/修改sop
const insertOrUpdateSopApi = params => {
  params.method = 'scrm.api.sop.sopInfo.insertOrUpdate'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const getSopInfoDetailApi = params => {
  params.method = 'scrm.api.sop.sopInfo.getDetailBySopId'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 获取素材组列表
const getGroupListApi = params => {
  params.method = 'marketing.api.material.group.list'
  return http({
    url: 'rop-scrm-marketing/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 获取素材列表
const getMaterialListApi = params => {
  // params.method = 'marketing.api.material.page'
  params.method = 'marketing.api.material.sop.page'
  return http({
    url: 'rop-scrm-marketing/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 朋友圈模板
const getMomentListApi = params => {
  params.method = 'marketing.api.moment.page'
  return http({
    url: 'rop-scrm-marketing/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

// 根据sopId获取SOP营销效果分析
const getEffectAnalysisApi = params => {
  params.method = 'scrm.api.sop.sopEvent.effectAnalysis'
  return http({
    url: 'rop-scrm-sop/router',
    method: 'POST',
    data: params,
    sign: true
  })
}
export default { getCustomerListApi, getCustomerByGroupTagListApi,getCustomerByTagListApi, getCustomerCrowdApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getFailEventList, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi,getEffectAnalysisApi }