customer.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import request from '@/config/axios'
  2. export interface CrmStatisticsCustomerSummaryByDateRespVO {
  3. time: string
  4. customerCreateCount: number
  5. customerDealCount: number
  6. }
  7. export interface CrmStatisticsCustomerSummaryByUserRespVO {
  8. ownerUserName: string
  9. customerCreateCount: number
  10. customerDealCount: number
  11. contractPrice: number
  12. receivablePrice: number
  13. }
  14. export interface CrmStatisticsFollowupSummaryByDateRespVO {
  15. time: string
  16. followupRecordCount: number
  17. followupCustomerCount: number
  18. }
  19. export interface CrmStatisticsFollowupSummaryByUserRespVO {
  20. ownerUserName: string
  21. followupRecordCount: number
  22. followupCustomerCount: number
  23. }
  24. export interface CrmStatisticsFollowupSummaryByTypeRespVO {
  25. followupType: string
  26. followupRecordCount: number
  27. }
  28. export interface CrmStatisticsCustomerContractSummaryRespVO {
  29. customerName: string
  30. contractName: string
  31. totalPrice: number
  32. receivablePrice: number
  33. customerType: string
  34. customerSource: string
  35. ownerUserName: string
  36. creatorUserName: string
  37. createTime: Date
  38. orderDate: Date
  39. }
  40. export interface CrmStatisticsCustomerDealCycleByDateRespVO {
  41. time: string
  42. customerDealCycle: number
  43. }
  44. export interface CrmStatisticsCustomerDealCycleByUserRespVO {
  45. ownerUserName: string
  46. customerDealCycle: number
  47. customerDealCount: number
  48. }
  49. export const DATE_INTERVAL_OPTIONS = [
  50. { value: 1, name: '今天' },
  51. { value: 2, name: '昨天' },
  52. { value: 3, name: '本周' },
  53. { value: 4, name: '上周' },
  54. { value: 5, name: '本月' },
  55. { value: 6, name: '上月' },
  56. { value: 7, name: '本季度' },
  57. { value: 8, name: '上季度' },
  58. { value: 9, name: '本年' },
  59. { value: 10, name: '去年' },
  60. { value: 11, name: '自定义' }
  61. ]
  62. export const CUSTOMER_INTERVAL = 11
  63. // 客户分析 API
  64. export const StatisticsCustomerApi = {
  65. // 1.1 客户总量分析(按日期)
  66. getCustomerSummaryByDate: (params: any) => {
  67. return request.get({
  68. url: '/crm/statistics-customer/get-customer-summary-by-date',
  69. params
  70. })
  71. },
  72. // 1.2 客户总量分析(按用户)
  73. getCustomerSummaryByUser: (params: any) => {
  74. return request.get({
  75. url: '/crm/statistics-customer/get-customer-summary-by-user',
  76. params
  77. })
  78. },
  79. // 2.1 客户跟进次数分析(按日期)
  80. getFollowupSummaryByDate: (params: any) => {
  81. return request.get({
  82. url: '/crm/statistics-customer/get-followup-summary-by-date',
  83. params
  84. })
  85. },
  86. // 2.2 客户跟进次数分析(按用户)
  87. getFollowupSummaryByUser: (params: any) => {
  88. return request.get({
  89. url: '/crm/statistics-customer/get-followup-summary-by-user',
  90. params
  91. })
  92. },
  93. // 3.1 获取客户跟进方式统计数
  94. getFollowupSummaryByType: (params: any) => {
  95. return request.get({
  96. url: '/crm/statistics-customer/get-followup-summary-by-type',
  97. params
  98. })
  99. },
  100. // 4.1 合同摘要信息(客户转化率页面)
  101. getContractSummary: (params: any) => {
  102. return request.get({
  103. url: '/crm/statistics-customer/get-contract-summary',
  104. params
  105. })
  106. },
  107. // 5.1 获取客户成交周期(按日期)
  108. getCustomerDealCycleByDate: (params: any) => {
  109. return request.get({
  110. url: '/crm/statistics-customer/get-customer-deal-cycle-by-date',
  111. params
  112. })
  113. },
  114. // 5.2 获取客户成交周期(按用户)
  115. getCustomerDealCycleByUser: (params: any) => {
  116. return request.get({
  117. url: '/crm/statistics-customer/get-customer-deal-cycle-by-user',
  118. params
  119. })
  120. }
  121. }