Browse Source

统计配置开发

XMLWAN 4 years ago
parent
commit
db4b45fe35

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

@@ -143,3 +143,51 @@ export function getDialysisModeType(startime, endtime) {
143 143
     params: params
144 144
   })
145 145
 }
146
+
147
+export function getTotalLapseCount(startime, endtime) {
148
+  const params = {
149
+    startime: startime,
150
+    endtime: endtime
151
+  }
152
+  return request({
153
+    url: '/com/api/gettotallapsecount',
154
+    method: 'get',
155
+    params: params
156
+  })
157
+}
158
+
159
+export function getTotalSexCount(startime, endtime) {
160
+  const params = {
161
+    startime: startime,
162
+    endtime: endtime
163
+  }
164
+  return request({
165
+    url: '/com/api/gettotalsexcount',
166
+    method: 'get',
167
+    params: params
168
+  })
169
+}
170
+
171
+export function getTotalInfectiousCount(startime, endtime) {
172
+  const params = {
173
+    startime: startime,
174
+    endtime: endtime
175
+  }
176
+  return request({
177
+    url: '/com/api/gettoalinfectiouscount',
178
+    method: 'get',
179
+    params: params
180
+  })
181
+}
182
+
183
+export function getTotalAgeCount(startime, endtime) {
184
+  const params = {
185
+    startime: startime,
186
+    endtime: endtime
187
+  }
188
+  return request({
189
+    url: '/com/api/gettotalagecount',
190
+    method: 'get',
191
+    params: params
192
+  })
193
+}

+ 113 - 23
src/xt_pages/qcd/basicInformationAnalysis.vue View File

@@ -58,8 +58,8 @@
58 58
             
59 59
               <div class="borderBox">
60 60
                <div v-for="(item,index) in modetype" :key="index">
61
-                <p>{{item.mode_id}}:{{getTotalCount(item.mode_id)}}次(64%)</p>
62
-                <el-progress :percentage="70"></el-progress>
61
+                <p>{{item.mode_id}}:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
62
+                <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
63 63
                </div>
64 64
               </div>
65 65
             </div>
@@ -69,10 +69,10 @@
69 69
                 <p class="infoTitle">传染病统计</p>
70 70
               </div>
71 71
               <div class="borderBox2">
72
-                <p>无传染病:64人(64%)</p>
73
-                <el-progress :percentage="70"></el-progress>
74
-                <p>乙肝:64人(64%)</p>
75
-                <el-progress :percentage="70"></el-progress>
72
+               <div v-for="(item,i) in this.InfectiousList" :key="i">
73
+                  <p>{{item.disease_id}}:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
74
+                  <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
75
+                </div>
76 76
               </div>
77 77
             </div>
78 78
           </div>
@@ -82,13 +82,13 @@
82 82
             <div class="infoOne">
83 83
               <div class="titleBox">
84 84
                 <span class="point1"></span>
85
-                <p class="infoTitle">转归统计(总人数100人)</p>
85
+                <p class="infoTitle">转归统计(总人数{{patientCount}}人)</p>
86 86
               </div>
87 87
               <div class="borderBox1">
88
-                <p>留治:64人(64%)</p>
89
-                <el-progress :percentage="70"></el-progress>
90
-                <p>转出:64人(64%)</p>
91
-                <el-progress :percentage="70"></el-progress>
88
+                <p>留治:{{RetentionCount}}人({{(RetentionCount/patientCount*100).toFixed(1)}}%)</p>
89
+                <el-progress :percentage="(RetentionCount/patientCount*100).toFixed(1)"></el-progress>
90
+                <p>转出:{{rollOut}}人({{(rollOut/patientCount*100).toFixed(1)}}%)</p>
91
+                <el-progress :percentage="(rollOut/patientCount*100).toFixed(1)"></el-progress>
92 92
               </div>
93 93
             </div>
94 94
             <div class="infoOne">
