PatBleedCount.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="container">
  3. <div class="bgimg"></div>
  4. <div class="content">
  5. <div class="title">出血次数统计</div>
  6. <div v-if='id && name' class="title" style="font-size: 1rem;">姓名:{{name}}</div>
  7. <div class="injectionListForm baseInfo">
  8. <!-- <p>年化出血率:{{year_bleed_rate}}</p>
  9. <p>年化关节出血率:{{year_gj_bleed_rate}}</p> -->
  10. <ul class="tabs">
  11. <li @click="tabChange(1)" :class="tab==1?'act':''">近1个月</li>
  12. <li v-if='days>=90' @click="tabChange(3)" :class="tab==3?'act':''">近3个月</li>
  13. <li v-if='days>=180' @click="tabChange(6)" :class="tab==6?'act':''">近6个月</li>
  14. <li v-if='days>=360' @click="tabChange(12)" :class="tab==12?'act':''">近12个月</li>
  15. </ul>
  16. <v-chart :option="barOption" style="height: 350px">
  17. </v-chart>
  18. </div>
  19. <div class="footer">
  20. <div class="jbbtn" @click="goPage(-1)">返回</div>
  21. <!-- <div class="jbbtn" @click="goPage('/patclockbleed')">出血打卡</div><br> -->
  22. <div v-if='!id' style="font-size: 1rem;" class="jbbtn" @click="goPage('/patgjbleedcount')">关节出血次数统计</div>
  23. <div v-else style="font-size: 1rem;" class="jbbtn" @click="goPage('/patgjbleedcount?id='+id)">关节出血次数统计</div>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import {
  30. Field,
  31. Picker,
  32. Search,
  33. Button
  34. } from 'mint-ui'
  35. export default {
  36. name: 'Index',
  37. components: {
  38. Field,
  39. Picker,
  40. Search,
  41. Button
  42. },
  43. data() {
  44. return {
  45. tab:1,
  46. id:'',
  47. form: {},
  48. patinfo:{},
  49. recordsList: [],
  50. barOption:{},
  51. name:'',
  52. year_bleed_rate:'',
  53. year_gj_bleed_rate:'',
  54. days:0
  55. }
  56. },
  57. methods: {
  58. goPage(path) {
  59. if(path==-1){
  60. this.$router.go(-1)
  61. }else{
  62. this.$router.push(path)
  63. }
  64. },
  65. tabChange(tab){
  66. this.tab=tab
  67. this.barOption={}
  68. this.getData()
  69. },
  70. getData() {
  71. let query_form={time_range:this.tab}
  72. let id = this.$route.query.id
  73. if(id){
  74. query_form.patient_id=id
  75. this.id=id
  76. this.$api.get_patient_info({id:id}).then(res=>{
  77. this.name=res.data.data.name
  78. })
  79. }
  80. this.$api.get_patient_bleed_statistics(query_form).then(res => {
  81. if (!res.data.code) {
  82. let data=res.data.data
  83. this.days=data.first_bleed_time_interval
  84. this.year_bleed_rate = data.year_bleed_rate;
  85. this.year_gj_bleed_rate = data.year_gj_bleed_rate;
  86. this.barOption={
  87. tooltip: {
  88. trigger: 'axis',
  89. axisPointer: {
  90. type: 'shadow'
  91. }
  92. },
  93. legend: {
  94. itemWidth:5,
  95. itemHeight:5,
  96. textStyle:{
  97. fontSize:10
  98. }
  99. },
  100. xAxis: {
  101. type: 'category',
  102. data: ['总出血次数', '关节出血', '其他部位出现']
  103. },
  104. yAxis: {
  105. type: 'value',
  106. name:'(次)'
  107. },
  108. series: [
  109. {
  110. name:'自发性出血',
  111. data: [data.gj_zfx_bleed_cnt+data.qt_zfx_bleed_cnt, data.gj_zfx_bleed_cnt, data.qt_zfx_bleed_cnt],
  112. itemStyle:{
  113. color:'#DEEBF7'
  114. },
  115. type: 'bar',
  116. stack: '1',
  117. barWidth:30,
  118. label:{
  119. show:true,
  120. position:'inside'
  121. }
  122. },
  123. {
  124. name:'外伤性出血',
  125. data: [data.gj_wsx_bleed_cnt+data.qt_wsx_bleed_cnt, data.gj_wsx_bleed_cnt, data.qt_wsx_bleed_cnt],
  126. itemStyle:{
  127. color:'#F8CBAD'
  128. },
  129. type: 'bar',
  130. stack: '1',
  131. label:{
  132. show:true,
  133. position:'inside'
  134. }
  135. }
  136. ]
  137. }
  138. }
  139. })
  140. }
  141. },
  142. created() {
  143. this.getData()
  144. }
  145. }
  146. </script>
  147. <style scoped lang="scss">
  148. .injectionListForm {
  149. width: 95%;
  150. margin: auto;
  151. margin-top: 1rem;
  152. background: #fff;
  153. padding: 1rem 0;
  154. border-radius: 8px;
  155. position: relative;
  156. .tabs{
  157. display: flex;
  158. padding: 0;
  159. li{
  160. width: 25%;
  161. text-align:center;
  162. list-style: none;
  163. font-size: 13px;
  164. line-height: 28px;
  165. &.act{
  166. background-color: #4472C4;
  167. color: #fff;
  168. }
  169. }
  170. }
  171. }
  172. .footer {
  173. display: flex;
  174. flex-wrap: wrap;
  175. // margin-top:2rem;
  176. .jbbtn {
  177. width: 42%;
  178. }
  179. }
  180. .listItemContainer {
  181. display: flex;
  182. .listItem {
  183. width: 33%;
  184. /* height: 3.2rem; */
  185. line-height: 3.2rem;
  186. flex-direction: row;
  187. justify-content: space-between;
  188. border-bottom: 1px solid #ccc;
  189. font-size:1.1rem;
  190. }
  191. .listHeader{
  192. font-size:1.2rem;
  193. }
  194. }
  195. </style>