Browse Source

耗材参数

XMLWAN 4 years ago
parent
commit
c1d5bbc0fc
2 changed files with 309 additions and 46 deletions
  1. 28 0
      src/api/common/common.js
  2. 281 46
      src/xt_pages/qcd/basicInformationAnalysis.vue

+ 28 - 0
src/api/common/common.js View File

@@ -1,5 +1,6 @@
1 1
 import request from '@/utils/request'
2 2
 import url from 'postcss-url'
3
+import { data } from 'autoprefixer'
3 4
 
4 5
 export function getInspectionMajor(params) {
5 6
   return request({
@@ -510,3 +511,30 @@ export function getIdSlist(data, patientid) {
510 511
     data: data
511 512
   })
512 513
 }
514
+
515
+
516
+export function getTreatModeList(params){
517
+  console.log("params",params)
518
+  return request({
519
+    url:"/com/api/getreatmodelist",
520
+    method:"get",
521
+    params:params,
522
+  })
523
+}
524
+
525
+export function getCountModeId(params){
526
+  return request({
527
+    url:'/com/api/getcountmodeid',
528
+    method:"Get",
529
+    params:params
530
+  })
531
+}
532
+
533
+export function getRolloutCount(params){
534
+  
535
+  return request({
536
+    url:"/com/api/getrolloutcount",
537
+    method:"Get",
538
+    params:params
539
+  })
540
+}

+ 281 - 46
src/xt_pages/qcd/basicInformationAnalysis.vue View File

@@ -34,6 +34,7 @@
34 34
         <label class="title">
35 35
              <span class="name">日期查询</span> :
36 36
         </label>
37
+
37 38
         <el-date-picker
38 39
           v-model="listQuery.start_time"
39 40
           prefix-icon="el-icon-date"
@@ -62,6 +63,22 @@
62 63
           :picker-options="pickerOptions"
63 64
         ></el-date-picker>
64 65
       </div>
66
+
67
+       <div class="cell clearfix" v-show="treatShow">
68
+        <label class="title">
69
+          <span class="name">透析模式</span> :
70
+        </label>
71
+        <div class="time">
72
+          <ul class>
73
+            <li
74
+             :class="item.state == stateMode ? 'active' : ''"
75
+              @click="selectTreatMode(item.state)"
76
+              v-for="item in treatmentMode"
77
+              :key="item.mode_id"
78
+            >{{ item.name }}</li>
79
+          </ul>
80
+        </div>
81
+       </div>
65 82
       <div v-if="way == 0" class="cell clearfix" style="align-items:normal">
66 83
         <div style="float:left">
67 84
           <div class="infoBox" style="width:370px;">
@@ -279,6 +296,23 @@
279 296
           <line-chart :options="chart"></line-chart>
280 297
         </div>
281 298
         <div>
299
+
300
+        <div class="cell clearfix" v-show="treatShow">
301
+        <label class="title">
302
+          <span class="name">转归状态</span> :
303
+        </label>
304
+        <div class="time">
305
+          <ul class>
306
+            <li
307
+             :class="item.state == lapseMode ? 'active' : ''"
308
+              @click="selectLapsetoMode(item.state)"
309
+              v-for="item in lapsetoMode"
310
+              :key="item.value"
311
+            >{{ item.label }}</li>
312
+          </ul>
313
+        </div>
314
+       </div>
315
+
282 316
           <p style="font-size: 16px;font-weight: bold;color: #000;">转归统计</p>
283 317
           <line-chart :options="bar"></line-chart>
284 318
         </div>
@@ -297,7 +331,7 @@ import PieChart from "../qcd/components/BarChart";
297 331
 import { uParseTime } from "@/utils/tools";
298 332
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
299 333
 import LineChart from "../qcd/components/LineChart";
300
-import {getDialysisModeType,getTotalLapseCount,getTotalSexCount,getTotalInfectiousCount,getTotalAgeCount,getTotalDialysisCount} from "@/api/common/common"
334
+import {getDialysisModeType,getTotalLapseCount,getTotalSexCount,getTotalInfectiousCount,getTotalAgeCount,getTotalDialysisCount,getTreatModeList,getCountModeId,getRolloutCount} from "@/api/common/common"
301 335
 export default {
302 336
   name: "dialysisTotal",
303 337
   components: {
@@ -350,6 +384,8 @@ export default {
350 384
       rollOutTotal:0,
351 385
       outTotal:0,
352 386
       dialysisAge:[],
387
+      start:0,
388
+      end:0,
353 389
 
354 390
       way: 0,
355 391
       wayArr: [
@@ -385,14 +421,14 @@ export default {
385 421
         series: [
386 422
           {
387 423
             name: "",
388
-            type: "bar",
424
+            type: "line",
389 425
             data: [],
390 426
             barWidth: 30,
391 427
             label: {
392 428
               normal: {
393 429
                 show: true,
394 430
                 position: "top",
395
-                formatter: "{c}%"
431
+                formatter: "{c}"
396 432
               }
397 433
             },
398 434
             //配置样式
@@ -473,14 +509,14 @@ export default {
473 509
         series: [
474 510
           {
475 511
             name: "",
476
-            type: "bar",
512
+            type: "line",
477 513
             data: [],
478 514
             barWidth: 30,
479 515
             label: {
480 516
               normal: {
481 517
                 show: true,
482 518
                 position: "top",
483
-                formatter: "{c}%"
519
+                formatter: "{c}"
484 520
               }
485 521
             },
486 522
             //配置样式
@@ -538,10 +574,20 @@ export default {
538 574
             zoomLock: true // 锁定区域禁止缩放
539 575
           }
540 576
         ],
541
-      }
577
+      },
578
+      treatmentMode:[],
579
+      stateMode:1,
580
+      lapseMode:0,
581
+      treatShow:false,
582
+      mode_id:0,
583
+      lapsetoMode:[
584
+        { value: 0, label: "留治", state: 0 },
585
+        { value: 1, label: "转出", state: 1}
586
+      ],
587
+      lapseid:0,
542 588
     };
543 589
 
544
-    
590
+
545 591
   },
546 592
   methods: {
547 593
     getTimestamp(time) {
@@ -569,6 +615,10 @@ export default {
569 615
         this.getTotalAgeCount(timeStar,timeEnd)
570 616
         //统计透析年龄
571 617
         this.getTotalDialysisCount(timeStar,timeEnd)
618
+        this.start = timeStar
619
+        this.end =timeEnd
620
+        this.getCountModeId()
621
+        this.getRolloutCount(timeStar,timeEnd)
572 622
       }
573 623
     },
574 624
     changeEndTime(val) {
@@ -593,6 +643,10 @@ export default {
593 643
         this.getTotalAgeCount(timeStar,timeEnd)
594 644
         //统计透析年龄
595 645
         this.getTotalDialysisCount(timeStar,timeEnd)
646
+        this.start = timeStar
647
+        this.end =timeEnd
648
+        this.getCountModeId()
649
+        this.getRolloutCount(timeStar,timeEnd)
596 650
       }
597 651
     },
598 652
     selectLapseTo(state) {
@@ -600,9 +654,7 @@ export default {
600 654
       this.listQuery.state = state;
601 655
       //获取本月当前机构的透析模式
602 656
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
603
-      // console.log("开始时间",startDate)
604 657
       const endDate = moment(new Date()).format('YYYY-MM-DD')
605
-      // console.log("结束时间",endDate)
606 658
       var now = new Date()
607 659
       var nowMonth = now.getMonth(); //当前月
608 660
       var nowYear = now.getFullYear(); //当前年
@@ -628,6 +680,10 @@ export default {
628 680
         this.getTotalAgeCount(timeStar,timeEnd)
629 681
         //统计透析年龄
630 682
         this.getTotalDialysisCount(timeStar,timeEnd)
683
+        this.start = timeStar
684
+        this.end = timeEnd
685
+        this.getCountModeId()
686
+        this.getRolloutCount(timeStar,timeEnd)
631 687
       }
632 688
       //近三月
633 689
       if(state == 1){
@@ -653,6 +709,10 @@ export default {
653 709
         this.getTotalAgeCount(startunitx,endunitx)
654 710
         //统计透析年龄
655 711
         this.getTotalDialysisCount(startunitx,endunitx)
712
+        this.start = startunitx
713
+        this.end = endunitx
714
+        this.getCountModeId()
715
+        this.getRolloutCount(startunitx,endunitx)
656 716
       }
657 717
 
658 718
      //近半年
@@ -679,6 +739,11 @@ export default {
679 739
         this.getTotalAgeCount(startunitx,endunitx)
680 740
         //统计透析年龄
681 741
         this.getTotalDialysisCount(startunitx,endunitx)
742
+
743
+        this.start = startunitx
744
+        this.end = endunitx
745
+        this.getCountModeId()
746
+        this.getRolloutCount(startunitx,endunitx)
682 747
      }
683 748
 
684 749
      //近一年
@@ -705,17 +770,32 @@ export default {
705 770
         this.getTotalAgeCount(startunitx,endunitx)
706 771
         //统计透析年龄
707 772
         this.getTotalDialysisCount(startunitx,endunitx)
773
+
774
+        this.start = startunitx
775
+        this.end = endunitx
776
+        this.getCountModeId()
777
+        this.getRolloutCount(startunitx,endunitx)
708 778
      }
709 779
 
710 780
 
711 781
 
782
+    },
783
+    selectTreatMode(state){
784
+      this.mode_id = state
785
+      this.stateMode = state;
786
+      this.getCountModeId()
787
+    },
788
+    selectLapsetoMode(state){
789
+      this.lapseid  = state
790
+      this.lapseMode = state
791
+      this.getRolloutCount(this.start,this.end)
712 792
     },
713 793
     getDialysisModeType(startDate,endDate){
714 794
        this.modesData.series = []
715 795
        this.modesData.xAxis = []
716 796
       getDialysisModeType(startDate,endDate).then(response=>{
717 797
          if(response.data.state == 1){
718
-         
798
+
719 799
           var modetype =  response.data.data.modetype
720 800
           this.modetype = modetype
721 801
           var total =  response.data.data.total
@@ -780,13 +860,13 @@ export default {
780 860
            if(modedate[i].mode_id == 19){
781 861
                modedate[i].mode_id = "IUF+HD"
782 862
             }
783
-            this.modesData.xAxis.push(modedate[i].mode_id)
784
-            this.modesData.series.push(((modedate[i].count/total)*100).toFixed(1))
863
+            // this.modesData.xAxis.push(modedate[i].mode_id)
864
+            // this.modesData.series.push(((modedate[i].count/total)*100).toFixed(1))
785 865
           }
786
-          this.chart.series[0].data = this.modesData.series
787
-          this.chart.xAxis.data = this.modesData.xAxis
788
-          this.getArrLength1(this.chart.xAxis.data)
789
-           
866
+          // this.chart.series[0].data = this.modesData.series
867
+          // this.chart.xAxis.data = this.modesData.xAxis
868
+          // this.getArrLength1(this.chart.xAxis.data)
869
+
790 870
          }
791 871
       })
792 872
     },
@@ -801,26 +881,29 @@ export default {
801 881
              {name:"转出",count:0}
802 882
            ]
803 883
           var patients =  response.data.data.patients
884
+
804 885
           this.rollOutTotal = patients.length
805 886
           var patienttwo = response.data.data.patienttwo
806 887
           this.outTotal = patienttwo.length
807 888
           var count = response.data.data.count
808
-          console.log("count",count)
809 889
           this.patientCount = count
810 890
 
891
+          var rollout = response.data.data.rollout
892
+          console.log("rollout",rollout)
893
+
811 894
           for(let i=0;i<arr.length;i++){
812 895
             arr[0].count = this.rollOutTotal
813 896
             arr[1].count = this.outTotal
814 897
           }
815 898
 
816
-          for(let j=0;j<arr.length;j++){
817
-            this.modesDataTwo.xAxis.push(arr[j].name)
818
-            this.modesDataTwo.series.push(((arr[j].count/count)*100).toFixed(1))
819
-          }
820
-          this.bar.series[0].data = this.modesDataTwo.series
821
-          this.bar.xAxis.data = this.modesDataTwo.xAxis
822
-          this.getArrLength(this.bar.xAxis.data)
823
-        
899
+          // for(let j=0;j<arr.length;j++){
900
+          //   this.modesDataTwo.xAxis.push(arr[j].name)
901
+          //   this.modesDataTwo.series.push(((arr[j].count/count)*100).toFixed(1))
902
+          // }
903
+          // this.bar.series[0].data = this.modesDataTwo.series
904
+          // this.bar.xAxis.data = this.modesDataTwo.xAxis
905
+          // this.getArrLength(this.bar.xAxis.data)
906
+
824 907
          }
825 908
       })
826 909
     },
@@ -844,11 +927,8 @@ export default {
844 927
        getTotalInfectiousCount(timeStar,timeEnd).then(response=>{
845 928
            if(response.data.state === 1){
846 929
              this.InfectiousTotal = response.data.data.total
847
-            //  console.log("===",this.InfectiousTotal)
848 930
              var infectious = response.data.data.count
849
-          //  console.log("infectious",infectious)
850 931
              var otherTotal = response.data.data.otherTotal
851
-            //  console.log("otherTotal",otherTotal)
852 932
              this.otherTotal = otherTotal
853 933
               var arr = [
854 934
                 {count:0,disease_id:2},
@@ -890,20 +970,6 @@ export default {
890 970
       },
891 971
     //统计透析年龄
892 972
     getTotalDialysisCount(timeStar,timeEnd){
893
-      //  const endDate = moment(new Date()).format('YYYY-MM-DD')
894
-      //  console.log("结束时间",endDate)
895
-      //  var end = Date.parse(endDate)/1000
896
-      //  console.log("end",end)
897
-      //  const startDate = moment().subtract('month', 144).format('YYYY-MM-DD')
898
-      //  var twStart = Date.parse(startDate)/1000
899
-      //  console.log("12年前",twStart)
900
-      // const start = moment().subtract('month', 432).format('YYYY-MM-DD')
901
-      // console.log("start",start)
902
-      //  var sixStart = Date.parse(start)/1000
903
-      //  console.log("36年前",sixStart)
904
-      //  const sevnstart = moment().subtract('month', 720).format('YYYY-MM-DD')
905
-      //  var sevenStart = Date.parse(sevnstart)/1000
906
-      //  console.log("60年前",sevenStart)
907 973
       getTotalDialysisCount(timeStar,timeEnd).then(response=>{
908 974
          if(response.data.state == 1){
909 975
            var dataage =  response.data.data.dataage
@@ -913,8 +979,107 @@ export default {
913 979
          }
914 980
       })
915 981
     },
982
+    getTreatModeList(timeStar,timeEnd){
983
+         const params = {
984
+           start_time:timeStar,
985
+           end_time:timeEnd
986
+         }
987
+      getTreatModeList(params).then(response=>{
988
+         if(response.data.state == 1){
989
+           var list =  response.data.data.list
990
+           this.mode_id = list[0].mode_id
991
+           for(let i=0;i<list.length;i++){
992
+             if(list[i].mode_id == 1){
993
+               list[i].name = "HD"
994
+               list[i].state = 1
995
+             }
996
+             if(list[i].mode_id == 2){
997
+               list[i].name = "HDF"
998
+               list[i].state = 2
999
+             }
1000
+             if(list[i].mode_id == 3){
1001
+               list[i].name = "HD+HP"
1002
+               list[i].state = 3
1003
+             }
1004
+             if(list[i].mode_id == 4){
1005
+               list[i].name = "HP"
1006
+               list[i].state = 4
1007
+             }
1008
+             if(list[i].mode_id == 5){
1009
+               list[i].name = "HF"
1010
+               list[i].state = 5
1011
+             }
1012
+             if(list[i].mode_id == 6){
1013
+               list[i].name = "SCUF"
1014
+               list[i].state = 6
1015
+             }
1016
+             if(list[i].mode_id == 7){
1017
+               list[i].name = "IUF"
1018
+               list[i].state = 7
1019
+             }
1020
+             if(list[i].mode_id == 8){
1021
+               list[i].name="HFHD"
1022
+               list[i].state = 8
1023
+             }
1024
+             if(list[i].mode_id == 9){
1025
+               list[i].name ="HFHD+HP"
1026
+               list[i].state = 9
1027
+             }
1028
+             if(list[i].mode_id == 10){
1029
+               list[i].name = "PHF"
1030
+               list[i].state = 10
1031
+             }
1032
+             if(list[i].mode_id == 11){
1033
+               list[i].name = "HFR"
1034
+               list[i].state = 11
1035
+             }
1036
+             if(list[i].mode_id == 12){
1037
+               list[i].name = "HDF+HP"
1038
+               list[i].state = 12
1039
+             }
1040
+             if(list[i].mode_id == 13){
1041
+               list[i].name = "CRRT"
1042
+               list[i].state = 13
1043
+             }
1044
+             if(list[i].mode_id == 14){
1045
+               list[i].name = "腹水回输"
1046
+               list[i].state = 14
1047
+             }
1048
+             if(list[i].mode_id == 15){
1049
+               list[i].name = "HD前置换"
1050
+               list[i].state = 15
1051
+             }
1052
+             if(list[i].mode_id == 16){
1053
+               list[i].name = "HD后置换"
1054
+               list[i].state = 16
1055
+             }
1056
+             if(list[i].mode_id == 17){
1057
+               list[i].name = "HDF前置换"
1058
+               list[i].state = 17
1059
+             }
1060
+             if(list[i].mode_id == 18){
1061
+               list[i].name = "HDF后置换"
1062
+               list[i].state = 18
1063
+             }
1064
+             if(list[i].mode_id == 19) {
1065
+               list[i].name = "IUF+HD"
1066
+               list[i].state = 19
1067
+             }
1068
+           }
1069
+           this.treatmentMode = list
1070
+         }
1071
+      })
1072
+    },
916 1073
     selectWay(index){
917 1074
       this.way = index
1075
+      if(index == 0){
1076
+        this.treatShow = false
1077
+      }
1078
+      if(index == 1){
1079
+        this.treatShow = true
1080
+        this.getCountModeId()
1081
+      }
1082
+
918 1083
     },
919 1084
     getArrLength(result){
920 1085
       if(result.length > 10){
@@ -933,25 +1098,86 @@ export default {
933 1098
         var dataZoom_end = 100;
934 1099
         this.chart.dataZoom[0].end = dataZoom_end
935 1100
       }
1101
+    },
1102
+    getCountModeId(){
1103
+        const params = {
1104
+          start_time:this.start,
1105
+          end_time:this.end,
1106
+          mode_id:this.mode_id
1107
+        }
1108
+        this.modesData.series = []
1109
+        this.modesData.xAxis = []
1110
+      getCountModeId(params).then(response=>{
1111
+         if(response.data.state == 1){
1112
+           var modeCount = response.data.data.modeCount
1113
+           for(let i=0;i<modeCount.length;i++){
1114
+
1115
+             this.modesData.xAxis.push(moment(new Date(modeCount[i].dialysis_date*1000)).format('YYYY-MM-DD'))
1116
+             this.modesData.series.push(modeCount[i].Count)
1117
+
1118
+             this.chart.series[0].data = this.modesData.series
1119
+             this.chart.xAxis.data = this.modesData.xAxis
1120
+             this.getArrLength1(this.chart.xAxis.data)
1121
+           }
1122
+         }
1123
+      })
1124
+    },
1125
+    getRolloutCount(){
1126
+       this.modesDataTwo.series = []
1127
+       this.modesDataTwo.xAxis = []
1128
+        const params = {
1129
+          start_time:this.start,
1130
+          end_time:this.end
1131
+        }
1132
+      getRolloutCount(params).then(response=>{
1133
+         if(response.data.state == 1){
1134
+           var rollout =  response.data.data.rollout
1135
+          var arr = []
1136
+          var arrOne = []
1137
+           for(let i=0;i<rollout.length;i++){
1138
+              if(rollout[i].lapseto_type == 1){
1139
+                arr.push(rollout[i])
1140
+              }
1141
+              if(rollout[i].lapseto_type == 2){
1142
+                 arrOne.push(rollout[i])
1143
+              }
1144
+            }
1145
+          if(this.lapseid == 0){
1146
+             for(let i=0;i<arr.length;i++){
1147
+              this.modesDataTwo.xAxis.push(moment(new Date(arrOne[i]. lapseto_time*1000)).format('YYYY-MM-DD'))
1148
+              this.modesDataTwo.series.push(arr[i].Count)
1149
+             }
1150
+            this.bar.series[0].data = this.modesDataTwo.series
1151
+            this.bar.xAxis.data = this.modesDataTwo.xAxis
1152
+            this.getArrLength(this.bar.xAxis.data)
1153
+           }
1154
+           if(this.lapseid == 1){
1155
+             for(let i=0;i<arrOne.length;i++){
1156
+              this.modesDataTwo.xAxis.push(moment(new Date(arrOne[i].lapseto_time*1000)).format('YYYY-MM-DD'))
1157
+              this.modesDataTwo.series.push(arrOne[i].Count)
1158
+             }
1159
+            this.bar.series[0].data = this.modesDataTwo.series
1160
+            this.bar.xAxis.data = this.modesDataTwo.xAxis
1161
+            this.getArrLength(this.bar.xAxis.data)
1162
+           }
1163
+
1164
+         }
1165
+      })
936 1166
     }
937 1167
   },
938 1168
   created() {
939 1169
         //获取本月当前机构的透析模式
940 1170
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
941
-       console.log("开始时间",startDate)
942 1171
       const endDate = moment(new Date()).format('YYYY-MM-DD')
943
-     console.log("结束时间",endDate)
944 1172
       var now = new Date()
945 1173
       var nowMonth = now.getMonth(); //当前月
946 1174
       var nowYear = now.getFullYear(); //当前年
947 1175
       //本月的开始时间
948 1176
       var monthStartDate = new Date(nowYear, nowMonth, 1);
949 1177
       var timeStar=Date.parse(monthStartDate)/1000;//s
950
-      console.log("本月第一天",timeStar)
951 1178
       //本月的结束时间
952 1179
       var monthEndDate = new Date(nowYear, nowMonth+1, 0);
953 1180
       var timeEnd=Date.parse(monthEndDate)/1000-1;//s
954
-      console.log("本月最后一天",timeEnd)
955 1181
       //统计透析总量
956 1182
       this.getDialysisModeType(startDate,endDate)
957 1183
       //统计转归状态
@@ -964,6 +1190,15 @@ export default {
964 1190
       this.getTotalAgeCount(timeStar,timeEnd)
965 1191
       //统计透析年龄
966 1192
       this.getTotalDialysisCount(timeStar,timeEnd)
1193
+
1194
+      //获取当前选中时间所有的透析模式
1195
+      this.getTreatModeList(timeStar,timeEnd)
1196
+      this.start = timeStar
1197
+      this.end = timeEnd
1198
+
1199
+     this.getRolloutCount(timeStar,timeEnd)
1200
+
1201
+
967 1202
   },
968 1203
 };
969 1204
 </script>