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

// 标签获取客户列表
const getCustomerByTagListApi = params => {
  params.method = 'entmicro.api.customer.getCustomerPageByTag'
  params.source = 'scrm-home'
  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营销事件次数分析
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 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
  })
}

export default { getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, insertOrUpdateSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi }