See999 il y a 4 ans
Parent
révision
9c01e16ba8
1 fichiers modifiés avec 78 ajouts et 54 suppressions
  1. 78 54
      src/xt_pages/medicalScheduling/schedulingStatistics.vue

+ 78 - 54
src/xt_pages/medicalScheduling/schedulingStatistics.vue Voir le fichier

94
                 <el-table-column align="center" prop="address" label="总工时/小时">
94
                 <el-table-column align="center" prop="address" label="总工时/小时">
95
                    <template slot-scope="scope">
95
                    <template slot-scope="scope">
96
                         <span v-if="scope.row.totalminute">{{ scope.row.totalminute / 60 }}</span>
96
                         <span v-if="scope.row.totalminute">{{ scope.row.totalminute / 60 }}</span>
97
-                    </template>
97
+                    </template> 
98
                 </el-table-column>
98
                 </el-table-column>
99
                 <el-table-column align="center" prop="attendance" label="出勤/天">
99
                 <el-table-column align="center" prop="attendance" label="出勤/天">
100
                     <!-- <span v-if='scope.row.attendance'>{{ scope.row.attendance ? scope.row.attendance : '' }}</span> -->
100
                     <!-- <span v-if='scope.row.attendance'>{{ scope.row.attendance ? scope.row.attendance : '' }}</span> -->
178
                         data: [],
178
                         data: [],
179
                         barWidth: 30,
179
                         barWidth: 30,
180
                         label: {
180
                         label: {
181
-                        normal: {
182
-                            show: true,
183
-                            position: "top",
184
-                            formatter: (params) => {
185
-                            if(this.percent.length > 0){
186
-                                let str = ''
187
-                                str = params.data + '('+ this.percent[params.dataIndex] +'%)'
188
-                                return str
189
-                            }else{
190
-                                let str = ''
191
-                                str = params.data
192
-                                return str
181
+                            normal: {
182
+                                show: true,
183
+                                position: "top",
193
                             }
184
                             }
194
-                            }
195
-                        }
196
                         },
185
                         },
197
                         //配置样式
186
                         //配置样式
198
                         itemStyle: {
187
                         itemStyle: {
275
 
264
 
276
         //获取所有排班种
265
         //获取所有排班种
277
         this.getScheduleList()
266
         this.getScheduleList()
278
-
267
+    
279
         // 获取统计表的数据
268
         // 获取统计表的数据
280
         this.getlist()
269
         this.getlist()
281
-
282
-        //获取统计图数据
283
-        this.getchartlist()
284
-
270
+        
271
+        
272
+      
285
     },
273
     },
286
     methods:{
274
     methods:{
287
         getDoctorList(){
275
         getDoctorList(){
295
 
283
 
296
                 this.doctorlist.push(...nurselist)
284
                 this.doctorlist.push(...nurselist)
297
                 this.doctorlist.push(...doctorlist)
285
                 this.doctorlist.push(...doctorlist)
298
-
286
+                
299
                 console.log("医护列表",this.doctorlist)
287
                 console.log("医护列表",this.doctorlist)
288
+                //获取统计图数据
289
+                this.getchartlist()
300
              }
290
              }
301
-
291
+               
302
            })
292
            })
303
         },
293
         },
304
         //搜索
294
         //搜索
308
                this.end_time = this.getTimestamp(this.weekDayArr[6])
298
                this.end_time = this.getTimestamp(this.weekDayArr[6])
309
             }
299
             }
310
             const params = {
300
             const params = {
311
-              keyword:this.keywords,
312
-              start_time:this.start_time,
313
-              end_time:this.end_time,
301
+              keyword:this.keywords, 
314
             }
302
             }
315
             console.log("params",params)
303
             console.log("params",params)
316
             toSearchTotal(params).then(response=>{
304
             toSearchTotal(params).then(response=>{
317
              if(response.data.state == 1){
305
              if(response.data.state == 1){
318
-                var scheudleTotal = response.data.data.scheduletotal
319
-                console.log("scheduletotal",scheudleTotal)
306
+                var scheudleTotal = response.data.data.scheduletotal 
307
+                console.log("scheduletotal",scheudleTotal) 
320
                 var list = response.data.data.list
308
                 var list = response.data.data.list
321
                 console.log("list",list)
309
                 console.log("list",list)
322
                 var workday = response.data.data.workDay
310
                 var workday = response.data.data.workDay
364
                         }
352
                         }
365
                     })
353
                     })
