index.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. mobile: string
  11. telephone: string
  12. website: string
  13. qq: string
  14. wechat: string
  15. email: string
  16. description: string
  17. remark: string
  18. ownerUserId: number
  19. roUserIds: string
  20. rwUserIds: string
  21. areaId: number
  22. detailAddress: string
  23. contactLastTime: Date
  24. contactNextTime: Date
  25. }
  26. // 查询客户列表
  27. export const getCustomerPage = async (params) => {
  28. return await request.get({ url: `/crm/customer/page`, params })
  29. }
  30. // 查询客户详情
  31. export const getCustomer = async (id: number) => {
  32. return await request.get({ url: `/crm/customer/get?id=` + id })
  33. }
  34. // 新增客户
  35. export const createCustomer = async (data: CustomerVO) => {
  36. return await request.post({ url: `/crm/customer/create`, data })
  37. }
  38. // 修改客户
  39. export const updateCustomer = async (data: CustomerVO) => {
  40. return await request.put({ url: `/crm/customer/update`, data })
  41. }
  42. // 删除客户
  43. export const deleteCustomer = async (id: number) => {
  44. return await request.delete({ url: `/crm/customer/delete?id=` + id })
  45. }
  46. // 导出客户 Excel
  47. export const exportCustomer = async (params) => {
  48. return await request.download({ url: `/crm/customer/export-excel`, params })
  49. }