detail.vue 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="wrap">
  3. <view style="color: #00c4b3;font-size: 24rpx;margin: 20rpx;">报告时间:{{formatDate(time,'yyyy-MM-dd')}}</view>
  4. <view >
  5. <view class="table newMonitTable">
  6. <view class="tableTh">
  7. <view class="list_td">检查项目</view>
  8. <view>结果</view>
  9. <view>单位</view>
  10. <view>参考值</view>
  11. </view>
  12. <view v-for="i in list" :key="i" class="tableTr">
  13. <view>{{i.type}}</view>
  14. <view v-if="i.inspect_tips !=''">
  15. <view :class="[i.inspect_tips=='↑' ? 'shang':'xia']">
  16. {{i.result}}{{i.inspect_tips}}
  17. </view>
  18. </view>
  19. <view class="" v-else>{{i.result}}</view>
  20. <view>{{i.unit}}</view>
  21. <view>{{i.range_min}}~{{ i.range_max}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {getInspectioninfo} from '@/api/api.js'
  29. import {formatDate} from "@/utils/formatDate.js"
  30. export default {
  31. data() {
  32. return {
  33. time: '',
  34. list: [],
  35. project_id:'',
  36. inspect_date:'',
  37. patient_id:0,
  38. org_id:0
  39. }
  40. },
  41. onLoad(options) {
  42. this.patient_id = this.$store.state.data.userInfo.id
  43. this.org_id = this.$store.state.data.userInfo.user_org_id
  44. this.inspect_date=options.inspect_date
  45. this.project_id=options.project_id
  46. console.log('vvvvvv',options);
  47. this.getgetInspectioninfo()
  48. },
  49. methods:{
  50. async getgetInspectioninfo () {
  51. let params={
  52. project_id:this.project_id,
  53. inspect_date:this.inspect_date,
  54. patient_id:this.patient_id,
  55. org_id:this.org_id
  56. // org_id:10340
  57. }
  58. let res = await getInspectioninfo(params)
  59. console.log('zzzzz',res);
  60. let reas=res.data.data
  61. let list=[]
  62. console.log('sadfdfaaaa',reas.list);
  63. for(let i in reas.list){
  64. // console.log('bbbbb',reas.list[1]);
  65. let objs={}
  66. objs['type'] = reas.list[i].item_name,
  67. objs['result'] = reas.list[i].inspect_value,
  68. objs['unit'] = reas.list[i].inspection_reference.unit,
  69. objs['range_max'] = reas.list[i].inspection_reference.range_max
  70. objs['range_min'] = reas.list[i].inspection_reference.range_min
  71. objs['inspect_tips'] = reas.list[i].inspect_tips
  72. list.push(objs)
  73. }
  74. this.time=reas.list[0].inspect_date
  75. this.list=list
  76. console.log('22222',this.list);
  77. },
  78. formatDate(value, fmt) {
  79. return formatDate(new Date(value * 1000), fmt)
  80. },
  81. }
  82. }
  83. </script>
  84. <style>
  85. .table {
  86. overflow: scroll;
  87. width: 100%;
  88. }
  89. .shang{
  90. color: red;
  91. }
  92. .xia{
  93. color: aquamarine;
  94. }
  95. .tableTh {
  96. display: -webkit-box;
  97. color: #8d8d8d;
  98. min-height: 80rpx;
  99. font-size: 28rpx
  100. }
  101. .tableTh view {
  102. width: 25vw;
  103. display: flex;
  104. flex-direction: column;
  105. justify-content: center;
  106. text-align: center;
  107. background: #f6f6f6;
  108. /* border-right: 2px solid #FFFFFF; */
  109. }
  110. .tableTr {
  111. display: -webkit-box;
  112. font-size: 28rpx
  113. }
  114. .tableTr view {
  115. width: 25vw;
  116. text-align: center;
  117. padding: 20rpx 0;
  118. display: table-cell;
  119. align-items: center;
  120. justify-content: space-around;
  121. display: flex;
  122. /* border-right: 2px solid #FFFFFF; */
  123. border-bottom: 2px solid #FFFFFF;
  124. background: #FFFFFF;
  125. }
  126. .table_wrap {
  127. display: table;
  128. overflow: scroll;
  129. width: 100%;
  130. }
  131. </style>