| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <template>
- <div class="container">
- <div class="bgimg"></div>
- <div class="content">
- <div class="title">出血次数统计</div>
- <div v-if='id && name' class="title" style="font-size: 1rem;">姓名:{{name}}</div>
- <div class="injectionListForm baseInfo">
- <!-- <p>年化出血率:{{year_bleed_rate}}</p>
- <p>年化关节出血率:{{year_gj_bleed_rate}}</p> -->
- <ul class="tabs">
- <li @click="tabChange(1)" :class="tab==1?'act':''">近1个月</li>
- <li v-if='days>=90' @click="tabChange(3)" :class="tab==3?'act':''">近3个月</li>
- <li v-if='days>=180' @click="tabChange(6)" :class="tab==6?'act':''">近6个月</li>
- <li v-if='days>=360' @click="tabChange(12)" :class="tab==12?'act':''">近12个月</li>
- </ul>
- <v-chart :option="barOption" style="height: 350px">
- </v-chart>
- </div>
- <div class="footer">
- <div class="jbbtn" @click="goPage(-1)">返回</div>
- <!-- <div class="jbbtn" @click="goPage('/patclockbleed')">出血打卡</div><br> -->
- <div v-if='!id' style="font-size: 1rem;" class="jbbtn" @click="goPage('/patgjbleedcount')">关节出血次数统计</div>
- <div v-else style="font-size: 1rem;" class="jbbtn" @click="goPage('/patgjbleedcount?id='+id)">关节出血次数统计</div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- Field,
- Picker,
- Search,
- Button
- } from 'mint-ui'
- export default {
- name: 'Index',
- components: {
- Field,
- Picker,
- Search,
- Button
- },
- data() {
- return {
- tab:1,
- id:'',
- form: {},
- patinfo:{},
- recordsList: [],
- barOption:{},
- name:'',
- year_bleed_rate:'',
- year_gj_bleed_rate:'',
- days:0
- }
- },
- methods: {
- goPage(path) {
- if(path==-1){
- this.$router.go(-1)
- }else{
- this.$router.push(path)
- }
- },
- tabChange(tab){
- this.tab=tab
- this.barOption={}
- this.getData()
- },
- getData() {
- let query_form={time_range:this.tab}
- let id = this.$route.query.id
- if(id){
- query_form.patient_id=id
- this.id=id
- this.$api.get_patient_info({id:id}).then(res=>{
- this.name=res.data.data.name
- })
- }
- this.$api.get_patient_bleed_statistics(query_form).then(res => {
- if (!res.data.code) {
- let data=res.data.data
- this.days=data.first_bleed_time_interval
- this.year_bleed_rate = data.year_bleed_rate;
- this.year_gj_bleed_rate = data.year_gj_bleed_rate;
- this.barOption={
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- itemWidth:5,
- itemHeight:5,
- textStyle:{
- fontSize:10
- }
- },
- xAxis: {
- type: 'category',
- data: ['总出血次数', '关节出血', '其他部位出现']
- },
- yAxis: {
- type: 'value',
- name:'(次)'
- },
- series: [
- {
- name:'自发性出血',
- data: [data.gj_zfx_bleed_cnt+data.qt_zfx_bleed_cnt, data.gj_zfx_bleed_cnt, data.qt_zfx_bleed_cnt],
- itemStyle:{
- color:'#DEEBF7'
- },
- type: 'bar',
- stack: '1',
- barWidth:30,
- label:{
- show:true,
- position:'inside',
- formatter: function (value, index) {//隐藏 0
- return value.data?value.data:'';
- },
- }
- },
- {
- name:'外伤性出血',
- data: [data.gj_wsx_bleed_cnt+data.qt_wsx_bleed_cnt, data.gj_wsx_bleed_cnt, data.qt_wsx_bleed_cnt],
- itemStyle:{
- color:'#F8CBAD'
- },
- type: 'bar',
- stack: '1',
- label:{
- show:true,
- position:'inside',
- formatter: function (value, index) {//隐藏 0
- // console.log(value)
- return value.data?value.data:'';
- },
- }
- }
- ]
- }
- }
- })
- }
- },
- created() {
- this.getData()
- }
- }
- </script>
- <style scoped lang="scss">
- .injectionListForm {
- width: 95%;
- margin: auto;
- margin-top: 1rem;
- background: #fff;
- padding: 1rem 0;
- border-radius: 8px;
- position: relative;
- .tabs{
- display: flex;
- padding: 0;
- li{
- width: 25%;
- text-align:center;
- list-style: none;
- font-size: 13px;
- line-height: 28px;
- &.act{
- background-color: #4472C4;
- color: #fff;
- }
- }
- }
- }
- .footer {
- display: flex;
- flex-wrap: wrap;
- // margin-top:2rem;
- .jbbtn {
- width: 42%;
- }
- }
- .listItemContainer {
- display: flex;
- .listItem {
- width: 33%;
- /* height: 3.2rem; */
- line-height: 3.2rem;
- flex-direction: row;
- justify-content: space-between;
- border-bottom: 1px solid #ccc;
- font-size:1.1rem;
- }
- .listHeader{
- font-size:1.2rem;
- }
- }
- </style>
|