/**
 * 所有跟用户相关的接口（TODO:DEMO USER）
 */

import { HttpResponse } from '@/@types'
import Axios from './axios'



/**
 * @interface loginParams -登录参数
 * @property {string} grant_type -授权类型
 * @property {string} email -邮箱
 * @property {string} password -用户密码
 */
interface CutomerParams {
  PageIndex: number,
  PageSize: number,
  pageCount: number,
  CorpName: string, //企业名称
  CustomerName: string, //备注名
  WeChatName: string, //昵称
  CustomerMobile: string, //手机号码
  CreateSTime: string, //创建开始时间
  CreateETime: string, //创建结束时间
  FriendSTime: string, //好友开始时间
  FriendETime: string, //好友结束时间
  Q_NotFollowUpDay: number, //几天未跟进
  Q_Friends: string, //好友关系 多选逗号分隔、
  Q_AddWay: string, //获取来源 多选英文逗号分隔
  EmpId: number, //员工id
  CustomerType: number, //类型1微信用户 2企业微信用户
  SelectList: Array<any>, //自定义查询
  OrderBy: number, //排序
  AddCondition: number //查询条件
}

/**
 * @example Axios.get(`https://xxx.com}`)
 * @todo Get the exchange rate of the current currency
 */

class CustomerService {
  // 获取用户列表数据
  static async getCustomerList(data: CutomerParams): Promise<HttpResponse> {
    return Axios('/QYCustomer/GetCustomerInfoPageList', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //获取途径下拉数据
  static async getWayList(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/GetCustomerAddWayEnumList', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //获取部门-员工下拉数据
  static async getEmployeeData(data: any): Promise<HttpResponse> {
    return Axios('/User/GetEmployeeAddrBook', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //获取员工详情数据
  static async getCustomInfo(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/GetCustomerInfo', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //获取客户阶段下拉数据
  static async getCustomStageList(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/GetCustomerStageList', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //保存客户资料
  static async saveCustomInfo(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/SetCustomerInfo', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //保存客户标签
  static async saveCustomLabel(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/SetCustomerLabelBatch', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //获取客户旅程类型枚举列表
  static async getCustomerTripType(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/GetCustomerTripTypeEnumList', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
  //获取客户旅程分页列表
  static async getCustomerTripPage(data: any): Promise<HttpResponse> {
    return Axios('/QYCustomer/GetCustomerTripPageList', {
      method: 'post',
      responseType: 'json',
      data
    })
  }
}
export {CutomerParams}
export default CustomerService