@@ -97,10 +97,10 @@
97 97
                 <p class="infoTitle">男女比例</p>
98 98
               </div>
99 99
               <div class="borderBox2">
100
-                <p>男:64人(64%)</p>
101
-                <el-progress :percentage="70"></el-progress>
102
-                <p>女:64人(64%)</p>
103
-                <el-progress :percentage="70"></el-progress>
100
+                <p>男:{{totalMan}}人({{(totalMan/totalGender*100).toFixed(1)}}%)</p>
101
+                <el-progress :percentage="(totalMan/totalGender*100).toFixed(1)"></el-progress>
102
+                <p>女:{{totalWoman}}人({{(totalWoman/totalGender*100).toFixed(1)}}%)</p>
103
+                <el-progress :percentage="(totalWoman/totalGender*100).toFixed(1)"></el-progress>
104 104
               </div>
105 105
             </div>
106 106
             <div class="infoOne">
@@ -109,9 +109,9 @@
109 109
                 <p class="infoTitle">年龄统计</p>
110 110
               </div>
111 111
               <div class="borderBox">
112
-                <p>年龄&lt;20:64人(64%)</p>
112
+                <p>年龄20:64人(64%)</p>
113 113
                 <el-progress :percentage="70"></el-progress>
114
-                <p>20≤年龄≤30:64人(64%)</p>
114
+                <p>20<年龄≤40:64人(64%)</p>
115 115
                 <el-progress :percentage="70"></el-progress>
116 116
                 <p>30≤年龄≤40:64人(64%)</p>
117 117
                 <el-progress :percentage="70"></el-progress>
@@ -150,7 +150,7 @@ import { GetOICData } from "@/api/qcd";
150 150
 import PieChart from "../qcd/components/BarChart";
151 151
 import { uParseTime } from "@/utils/tools";
152 152
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
153
-import {getDialysisModeType} from "@/api/common/common"
153
+import {getDialysisModeType,getTotalLapseCount,getTotalSexCount,getTotalInfectiousCount,getTotalAgeCount} from "@/api/common/common"
154 154
 export default {
155 155
   name: "dialysisTotal",
156 156
   components: {
@@ -178,6 +178,14 @@ export default {
178 178
       ],
179 179
       modetype:[],
180 180
       total:0,
181
+      patientCount:0,
182
+      rollOut:0,
183
+      RetentionCount:0,
184
+      totalMan:0,
185
+      totalWoman:0,
186
+      totalGender:0,
187
+      InfectiousList:[],
188
+      InfectiousTotal:0,
181 189
     };
182 190
   },
