index.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import request from '@/config/axios'
  2. export interface CustomerVO {
  3. id?: number
  4. name: string
  5. industryId: number
  6. level: number
  7. source: number
  8. followUpStatus?: boolean
  9. lockStatus?: boolean
  10. dealStatus?: boolean
  11. mobile: string
  12. telephone: string
  13. website: string
  14. qq: string
  15. wechat: string
  16. email: string
  17. description: string
  18. remark: string
  19. ownerUserId?: number
  20. ownerUserName?: string
  21. ownerUserDept?: string
  22. roUserIds?: string
  23. rwUserIds?: string
  24. areaId?: number
  25. areaName?: string
  26. detailAddress: string
  27. contactLastTime?: Date
  28. contactNextTime: Date
  29. createTime?: Date
  30. updateTime?: Date
  31. creator?: string
  32. creatorName?: string
  33. }
  34. // 查询客户列表
  35. export const getCustomerPage = async (params) => {
  36. return await request.get({ url: `/crm/customer/page`, params })
  37. }
  38. // 查询客户详情
  39. export const getCustomer = async (id: number) => {
  40. return await request.get({ url: `/crm/customer/get?id=` + id })
  41. }
  42. // 新增客户
  43. export const createCustomer = async (data: CustomerVO) => {
  44. return await request.post({ url: `/crm/customer/create`, data })
  45. }
  46. // 修改客户
  47. export const updateCustomer = async (data: CustomerVO) => {
  48. return await request.put({ url: `/crm/customer/update`, data })
  49. }
  50. // 删除客户
  51. export const deleteCustomer = async (id: number) => {
  52. return await request.delete({ url: `/crm/customer/delete?id=` + id })
  53. }
  54. // 导出客户 Excel
  55. export const exportCustomer = async (params: any) => {
  56. return await request.download({ url: `/crm/customer/export-excel`, params })
  57. }
  58. // 客户列表
  59. export const queryAllList = async () => {
  60. return await request.get({ url: `/crm/customer/query-all-list` })
  61. }
  62. // 查询客户操作日志
  63. export const getOperateLogPage = async (id: number) => {
  64. return await request.get({ url: '/crm/customer/operate-log-page?id=' + id })
  65. }
  66. // ======================= 业务操作 =======================
  67. // 锁定/解锁客户
  68. export const lockCustomer = async (id: number, lockStatus: boolean) => {
  69. return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
  70. }
  71. // TODO @puhui999:方法名,改成和后端一致哈
  72. // 领取公海客户
  73. export const receive = async (ids: any[]) => {
  74. return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } })
  75. }
  76. // 客户放入公海
  77. export const putPool = async (id: number) => {
  78. return await request.put({ url: `/crm/customer/put-pool?id=${id}` })
  79. }