PatBleedCount.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. formatter: function (value, index) {//隐藏 0
  122. return value.data?value.data:'';
  123. },
  124. }
  125. },
  126. {
  127. name:'外伤性出血',
  128. data: [data.gj_wsx_bleed_cnt+data.qt_wsx_bleed_cnt, data.gj_wsx_bleed_cnt, data.qt_wsx_bleed_cnt],
  129. itemStyle:{
  130. color:'#F8CBAD'
  131. },
  132. type: 'bar',
  133. stack: '1',
  134. label:{
  135. show:true,
  136. position:'inside',
  137. formatter: function (value, index) {//隐藏 0
  138. // console.log(value)
  139. return value.data?value.data:'';
  140. },
  141. }
  142. }
  143. ]
  144. }
  145. }
  146. })
  147. }
  148. },
  149. created() {
  150. this.getData()
  151. }
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .injectionListForm {
  156. width: 95%;
  157. margin: auto;
  158. margin-top: 1rem;
  159. background: #fff;
  160. padding: 1rem 0;
  161. border-radius: 8px;
  162. position: relative;
  163. .tabs{
  164. display: flex;
  165. padding: 0;
  166. li{
  167. width: 25%;
  168. text-align:center;
  169. list-style: none;
  170. font-size: 13px;
  171. line-height: 28px;
  172. &.act{
  173. background-color: #4472C4;
  174. color: #fff;
  175. }
  176. }
  177. }
  178. }
  179. .footer {
  180. display: flex;
  181. flex-wrap: wrap;
  182. // margin-top:2rem;
  183. .jbbtn {
  184. width: 42%;
  185. }
  186. }
  187. .listItemContainer {
  188. display: flex;
  189. .listItem {
  190. width: 33%;
  191. /* height: 3.2rem; */
  192. line-height: 3.2rem;
  193. flex-direction: row;
  194. justify-content: space-between;
  195. border-bottom: 1px solid #ccc;
  196. font-size:1.1rem;
  197. }
  198. .listHeader{
  199. font-size:1.2rem;
  200. }
  201. }
  202. </style>