import request from '@/utils/request'
import Qs from 'qs'


/**首页保姆任务 */
export function servantTaskCount(query) {
  return request({
    url: '/customerTask/servantTaskCount',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
 
/**订单中心-保姆订单详情-管家拜访 */
export function visitList(query) {
  return request({
    url: '/customerTask/visitList',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
 
/**订单中心-保姆订单详情-修改拜访日期 */
export function updateVisitTime(query) {
  return request({
    url: '/customerTask/updateVisitTime',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
 

/**订单中心-保姆订单详情-邀请主顾双方使用小程序，发送短信 */
export function invitationUseApp(query) {
  return request({
    url: '/customerTask/invitationUseApp',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

/**订单中心-保姆订单详情-邀请主顾双方使用小程序，发送短信--订单方式 */
export function invitationUseAppByOrder(query) {
  return request({
    url: '/customerTask/invitationUseAppByOrder',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

/**订单中心-保姆订单详情-拜访-跟教保姆记录查看 */
export function getServantTaskTeach(query) {
  return request({
    url: '/customerTask/getServantTaskTeach',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

/**订单中心-保姆订单详情-拜访-跟教保姆记录--录入 */
export function addServantTaskTeach(data) {
  return request({
    url: '/customerTask/addServantTaskTeach',
    method: 'post',
    data
  })
}

/**订单中心-保姆订单详情-拜访任务完成 */
export function completeParentTask(query) {
  return request({
    url: '/customerTask/completeParentTask',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
} 

//------------------------管家跟进类---------------
/**详细信息-管家工单 */
export function getTaskList(query) {
  return request({
    url: '/customerTask/getTaskList',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
} 

/**添加跟进记录，创建任务的字典数据*/
export function getTicketTaskDict(query) {
  return request({
    url: '/customerTask/getTicketTaskDict',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
} 

/**添加跟进记录,保存*/
export function addTicketAction(data) {
  return request({
    url: '/customerTask/addTicketAction',
    method: 'post',
    data
  })
} 

/**任务流转时，获取技能组下的用户*/
export function getSkillGroupUser(query) {
  return request({
    url: '/customerTask/getSkillGroupUser',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
} 


/**工单升级，流转*/
export function ticketUpgrade(data) {
  return request({
    url: '/customerTask/ticketUpgrade',
    method: 'post',
    data
  })
} 

/**任务工单完成时处理参数*/
export function ticketCompletedResult(query) {
  return request({
    url: '/customerTask/ticketCompletedResult',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
} 

/**工单完成*/
export function ticketCompleted(data) {
  return request({
    url: '/customerTask/ticketCompleted',
    method: 'post',
    data
  })
} 

/**新建工单*/
export function createNewTicket(data) {
  return request({
    url: '/customerTask/createNewTicket',
    method: 'post',
    data
  })
}