schemeDetail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <template v-if="option.type == schemeTypeEnum['服务告知']">
  3. <announcementsVue
  4. :content="content"
  5. :date="option.date"
  6. :index="option.index"
  7. ></announcementsVue>
  8. </template>
  9. <template v-if="option.type == schemeTypeEnum['注意事项']">
  10. <announcements-vue
  11. :content="content"
  12. :date="option.date"
  13. :index="option.index"
  14. ></announcements-vue>
  15. </template>
  16. <template v-if="option.type == schemeTypeEnum['复诊提醒']">
  17. <return-visit-vue
  18. :content="content"
  19. :date="option.date"
  20. :index="option.index"
  21. ></return-visit-vue>
  22. </template>
  23. <template v-if="option.type == schemeTypeEnum['宣教']">
  24. <health-education-vue
  25. :content="content"
  26. :date="option.date"
  27. :index="option.index"
  28. ></health-education-vue>
  29. </template>
  30. <template v-if="option.type == schemeTypeEnum['问卷']">
  31. <questionnaire-vue
  32. :content="content"
  33. :date="option.date"
  34. :index="option.index"
  35. ></questionnaire-vue>
  36. </template>
  37. </template>
  38. <script lang="ts" setup>
  39. import { getCurrentInstance, nextTick, reactive, ref, computed } from 'vue';
  40. import { useStore } from 'vuex';
  41. import { useOnLoad } from '@/hook';
  42. import { schemeTypeEnum } from '../../static/schemeDetail';
  43. import AnnouncementsVue from './template/announcements.vue';
  44. import HealthEducationVue from './template/health-education.vue';
  45. import QuestionnaireVue from './template/questionnaire.vue';
  46. import ReturnVisitVue from './template/return-visit.vue';
  47. import { GetPatientGroupPlanDetailList, GetPatientGroupPlanDetail } from '../../service';
  48. defineOptions({
  49. components: {
  50. AnnouncementsVue,
  51. HealthEducationVue,
  52. QuestionnaireVue,
  53. ReturnVisitVue,
  54. },
  55. });
  56. const option = reactive({
  57. type: '',
  58. planuuid: '',
  59. id: '',
  60. memberName: '',
  61. date: '',
  62. index: '',
  63. });
  64. const content = ref([]);
  65. /** 查询患者组内执行计划详情列表 */
  66. const getPatientGroupPlanDetailList = async () => {
  67. const params = {
  68. PlanUuid: option.planuuid,
  69. TempType: option.type,
  70. };
  71. const resp = await GetPatientGroupPlanDetailList(params);
  72. content.value = resp;
  73. };
  74. /** 查询患者执行计划详情 */
  75. const getPatientGroupPlanDetail = async () => {
  76. const params = {
  77. Id: option.id,
  78. };
  79. const resp = await GetPatientGroupPlanDetail(params);
  80. content.value = resp;
  81. };
  82. useOnLoad((options: any) => {
  83. uni.setNavigationBarTitle({
  84. title: schemeTypeEnum[options.type],
  85. });
  86. Object.keys(options).map((key) => {
  87. option[key] = options[key];
  88. });
  89. if ([schemeTypeEnum['宣教'], schemeTypeEnum['问卷']].includes(option.type)) {
  90. getPatientGroupPlanDetail();
  91. } else {
  92. getPatientGroupPlanDetailList();
  93. }
  94. });
  95. </script>
  96. <style lang="scss" scoped></style>