Browse Source

bug修改

XMLWAN 4 years ago
parent
commit
6bfdaad036

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

@@ -289,6 +289,7 @@ export function getInspectionTotalCount(startime, endtime, patientid) {
289 289
     endtime: endtime,
290 290
     patientid: patientid
291 291
   }
292
+  console.log('病人新项目', params)
292 293
   return request({
293 294
     url: '/com/api/getinspectiontotalcount',
294 295
     method: 'get',
@@ -302,6 +303,7 @@ export function getInspectionDetailById(id, startime, endtime) {
302 303
     startime: startime,
303 304
     endtime: endtime
304 305
   }
306
+  console.log('params', params)
305 307
   return request({
306 308
     url: '/com/api/getinspectionDetailById',
307 309
     method: 'get',

+ 1 - 0
src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue View File

@@ -2,6 +2,7 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-button type="primary" @click="$router.back(-1)">返回</el-button>
5 6
     </div>
6 7
     <div class="app-container">
7 8
       <div class="cell clearfix">

+ 3 - 2
src/xt_pages/qcd/officesControlAnalysis/time.vue View File

@@ -619,7 +619,8 @@ export default {
619 619
             arrtwo.map(item => {
620 620
               arr.push(item)
621 621
             })
622
-            arr.sort(this.compare('sort'))    
622
+            arr.sort(this.compare('sort'))  
623
+            console.log("arr",arr)
623 624
             for(const key in this.normData ){
624 625
                this.modesData.xAxis.push(this.normData[key].item_name);
625 626
                 if(key in arr){
@@ -631,7 +632,7 @@ export default {
631 632
             this.chart.series[0].data = this.modesData.series
632 633
             this.chart.xAxis.data = this.modesData.xAxis
633 634
             this.getArrLength(this.chart.xAxis.data)
634
-
635
+            console.log('====',this.modesData) 
635 636
           
636 637
          }
637 638
       })

+ 2 - 0
src/xt_pages/qcd/patientComplianceDetails.vue View File

@@ -356,6 +356,7 @@ export default {
356 356
       })
357 357
     },
358 358
     getlist(){
359
+        console.log("进来没有")
359 360
         this.modesData.series = []
360 361
         this.modesData.xAxis = []
361 362
         const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
@@ -380,6 +381,7 @@ export default {
380 381
        GetQualityControl(params).then(response=>{
381 382
           if(response.data.state == 1){
382 383
             var list = response.data.data.list
384
+            console.log("list",list)
383 385
             for(let i=0;i<list.length;i++){
384 386
               if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
385 387
                     this.isTrue = 1  

+ 74 - 32
src/xt_pages/qcd/patientControlAnalysis.vue View File

@@ -78,7 +78,6 @@
78 78
             <el-table-column fixed prop="name" label="姓名" width="100"></el-table-column>
79 79
             <el-table-column label="透析号" width="80">
80 80
               <template slot-scope="scope">
81
-                  <!-- {{getDialysisNo(scope.row.name)}} -->
82 81
                   {{scope.row.dialysis_no}}
83 82
               </template>
84 83
             </el-table-column>
@@ -91,14 +90,22 @@
91 90
               :key="index"
92 91
             >
93 92
             <template slot-scope="scope">
94
-              <span v-if="scope.row.data[modeItem.item_name].inspect_value == ''">0</span>
95
-              <span v-if="scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) < parseInt(scope.row.data[modeItem.item_name].range_min))">
93
+              <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value == ''">0</span>
94
+              <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) < parseInt(scope.row.data[modeItem.item_name].range_min))">
96 95
                 <span >{{scope.row.data[modeItem.item_name].inspect_value}}</span><span style="color:#5B98FF;margin-left:5px;">↓</span>
97 96
               </span>
98
-              <span v-if="scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) > parseInt(scope.row.data[modeItem.item_name].range_max))">
97
+              <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) > parseInt(scope.row.data[modeItem.item_name].range_max))">
99 98
                 <span>{{scope.row.data[modeItem.item_name].inspect_value}}</span><span style="color:#F56C6C;margin-left:5px;">↑</span>
100 99
               </span>
101
-              <span v-if="scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) >= parseInt(scope.row.data[modeItem.item_name].range_min))&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) <= parseInt(scope.row.data[modeItem.item_name].range_max)) ">{{scope.row.data[modeItem.item_name].inspect_value}}</span>
100
+              <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) >= parseInt(scope.row.data[modeItem.item_name].range_min))&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) <= parseInt(scope.row.data[modeItem.item_name].range_max)) ">{{scope.row.data[modeItem.item_name].inspect_value}}</span>
101
+              <span v-if="scope.row.data[modeItem.item_name].range_type == 2 && scope.row.data[modeItem.item_name].inspect_value !=''">
102
+                <span v-if="scope.row.data[modeItem.item_name].range_value == scope.row.data[modeItem.item_name].inspect_value">
103
+                   <span style="color:#5B98FF;margin-left:5px;" >{{scope.row.data[modeItem.item_name].inspect_value}}</span>
104
+                </span>
105
+                 <span v-if="scope.row.data[modeItem.item_name].range_value != scope.row.data[modeItem.item_name].inspect_value">
106
+                   <span style="color:#F56C6C;margin-left:5px;" >{{scope.row.data[modeItem.item_name].inspect_value}}</span>
107
+                </span>
108
+              </span>
102 109
             </template>
103 110
         </el-table-column>
104 111
             <el-table-column fixed="right" label="操作" width="100">
@@ -153,7 +160,7 @@ export default {
153 160
         start_time: "",
154 161
         end_time: "",
155 162
         page: 1,
156
-        limit: 20
163
+        limit: 10
157 164
       },
158 165
       total:0,
159 166
       lapstor:0,
@@ -358,7 +365,7 @@ export default {
358 365
        getPatientContorlAnalysis(params).then(response=>{
359 366
            if(response.data.state == 1){
360 367
               var control = response.data.data.patientcontorDetail
361
-              console.log("control",control)
368
+             console.log("control",control)
362 369
               let dataInfo = {}
363 370
               control.forEach((item, index) => {
364 371
                 let { inspect_date } = item
@@ -367,8 +374,9 @@ export default {
367 374
                     inspect_date,
368 375
                     name: item.name,
369 376
                     child: [],
370
-                    patient_id: item.patient_id
371
-
377
+                    patient_id: item.patient_id,
378
+                    range_type:item.range_type,
379
+                    dialysis_no:item.dialysis_no
372 380
                   }
373 381
                 }
374 382
               })
@@ -397,7 +405,7 @@ export default {
397 405
                     }
398 406
                   }
399 407
                 }
400
-                console.log("arrthree",arrthree)
408
+                // console.log("arrthree",arrthree)
401 409
                 var arrfour = this.arrayDate(arrthree, newarrtwo)
402 410
                 arrfour.map(item => {
403 411
                   item.item_name = ''
@@ -413,7 +421,6 @@ export default {
413 421
                     dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
414 422
                   }
415 423
                 }
416
-
417 424
                 this.tableData = []
418 425
 
419 426
                 for (const key in dd) {
@@ -422,12 +429,14 @@ export default {
422 429
                       dd[key][this.ObjectData[mkey].item_name] = {
423 430
                         item_name: this.ObjectData[mkey].item_name,
424 431
                         name: mkey,
425
-                        inspect_value: 0
432
+                        inspect_value: 0,
433
+                        range_type:this.ObjectData[mkey].range_type  
426 434
                       }
427 435
                     }
428 436
                   }
429 437
                   this.tableData.push({ name: key, data: dd[key]})
430 438
                 }
439
+                console.log("表哥===========",this.tableData)
431 440
               let dataInfotwo = {}
432 441
               control.forEach((item, index) => {
433 442
                 let { inspect_date } = item
@@ -435,14 +444,17 @@ export default {
435 444
                   dataInfotwo[inspect_date] = {
436 445
                     inspect_date,
437 446
                     name: item.name,
447
+                    dialysis_no:item.dialysis_no
438 448
                   }
439 449
                 }
440 450
               })
441 451
               let listtwo = Object.values(dataInfotwo)
452
+              // console.log("listtwo",listtwo)
442 453
                 listtwo.map(item=>{
443 454
                   this.tableData.map(it=>{
444 455
                     if(item.inspect_date == parseInt(it.name)){
445 456
                       it.name = item.name
457
+                      it.dialysis_no = item.dialysis_no
446 458
                     }
447 459
                   })
448 460
                 })
@@ -480,6 +492,11 @@ export default {
480 492
             var total = response.data.data.total
481 493
             this.total = total
482 494
             var control = response.data.data.control
495
+           var infectiousControl =  response.data.data.infectiousControl
496
+          //  console.log("infectiousContrl",infectiousControl)
497
+           infectiousControl.map(item=>{
498
+             control.push(item)
499
+           })
483 500
             // console.log("control",control)
484 501
             var newArr = []
485 502
             // 分页
@@ -499,7 +516,8 @@ export default {
499 516
                 inspect_date,
500 517
                 name: item.name,
501 518
                 child: [],
502
-                patient_id: item.patient_id
519
+                patient_id: item.patient_id,
520
+                range_type:item.range_type
503 521
               }
504 522
             }
505 523
           })
