|
@@ -89,7 +89,7 @@
|
89
|
89
|
<line-chart :options="chart"></line-chart>
|
90
|
90
|
</div>
|
91
|
91
|
<div class="tableTitle">统计表</div>
|
92
|
|
- <el-table class='statisticsTable' :data="tableData" height="250" border ref="tab">
|
|
92
|
+ <el-table class='statisticsTable' :data="tableData" height="250" border ref="tab" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }">
|
93
|
93
|
<el-table-column fixed align="center" prop="date" label="医护姓名" width="100">
|
94
|
94
|
<template slot-scope="scope">
|
95
|
95
|
<span>{{scope.row.user_name}}</span>
|
|
@@ -656,84 +656,89 @@ export default {
|
656
|
656
|
|
657
|
657
|
// this.getArrLength(this.chart.xAxis.data)
|
658
|
658
|
let tempArr = [], newArr = []
|
659
|
|
- for (let i = 0; i < scheudleTotal.length; i++) {
|
660
|
|
- if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
|
661
|
|
- newArr.push({
|
662
|
|
- user_name: scheudleTotal[i].user_name,
|
663
|
|
- doctor_id:scheudleTotal[i].doctor_id,
|
664
|
|
- list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
|
665
|
|
- })
|
666
|
|
- tempArr.push(scheudleTotal[i].user_name);
|
667
|
|
- } else {
|
668
|
|
- for (let j = 0; j < newArr.length; j++) {
|
669
|
|
- if (newArr[j].user_name == scheudleTotal[i].user_name) {
|
670
|
|
- newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
|
671
|
|
- }
|
|
659
|
+ for (let i = 0; i < scheudleTotal.length; i++) {
|
|
660
|
+ if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
|
|
661
|
+ newArr.push({
|
|
662
|
+ user_name: scheudleTotal[i].user_name,
|
|
663
|
+ doctor_id:scheudleTotal[i].doctor_id,
|
|
664
|
+ list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
|
|
665
|
+ })
|
|
666
|
+ tempArr.push(scheudleTotal[i].user_name);
|
|
667
|
+ } else {
|
|
668
|
+ for (let j = 0; j < newArr.length; j++) {
|
|
669
|
+ if (newArr[j].user_name == scheudleTotal[i].user_name) {
|
|
670
|
+ newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
|
672
|
671
|
}
|
673
|
672
|
}
|
674
|
673
|
}
|
|
674
|
+ }
|
675
|
675
|
|
676
|
|
- newArr.map(item => {
|
677
|
|
- list.map(it => {
|
678
|
|
- if(item.doctor_id == it.doctor_id){
|
679
|
|
- item.totalminute = it.totalminute
|
680
|
|
- }
|
681
|
|
- })
|
|
676
|
+ newArr.map(item => {
|
|
677
|
+ list.map(it => {
|
|
678
|
+ if(item.doctor_id == it.doctor_id){
|
|
679
|
+ item.totalminute = it.totalminute
|
|
680
|
+ }
|
682
|
681
|
})
|
683
|
|
- newArr.map(item => {
|
684
|
|
- workday.map(it => {
|
685
|
|
- if(item.doctor_id == it.doctor_id){
|
686
|
|
- item.attendance = it.Count
|
687
|
|
- }
|
688
|
|
- })
|
|
682
|
+ })
|
|
683
|
+ newArr.map(item => {
|
|
684
|
+ workday.map(it => {
|
|
685
|
+ if(item.doctor_id == it.doctor_id){
|
|
686
|
+ item.attendance = it.Count
|
|
687
|
+ }
|
689
|
688
|
})
|
690
|
|
- newArr.map(item => {
|
691
|
|
- noWorkDay.map(it => {
|
692
|
|
- if(item.doctor_id == it.doctor_id){
|
693
|
|
- item.absence = it.Count
|
694
|
|
- }
|
695
|
|
- })
|
|
689
|
+ })
|
|
690
|
+ newArr.map(item => {
|
|
691
|
+ noWorkDay.map(it => {
|
|
692
|
+ if(item.doctor_id == it.doctor_id){
|
|
693
|
+ item.absence = it.Count
|
|
694
|
+ }
|
696
|
695
|
})
|
697
|
|
-
|
698
|
|
- let arr = [...newArr]
|
699
|
|
- if(val == 0){
|
700
|
|
- arr.sort(this.compare('doctor_id'))
|
701
|
|
- this.doctorlist.sort(this.compare('admin_user_id'))
|
702
|
|
- this.doctorlist.forEach((item, index) => {
|
703
|
|
- if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
704
|
|
-
|
705
|
|
- }else{
|
706
|
|
- arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
|
707
|
|
- }
|
708
|
|
- })
|
709
|
|
-
|
710
|
|
- this.tableData = arr
|
711
|
|
- }else if(val == 2){
|
712
|
|
- arr.sort(this.compare('doctor_id'))
|
713
|
|
- this.doctorArr.sort(this.compare('admin_user_id'))
|
714
|
|
- this.doctorArr.forEach((item, index) => {
|
715
|
|
- if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
716
|
|
-
|
717
|
|
- }else{
|
718
|
|
- arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
|
719
|
|
- }
|
720
|
|
- })
|
721
|
|
- this.tableData = arr
|
722
|
|
- }else if(val == 3){
|
723
|
|
- arr.sort(this.compare('doctor_id'))
|
724
|
|
- this.nurseArr.sort(this.compare('admin_user_id'))
|
725
|
|
- this.nurseArr.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, list: []})
|
730
|
|
- }
|
731
|
|
- })
|
732
|
|
- this.tableData = arr
|
733
|
|
- this.$nextTick(() => {
|
734
|
|
- this.$refs.tab.doLayout()
|
735
|
|
- })
|
736
|
|
- }
|
|
696
|
+ })
|
|
697
|
+
|
|
698
|
+ let arr = [...newArr]
|
|
699
|
+ if(val == 0){
|
|
700
|
+ arr.sort(this.compare('doctor_id'))
|
|
701
|
+ this.doctorlist.sort(this.compare('admin_user_id'))
|
|
702
|
+ this.doctorlist.forEach((item, index) => {
|
|
703
|
+ if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
|
704
|
+
|
|
705
|
+ }else{
|
|
706
|
+ arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
|
|
707
|
+ }
|
|
708
|
+ })
|
|
709
|
+ this.tableData = arr
|
|
710
|
+ this.$nextTick(() => {
|
|
711
|
+ this.$refs.tab.doLayout()
|
|
712
|
+ })
|
|
713
|
+ }else if(val == 2){
|
|
714
|
+ arr.sort(this.compare('doctor_id'))
|
|
715
|
+ this.doctorArr.sort(this.compare('admin_user_id'))
|
|
716
|
+ this.doctorArr.forEach((item, index) => {
|
|
717
|
+ if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
|
718
|
+
|
|
719
|
+ }else{
|
|
720
|
+ arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
|
|
721
|
+ }
|
|
722
|
+ })
|
|
723
|
+ this.tableData = arr
|
|
724
|
+ this.$nextTick(() => {
|
|
725
|
+ this.$refs.tab.doLayout()
|
|
726
|
+ })
|
|
727
|
+ }else if(val == 3){
|
|
728
|
+ arr.sort(this.compare('doctor_id'))
|
|
729
|
+ this.nurseArr.sort(this.compare('admin_user_id'))
|
|
730
|
+ this.nurseArr.forEach((item, index) => {
|
|
731
|
+ if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
|
732
|
+
|
|
733
|
+ }else{
|
|
734
|
+ arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
|
|
735
|
+ }
|
|
736
|
+ })
|
|
737
|
+ this.tableData = arr
|
|
738
|
+ this.$nextTick(() => {
|
|
739
|
+ this.$refs.tab.doLayout()
|
|
740
|
+ })
|
|
741
|
+ }
|
737
|
742
|
}
|
738
|
743
|
})
|
739
|
744
|
},
|