index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. import { WardVO, WardForm, WardQuery } from '@/api/system/ward/types';
  4. /**
  5. * 查询病区管理列表
  6. * @param query
  7. * @returns {*}
  8. */
  9. export const listWard = (query?: WardQuery): AxiosPromise<WardVO[]> => {
  10. return request({
  11. url: '/system/ward/list',
  12. method: 'get',
  13. params: query
  14. });
  15. };
  16. /**
  17. * 查询病区管理详细
  18. * @param wardId
  19. */
  20. export const getWard = (wardId: string | number): AxiosPromise<WardVO> => {
  21. return request({
  22. url: '/system/ward/' + wardId,
  23. method: 'get'
  24. });
  25. };
  26. export const listUsed = (): AxiosPromise<WardVO> => {
  27. return request({
  28. url: '/system//ward/listUsed',
  29. method: 'get'
  30. });
  31. };
  32. /**
  33. * 新增病区管理
  34. * @param data
  35. */
  36. export const addWard = (data: WardForm) => {
  37. return request({
  38. url: '/system/ward',
  39. method: 'post',
  40. data: data
  41. });
  42. };
  43. /**
  44. * 修改病区管理
  45. * @param data
  46. */
  47. export const updateWard = (data: WardForm) => {
  48. return request({
  49. url: '/system/ward',
  50. method: 'put',
  51. data: data
  52. });
  53. };
  54. /**
  55. * 删除病区管理
  56. * @param wardId
  57. */
  58. export const delWard = (wardId: string | number | Array<string | number>) => {
  59. return request({
  60. url: '/system/ward/' + wardId,
  61. method: 'delete'
  62. });
  63. };