index.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 (params: any) => {
  64. return await request.get({ url: '/crm/customer/operate-log-page', params })
  65. }
  66. // 锁定/解锁客户
  67. export const lockCustomer = async (id: number, lockStatus: boolean) => {
  68. return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
  69. }