index.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import request from '@/config/axios'
  2. import { TransferReqVO } from '@/api/crm/permission'
  3. export interface ClueVO {
  4. id: number // 编号
  5. name: string // 线索名称
  6. followUpStatus: boolean // 跟进状态
  7. contactLastTime: Date // 最后跟进时间
  8. contactLastContent: string // 最后跟进内容
  9. contactNextTime: Date // 下次联系时间
  10. ownerUserId: number // 负责人的用户编号
  11. ownerUserName?: string // 负责人的用户名称
  12. ownerUserDept?: string // 负责人的部门名称
  13. transformStatus: boolean // 转化状态
  14. customerId: number // 客户编号
  15. customerName?: string // 客户名称
  16. mobile: string // 手机号
  17. telephone: string // 电话
  18. qq: string // QQ
  19. wechat: string // wechat
  20. email: string // email
  21. areaId: number // 所在地
  22. areaName?: string // 所在地名称
  23. detailAddress: string // 详细地址
  24. industryId: number // 所属行业
  25. level: number // 客户等级
  26. source: number // 客户来源
  27. remark: string // 备注
  28. creator: string // 创建人
  29. creatorName?: string // 创建人名称
  30. createTime: Date // 创建时间
  31. updateTime: Date // 更新时间
  32. }
  33. // 查询线索列表
  34. export const getCluePage = async (params: any) => {
  35. return await request.get({ url: `/crm/clue/page`, params })
  36. }
  37. // 查询线索详情
  38. export const getClue = async (id: number) => {
  39. return await request.get({ url: `/crm/clue/get?id=` + id })
  40. }
  41. // 新增线索
  42. export const createClue = async (data: ClueVO) => {
  43. return await request.post({ url: `/crm/clue/create`, data })
  44. }
  45. // 修改线索
  46. export const updateClue = async (data: ClueVO) => {
  47. return await request.put({ url: `/crm/clue/update`, data })
  48. }
  49. // 删除线索
  50. export const deleteClue = async (id: number) => {
  51. return await request.delete({ url: `/crm/clue/delete?id=` + id })
  52. }
  53. // 导出线索 Excel
  54. export const exportClue = async (params) => {
  55. return await request.download({ url: `/crm/clue/export-excel`, params })
  56. }
  57. // 线索转移
  58. export const transferClue = async (data: TransferReqVO) => {
  59. return await request.put({ url: '/crm/clue/transfer', data })
  60. }
  61. // 线索转化为客户
  62. export const transformClue = async (id: number) => {
  63. return await request.put({ url: '/crm/clue/transform', params: { id } })
  64. }
  65. // 获得分配给我的、待跟进的线索数量
  66. export const getFollowClueCount = async () => {
  67. return await request.get({ url: '/crm/clue/follow-count' })
  68. }