index.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import request from '@/config/axios'
  2. import { TransferReqVO } from '@/api/crm/customer'
  3. export interface ContractVO {
  4. id: number
  5. name: string
  6. no: string
  7. customerId: number
  8. customerName?: string
  9. businessId: number
  10. businessName: string
  11. contactLastTime: Date
  12. ownerUserId: number
  13. ownerUserName?: string
  14. ownerUserDeptName?: string
  15. processInstanceId: number
  16. auditStatus: number
  17. orderDate: Date
  18. startTime: Date
  19. endTime: Date
  20. totalProductPrice: number
  21. discountPercent: number
  22. totalPrice: number
  23. signContactId: number
  24. signContactName?: string
  25. signUserId: number
  26. signUserName: string
  27. remark: string
  28. createTime?: Date
  29. creator: string
  30. creatorName: string
  31. updateTime?: Date
  32. products?: [
  33. {
  34. id: number
  35. productId: number
  36. productName: string
  37. productNo: string
  38. productUnit: number
  39. productPrice: number
  40. contractPrice: number
  41. count: number
  42. totalPrice: number
  43. }
  44. ]
  45. }
  46. // 查询 CRM 合同列表
  47. export const getContractPage = async (params) => {
  48. return await request.get({ url: `/crm/contract/page`, params })
  49. }
  50. // 查询 CRM 联系人列表,基于指定客户
  51. export const getContractPageByCustomer = async (params: any) => {
  52. return await request.get({ url: `/crm/contract/page-by-customer`, params })
  53. }
  54. // 查询 CRM 联系人列表,基于指定商机
  55. export const getContractPageByBusiness = async (params: any) => {
  56. return await request.get({ url: `/crm/contract/page-by-business`, params })
  57. }
  58. // 查询 CRM 合同详情
  59. export const getContract = async (id: number) => {
  60. return await request.get({ url: `/crm/contract/get?id=` + id })
  61. }
  62. // 查询 CRM 合同下拉列表
  63. export const getCrmContractSimpleListByCustomerId = async (customerId: number) => {
  64. return await request.get({
  65. url: `/crm/contract/list-all-simple-by-customer?customerId=${customerId}`
  66. })
  67. }
  68. // 新增 CRM 合同
  69. export const createContract = async (data: ContractVO) => {
  70. return await request.post({ url: `/crm/contract/create`, data })
  71. }
  72. // 修改 CRM 合同
  73. export const updateContract = async (data: ContractVO) => {
  74. return await request.put({ url: `/crm/contract/update`, data })
  75. }
  76. // 删除 CRM 合同
  77. export const deleteContract = async (id: number) => {
  78. return await request.delete({ url: `/crm/contract/delete?id=` + id })
  79. }
  80. // 导出 CRM 合同 Excel
  81. export const exportContract = async (params) => {
  82. return await request.download({ url: `/crm/contract/export-excel`, params })
  83. }
  84. // 提交审核
  85. export const submitContract = async (id: number) => {
  86. return await request.put({ url: `/crm/contract/submit?id=${id}` })
  87. }
  88. // 合同转移
  89. export const transferContract = async (data: TransferReqVO) => {
  90. return await request.put({ url: '/crm/contract/transfer', data })
  91. }
  92. // 获得待审核合同数量
  93. export const getAuditContractCount = async () => {
  94. return await request.get({ url: '/crm/contract/audit-count' })
  95. }
  96. // 获得即将到期(提醒)的合同数量
  97. export const getRemindContractCount = async () => {
  98. return await request.get({ url: '/crm/contract/remind-count' })
  99. }