index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="p-2">
  3. <el-container class="layout-container-demo" style="height: 100vh; min-height: 100vh;">
  4. <el-aside id="leftPanel"
  5. style="background:transparent; width: 370px;flex: 0 0 auto; border-right: 2px solid #e4e7ed;">
  6. <el-form ref="queryFormRef" :model="queryParams" :inline="true">
  7. <el-form-item label="开方日期" id="dateRangeEl">
  8. <el-date-picker v-model="queryParams.screeningTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
  9. range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
  10. :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]">
  11. </el-date-picker>
  12. </el-form-item>
  13. <el-form-item id="doctorNameEl">
  14. <el-input v-model="queryParams.patientNo" placeholder="医生姓名" clearable />
  15. </el-form-item>
  16. <el-form-item id="buttonEl">
  17. <el-button type="primary" @click="handleQuery">搜索</el-button>
  18. <el-button @click="resetQuery">重置</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </el-aside>
  22. <el-container>
  23. <el-main style="padding-left: 20px;">
  24. <div>
  25. <el-table v-loading="loading" border :data="dataList">
  26. <el-table-column label="时间" align="center" prop="screeningTime" />
  27. <el-table-column label="看诊类型" align="center" prop="visitType" />
  28. <el-table-column label="门诊/住院号" align="center" prop="patientNo" />
  29. <el-table-column label="营养筛查类型" align="center" prop="configName" />
  30. <el-table-column label="营养筛查分数" align="center" prop="screeningScore" />
  31. </el-table>
  32. <!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  33. v-model:limit="queryParams.pageSize" @pagination="getList" /> -->
  34. </div>
  35. <div>
  36. <div class="p-2">
  37. <el-menu class="el-menu-demo" mode="horizontal" @select="handleMenumSelect"
  38. :default-active="currentIndex">
  39. <el-menu-item index="1">三大营养素分析</el-menu-item>
  40. <el-menu-item index="2">营养数据分析</el-menu-item>
  41. </el-menu>
  42. </div>
  43. <el-row :gutter="10" class="mb8" v-show="leftIndex == currentIndex" style="margin: 0px;">
  44. <el-col :span="13">
  45. <div style="margin-top: 20px;margin-bottom: 20px;">医嘱总热量/天:--</div>
  46. <div>
  47. <el-table border stripe :data="leftList">
  48. <el-table-column label="元素名称" align="center" prop="nutrientName" />
  49. <el-table-column label="单位" align="center" prop="nutrientQuantity">
  50. <template #default="scope">
  51. {{ scope.row.nutrientQuantity.toFixed(4) }}
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="肠外营养含量/天" align="center" prop="nutrientRefVal" />
  55. <el-table-column label="热量占比" align="center" prop="nutrientRatio" />
  56. </el-table>
  57. </div>
  58. <div style="margin-top: 20px;margin-bottom: 20px;text-align: right;">热氮比:--</div>
  59. </el-col>
  60. <el-col :span="10" align="center">
  61. <div style="height: 300px;">
  62. <v-chart :option="pieOption" style="width: 400px; height: 200px;" class="chart-center" />
  63. </div>
  64. </el-col>
  65. </el-row>
  66. <el-row :gutter="10" class="mb8" v-show="rightIndex == currentIndex">
  67. <el-col :span="24">
  68. <div style="height: 400px;overflow-y: scroll;">
  69. <el-table border stripe :data="rightList">
  70. <el-table-column label="元素类型" align="center" prop="nutrientName" />
  71. <el-table-column label="元素名称" align="center" prop="nutrientUnit" />
  72. <el-table-column label="单位" align="center" prop="nutrientQuantity" />
  73. <el-table-column label="肠外营养含量/天" align="center" prop="nutrientQuantity" />
  74. </el-table>
  75. </div>
  76. </el-col>
  77. </el-row>
  78. </div>
  79. </el-main>
  80. </el-container>
  81. </el-container>
  82. </div>
  83. </template>
  84. <script setup name="ScreeningAssessmentConfig" lang="ts">
  85. import { ref, onMounted } from 'vue';
  86. import { listScreening } from '@/api/patients/screening';
  87. import { ScreeningQuery } from '@/api/patients/screening/types';
  88. import { FoodIngredientVO } from '@/api/system/foodIngredient/types';
  89. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  90. const emit = defineEmits(['change']);
  91. const dataList = ref([{
  92. screeningTime: '',
  93. visitType: '',
  94. patientNo: '',
  95. configName: '',
  96. screeningScore: ''
  97. }]);
  98. const loading = ref(true);
  99. const total = ref(0);
  100. const leftList = ref<FoodIngredientVO[]>([]);
  101. const leftCalories = ref<number>(0.0);
  102. const rightList = ref<FoodIngredientVO[]>([]);
  103. const leftIndex = ref('1')
  104. const rightIndex = ref('2')
  105. const currentIndex = ref('1')
  106. const pieOption = ref({
  107. legend: {
  108. orient: 'horizontal',
  109. bottom: 'bottom',
  110. data: ['蛋白质 30%', '脂肪 20%', '碳水化合物 50%']
  111. },
  112. title: {
  113. text: '三大营养素元素质量占比',
  114. left: 'center'
  115. },
  116. series: [
  117. {
  118. type: 'pie',
  119. radius: ['50%', '70%'],
  120. avoidLabelOverlap: false,
  121. label: {
  122. show: false,
  123. position: 'center'
  124. },
  125. labelLine: {
  126. show: false
  127. },
  128. emphasis: {
  129. label: {
  130. show: true,
  131. fontSize: '30',
  132. fontWeight: 'bold'
  133. }
  134. },
  135. data: [
  136. { value: 30, name: '蛋白质 30%' },
  137. { value: 20, name: '脂肪 20%' },
  138. { value: 50, name: '碳水化合物 50%' },
  139. ]
  140. }
  141. ]
  142. });
  143. const queryFormRef = ref<ElFormInstance>();
  144. const queryParams = ref<ScreeningQuery>(
  145. {
  146. pageNum: 1,
  147. pageSize: 3,
  148. patientNo: undefined,
  149. screeningTime: undefined,
  150. // orderTime: undefined,
  151. // doctorName: undefined,
  152. }
  153. );
  154. const handleMenumSelect = async (key: string, keyPath: string[]) => {
  155. currentIndex.value = key.toString()
  156. }
  157. /** 搜索按钮操作 */
  158. const handleQuery = () => {
  159. queryParams.value.pageNum = 1;
  160. getList();
  161. }
  162. const getList = async () => {
  163. loading.value = true;
  164. queryParams.value.patientId= '1937770358913093633';
  165. const res = await listScreening(queryParams.value);
  166. dataList.value = res.rows;
  167. total.value = res.total;
  168. loading.value = false;
  169. }
  170. /** 重置按钮操作 */
  171. const resetQuery = () => {
  172. queryFormRef.value?.resetFields();
  173. handleQuery();
  174. }
  175. onMounted(() => {
  176. getList();
  177. });
  178. </script>
  179. <style scoped>
  180. .layout-container-demo .el-header {
  181. position: relative;
  182. background-color: var(--el-color-primary-light-7);
  183. color: var(--el-text-color-primary);
  184. }
  185. .layout-container-demo .el-aside {
  186. color: var(--el-text-color-primary);
  187. background: var(--el-color-primary-light-8);
  188. }
  189. .layout-container-demo .el-menu {
  190. border-right: none;
  191. }
  192. .layout-container-demo .el-main {
  193. padding: 0;
  194. }
  195. .layout-container-demo .toolbar {
  196. display: inline-flex;
  197. align-items: center;
  198. justify-content: center;
  199. height: 100%;
  200. right: 20px;
  201. }
  202. :deep(#dateRangeEl .el-form-item__content) {
  203. width: 215px;
  204. }
  205. :deep(#doctorNameEl .el-form-item__content) {
  206. width: 140px;
  207. margin-right: 0px;
  208. }
  209. :deep(#buttonEl .el-form-item__content) {
  210. margin-left:-25px;
  211. margin-right: 0px;
  212. }
  213. </style>