366
                 })
354
                 })
367
-
355
+                
368
                 let arr = [...newArr]
356
                 let arr = [...newArr]
369
-
357
+                
370
                 if(this.keywords != ''){
358
                 if(this.keywords != ''){
371
                     this.tableData = arr
359
                     this.tableData = arr
372
                 }else {
360
                 }else {
374
                     this.doctorlist.sort(this.compare('admin_user_id'))
362
                     this.doctorlist.sort(this.compare('admin_user_id'))
375
                     this.doctorlist.forEach((item, index) => {
363
                     this.doctorlist.forEach((item, index) => {
376
                       if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
364
                       if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
377
-
365
+                    
378
                       }else{
366
                       }else{
379
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
367
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
380
                       }
368
                       }
383
                     this.tableData = arr
371
                     this.tableData = arr
384
                 }
372
                 }
385
               }
373
               }
386
-          })
374
+          })  
387
         },
375
         },
388
         formatDate(date){
376
         formatDate(date){
389
             var year = date.getFullYear()+'.'
377
             var year = date.getFullYear()+'.'
416
                 this.nowYear = this.nowYear - 1
404
                 this.nowYear = this.nowYear - 1
417
             }
405
             }
418
             this.weekNum = this.weekNum - 1
406
             this.weekNum = this.weekNum - 1
419
-            this.getlist()
420
         },
407
         },
421
         //下一周
408
         //下一周
422
         nextclick(){
409
         nextclick(){
430
                 this.weekNum = this.getYearWeek(year, month, date)
417
                 this.weekNum = this.getYearWeek(year, month, date)
431
                 this.nowYear = this.nowYear + 1
418
                 this.nowYear = this.nowYear + 1
432
             }
419
             }
433
-           this.getlist()
434
         },
420
         },