@@ -557,19 +575,20 @@ export default {
557 575
                 name: item.name,
558 576
                 inspect_value:item.inspect_value,
559 577
                 id:item.id,
560
-                inspect_date:item.inspect_date
578
+                inspect_date:item.inspect_date,
561 579
               }
562 580
             }
563 581
           })
564 582
         let listtwo = Object.values(dataInfotwo)
565
-        console.log("listtwo",listtwo)
583
+        // console.log("listtwo",listtwo)
566 584
           for (const key in dd) {
567 585
             for (const mkey in this.ObjectData) {
568 586
               if (!(this.ObjectData[mkey].item_name in dd[key])) {
569 587
                 dd[key][this.ObjectData[mkey].item_name] = {
570 588
                   item_name: this.ObjectData[mkey].item_name,
571 589
                   name: mkey,
572
-                  inspect_value: 0
590
+                  inspect_value: 0,
591
+                  range_type:this.ObjectData[mkey].range_type
573 592
                 }
574 593
               }
575 594
             }
@@ -593,7 +612,7 @@ export default {
593 612
                }
594 613
              }
595 614
           }
596
-         console.log("表哥123",this.tableData)
615
+        //  console.log("表哥123",this.tableData)
597 616
          }
598 617
       })
599 618
     },
@@ -628,32 +647,49 @@ export default {
628 647
        getCartogramlist(this.lapstor,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
629 648
            if(response.data.state == 1){
630 649
               var cartogramlist =  response.data.data.cartogramlist
631
-            //  console.log("cartogramlist",cartogramlist)
650
+              // console.log("cartogramlist",cartogramlist)
632 651
               var totaltwo =  response.data.data.total
633 652
               // console.log("totaltwo",totaltwo)
653
+              var infectiouscontrol =  response.data.data.infectiouscontrol
654
+              // console.log("infectiouscontrol",infectiouscontrol)
655
+              infectiouscontrol.map(item=>{
656
+                cartogramlist.push(item)
657
+              })
634 658
                var cart = []
635
-               for(let i=0;i<cartogramlist.length;i++){
636
-                  if(cartogramlist[i].inspect_value != ''){
637
-                    cart.push(cartogramlist[i])
638
-                  }
639
-               }
659
+              //  console.log("已配置的选项",this.normData)
660
+              //过滤已经配置的选项
661
+              for(let i=0;i<cartogramlist.length;i++){
662
+                for(let j=0;j<this.normData.length;j++){
663
+                   if(cartogramlist[i].item_id == this.normData[j].inspection_minor){
664
+                        cart.push(cartogramlist[i])
665
+                   }
666
+                }
667
+              }
668
+            //  console.log("cart",cart)
669
+
670
+              //  for(let i=0;i<cartogramlist.length;i++){
671
+              //     if(cartogramlist[i].inspect_value != ''){
672
+              //       cart.push(cartogramlist[i])
673
+              //     }
674
+              //  }
640 675
               // console.log("cart",cart)
641 676
                let dataInfo = {}
642 677
                 cart.forEach((item, index) => {
643
-                  let { inspect_date } = item
644
-                  if (!dataInfo[inspect_date]) {
645
-                    dataInfo[inspect_date] = {
646
-                      inspect_date,
678
+                  let { patient_id } = item
679
+                  if (!dataInfo[patient_id]) {
680
+                    dataInfo[patient_id] = {
681
+                      patient_id,
647 682
                       name:item.name,
648 683
                       child: [],
649
-                      patient_id:item.patient_id,
684
+                      inspect_date:item.inspect_date,
650 685
                       total:0,
651 686
                       count:0,
687
+                      infectotal:0,
652 688
                     }
653 689
                   }
654 690
                 })
655 691
               let list = Object.values(dataInfo)
656
-              console.log("list",list)
692
+
657 693
 
658 694
               var arr = []
659 695
               list.map(item=>{
@@ -665,18 +701,24 @@ export default {
665 701
               })
666 702
 
667 703
 
668
-
704
+          //  console.log("list",list)
669 705
              list.map(item=>{
670 706
                 item.child.map(it=>{
671
-                   if(parseInt(it.range_min)<=parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max)){
707
+                  //  console.log("长度",item.child.length)
708
+                  //  console.log("it",it)
709
+                   if(it.range_type == 1 && parseInt(it.range_min)<=parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max)){
672 710
                        item.total ++
673 711
                    }
712
+                   if(it.range_type == 2 && it.inspect_value == it.range_value){
713
+                      item.infectotal ++
714
+                   }
674 715
                 })
675 716
              })
717
+            //  console.log("list",list)
676 718
              var standardTotal = 0
677 719
 
678 720
              list.map(item=>{
679
-               if(item.total == item.child.length){
721
+               if((item.total +item.infectotal) == item.child.length){
680 722
                   item.count ++
681 723
                }
682 724
              })

+ 31 - 8
src/xt_pages/qcd/statisticalConfiguration.vue View File

@@ -22,7 +22,14 @@
22 22
              <template slot-scope="scope">{{ scope.row.item_name }}</template>
23 23
           </el-table-column>
24 24
           <el-table-column prop="address" label="范围">
25
-             <template slot-scope="scope">{{ scope.row.min_range }} - {{scope.row.large_range}}</template>
25
+             <template slot-scope="scope">
26
+               <span v-if="scope.row.range_type == 1">
27
+                 {{ scope.row.min_range }} - {{scope.row.large_range}}
28
+                </span>
29
+                <span v-if="scope.row.range_type == 2">
30
+                   {{scope.row.range_value}}
31
+                </span>
32
+             </template>
26 33
           </el-table-column>
27 34
            <el-table-column prop="address" label="单位">
28 35
               <template slot-scope="scope">{{ scope.row.unit }}</template>
@@ -75,9 +82,9 @@
75 82
             </el-select>
76 83
           </el-form-item>
77 84
        
78
-            <el-form-item label="检类型" :label-width="formLabelWidth" required prop="check_type">
85
+            <el-form-item label="检查结果类型" :label-width="formLabelWidth" required prop="check_type">
79 86
                     <el-radio
80
-                      :disabled = "true"
87
+                      @change="chageType"
81 88
                       v-model="form.check_type"
82 89
                       v-for="item in radioType"
83 90
                       :key="item.label"
@@ -135,9 +142,9 @@
135 142
                 </el-option>
136 143
             </el-select>
137 144
           </el-form-item>
138
-          <el-form-item label="检类型" :label-width="formLabelWidth" required prop="check_type">
145
+          <el-form-item label="检查结果类型" :label-width="formLabelWidth" required prop="check_type">
139 146
                 <el-radio
140
-                  :disabled = "true"
147
+                   @change = "chageType"
141 148
                    v-model="editform.check_type"
142 149
                    v-for="item in radioType"
143 150
                    :key="item.label"
@@ -191,8 +198,8 @@ export default {
191 198
         { path: false, name: "质控达标统计配置" }
192 199
       ],
193 200
      radioType: [
194
-        { value: 1, label: "数值范围" },
195
-        { value: 2, label: "选项" }
201
+        { value: 1, label: "数值类型" },
202
+        { value: 2, label: "非数值类型" }
196 203
       ],
197 204
       tabActiveName: "control",
198 205
       InspectionMajor:[],
@@ -226,7 +233,8 @@ export default {
226 233
         inspectionMinor: [{ required: true, message: "检查小项不能为空" }],
227 234
         large_range:[{required:true,message:"质控范围不能为空"}],
228 235
         min_range:[{required:true,message:"质控范围不能为空"}],
229
-        check_type:[{required:true,message:"检验类型不能为空"}]
236
+        check_type:[{required:true,message:"检验类型不能为空"}],
237
+        range_value:[{required:true,message:"参考值不能为空"}]
230 238
       },
231 239
       page:1,
232 240
       limit:10,
@@ -290,6 +298,7 @@ export default {
290 298
     },
291 299
     //获取小项
292 300
     changeInspection(id){
301
+       this.form.inspectionMinor = ""
293 302
       getInspectionMinor(id).then(response=>{
294 303
         if(response.data.state == 1){
295 304
          var inspection =  response.data.data.inspection
@@ -451,6 +460,20 @@ export default {
451 460
         }
452 461
       })
453 462
     },
463
+    chageType(val){
464
+      if(val == 1){
465
+         this.showOne = true
466
+         this.showTwo = false
467
+         this.form.range_value = ""
468
+         this.editform.range_value = ""
469
+      }
470
+      if(val == 2){
471
+         this.showOne = false
472
+         this.showTwo = true
473
+         this.form.range_value = ""
474
+         this.editform.range_value = ""
475
+      }
476
+    }
454 477
   },
455 478
   components: {
456 479
     PieChart,

+ 139 - 54
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue View File

@@ -59,6 +59,7 @@
59 59
           height="500" :row-style="{ color: '#303133' }" 
60 60
           :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
61 61
           highlight-current-row
62
+           ref="singleTable"
62 63
           @current-change="handleChange"
63 64
           >
64 65
            <el-table-column prop="dialysis_no" label="透析号" width="80">
@@ -91,6 +92,7 @@ export default {
91 92
   },
92 93
   data() {
93 94
     return {
95
+      patient_id:0,
94 96
       listQuery: {
95 97
         start_time: "",
96 98
         end_time: "",
@@ -242,13 +244,19 @@ export default {
242 244
     getCurrentOrgPatients(){
243 245
       getCurrentOrgPatients().then(response=>{
244 246
          var patients = response.data.data.patients
247
+         for(let i=0;i<patients.length;i++){
248
+            this.$refs.singleTable.setCurrentRow(patients[0])
249
+            this.patient_id = patients[0].id
250
+         }
245 251
          this.patientsData = patients
252
+          //获取检验检查项目
253
+         this.getInspectionTotalCount()
246 254
       })
247 255
     },
248 256
     getInspectionTotalCount(){
249 257
       this.modesData.series = []
250 258
       this.modesData.xAxis = []
251
-      getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time).then(response=>{
259
+      getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time,this.patient_id).then(response=>{
252 260
         if(response.data.state === 1){
253 261
           var Inspection = response.data.data.Inspection
254 262
     
@@ -265,7 +273,7 @@ export default {
265 273
             }
266 274
           }
267 275
         
268
-          var arrtwo =  this.arrayDate(counts,this.normData)
276
+          // var arrtwo =  this.arrayDate(counts,this.normData)
269 277
           
270 278
           var hash = {};
271 279
           var i = 0;
@@ -297,7 +305,7 @@ export default {
297 305
           res.map(item => {
298 306
             this.modesData.series.push(parseInt(item.Count));
299 307
           })
300
-          console.log("this=====",this.tableData)
308
+          // console.log("this=====",this.tableData)
301 309
           for (const key in this.tableData) {
302 310
             this.modesData.xAxis.push(this.tableData[key].project_name);
303 311
             let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
@@ -319,34 +327,84 @@ export default {
319 327
        getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
320 328
           if(response.data.state === 1){
321 329
             var patientdetail = response.data.data.patientdetail
322
-            console.log("patientdetail",patientdetail)
330
+            // console.log("patientdetail",patientdetail)
323 331
             var arr=[]
324
-            for(let i=0;i<this.tableData.length;i++){
325
-              for(let j=0;j<patientdetail.length;j++){
326
-                 if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
327
-                    arr.push(patientdetail[j])
328
-                 }
332
+
333
+          for(let i=0;i<this.tableData.length;i++){
334
+            for(let j=0;j<patientdetail.length;j++){
335
+              if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
336
+                arr.push(patientdetail[j])
329 337
               }
330 338
             }
331
-            
332
-           let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
333
-           let day = parseInt(time / (1000 * 60 * 60 * 24))
334
-           console.log("arr",arr)
335
-           console.log("tabledata",this.tableData)
336
-            for (const key in this.tableData) {
337
-              this.modesData.xAxis.push(this.tableData[key].project_name);
338
-              if (key in arr) {
339
-                this.modesData.series.push(parseInt(arr[key].Count));
340
-                this.obj.push(Math.round(day / arr[key].InspectionFrequency))
341
-                // batotal += parseInt(res[key].Count);
342
-              } else {
343
-                this.modesData.series.push(0);
344
-                this.obj.push(0)
345
-              }
339
+          }
340
+          // console.log('arr',arr)
341
+         
342
+          
343
+          var hash = {};
344
+          var i = 0;
345
+          var res = [];
346
+          arr.forEach(function(item) {
347
+            var ProjectName = item.ProjectName;
348
+            hash[ProjectName] ? res[hash[ProjectName] - 1].Count.push(item.Count) : hash[ProjectName] = ++i && res.push({
349
+                Count: [item.Count],
350
+                ProjectName: ProjectName,
351
+                ProjectId: item.ProjectId,
352
+                Sort:item.Sort,
353
+            })
354
+          });
355
+          
356
+          res.map(item => {
357
+            item.Count = eval(item.Count.join('+'))
358
+          })
359
+          
360
+          let arr1 = []
361
+          this.tableData.map(it => {
362
+            arr1.push(it.project_name)
363
+          })
364
+
365
+          arr1.forEach((item,index)=>{
366
+            if(!(res[index] && item ==res[index].ProjectName)){
367
+              res.splice(index,0,{Count:0, ProjectName: item, Sort: index+1})
346 368
             }
347
-            this.chart.series[0].data = this.modesData.series
348
-            this.chart.xAxis.data = this.modesData.xAxis
349
-            this.getArrLength(this.chart.xAxis.data)
369
+          })
370
+          res.map(item => {
371
+            this.modesData.series.push(parseInt(item.Count));
372
+          })
373
+          // console.log("this=====",this.tableData)
374
+          for (const key in this.tableData) {
375
+            this.modesData.xAxis.push(this.tableData[key].project_name);
376
+            let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
377
+            let day = parseInt(time / (1000 * 60 * 60 * 24))
378
+            this.obj.push(Math.round(day / this.tableData[key].inspection_frequency))
379
+          }
380
+          
381
+          this.chart.series[0].data = this.modesData.series
382
+          this.chart.xAxis.data = this.modesData.xAxis
383
+          this.getArrLength(this.chart.xAxis.data)
384
+          //   for(let i=0;i<this.tableData.length;i++){
385
+          //     for(let j=0;j<patientdetail.length;j++){
386
+          //        if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
387
+          //           arr.push(patientdetail[j])
388
+          //        }
389
+          //     }
390
+          //   }
391
+            
392
+          //  let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
393
+          //  let day = parseInt(time / (1000 * 60 * 60 * 24))
394
+          //  console.log("tabledata",this.tableData)
395
+          //   for (const key in this.tableData) {
396
+          //     this.modesData.xAxis.push(this.tableData[key].project_name);
397
+          //     if (key in arr) {
398
+          //       this.modesData.series.push(parseInt(arr[key].Count));
399
+          //       this.obj.push(Math.round(day / arr[key].InspectionFrequency))
400
+          //     } else {
401
+          //       this.modesData.series.push(0);
402
+          //       this.obj.push(0)
403
+          //     }
404
+          //   }
405
+          //   this.chart.series[0].data = this.modesData.series
406
+          //   this.chart.xAxis.data = this.modesData.xAxis
407
+          //   this.getArrLength(this.chart.xAxis.data)
350 408
           }
351 409
        })
352 410
     },
@@ -358,32 +416,60 @@ export default {
358 416
       getSearchPatientInfo(this.patient_id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
359 417
          if(response.data.state  === 1){
360 418
            var PatientsInfo = response.data.data.PatientsInfo
361
-           console.log("patientsInfo",PatientsInfo)
419
+          //  console.log("patientsInfo",PatientsInfo)
362 420
            var arr = []
363
-           for(let i=0;i<this.tableData.length;i++){
364
-             for(let j=0;j<PatientsInfo.length;j++){
365
-                 if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
366
-                    arr.push(PatientsInfo[j])
367
-                 }
368
-             }
369
-           }
370
-           let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
371
-           let day = parseInt(time / (1000 * 60 * 60 * 24))
372
-       
373
-            for (const key in this.tableData) {
374
-              this.modesData.xAxis.push(this.tableData[key].project_name);
375
-              if (key in arr) {
376
-                this.modesData.series.push(parseInt(arr[key].Count));
377
-                this.obj.push(Math.round(day / arr[key].InspectionFrequency))
378
-                // batotal += parseInt(res[key].Count);
379
-              } else {
380
-                this.modesData.series.push(0);
381
-                this.obj.push(0)
421
+        
422
+          for(let i=0;i<this.tableData.length;i++){
423
+            for(let j=0;j<PatientsInfo.length;j++){
424
+              if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
425
+                arr.push(PatientsInfo[j])
382 426
               }
383 427
             }
384
-            this.chart.series[0].data = this.modesData.series
385
-            this.chart.xAxis.data = this.modesData.xAxis
386
-            this.getArrLength(this.chart.xAxis.data)
428
+          }
429
+          // console.log('arr',arr)
430
+         
431
+          
432
+          var hash = {};
433
+          var i = 0;
434
+          var res = [];
435
+          arr.forEach(function(item) {
436
+            var ProjectName = item.ProjectName;
437
+            hash[ProjectName] ? res[hash[ProjectName] - 1].Count.push(item.Count) : hash[ProjectName] = ++i && res.push({
438
+                Count: [item.Count],
439
+                ProjectName: ProjectName,
440
+                ProjectId: item.ProjectId,
441
+                Sort:item.Sort,
442
+            })
443
+          });
444
+          
445
+          res.map(item => {
446
+            item.Count = eval(item.Count.join('+'))
447
+          })
448
+          
449
+          let arr1 = []
450
+          this.tableData.map(it => {
451
+            arr1.push(it.project_name)
452
+          })
453
+
454
+          arr1.forEach((item,index)=>{
455
+            if(!(res[index] && item ==res[index].ProjectName)){
456
+              res.splice(index,0,{Count:0, ProjectName: item, Sort: index+1})
457
+            }
458
+          })
459
+          res.map(item => {
460
+            this.modesData.series.push(parseInt(item.Count));
461
+          })
462
+          // console.log("this=====",this.tableData)
463
+          for (const key in this.tableData) {
464
+            this.modesData.xAxis.push(this.tableData[key].project_name);
465
+            let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
466
+            let day = parseInt(time / (1000 * 60 * 60 * 24))
467
+            this.obj.push(Math.round(day / this.tableData[key].inspection_frequency))
468
+          }
469
+          
470
+          this.chart.series[0].data = this.modesData.series
471
+          this.chart.xAxis.data = this.modesData.xAxis
472
+          this.getArrLength(this.chart.xAxis.data)
387 473
          }
388 474
       })
389 475
     },
@@ -418,7 +504,7 @@ export default {
418 504
       PostSearch(key).then(response => {
419 505
         if (response.data.state == 1) {
420 506
             searchArray = response.data.data.patient
421
-            console.log("searchArray",searchArray)
507
+            // console.log("searchArray",searchArray)
422 508
           cb(searchArray)
423 509
         } else {
424 510
           cb([])
@@ -426,7 +512,7 @@ export default {
426 512
       })
427 513
     },
428 514
     handleSelect(val) {
429
-      console.log("val",val)
515
+      // console.log("val",val)
430 516
       this.listQuery.search = val.name
431 517
       this.patient_id = val.id
432 518
       this.onSearch()
@@ -465,8 +551,7 @@ export default {
465 551
 
466 552
     //获取该机构下的所有患者
467 553
     this.getCurrentOrgPatients()
468
-    //获取检验检查项目
469
-    this.getInspectionTotalCount()
554
+   
470 555
   }
471 556
 };
472 557
 </script>

+ 7 - 7
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

@@ -191,15 +191,15 @@ export default {
191 191
       getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
192 192
          if(response.data.state === 1){
193 193
           var list = response.data.data.list
194
-          console.log("list",list)
194
+          // console.log("list",list)
195 195
           var totallist  =  response.data.data.totallist
196
-           console.log("totallist",totallist)
196
+          //  console.log("totallist",totallist)
197 197
           this.total = totallist  
198 198
           var prescriptionList = response.data.data.prescriptionList
199
-          console.log("prescriptionList",prescriptionList)
199
+          // console.log("prescriptionList",prescriptionList)
200 200
           this.getModeId(prescriptionList)
201 201
           var count = response.data.data.count
202
-          console.log("count",count)
202
+          // console.log("count",count)
203 203
           this.DialysisCount = count
204 204
           // for(let i=0;i<count.length;i++){
205 205
           //  for(let j=0;j<prescriptionList.length;j++){
@@ -225,7 +225,7 @@ export default {
225 225
             }
226 226
           })
227 227
           let list = Object.values(dataInfo)
228
-          console.log("arr",list)    
228
+          // console.log("arr",list)    
229 229
           list.map(item => {
230 230
             for (let i = 0; i < prescriptionList.length; i++) {
231 231
               if (item.patient_id === prescriptionList[i].patient_id) {
@@ -380,7 +380,7 @@ export default {
380 380
         PostSearch(key).then(response => {
381 381
           if (response.data.state == 1) {
382 382
              searchArray = response.data.data.patient
383
-             console.log("searchArray",searchArray)
383
+            //  console.log("searchArray",searchArray)
384 384
             cb(searchArray)
385 385
           } else {
386 386
             cb([])
@@ -388,7 +388,7 @@ export default {
388 388
         })
389 389
       },
390 390
    handleSelect(val) {
391
-        console.log("val",val)
391
+        // console.log("val",val)
392 392
         this.listQuery.search = val.name
393 393
         this.patient_id = val.id
394 394
         this.onSearch()