customer.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 CrmStatisticCustomerBaseRespVO {
  45. customerCount: number
  46. dealCount: number
  47. dealPortion: number
  48. }
  49. export interface CrmStatisticCustomerIndustryRespVO extends CrmStatisticCustomerBaseRespVO {
  50. industryId: number
  51. industryName: string
  52. industryPortion: number
  53. }
  54. export interface CrmStatisticCustomerSourceRespVO extends CrmStatisticCustomerBaseRespVO {
  55. source: number
  56. sourceName: string
  57. sourcePortion: number
  58. }
  59. export interface CrmStatisticCustomerLevelRespVO extends CrmStatisticCustomerBaseRespVO {
  60. level: number
  61. levelName: string
  62. levelPortion: number
  63. }
  64. export interface CrmStatisticCustomerAreaRespVO extends CrmStatisticCustomerBaseRespVO {
  65. areaId: number
  66. areaName: string
  67. areaPortion: number
  68. }
  69. export interface CrmStatisticsCustomerDealCycleByUserRespVO {
  70. ownerUserName: string
  71. customerDealCycle: number
  72. customerDealCount: number
  73. }
  74. // 客户分析 API
  75. export const StatisticsCustomerApi = {
  76. // 1.1 客户总量分析(按日期)
  77. getCustomerSummaryByDate: (params: any) => {
  78. return request.get({
  79. url: '/crm/statistics-customer/get-customer-summary-by-date',
  80. params
  81. })
  82. },
  83. // 1.2 客户总量分析(按用户)
  84. getCustomerSummaryByUser: (params: any) => {
  85. return request.get({
  86. url: '/crm/statistics-customer/get-customer-summary-by-user',
  87. params
  88. })
  89. },
  90. // 2.1 客户跟进次数分析(按日期)
  91. getFollowUpSummaryByDate: (params: any) => {
  92. return request.get({
  93. url: '/crm/statistics-customer/get-follow-up-summary-by-date',
  94. params
  95. })
  96. },
  97. // 2.2 客户跟进次数分析(按用户)
  98. getFollowUpSummaryByUser: (params: any) => {
  99. return request.get({
  100. url: '/crm/statistics-customer/get-follow-up-summary-by-user',
  101. params
  102. })
  103. },
  104. // 3.1 获取客户跟进方式统计数
  105. getFollowUpSummaryByType: (params: any) => {
  106. return request.get({
  107. url: '/crm/statistics-customer/get-follow-up-summary-by-type',
  108. params
  109. })
  110. },
  111. // 4.1 合同摘要信息(客户转化率页面)
  112. getContractSummary: (params: any) => {
  113. return request.get({
  114. url: '/crm/statistics-customer/get-contract-summary',
  115. params
  116. })
  117. },
  118. // 5.1 获取客户成交周期(按日期)
  119. getCustomerDealCycleByDate: (params: any) => {
  120. return request.get({
  121. url: '/crm/statistics-customer/get-customer-deal-cycle-by-date',
  122. params
  123. })
  124. },
  125. // 5.2 获取客户成交周期(按用户)
  126. getCustomerDealCycleByUser: (params: any) => {
  127. return request.get({
  128. url: '/crm/statistics-customer/get-customer-deal-cycle-by-user',
  129. params
  130. })
  131. },
  132. // TODO @puhui999:下面这些拆出去哈;
  133. // 6.1 获取客户行业统计数据
  134. getCustomerIndustry: (params: any) => {
  135. return request.get({
  136. url: '/crm/statistics-portrait/get-customer-industry-summary',
  137. params
  138. })
  139. },
  140. // 6.1 获取客户来源统计数据
  141. getCustomerSource: (params: any) => {
  142. return request.get({
  143. url: '/crm/statistics-portrait/get-customer-source-summary',
  144. params
  145. })
  146. },
  147. // 6.1 获取客户行业统计数据
  148. getCustomerLevel: (params: any) => {
  149. return request.get({
  150. url: '/crm/statistics-portrait/get-customer-level-summary',
  151. params
  152. })
  153. },
  154. // 6.1 获取客户行业统计数据
  155. getCustomerArea: (params: any) => {
  156. return request.get({
  157. url: '/crm/statistics-portrait/get-customer-area-summary',
  158. params
  159. })
  160. }
  161. }