index.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import request from '@/config/axios'
  2. export interface ContactVO {
  3. name: string
  4. nextTime: Date
  5. mobile: string
  6. telephone: string
  7. email: string
  8. post: string
  9. customerId: number
  10. address: string
  11. remark: string
  12. ownerUserId: string
  13. lastTime: Date
  14. id: number
  15. parentId: number
  16. qq: number
  17. wechat: string
  18. sex: number
  19. master: boolean
  20. creatorName: string
  21. updateTime?: Date
  22. createTime?: Date
  23. customerName: string
  24. areaName: string
  25. ownerUserName: string
  26. }
  27. // 查询 CRM 联系人列表
  28. export const getContactPage = async (params) => {
  29. return await request.get({ url: `/crm/contact/page`, params })
  30. }
  31. // 查询 CRM 联系人列表,基于指定客户
  32. export const getContactPageByCustomer = async (params: any) => {
  33. return await request.get({ url: `/crm/contact/page-by-customer`, params })
  34. }
  35. // 查询 CRM 联系人详情
  36. export const getContact = async (id: number) => {
  37. return await request.get({ url: `/crm/contact/get?id=` + id })
  38. }
  39. // 新增 CRM 联系人
  40. export const createContact = async (data: ContactVO) => {
  41. return await request.post({ url: `/crm/contact/create`, data })
  42. }
  43. // 修改 CRM 联系人
  44. export const updateContact = async (data: ContactVO) => {
  45. return await request.put({ url: `/crm/contact/update`, data })
  46. }
  47. // 删除 CRM 联系人
  48. export const deleteContact = async (id: number) => {
  49. return await request.delete({ url: `/crm/contact/delete?id=` + id })
  50. }
  51. // 导出 CRM 联系人 Excel
  52. export const exportContact = async (params) => {
  53. return await request.download({ url: `/crm/contact/export-excel`, params })
  54. }
  55. // 获得 CRM 联系人列表(精简)
  56. export const getSimpleContactList = async () => {
  57. return await request.get({ url: `/crm/contact/simple-all-list` })
  58. }