insurance.ts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { ApiInstance } from '../type'
  2. export interface SearchInsurance {
  3. pages: number,
  4. size: number,
  5. username?: string,
  6. insCompanyId?: string,
  7. quoteStatus?: string, // 0:启用 1:禁用
  8. useStatus?: string, // 0 正常 1 不可用 2 未知
  9. userDept?: string
  10. }
  11. interface FieldsItem {
  12. type: string,
  13. field: string,
  14. label: string,
  15. value: string,
  16. isEdit: boolean
  17. }
  18. export interface AddAgreementAttribution {
  19. insCompanyId: string,
  20. userDept: string,
  21. loginUrl: string,
  22. username: string,
  23. password: string,
  24. fields: FieldsItem[],
  25. userAbbr?: string,
  26. }
  27. export interface UpdateAgreementAttribution extends AddAgreementAttribution {
  28. id: string
  29. }
  30. const insuranceApi = (axiosInstance: ApiInstance) => ({
  31. getAgreementAttributionList: (data: SearchInsurance) => axiosInstance.post('/manager/attribution/getAgreementAttributionList', data), // 列表查询
  32. leftList: (data: any) => axiosInstance.get(`/esmInsCompany/gainTopList?type=${data}&&systemCode=${localStorage.getItem('login_system')}`), //获取顶级保险公司
  33. getDeptTree: (data: { sysCode: string }) => axiosInstance.post('/dept/getDeptTree', data), // 归属
  34. addAgreementAttribution: (data: AddAgreementAttribution) => axiosInstance.post('/manager/attribution/addAgreementAttribution', data), // 新增
  35. getPtlInsAttributionTemplate: (data: { insCompanyId: string, apiType: string }) => axiosInstance.post('/manager/attributionTemplate/getPtlInsAttributionTemplate', data), // 配置
  36. getLoginUrl: (data: { companyId: string }) => axiosInstance.post('/manager/attribution/getLoginUrl', data), // 登录地址
  37. getAgreementAttribution: (data: { id: string }) => axiosInstance.post('/manager/attribution/getAgreementAttribution', data), // 详情
  38. updateAgreementAttribution: (data: any) => axiosInstance.post('/manager/attribution/updateAgreementAttribution', data), // 编辑
  39. enableAgreementAttribution: (data: { ids: string[] }) => axiosInstance.post('/manager/attribution/enableAgreementAttribution', data), // 启用
  40. disableAgreementAttribution: (data: { ids: string[] }) => axiosInstance.post('/manager/attribution/disableAgreementAttribution', data), // 禁用
  41. deleteAgreementAttribution: (data: { ids: string[] }) => axiosInstance.post('/manager/attribution/deleteAgreementAttribution', data), // 删除
  42. deptTree: (data: { id: string, deptName?: string }) => axiosInstance.get(`/manager/attribution/deptTree?id=${data.id}&deptName=${data.deptName}`), // 授权tree
  43. authorization: (data: { id: string, deptIds: string[] }) => axiosInstance.post('/manager/attribution/authorization', data),
  44. detectLogin: (data: any) => axiosInstance.post('/unify/order/detectLogin', data)
  45. })
  46. export default insuranceApi