LeftCard.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <el-card class="left-card">
  3. <!-- 顶部标签页 -->
  4. <el-tabs v-model="activeTab" class="main-tabs">
  5. <el-tab-pane label="肠内营养" name="nutrition">
  6. <div class="content-wrapper">
  7. <!-- 日期和操作栏 -->
  8. <div class="operation-bar">
  9. <!-- 日期选择 -->
  10. <el-row>
  11. <el-col :span="10">
  12. <span class="label">日期时间:</span>
  13. <el-date-picker v-model="dateRange" type="date" placeholder="请选择" />
  14. </el-col>
  15. <el-col class="right_btn" :span="7">
  16. <!-- <el-button type="primary" plain>打印知情同意书</el-button> -->
  17. <el-button type="success" @click="goHistoryPrescription">历史处方</el-button>
  18. </el-col>
  19. </el-row>
  20. <!-- 添加按钮组 -->
  21. <div class="add-buttons">
  22. <el-button :class="['add-btn', {'is-active': prescriptionType === 'normal'}]"
  23. @click="addPrescription">添加配置处方</el-button>
  24. <el-button :class="['add-btn', {'is-active': prescriptionType === 'package'}]"
  25. @click="addTemplate">添加预包装处方</el-button>
  26. <el-button :class="['add-btn', {'is-active': prescriptionType === 'long-term'}]"
  27. @click="addLongTerm">添加长期医嘱处方</el-button>
  28. </div>
  29. <!-- 开方原因 -->
  30. <div class="prescription-reason">
  31. <span class="reason-label">开方原因:</span>
  32. <span class="reason-value">1111</span>
  33. </div>
  34. </div>
  35. <!-- 处方提示信息 -->
  36. <div class="prescription-info">
  37. <div class="warning-box">
  38. 当前处方中的脂肪、维生素A、维生素D、维生素E、维生素B1、维生素B2、维生素B6、维生素B12、硒(尼克黄)、维生素C、生物素、泛酸元素可能过量
  39. </div>
  40. </div>
  41. <!-- 处方表格 -->
  42. <div class="prescription-tables">
  43. <template v-if="tableType === 'normal'">
  44. <ConfigureTable @change="updateConfigureData"/>
  45. <MaterialTable v-model="configData"/>
  46. </template>
  47. <template v-else-if="tableType === 'package'">
  48. <PackageTable/>
  49. </template>
  50. <template v-else>
  51. <NutritionTable/>
  52. <MaterialTable/>
  53. </template>
  54. </div>
  55. </div>
  56. </el-tab-pane>
  57. <el-tab-pane label="膳食治疗" name="therapy">
  58. <!-- 膳食治疗内容 -->
  59. </el-tab-pane>
  60. </el-tabs>
  61. </el-card>
  62. </template>
  63. <script setup lang="ts">
  64. import {ref} from 'vue';
  65. import NutritionTable from './table/NutritionTable.vue';
  66. import MaterialTable from './table/MaterialTable.vue';
  67. import PackageTable from './table/PackageTable.vue';
  68. import ConfigureTable from './table/ConfigureTable.vue';
  69. import { listEnteralNutrition, getEnteralNutrition, delEnteralNutrition, addEnteralNutrition, updateEnteralNutrition } from '@/api/patients/nutrition';
  70. import { EnteralNutritionVO, EnteralNutritionQuery, EnteralNutritionForm } from '@/api/patients/nutrition/types';
  71. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  72. const emit = defineEmits(['gotoTop']);
  73. // 顶部tab切换
  74. const activeTab = ref('nutrition');
  75. const configData= ref('');
  76. // 表格类型
  77. const tableType = ref<'normal' | 'package' | 'long-term'>('normal');
  78. // 日期范围
  79. const dateRange = ref([]);
  80. // 处方类型
  81. const prescriptionType = ref<'normal' | 'package' | 'long-term'>('normal');
  82. const updateConfigureData = (val:string) => {
  83. configData.value=val;
  84. };
  85. // 添加配置处方
  86. const addPrescription = () => {
  87. prescriptionType.value = 'normal';
  88. tableType.value = 'normal';
  89. };
  90. // 添加预包装处方
  91. const addTemplate = () => {
  92. prescriptionType.value = 'package';
  93. tableType.value = 'package';
  94. };
  95. // 添加长期医嘱处方
  96. const addLongTerm = () => {
  97. prescriptionType.value = 'long-term';
  98. tableType.value = 'long-term';
  99. };
  100. // 跳转历史处方页面
  101. const goHistoryPrescription = () => {
  102. emit('gotoTop')
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. .left-card {
  107. flex: 1;
  108. position: relative;
  109. .main-tabs {
  110. :deep(.el-tabs__header) {
  111. margin-bottom: 20px;
  112. }
  113. :deep(.el-tabs__nav) {
  114. .el-tabs__item {
  115. font-size: 15px;
  116. padding: 0 30px;
  117. height: 40px;
  118. line-height: 40px;
  119. }
  120. }
  121. }
  122. .operation-bar {
  123. margin-bottom: 16px;
  124. .right_btn {
  125. margin-left: 268px;
  126. }
  127. .add-buttons {
  128. display: flex;
  129. gap: 12px;
  130. margin-top: 30px;
  131. margin-bottom: 12px;
  132. .add-btn {
  133. min-width: 120px;
  134. background-color: #fff;
  135. border: 1px solid #dcdfe6;
  136. color: #606266;
  137. transition: all 0.3s;
  138. &.is-active {
  139. background-color: var(--el-color-primary);
  140. border-color: var(--el-color-primary);
  141. color: #fff;
  142. }
  143. &:hover:not(.is-active) {
  144. border-color: var(--el-color-primary);
  145. color: var(--el-color-primary);
  146. }
  147. }
  148. }
  149. .prescription-reason {
  150. display: flex;
  151. align-items: center;
  152. gap: 8px;
  153. color: #f56c6c;
  154. font-size: 14px;
  155. .reason-label {
  156. color: #606266;
  157. }
  158. .reason-value {
  159. color: #f56c6c;
  160. }
  161. }
  162. }
  163. .prescription-info {
  164. margin-bottom: 16px;
  165. .warning-box {
  166. padding: 8px 16px;
  167. background: #fff7e6;
  168. border: 1px solid #ffd591;
  169. border-radius: 4px;
  170. color: #fa8c16;
  171. border: 1px solid #fa8c16;
  172. font-size: 12px;
  173. line-height: 1.5;
  174. }
  175. }
  176. .prescription-tables {
  177. display: flex;
  178. flex-direction: column;
  179. gap: 20px;
  180. margin-bottom: 16px;
  181. }
  182. }
  183. </style>