435
         getYearWeek(year,month,date){
421
         getYearWeek(year,month,date){
436
             /*
422
             /*
557
                             }
543
                             }
558
                         })
544
                         })
559
                     })
545
                     })
560
-
546
+                    
561
                     let arr = [...newArr]
547
                     let arr = [...newArr]
562
 
548
 
563
                     arr.sort(this.compare('doctor_id'))
549
                     arr.sort(this.compare('doctor_id'))
564
                     this.doctorlist.sort(this.compare('admin_user_id'))
550
                     this.doctorlist.sort(this.compare('admin_user_id'))
565
                     this.doctorlist.forEach((item, index) => {
551
                     this.doctorlist.forEach((item, index) => {
566
                       if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
552
                       if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
567
-
553
+                    
568
                       }else{
554
                       }else{
569
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
555
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
570
                       }
556
                       }
571
                     })
557
                     })
572
-
558
+                    
573
 
559
 
574
                     console.log('newArr',arr)
560
                     console.log('newArr',arr)
575
                     this.tableData = arr
561
                     this.tableData = arr
583
             }
569
             }
584
             const params = {
570
             const params = {
585
               doctor_type: parseInt(val),
571
               doctor_type: parseInt(val),
586
-              start_time:this.start_time,
587
-              end_time:this.end_time
588
             }
572
             }
589
-            // console.log("params",params)
573
+            console.log("params",params)
590
             changeOption(params).then(response=>{
574
             changeOption(params).then(response=>{
591
               if(response.data.state == 1){
575
               if(response.data.state == 1){
592
                 var scheudleTotal =  response.data.data.scheduletotal
576
                 var scheudleTotal =  response.data.data.scheduletotal
638
                             }
622
                             }
639
                         })
623
                         })
640
                     })
624
                     })
641
-
625
+                    
642
                     let arr = [...newArr]
626
                     let arr = [...newArr]
643
                     if(val == 0){
627
                     if(val == 0){
644
                         arr.sort(this.compare('doctor_id'))
628
                         arr.sort(this.compare('doctor_id'))
645
                         this.doctorlist.sort(this.compare('admin_user_id'))
629
                         this.doctorlist.sort(this.compare('admin_user_id'))
646
                         this.doctorlist.forEach((item, index) => {
630
                         this.doctorlist.forEach((item, index) => {
647
                           if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
631
                           if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
648
-
632
+                        
649
                           }else{
633
                           }else{
650
                             arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
634
                             arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
651
                           }
635
                           }
652
                         })
636
                         })
653
-
637
+                        
654
 
638
 
655
                         console.log('newArr',arr)
639
                         console.log('newArr',arr)
656
                         this.tableData = arr
640
                         this.tableData = arr
659
                         this.doctorArr.sort(this.compare('admin_user_id'))
643
                         this.doctorArr.sort(this.compare('admin_user_id'))
660
                         this.doctorArr.forEach((item, index) => {
644
                         this.doctorArr.forEach((item, index) => {
661
                           if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
645
                           if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
662
-
646
+                        
663
                           }else{
647
                           }else{
664
                             arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
648
                             arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
665
                           }
649
                           }
666
                         })
650
                         })
667
-
651
+                        
668
 
652
 
669
                         console.log('newArr',arr)
653
                         console.log('newArr',arr)
670
                         this.tableData = arr
654
                         this.tableData = arr
673
                         this.nurseArr.sort(this.compare('admin_user_id'))
657
                         this.nurseArr.sort(this.compare('admin_user_id'))
674
                         this.nurseArr.forEach((item, index) => {
658
                         this.nurseArr.forEach((item, index) => {
675
                           if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
659
                           if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
676
-
660
+                        
677
                           }else{
661
                           }else{
678
                             arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
662
                             arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
679
                           }
663
                           }
680
                         })
664
                         })
681
-
665
+                        
682
 
666
 
683
                         console.log('newArr',arr)
667
                         console.log('newArr',arr)
684
                         this.tableData = arr
668
                         this.tableData = arr
685
                     }
669
                     }
686
-
670
+                    
687
               }
671
               }
688
             })
672
             })
689
         },
673
         },
714
                                 }
698
                                 }
715
                             })
699
                             })
716
                         }
700
                         }
717
-
701
+                        
718
                     }
702
                     }
719
                 })
703
                 })
720
                 return Count
704
                 return Count
721
-            }
705
+            }   
722
         },
706
         },
723
         toPrint(){
707
         toPrint(){
724
             this.$router.push({
708
             this.$router.push({
725
                 path: '/medicalScheduling/statistics/print',
709
                 path: '/medicalScheduling/statistics/print',
726
                 // query: { date: date }
710
                 // query: { date: date }
727
-            })
711
+            }) 
728
         },
712
         },
729
         //获取统计图数据
713
         //获取统计图数据
730
         getchartlist(){
714
         getchartlist(){
731
            getchartlist().then(response=>{
715
            getchartlist().then(response=>{
732
-               if(response.data.state == 1){
733
-                 var workdaylist =  response.data.data.workDaylist
734
-                 console.log("早年公共",workdaylist)
735
-               }
716
+                if(response.data.state == 1){
717
+                    var workdaylist =  response.data.data.workDaylist
718
+                    console.log("早年公共",workdaylist)
719
+
720
+
721
+                    let arr = [...workdaylist]
722
+
723
+                    arr.sort(this.compare('doctor_id'))
724
+                    this.doctorlist.sort(this.compare('admin_user_id'))
725
+                    this.doctorlist.forEach((item, index) => {
726
+                        if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
727
+                        
728
+                        }else{
729
+                          arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id,workminute: 0})
730
+                        }
731
+                    })
732
+                    console.log('arrrrrrrrrrrrrrr',arr)
733
+
734
+                    let chartX = []
735
+                    let chartY = []
736
+                    arr.map(item => {
737
+                        chartX.push(item.user_name)
738
+                        chartY.push(item.workminute / 60)
739
+                    })
740
+                    this.chart.xAxis.data = chartX
741
+                    this.chart.series[0].data = chartY
742
+
743
+                    this.getArrLength(this.chart.xAxis.data)
744
+                }
736
            })
745
            })
746
+        },
747
+        getArrLength(result){
748
+            if(result.length > 10){
749
+                var dataZoom_end = (10/result.length)*100;
750
+                this.chart.dataZoom[0].end = dataZoom_end
751
+            }else{
752
+                var dataZoom_end = 100;
753
+                this.chart.dataZoom[0].end = dataZoom_end
754
+            }
737
         }
755
         }
738
     }
756
     }
739
 }
757
 }
769
 .pointTitle {
787
 .pointTitle {
770
   font-size: 13px;
788
   font-size: 13px;
771
 }
789
 }
790
+.statisticsTable{
791
+    ::-webkit-scrollbar{
792
+        height:15px !important;
793
+    }
794
+}
795
+
772
 </style>
796
 </style>