operation.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import { ApiInstance } from '../type'
  2. import {LocationQueryValue} from "vue-router";
  3. // 新增
  4. export interface AddOperation {
  5. typeAttr: string,
  6. deptId: string,
  7. name: string,
  8. mobile: string,
  9. identity: string,
  10. identityTimeStart: string,
  11. identityTimeEnd: string,
  12. leaderId: string,
  13. referrerId: string,
  14. sex?: string,
  15. birthday?: string,
  16. nations?: string,
  17. koseki?: string,
  18. maritalStatus?: string,
  19. politicsStatus?: string,
  20. health?: string,
  21. province?: string,
  22. city?: string,
  23. district?: string,
  24. liveAddress?: string,
  25. postalCode?: string,
  26. education?: string,
  27. graduationTime?: string,
  28. school?: string,
  29. isComputer?: string,
  30. emergencyContactName?: string,
  31. emergencyContactTel?: string,
  32. salary?: string,
  33. salaryLevel?: string,
  34. bankCardId?: string,
  35. bankName?: string,
  36. sfz1?: string,
  37. sfz2?: string,
  38. qualification?: string,
  39. contract?: string,
  40. applicant?: string,
  41. salaryTable?: string,
  42. leaveTable?: string
  43. }
  44. // 列表
  45. export interface OperationSearch {
  46. pages: number,
  47. size: number,
  48. salesman?: string,
  49. organizationName?: string,
  50. deptId?: string,
  51. typeAttr?: string,
  52. deptName?: string,
  53. status?: number,
  54. isEnable?: string,
  55. leaderId?: string
  56. }
  57. // 银行卡
  58. export interface AddBankCard {
  59. userJzgInfoId: string,
  60. bankCardNumber: string,
  61. bankName: string,
  62. bankAddress: string,
  63. attachment?: string
  64. }
  65. // 启用/禁用
  66. export interface OperationIsEnable {
  67. ids: string[],
  68. isEnable: number,
  69. getAll: number
  70. }
  71. export interface OperationEdit extends AddOperation {
  72. id: string
  73. }
  74. // 业务员管理相关接口
  75. const operationApi = (axiosInstance: ApiInstance) => ({
  76. addOperation: (data: AddOperation) => axiosInstance.post('/userInfo/add', data), // 新赠
  77. updateOperation: (data: any) => axiosInstance.post('/userInfo/update', data), //编辑
  78. operationList: (data: OperationSearch) => axiosInstance.post('/userInfo/getUserInfoList', data), // 列表
  79. operationDelete: (data: {
  80. ids: string[],
  81. getAll: number
  82. }) => axiosInstance.post('/userInfo/delete', data), // 删除
  83. operationIsEnable: (data: OperationIsEnable) => axiosInstance.post('/userInfo/isEnable', data), // 启用/禁用
  84. operationDetail: (data: string | null | LocationQueryValue[] | undefined) => axiosInstance.get(`/userInfo/getUserInfo?id=${data}`), // 详情
  85. setLeader: (data: {
  86. ids: string[],
  87. leaderId: string,
  88. getAll: number
  89. }) => axiosInstance.post('/userInfo/batchLeader', data), // 设置负责人
  90. getUser: (data: string) => axiosInstance.post('/userInfo/getUser', { deptId: data }), // 获取管理人/推荐人
  91. addBankCard: (data: AddBankCard) => axiosInstance.post('/userInfo/addBankCard', data), // 添加银行卡
  92. salesmanAuthSuccess: (data: { userInfoId: string }) => axiosInstance.post('/userInfo/salesmanAuthSuccess', data), // 审核通过
  93. salesmanAuthFailed: (data: {
  94. userInfoId: string,
  95. approvalOpinion: string
  96. }) => axiosInstance.post('/userInfo/salesmanAuthFailed', data), // 审核不通过
  97. })
  98. export default operationApi