LeftCard.vue 5.4 KB

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