city.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import request from '@/utils/request.js'
  2. // 获取省 数据
  3. export function getProver() {
  4. return request({
  5. url: '/area/getProver',
  6. method: 'get'
  7. })
  8. };
  9. // 获取市 区数据
  10. export function getArea(data) {
  11. return request({
  12. url: `/area/getChildren/${data}`,
  13. method: 'get'
  14. })
  15. };
  16. // 获取 选择器类型信息
  17. export function getSelectType(data) {
  18. return request({
  19. url: `/basis/parameterconfigMgr/customerQuery/${data}`,
  20. method: 'post'
  21. })
  22. };
  23. /**
  24. * 获取药房详细信息
  25. * @deprecated {@link @/api/business.js#getPharmacyMsg}
  26. */
  27. export function getPharmacyMsg(data) {
  28. return request({
  29. url: `/basis/pharmacyMgr/${data}`,
  30. method: 'get',
  31. })
  32. };
  33. // 医共体选择器数据
  34. export function doctorBodySelect() {
  35. return request({
  36. url: '/test/outpatient/organizationCustomerQuery',
  37. method: 'post'
  38. })
  39. };
  40. // 选择医疗机构
  41. export function medicalInstitution(data) {
  42. return request({
  43. url: '/test/outpatient/stitutionsCustomerQuery?organizationId=' + data.organizationId,
  44. method: 'post',
  45. data
  46. })
  47. };
  48. // 开方医生选择器
  49. export function getDoctorSelect(data) {
  50. return request({
  51. url: '/test/outpatient/userCustomerQuery?stitutionsId=' + data.stitutionsId,
  52. method: 'post',
  53. data
  54. })
  55. };
  56. // 获取患者地址信息
  57. export function getPatAddress(data) {
  58. return request({
  59. url: '/test/outpatient/historyDistribution?patId=' + data.patId,
  60. method: 'get',
  61. data
  62. })
  63. };
  64. let _hospitalCategoryAndDepartment_ = null;
  65. async function getHospitalCategoryAndDepartment() {
  66. if (_hospitalCategoryAndDepartment_) { return _hospitalCategoryAndDepartment_; }
  67. try {
  68. const res = await request({
  69. url: '/basis/prescriptionMgr/getPreSectInfo',
  70. method: 'get',
  71. data: {},
  72. });
  73. _hospitalCategoryAndDepartment_ = res && res.ResultCode === 0 ? res.Data : {};
  74. } catch (error) { _hospitalCategoryAndDepartment_ = {}; }
  75. return _hospitalCategoryAndDepartment_;
  76. }
  77. export async function getHospitalCategory() {
  78. _hospitalCategoryAndDepartment_ = null;
  79. const data = await getHospitalCategoryAndDepartment();
  80. return Object.keys(data).filter(Boolean).map(name => ({id: name, name}));
  81. }
  82. export async function getHospitalDepartment(params) {
  83. const data = (await getHospitalCategoryAndDepartment())[params.hospital || ''] || []
  84. return data.filter(Boolean).map(name => ({id: name, name}));
  85. }