hospList.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * @Author: your name
  3. * @Date: 2022-01-13 09:15:59
  4. * @LastEditTime: 2023-03-06 13:47:16
  5. * @LastEditors: code4eat awesomedema@gmail.com
  6. * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  7. * @FilePath: /KC-MiddlePlatform/src/service/hospList.ts
  8. */
  9. import { Key } from 'react';
  10. import { request } from 'umi';
  11. //获取当前登陆院区以及互通的院区列表
  12. export const getShareHospList = async () => {
  13. return request<
  14. {
  15. id: number;
  16. name: string;
  17. }[]
  18. >('/centerSys/hospital/currentAndShareHosp', {
  19. method: 'GET',
  20. });
  21. };
  22. //获取所有院区
  23. export const getHospList = async () => {
  24. return request<
  25. {
  26. id: number;
  27. name: string;
  28. }[]
  29. >('/centerSys/hospital/getAllMainList', {
  30. method: 'GET',
  31. });
  32. };
  33. //获取主院
  34. export const getMainHosp = async () => {
  35. return request<{
  36. id: number;
  37. name: string;
  38. }[]>('/centerSys/hospital/getMainList', {
  39. method: 'GET',
  40. });
  41. };
  42. export type HospTableItem = {
  43. id: number;
  44. hospName: string;
  45. hospSign: string;
  46. hospAbbreviation: string;
  47. mainHospId: number;
  48. mainHospName: string;
  49. updateTime: string;
  50. systemName: string;
  51. dataShare: string;
  52. };
  53. //获取医院列表
  54. export const getAllHosp = async (params?: {
  55. current: number;
  56. pageSize: number;
  57. hospitalName?: string;
  58. }) => {
  59. return request<{
  60. current: number;
  61. pageSize: number;
  62. totalCount: number;
  63. totalPage: number;
  64. list?: HospTableItem[];
  65. }>('/centerSys/hospital/list', {
  66. method: 'GET',
  67. params: params,
  68. });
  69. };
  70. export type AddHospDataType = {
  71. hospAbbreviation: string; //医院简称
  72. hospName: string;
  73. hospSign: string;
  74. isDataShare: number; //是否数据共享,0.默认,不共享,1.共享数据
  75. mainHospId: number;
  76. mainHospName: string;
  77. systemName: string;
  78. };
  79. //添加院区
  80. export const addHosp = async (data: AddHospDataType) => {
  81. return request('/centerSys/hospital/addHospital', {
  82. method: 'POST',
  83. data: data,
  84. });
  85. };
  86. //院区管理删除院区
  87. export const delHosp = async (data: number[]) => {
  88. return request('/centerSys/hospital/deleteHosp', {
  89. method: 'POST',
  90. data: data,
  91. });
  92. };
  93. //院区管理编辑院区
  94. export type EditHospType = {
  95. id: number;
  96. hospAbbreviation: string;
  97. hospName: string;
  98. hospSign: string;
  99. isDataShare: string;
  100. systemName: string;
  101. };
  102. export const editHosp = async (data: EditHospType) => {
  103. return request('/centerSys/hospital/editHosp', {
  104. method: 'POST',
  105. data: data,
  106. });
  107. };
  108. //院区绑定菜单
  109. export const hospBindMenu = async (data: { hospId: number; menuIds: string[] }) => {
  110. return request('/centerSys/hospital/addHospMenu', {
  111. method: 'POST',
  112. data: data,
  113. });
  114. };
  115. export type YoushuAccountsType = {
  116. id: number;
  117. userName: string;
  118. account: string;
  119. password: string;
  120. isDefault: number; //是否默认0,非默认,1.默认
  121. };
  122. export type GetHospYoushuAccountsType = {
  123. reportUrl: string;
  124. reportId: string;
  125. youshuUsers: YoushuAccountsType[];
  126. };
  127. export const getHospYoushuAccounts = async (data: { hospId: number }) => {
  128. return request<GetHospYoushuAccountsType>('/centerSys/hospital/getHospReport', {
  129. method: 'GET',
  130. params: data,
  131. });
  132. };
  133. export type YoushuUserSaveDTOs = {
  134. userName: string;
  135. account: string;
  136. password: string;
  137. };
  138. export type HospBindYoushuAccountReqBodyType = {
  139. hospId: number;
  140. reportId: number;
  141. reportUrl: string;
  142. userId: number;
  143. youshuUserSaveDTOs: YoushuUserSaveDTOs[];
  144. };
  145. export const hospBindYoushuAccount = async (data: HospBindYoushuAccountReqBodyType) => {
  146. return request('/centerSys/hospital/saveHospReport', {
  147. method: 'POST',
  148. data: data,
  149. });
  150. };
  151. //院区初始化
  152. export const hospInit = async (hospId:Key) => {
  153. return request('/centerSys/role/init', {
  154. method: 'POST',
  155. params:{hospId},
  156. });
  157. };