183 191
   methods: {
@@ -198,7 +206,8 @@ export default {
198 206
     getDialysisModeType(startDate,endDate){
199 207
       getDialysisModeType(startDate,endDate).then(response=>{
200 208
          if(response.data.state == 1){
201
-           var modetype =  response.data.data.modetype
209
+          var modetype =  response.data.data.modetype
210
+          console.log("mode---",modetype)
202 211
             var total =  response.data.data.total
203 212
             console.log("total",total)
204 213
             this.total = total
@@ -251,12 +260,73 @@ export default {
251 260
            }
252 261
            this.modetype = modetype
253 262
            console.log("modetype",modetype)
254
-           
263
+         
255 264
          }
256 265
       })
257 266
     },
258
-    getTotalCount(id){
259
-      console.log("id",id)
267
+    //统计转归
268
+    getTotalLapseCount(startDate,endDate){
269
+      getTotalLapseCount(startDate,endDate).then(response=>{
270
+         if(response.data.state == 1){
271
+          var patients =  response.data.data.patients
272
+          
273
+          var total = response.data.data.total
274
+          this.rollOut = total
275
+         
276
+          var count = response.data.data.count
277
+        
278
+          this.patientCount = count
279
+          this.RetentionCount = count-total
280
+         }
281
+      })
282
+    },
283
+    getTotalSexCount(timeStar,timeEnd){
284
+      getTotalSexCount(timeStar,timeEnd).then(response=>{
285
+        if(response.data.state === 1){
286
+          var total = response.data.data.total
287
+          this.totalGender = total
288
+          var totalMan = response.data.data.totalSex
289
+          this.totalMan = totalMan
290
+          var totalWoman = total - totalMan
291
+          this.totalWoman = totalWoman
292
+        }
293
+      })
294
+    },
295
+    //统计传染病
296
+    getTotalInfectiousCount(timeStar,timeEnd){
297
+       getTotalInfectiousCount(timeStar,timeEnd).then(response=>{
298
+           if(response.data.state === 1){
299
+             this.InfectiousTotal = response.data.data.total
300
+             var infectious = response.data.data.count
301
+             for(let i=0;i<infectious.length;i++){
302
+               if(infectious[i].disease_id == 2){
303
+                 infectious[i].disease_id = "乙肝"
304
+               }
305
+               if(infectious[i].disease_id == 3){
306
+                 infectious[i].disease_id = "丙肝"
307
+               }
308
+               if(infectious[i].disease_id == 4){
309
+                 infectious[i].disease_id = "艾滋病"
310
+               }
311
+               if(infectious[i].disease_id == 5){
312
+                 infectious[i].disease_id = "肺结核"
313
+               }
314
+               if(infectious[i].disease_id == 6){
315
+                 infectious[i].disease_id = "梅毒"
316
+               }
317
+               this.InfectiousList = infectious
318
+             }
319
+             console.log("infectious-----------",infectious)
320
+           }
321
+       })
322
+    },
323
+    getTotalAgeCount(timeStar,timeEnd){
324
+      getTotalAgeCount(timeStar,timeEnd).then(response=>{
325
+         if(response.data.state == 1){
326
+          var ageCount =  response.data.data.ageCount
327
+          console.log("ageCount",ageCount)
328
+         }
329
+      })
260 330
     }
261 331
   },
262 332
   created() {
@@ -264,8 +334,28 @@ export default {
264 334
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
265 335
       console.log("开始时间",startDate)
266 336
       const endDate = moment(new Date()).format('YYYY-MM-DD')
267
-      console.log("结束时间",endDate)
337
+      console.log("结束时间",endDate) 
338
+      var now = new Date()
339
+      var nowMonth = now.getMonth(); //当前月 
340
+      var nowYear = now.getFullYear(); //当前年 
341
+      //本月的开始时间
342
+      var monthStartDate = new Date(nowYear, nowMonth, 1); 
343
+      var timeStar=Date.parse(monthStartDate)/1000;//s
344
+      console.log("本月第一天",timeStar)
345
+      //本月的结束时间
346
+      var monthEndDate = new Date(nowYear, nowMonth+1, 0);
347
+      var timeEnd=Date.parse(monthEndDate)/1000-1;//s
348
+      console.log("本月最后一天",timeEnd)
349
+      //统计透析总量
268 350
       this.getDialysisModeType(startDate,endDate)
351
+      //统计转归状态
352
+      this.getTotalLapseCount(timeStar,timeEnd)
353
+      //统计男女比例
354
+      this.getTotalSexCount(timeStar,timeEnd)
355
+      //统计传染病
356
+      this.getTotalInfectiousCount(timeStar,timeEnd)
357
+      //统计年龄
358
+      this.getTotalAgeCount(timeStar,timeEnd)
269 359
   },
270 360
 };
271 361
 </script>

+ 1 - 0
src/xt_pages/statistics/index.vue View File

@@ -179,6 +179,7 @@ export default {
179 179
               contagionMap[contagionList[index].id] = contagionList[index].name;
180 180
             }
181 181
             var diseaseCounts = response.data.data.disease_counts;
182
+            console.log("diseaseCounts",diseaseCounts)
182 183
             var diseaseCountsMap = {};
183 184
             for (var index in diseaseCounts) {
184 185
               diseaseCountsMap[diseaseCounts[index].disease_id] =