care.api.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. import type { List } from '@/model';
  2. import type { SupplierQuery, SupplierModel, SystemItemModel, SystemIteQuery, SystemCwModel ,OpenConditioningSchemeModel} from '@/model/care.model';
  3. import request from '@/request/alova';
  4. // 供应商搜索列表
  5. export function supplierMethod(page: number, size: number, query?: SupplierQuery) {
  6. return request.Post<List<SupplierModel>>('/fdhb-pc/conditioningManage/supplier/pageCpSupplier', query ?? {}, {
  7. hitSource: /plan$/, // 匹配失效源
  8. params: { pageNum: page, pageSize: size },
  9. });
  10. }
  11. // 新增和编辑供应商
  12. export function supplierEditMethod(data: Partial<SupplierModel>) {
  13. console.log(data, '新增和编辑供应商');
  14. return data?.id
  15. ? request.Post(`/fdhb-pc/conditioningManage/supplier/updateCpSupplier`, { ...data, id: data.id }, { name: 'edit-supplier' })
  16. : request.Post(`/fdhb-pc/conditioningManage/supplier/addCpSupplier`, { ...data }, { name: 'edit-supplier' });
  17. }
  18. // 删除供应商
  19. export function supplierDeleteMethod(data: Partial<SupplierModel>) {
  20. return request.Post(`/fdhb-pc/conditioningManage/supplier/deleteCpSupplier/${data.id}`, {
  21. name: 'update-supplier',
  22. cacheFor: null,
  23. });
  24. }
  25. //系统项目列表
  26. export function pageSystemCpMethod(page: number, size: number, query?: SystemIteQuery) {
  27. return request.Post<List<SystemItemModel>>('/fdhb-pc/conditioningManage/program/pageSystemCp', query ?? {}, {
  28. // hitSource: /plan$/, // 匹配失效源
  29. params: { pageNum: page, pageSize: size },
  30. });
  31. }
  32. // 获取所有的系统项目
  33. export function getAllSystemCpMethod() {
  34. return request.Post('/fdhb-pc/conditioningManage/program/getAllSystemCp', {}, {
  35. name: 'get-all-system-cp',
  36. cacheFor: null,
  37. });
  38. }
  39. // 新增和编辑系统项目和新增编辑项目列表
  40. export function systemCpEditMethod(data: Partial<SystemItemModel>) {
  41. console.log(data, '新增和编辑项目1111111111');
  42. if(data.addType === 'system'){
  43. return data?.id
  44. ? request.Post(`/fdhb-pc/conditioningManage/program/updateSystemCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
  45. : request.Post(`/fdhb-pc/conditioningManage/program/addSystemCp`, { ...data }, { name: 'edit-system-cp' });
  46. }else if(data.addType === 'itemsList'){
  47. return data?.id
  48. ? request.Post(`/fdhb-pc/conditioningManage/program/updateInstitutionCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
  49. : request.Post(`/fdhb-pc/conditioningManage/program/addInstitutionCp`, { ...data }, { name: 'edit-system-cp' });
  50. }
  51. }
  52. // 删除系统项目
  53. export function deleteSystemCpMethod(data: Partial<SystemItemModel>) {
  54. return request.Post(`/fdhb-pc/conditioningManage/program/deleteSystemCp/${data.id}`, {
  55. name: 'delete-system-cp',
  56. cacheFor: null,
  57. });
  58. }
  59. // 选择引入调理方案
  60. export function selectSystemCpMethod(data: Array<string>) {
  61. return request.Post(`/fdhb-pc/conditioningManage/program/copyCp`, [...data], {
  62. name: 'select-system-cp',
  63. cacheFor: null,
  64. });
  65. }
  66. // 机构待确认列表
  67. export function pageOrgConfirmMethod(page: number, size: number, query?: SystemIteQuery) {
  68. return request.Post<List<SystemItemModel>>('/fdhb-pc/conditioningManage/program/pageUnconfirmedCp', query ?? {}, {
  69. hitSource: /plan$/, // 匹配失效源
  70. params: { pageNum: page, pageSize: size },
  71. });
  72. }
  73. // 待确认列表删除
  74. export function deleteOrgConfirmMethod(data: Partial<SystemItemModel>) {
  75. return request.Post(`/fdhb-pc/conditioningManage/program/deleteUnconfirmedCp/${data.id}`, {
  76. name: 'delete-org-confirm',
  77. cacheFor: null,
  78. });
  79. }
  80. // 机构待确认列表确认
  81. export function confirmOrgConfirmMethod(data: Partial<SystemItemModel>) {
  82. return request.Post(
  83. `/fdhb-pc/conditioningManage/program/confirmedCp`,
  84. { ...data },
  85. {
  86. name: 'confirm-org-confirm',
  87. cacheFor: null,
  88. }
  89. );
  90. }
  91. // 已确认项目列表
  92. export function pageConfirmedCpMethod(page: number, size: number, query?: SystemIteQuery) {
  93. return request.Post('/fdhb-pc/conditioningManage/program/pageInstitutionCp', query ?? {}, {
  94. hitSource: /plan$/, // 匹配失效源
  95. params: { pageNum: page, pageSize: size },
  96. });
  97. }
  98. // 获取服务包内容里的列表
  99. export function getCpContentListMethod() {
  100. return request.Post(`/fdhb-pc/conditioningManage/program/getAllInstitutionCp`, {
  101. });
  102. }
  103. // 已确认项目列表删除
  104. export function deleteConfirmedCpMethod(data: Partial<SystemItemModel>) {
  105. return request.Post(`/fdhb-pc/conditioningManage/program/deleteInstitutionCp/${data.id}`, {
  106. name: 'delete-confirmed-cp',
  107. cacheFor: null,
  108. });
  109. }
  110. // 获取所有的供应商
  111. export function getAllSupplierMethod(data: Record<string, any>) {
  112. return request.Post(
  113. '/fdhb-pc/conditioningManage/supplier/getAllCpSupplier',
  114. { ...data },
  115. {
  116. name: 'get-all-supplier',
  117. cacheFor: null,
  118. }
  119. );
  120. }
  121. // 获取系统调理包列表
  122. export function getSystemCpListMethod(page: number, size: number, query?: SystemIteQuery) {
  123. return request.Post<List<SystemCwModel>>('/fdhb-pc/conditioningManage/wrap/pageSystemCw', query ?? {}, {
  124. hitSource: /plan$/, // 匹配失效源
  125. params: { pageNum: page, pageSize: size },
  126. name: 'get-system-cp-list',
  127. cacheFor: null,
  128. });
  129. }
  130. // 删除系统调理包
  131. export function deleteSystemCwMethod(data: Partial<SystemCwModel>) {
  132. return request.Post(`/fdhb-pc/conditioningManage/wrap/deleteSystemCw/${data.id}`, {
  133. name: 'delete-system-cw',
  134. cacheFor: null,
  135. });
  136. }
  137. // 新增和编辑系统调理包
  138. export function addSystemCwMethod(data: Partial<SystemCwModel>) {
  139. return data?.id
  140. ? request.Post(`/fdhb-pc/conditioningManage/wrap/updateSystemCw`, { ...data, id: data.id }, { name: 'edit-system-cw' })
  141. : request.Post(`/fdhb-pc/conditioningManage/wrap/addSystemCw`, { ...data }, { name: 'add-system-cw' });
  142. }
  143. // 获取系统调理包详情
  144. export function getSystemCwDetailMethod(data: Partial<SystemCwModel>) {
  145. return request.Post(`/fdhb-pc/conditioningManage/wrap/getCwDetailById/${data.id}`, {
  146. name: 'get-system-cw-detail',
  147. cacheFor: null,
  148. });
  149. }
  150. // 根据调理方案id获取调理方案详情
  151. export function getConditioningSchemeDetailMethod(data: Partial<SystemCwModel>) {
  152. return request.Post(`/fdhb-pc/conditioningManage/program/getCpDetailById/${data.id}`, {
  153. name: 'get-system-cw-detail',
  154. cacheFor: null,
  155. });
  156. }
  157. // 疾病分页查查询
  158. export function pageMedicineMethod(page: number, size: number, query?: Record<string, any>) {
  159. return request.Post(
  160. `/fdhb-pc/common/pageDiagnoseDisease`,
  161. { page, limit: size, keyWord: query?.keyword, ...query },
  162. {
  163. transform(data: any, headers) {
  164. return {
  165. data: data.records,
  166. total: data.total,
  167. };
  168. },
  169. }
  170. );
  171. }
  172. // 证型分页查询
  173. export function pageDiagnoseTypeMethod(page: number, size: number, query?: Record<string, any>) {
  174. return request.Post(
  175. `/fdhb-pc/common/pageDiagnoseSyndrome`,
  176. { page, limit: size, keyWord: query?.keyword, ...query },
  177. {
  178. transform(data: any, headers) {
  179. return {
  180. data: data.records,
  181. total: data.total,
  182. };
  183. },
  184. }
  185. );
  186. }
  187. // 症状分页查询
  188. export function pageDiagnoseSymptomMethod(page: number, size: number, query?: Record<string, any>) {
  189. return request.Post(
  190. `/fdhb-pc/common/pageDiagnoseSymptom`,
  191. { page, limit: size, keyWord: query?.keyword, ...query },
  192. {
  193. transform(data: any, headers) {
  194. return {
  195. data: data.records,
  196. total: data.total,
  197. };
  198. },
  199. }
  200. );
  201. }
  202. // 穴位分页查询
  203. export function pageAcupointMethod(page: number, size: number, query?: Record<string, any>) {
  204. return request.Post(
  205. `/fdhb-pc/common/pageAcuPoint`,
  206. { page, limit: size, keyWord: query?.keyword, ...query },
  207. {
  208. transform(data: any, headers) {
  209. return {
  210. data: data.records,
  211. total: data.total,
  212. };
  213. },
  214. }
  215. );
  216. }
  217. // 经络分页查询
  218. export function pageMeridianMethod(page: number, size: number, query?: Record<string, any>) {
  219. return request.Post(
  220. `/fdhb-pc/common/pageAcuMeridian`,
  221. { page, limit: size, keyWord: query?.keyword, ...query },
  222. {
  223. transform(data: any, headers) {
  224. return {
  225. data: data.records,
  226. total: data.total,
  227. };
  228. },
  229. }
  230. );
  231. }
  232. // 体质分页查询
  233. export function pagePhysicalTypeMethod(page: number, size: number, query?: Record<string, any>) {
  234. return request.Post(
  235. `/fdhb-pc/common/pagePhysicalType`,
  236. { page, limit: size, keyWord: query?.keyword, ...query },
  237. {
  238. transform(data: any, headers) {
  239. return {
  240. data: data.records,
  241. total: data.total,
  242. };
  243. },
  244. }
  245. );
  246. }
  247. // 机构调理包分页列表
  248. export function pageOrgCwMethod(page: number, size: number, query?: Record<string, any>) {
  249. return request.Post<List<SupplierModel>>('/fdhb-pc/conditioningManage/wrap/pageInstitutionCw', query ?? {}, {
  250. hitSource: /plan$/, // 匹配失效源
  251. params: { pageNum: page, pageSize: size },
  252. });
  253. }
  254. // export function pageOrgCwMethod(page: number, size: number, query?: Record<string, any>) {
  255. // return request.Post<List<SupplierModel>>('/fdhb-pc/conditioningManage/wrap/pageInstitutionCw', query ?? {}, {
  256. // hitSource: /plan$/, // 匹配失效源
  257. // params: { pageNum: page, pageSize: size },
  258. // });
  259. // }
  260. // 新增机构调理包
  261. export function addOrgCwMethod(data: Partial<SystemCwModel>) {
  262. console.log(data, '新增机构调理包');
  263. return data?.id
  264. ? request.Post(`/fdhb-pc/conditioningManage/wrap/updateInstitutionCw`, { ...data, id: data.id }, { name: 'edit-org-cw' })
  265. : request.Post(`/fdhb-pc/conditioningManage/wrap/addInstitutionCw`, { ...data }, { name: 'add-org-cw' });
  266. }
  267. // 删除机构调理包
  268. export function deleteOrgCwMethod(data: Partial<SystemCwModel>) {
  269. return request.Post(`/fdhb-pc/conditioningManage/wrap/deleteInstitutionCw/${data.id}`, {
  270. name: 'delete-org-cw',
  271. cacheFor: null,
  272. });
  273. }
  274. // 为患者开具调理方案
  275. export function addConditioningSchemeMethod(data: Partial<OpenConditioningSchemeModel>) {
  276. return request.Post(`/fdhb-pc/patientCrManage/addPcr`, { ...data }, { name: 'add-conditioning-record' });
  277. }
  278. // 根据调理包id获取调理包详情
  279. export function getConditioningRecordDetailMethod(data: Partial<SystemCwModel>) {
  280. console.log('获取调理包详情',data);
  281. if(data.types === 'institution'){
  282. // 机构调理包详情
  283. return request.Post(`/fdhb-pc/conditioningManage/wrap/getCwDetailById/${data.id}`, {
  284. name: 'get-conditioning-record-detail',
  285. cacheFor: null,
  286. });
  287. }else if(data.types === 'record'){
  288. return request.Post(`/fdhb-pc/patientCrManage/getPcrDetailById/${data.id}`, {
  289. name: 'get-conditioning-record-detail',
  290. cacheFor: null,
  291. });
  292. }
  293. }
  294. // 获取患者列表
  295. export function getPatientListMethod( query?: Record<string, any>) {
  296. return request.Post<List<SystemCwModel>>('/fdhb-pc/patientCrManage/todayPcrs', query ?? {}, {
  297. hitSource: /plan$/, // 匹配失效源
  298. });
  299. }
  300. // 调理记录分页列表
  301. export function getConditioningRecordMethod(page: number, size: number, query?: Record<string, any>) {
  302. return request.Post<List<SystemCwModel>>('/fdhb-pc/patientCrManage/pagePcrs', query ?? {}, {
  303. hitSource: /plan$/, // 匹配失效源
  304. params: { pageNum: page, pageSize: size },
  305. });
  306. }
  307. // 根据调理方案id获取调理记录详情
  308. export function getCpDetailMethod(data: Partial<SystemCwModel>) {
  309. return request.Post(`/fdhb-pc/patientCrManage/getPcrDetailById/${data.id}`, {
  310. name: 'get-conditioning-record-detail',
  311. cacheFor: null,
  312. });
  313. }
  314. // 获取所有的机构服务包
  315. export function getAllOrgCwMethod(query?: Record<string, any>) {
  316. return request.Post('/fdhb-pc/conditioningManage/wrap/getAllInstitutionCw', query ?? {}, {
  317. name: 'get-all-org-cw',
  318. cacheFor: null,
  319. });
  320. }
  321. // 患者(已开具调理方案)调理记录列表
  322. export function getPatientConditioningRecordMethod(id: number) {
  323. return request.Post(`/fdhb-pc/patientCrManage/getPcrs/${id}`, {
  324. name: 'get-conditioning-record-detail',
  325. cacheFor: null,
  326. });
  327. }
  328. // 获取省市区
  329. export function getProvinceMethod() {
  330. return request.Get('/fdhb-pc/region/regionCascadeProvince', {
  331. name: 'get-province',
  332. cacheFor: null,
  333. });
  334. }
  335. // 获取市
  336. export function getCityMethod(name: string,provincecode: string) {
  337. return request.Get('/fdhb-pc/region/regionCascadeCity', {
  338. name: 'get-city',
  339. cacheFor: null,
  340. params: { name,provincecode },
  341. });
  342. }
  343. // 获取区
  344. export function getAreaMethod(name: string,citycode: string) {
  345. return request.Get('/fdhb-pc/region/regionCascadeArea', {
  346. name: 'get-area',
  347. cacheFor: null,
  348. params: { name,citycode },
  349. });
  350. }
  351. // 根据调理记录ID获取调理过程
  352. export function getConditioningProcessMethod(id: number) {
  353. return request.Post(`/fdhb-pc/patientCrManage/getPcrProcessById/${id}`, {
  354. name: 'get-conditioning-process',
  355. cacheFor: null,
  356. });
  357. }
  358. // 获取可用的服务包
  359. export function getAvailableCwMethod(patientId: string) {
  360. return request.Post('/fdhb-pc/patientCrManage/getPatUsableCw', { patientId }, {
  361. name: 'get-available-cw',
  362. cacheFor: null,
  363. });
  364. }