import request from '@/utils/request'

// 获取任务列表数据
export function getTaskLists(params) {
  return request({
    url: 'api/OutboundTask/getlist',
    method: 'get',
    params
  })
}

// 添加任务
export function addTaskLists(params) {
  return request({
    url: 'api/OutboundTask/add',
    method: 'post',
    params
  })
}

// 删除任务
export function deleteTaskLists(params) {
  return request({
    url: 'api/OutboundTask/deletetask',
    method: 'post',
    params
  })
}

// 编辑任务
export function editTaskLists(params) {
  return request({
    url: 'api/OutboundTask/update',
    method: 'post',
    params
  })
}

// 获取任务详情
export function getTaskDetail(params) {
  return request({
    url: 'api/OutboundTask/getdetails',
    method: 'get',
    params
  })
}

//获取外呼号码列表
export function getOutboundNumberLists(params) {
  return request({
    url: 'api/OutboundTask/getcalllist',
    method: 'get',
    params
  })
}

//添加自动外呼
export function addOutboundNumberLists(data) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    transformRequest: [function(data) {
      data = JSON.stringify(data)
      return data
    }],
    url: 'api/OutboundTask/addcall',
    method: 'post',
    data
  })
}

//删除外呼号码
export function deleteOutboundNumberLists(params) {
  return request({
    url: 'api/OutboundTask/delete',
    method: 'post',
    params
  })
}

//编辑外呼号码
export function editOutboundNumber(params) {
  return request({
    url: 'api/OutboundTask/updatecall',
    method: 'post',
    params
  })
}

//获取外呼号码详情
export function getOutboundNumberDetail(params) {
  return request({
    url: 'api/OutboundTask/getdetailscall',
    method: 'get',
    params
  })
}

//获取当前是否有外呼任务
export function getWhetherOutboundTaskNow(params) {
  return request({
    url: 'api/OutboundTask/addmiddleware',
    method: 'post',
    params
  })
}

//获取自动外呼通话记录
export function getOutboundCallRecordsList(params) {
  return request({
    url: 'api/CallRecords/getoutboundlist',
    method: 'post',
    params
  })
}

