index.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /** ================================= 客户资料 ================================**/
  2. import { getUserId } from '@/services/bus/account';
  3. import { BaseResponse, commonSearch_go, commonUpdate_go } from '@/services/go/index';
  4. import {
  5. AddUserInfoApplyReq,
  6. DeleteUserReq,
  7. ModifyUserInfoApplyReq,
  8. ModifyUserInfoReq,
  9. QueryCustomInfoType, UpdateUserAccountReq
  10. } from './interface';
  11. import { QueryCustomInfoEnum } from './type';
  12. /** ================================= 信息 客户资料 ================================**/
  13. /**
  14. * 查询客户资料
  15. * @param MemberUserID 所属机构用户ID
  16. * @param queryType 查询类型(1:未提交 2:待审核 3:正常 4:停用)
  17. * @returns
  18. */
  19. export function QueryCustomInfo(querytype: QueryCustomInfoEnum): Promise<QueryCustomInfoType[]> {
  20. const userid = getUserId()
  21. return commonSearch_go('/Qhj/QueryCustomerInfo', { userid, querytype }).catch((err) => {
  22. throw new Error(`查询客户资料: ${err}`);
  23. });
  24. }
  25. /**
  26. * 新增客户申请
  27. * @param userInfoApply
  28. * @constructor
  29. */
  30. export function QueryAddUserInfoApply(userInfoApply: AddUserInfoApplyReq): Promise<BaseResponse> {
  31. return commonUpdate_go('/Erms3/AddUserInfoApply', userInfoApply).catch((err) => {
  32. throw new Error(`新增客户申请: ${err}`);
  33. });
  34. }
  35. /**
  36. * 修改客户申请 /Erms3/ModifyUserInfoApply
  37. * @param userInfoApply.userid: number;//用户ID(自增ID) (必填)
  38. * @param userInfoApply.userinfotype: number;//用户信息类型 - 1:个人 2:企业 (必填)
  39. * @param userInfoApply.username: string;//用户姓名 (必填)
  40. * @param userInfoApply.userstate: number;//开户状态 - 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过 (必填)
  41. * @param userInfoApply.customername: string;//客户名称(企业名称) (必填)
  42. * @constructor
  43. */
  44. export function QueryModifyUserInfoApply(userInfoApply: ModifyUserInfoApplyReq): Promise<BaseResponse> {
  45. return commonUpdate_go('/Erms3/ModifyUserInfoApply', userInfoApply).catch((err) => {
  46. throw new Error(`修改客户申请: ${err}`);
  47. });
  48. }
  49. /**
  50. * 撤回
  51. * @param req
  52. * @constructor
  53. */
  54. export function QueryModifyUserInfo(req: ModifyUserInfoReq): Promise<BaseResponse> {
  55. return commonUpdate_go('/Erms3/ModifyUserInfoApply', req).catch((err) => {
  56. throw new Error(`修改客户申请状态: ${err}`);
  57. });
  58. }
  59. /**
  60. * 删除客户申请
  61. * @constructor
  62. * @param req
  63. */
  64. export function QueryDeleteUserInfoApply(req: DeleteUserReq): Promise<string> {
  65. return commonSearch_go('/Erms3/DeleteUserInfoApply', req,)
  66. .then(() => 'ok')
  67. .catch((err) => {
  68. throw new Error(`删除客户申请: ${err}`);
  69. });
  70. }
  71. /**
  72. * 更新用户状态 /User/UpdateUserAccountStatus
  73. * @constructor
  74. * @param req
  75. */
  76. export function UpdateUserAccountStatus(req: UpdateUserAccountReq): Promise<BaseResponse> {
  77. return commonUpdate_go('/User/UpdateUserAccountStatus', req,).catch((err) => {
  78. throw new Error(`更新用户状态: ${err}`);
  79. });
  80. }