瀏覽代碼

Merge branch 'vue_statistics_branch' of http://git.shengws.com/csx/Vue_New into vue_statistics_branch

csx 4 年之前
父節點
當前提交
30271f002e
共有 1 個文件被更改,包括 76 次插入25 次删除
  1. 76 25
      src/xt_pages/qcd/basicInformationAnalysis.vue

+ 76 - 25
src/xt_pages/qcd/basicInformationAnalysis.vue 查看文件

@@ -70,8 +70,30 @@
70 70
               </div>
71 71
               <div class="borderBox2">
72 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>
73
+                 <span v-if="item.disease_id == 2">
74
+                    <p>乙肝:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
75
+                    <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
76
+                  </span>
77
+                  <span v-if="item.disease_id == 3">
78
+                    <p>丙肝:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
79
+                    <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
80
+                  </span>
81
+                   <span v-if="item.disease_id == 4">
82
+                    <p>艾滋病:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
83
+                    <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
84
+                  </span>
85
+                  <span v-if="item.disease_id == 5">
86
+                    <p>肺结核:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
87
+                    <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
88
+                  </span>
89
+                   <span v-if="item.disease_id == 6">
90
+                      <p>梅毒:{{item.count}}人({{(item.count/InfectiousTotal*100).toFixed(1)}}%)</p>
91
+                      <el-progress :percentage="(item.count/InfectiousTotal*100).toFixed(1)"></el-progress>
92
+                  </span>
93
+                    <span v-if="item.disease_id == 1">
94
+                      <p>其他:{{item.count + otherTotal}}人({{((item.count+otherTotal)/InfectiousTotal*100).toFixed(1)}}%)</p>
95
+                      <el-progress :percentage="((item.count+otherTotal)/InfectiousTotal*100).toFixed(1)"></el-progress>
96
+                  </span>
75 97
                 </div>
76 98
               </div>
77 99
             </div>
@@ -202,6 +224,7 @@ export default {
202 224
       InfectiousTotal:0,
203 225
       ageCount:[],
204 226
       ageTotal:0,
227
+      otherTotal:0,
205 228
     };
206 229
   },
207 230
   methods: {
@@ -297,12 +320,15 @@ export default {
297 320
          }
298 321
       })
299 322
     },
323
+    //统计男女比例
300 324
     getTotalSexCount(timeStar,timeEnd){
301 325
       getTotalSexCount(timeStar,timeEnd).then(response=>{
302 326
         if(response.data.state === 1){
303 327
           var total = response.data.data.total
328
+        //  console.log("总人数",total)
304 329
           this.totalGender = total
305 330
           var totalMan = response.data.data.totalSex
331
+       //  console.log("男人",totalMan)
306 332
           this.totalMan = totalMan
307 333
           var totalWoman = total - totalMan
308 334
           this.totalWoman = totalWoman
@@ -315,25 +341,31 @@ export default {
315 341
            if(response.data.state === 1){
316 342
              this.InfectiousTotal = response.data.data.total
317 343
              var infectious = response.data.data.count
318
-             for(let i=0;i<infectious.length;i++){
319
-               if(infectious[i].disease_id == 2){
320
-                 infectious[i].disease_id = "乙肝"
321
-               }
322
-               if(infectious[i].disease_id == 3){
323
-                 infectious[i].disease_id = "丙肝"
324
-               }
325
-               if(infectious[i].disease_id == 4){
326
-                 infectious[i].disease_id = "艾滋病"
327
-               }
328
-               if(infectious[i].disease_id == 5){
329
-                 infectious[i].disease_id = "肺结核"
330
-               }
331
-               if(infectious[i].disease_id == 6){
332
-                 infectious[i].disease_id = "梅毒"
333
-               }
334
-               this.InfectiousList = infectious
335
-             }
336
-             console.log("infectious-----------",infectious)
344
+             this.InfectiousList = infectious
345
+           // for(let i=0;i<infectious.length;i++){
346
+           //   if(infectious[i].disease_id == 1){
347
+           //      infectious[i].disease_id = "其他"
348
+            //   }
349
+            //   if(infectious[i].disease_id == 2){
350
+            //     infectious[i].disease_id = "乙肝"
351
+            //   }
352
+           //    if(infectious[i].disease_id == 3){
353
+            //     infectious[i].disease_id = "丙肝"
354
+           //    }
355
+            //   if(infectious[i].disease_id == 4){
356
+            //     infectious[i].disease_id = "艾滋病"
357
+            //   }
358
+            //   if(infectious[i].disease_id == 5){
359
+            //     infectious[i].disease_id = "肺结核"
360
+            //   }
361
+            //   if(infectious[i].disease_id == 6){
362
+            //     infectious[i].disease_id = "梅毒"
363
+            //   }
364
+               
365
+            // }
366
+             var otherTotal = response.data.data.otherTotal
367
+             this.otherTotal = otherTotal
368
+             // console.log("infectious-----------",otherTotal)
337 369
            }
338 370
        })
339 371
     },
@@ -342,15 +374,34 @@ export default {
342 374
          if(response.data.state == 1){
343 375
           var ageCount =  response.data.data.ageCount
344 376
           this.ageCount = ageCount
345
-          console.log("ageCount",ageCount)
377
+        //  console.log("ageCount",ageCount)
346 378
           this.ageTotal =  response.data.data.total
347 379
          // var two = response.data.data.two
348 380
         //  console.log("two",two)
381
+       
349 382
          }
350 383
       })
351 384
     },
385
+    //统计透析年龄
352 386
     getTotalDialysisCount(timeStar,timeEnd){
353 387
       getTotalDialysisCount(timeStar,timeEnd).then(response=>{
388
+         if(response.data.state == 1){
389
+           var patients = response.data.data.patients
390
+           var now = new Date()
391
+           var nowMonth = now.getMonth(); //当前月 
392
+           var nowYear = now.getFullYear(); //当前年 
393
+           var notime =  moment(new Date()).format('YYYY-MM-DD')
394
+           var nowdataunix =  Date.parse(notime)/1000
395
+           console.log("档期是---------------",nowdataunix)
396
+           for(let i=0;i<patients.length;i++){
397
+             if(patients[i].first_dialysis_date){
398
+             }
399
+           }
400
+           console.log("patients",patients)
401
+            var date =  new Date(1212508800)
402
+          console.log("date",date)
403
+          
404
+         }
354 405
       })
355 406
     }
356 407
   },
@@ -359,18 +410,18 @@ export default {
359 410
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
360 411
       console.log("开始时间",startDate)
361 412
       const endDate = moment(new Date()).format('YYYY-MM-DD')
362
-      console.log("结束时间",endDate) 
413
+     // console.log("结束时间",endDate) 
363 414
       var now = new Date()
364 415
       var nowMonth = now.getMonth(); //当前月 
365 416
       var nowYear = now.getFullYear(); //当前年 
366 417
       //本月的开始时间
367 418
       var monthStartDate = new Date(nowYear, nowMonth, 1); 
368 419
       var timeStar=Date.parse(monthStartDate)/1000;//s
369
-      console.log("本月第一天",timeStar)
420
+     // console.log("本月第一天",timeStar)
370 421
       //本月的结束时间
371 422
       var monthEndDate = new Date(nowYear, nowMonth+1, 0);
372 423
       var timeEnd=Date.parse(monthEndDate)/1000-1;//s
373
-      console.log("本月最后一天",timeEnd)
424
+     // console.log("本月最后一天",timeEnd)
374 425
       //统计透析总量
375 426
       this.getDialysisModeType(startDate,endDate)
376 427
       //统计转归状态