Browse Source

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

XMLWAN 4 years ago
parent
commit
dfdb87be53

+ 53 - 0
src/router/modules/dialysis.js View File

38
         noCache: true
38
         noCache: true
39
       }
39
       }
40
     },
40
     },
41
+    {
42
+      path: '/dialysis/consumableDrugs',
43
+      component: () => import('@/xt_pages/dialysis/consumableDrugs'),
44
+      name: '耗材药品',
45
+      meta: {
46
+        title: '耗材药品',
47
+        noCache: true
48
+      }
49
+    },
50
+    {
51
+      path: '/dialysis/consumableDrugs_print',
52
+      component: () => import('@/xt_pages/dialysis/consumableDrugs_print'),
53
+      hidden: true,
54
+      is_menu: false,
55
+      name: 'consumableDrugs_print',
56
+      meta: {
57
+        title: 'consumableDrugs_print',
58
+        noCache: true
59
+      }
60
+    },
61
+    {
62
+      path: '/dialysis/dialysisDrugs_print',
63
+      component: () => import('@/xt_pages/dialysis/dialysisDrugs_print'),
64
+      hidden: true,
65
+      is_menu: false,
66
+      name: 'dialysisDrugs_print',
67
+      meta: {
68
+        title: 'dialysisDrugs_print',
69
+        noCache: true
70
+      }
71
+    },
72
+    {
73
+      path: '/dialysis/dialysisParameters_print',
74
+      component: () => import('@/xt_pages/dialysis/dialysisParameters_print'),
75
+      hidden: true,
76
+      is_menu: false,
77
+      name: 'dialysisParameters_print',
78
+      meta: {
79
+        title: 'dialysisParameters_print',
80
+        noCache: true
81
+      }
82
+    },
83
+    {
84
+      path: '/dialysis/allSummary_print',
85
+      component: () => import('@/xt_pages/dialysis/allSummary_print'),
86
+      hidden: true,
87
+      is_menu: false,
88
+      name: 'allSummary_print',
89
+      meta: {
90
+        title: 'allSummary_print',
91
+        noCache: true
92
+      }
93
+    },
41
     {
94
     {
42
       path: '/dialysis/record/:id',
95
       path: '/dialysis/record/:id',
43
       component: () => import('@/xt_pages/dialysis/dialysisPage'),
96
       component: () => import('@/xt_pages/dialysis/dialysisPage'),

+ 7 - 7
src/xt_pages/dialysis/template/DialysisPrintOrderTwentyThree.vue View File

836
                         <label-box :isChecked="afterdialysis.cruor?(afterdialysis.cruor.indexOf('透析器-Ⅲ度') > -1 ? true : false):false" showValue="Ⅲ级"></label-box>&nbsp;
836
                         <label-box :isChecked="afterdialysis.cruor?(afterdialysis.cruor.indexOf('透析器-Ⅲ度') > -1 ? true : false):false" showValue="Ⅲ级"></label-box>&nbsp;
837
                       </td>
837
                       </td>
838
                       <td width="30">A管:</td>
838
                       <td width="30">A管:</td>
839
-                      <td width="220">
840
-                        <label-box :isChecked="afterdialysis.intravenous_tube == 1 ? true : false" showValue="0级"></label-box>&nbsp;
841
-                        <label-box :isChecked="afterdialysis.intravenous_tube == 2 ? true : false" showValue="Ⅰ级"></label-box>&nbsp;
842
-                        <label-box :isChecked="afterdialysis.intravenous_tube == 3 ? true : false" showValue="Ⅱ级"></label-box>&nbsp;
843
-                        <label-box :isChecked="afterdialysis.intravenous_tube == 4 ? true : false" showValue="Ⅲ级"></label-box>&nbsp;
844
-                      </td>
845
-                      <td width="30">V管:</td>
846
                       <td width="220">
839
                       <td width="220">
847
                         <label-box :isChecked="afterdialysis.arterial_tube == 1 ? true : false" showValue="0级"></label-box>&nbsp;
840
                         <label-box :isChecked="afterdialysis.arterial_tube == 1 ? true : false" showValue="0级"></label-box>&nbsp;
848
                         <label-box :isChecked="afterdialysis.arterial_tube == 2 ? true : false" showValue="Ⅰ级"></label-box>&nbsp;
841
                         <label-box :isChecked="afterdialysis.arterial_tube == 2 ? true : false" showValue="Ⅰ级"></label-box>&nbsp;
849
                         <label-box :isChecked="afterdialysis.arterial_tube == 3 ? true : false" showValue="Ⅱ级"></label-box>&nbsp;
842
                         <label-box :isChecked="afterdialysis.arterial_tube == 3 ? true : false" showValue="Ⅱ级"></label-box>&nbsp;
850
                         <label-box :isChecked="afterdialysis.arterial_tube == 4 ? true : false" showValue="Ⅲ级"></label-box>&nbsp;
843
                         <label-box :isChecked="afterdialysis.arterial_tube == 4 ? true : false" showValue="Ⅲ级"></label-box>&nbsp;
851
                       </td>
844
                       </td>
845
+                      <td width="30">V管:</td>
846
+                      <td width="220">
847
+                        <label-box :isChecked="afterdialysis.intravenous_tube == 1 ? true : false" showValue="0级"></label-box>&nbsp;
848
+                        <label-box :isChecked="afterdialysis.intravenous_tube == 2 ? true : false" showValue="Ⅰ级"></label-box>&nbsp;
849
+                        <label-box :isChecked="afterdialysis.intravenous_tube == 3 ? true : false" showValue="Ⅱ级"></label-box>&nbsp;
850
+                        <label-box :isChecked="afterdialysis.intravenous_tube == 4 ? true : false" showValue="Ⅲ级"></label-box>&nbsp;
851
+                      </td>
852
                       <td></td>
852
                       <td></td>
853
                   </tr>
853
                   </tr>
854
                 </tbody>
854
                 </tbody>

+ 249 - 110
src/xt_pages/medicalScheduling/index.vue View File

3
         <div class="position">
3
         <div class="position">
4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
5
             <div style="display:flex;align-items:center">
5
             <div style="display:flex;align-items:center">
6
-                <!-- <el-button type="primary" @click="setting">设置</el-button> -->
6
+                <el-button type="primary" @click="setting">设置</el-button>
7
                 <el-button type="primary" @click="DeleteStaffSchedule">清除</el-button>
7
                 <el-button type="primary" @click="DeleteStaffSchedule">清除</el-button>
8
                 <el-button type="primary" @click="copyStaffSchedule">复制</el-button>
8
                 <el-button type="primary" @click="copyStaffSchedule">复制</el-button>
9
                 <el-button type="primary" icon="el-icon-printer" @click="toPrint">打印</el-button>
9
                 <el-button type="primary" icon="el-icon-printer" @click="toPrint">打印</el-button>
214
                     <el-tabs v-model="activeName">
214
                     <el-tabs v-model="activeName">
215
                         <el-tab-pane label="护士" name="nurse">
215
                         <el-tab-pane label="护士" name="nurse">
216
                             <el-table
216
                             <el-table
217
-                                :data="nurseList"
217
+                                :data="nurseTableData"
218
                                 border
218
                                 border
219
                                 height="250"
219
                                 height="250"
220
                                 style="width: 100%">
220
                                 style="width: 100%">
262
 
262
 
263
                         <el-tab-pane label="医生" name="doctor">
263
                         <el-tab-pane label="医生" name="doctor">
264
                             <el-table
264
                             <el-table
265
-                                :data="doctorList"
265
+                                :data="doctorTableData"
266
                                 border
266
                                 border
267
                                 height="250"
267
                                 height="250"
268
                                 style="width: 100%">
268
                                 style="width: 100%">
333
 const moment = require('moment')
333
 const moment = require('moment')
334
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
334
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
335
 import { getDoctorList,getScheduleList,addSchedule,getStaffScheduleList,getNextWeekList,getScheduleByDoctorId,toSearchScheduleList,DeleteStaffSchedule,copyStaffSchedule,UpdateContinusSchedule,SaveNurseSort,SaveIsSchedule } from '@/api/doctorSchedule'
335
 import { getDoctorList,getScheduleList,addSchedule,getStaffScheduleList,getNextWeekList,getScheduleByDoctorId,toSearchScheduleList,DeleteStaffSchedule,copyStaffSchedule,UpdateContinusSchedule,SaveNurseSort,SaveIsSchedule } from '@/api/doctorSchedule'
336
+import { constants } from 'crypto'
336
 export default {
337
 export default {
337
     components:{
338
     components:{
338
         BreadCrumb
339
         BreadCrumb
391
            arrSeven:[],
392
            arrSeven:[],
392
 
393
 
393
            //
394
            //
394
-           nurseTableData: [{
395
-            date: '2016-05-02',
396
-            name: '王小虎',
397
-            address: '上海市普陀区金沙江路 1518 弄'
398
-            }, {
399
-            date: '2016-05-04',
400
-            name: '王小虎',
401
-            address: '上海市普陀区金沙江路 1517 弄'
402
-            }, {
403
-            date: '2016-05-01',
404
-            name: '王小虎',
405
-            address: '上海市普陀区金沙江路 1519 弄'
406
-            }, {
407
-            date: '2016-05-03',
408
-            name: '王小虎',
409
-            address: '上海市普陀区金沙江路 1516 弄'
410
-            }],
411
             nurseVisible:false,
395
             nurseVisible:false,
412
             activeName:'nurse',
396
             activeName:'nurse',
413
             radio:'1',
397
             radio:'1',
414
-            nurseList:[],
415
-            doctorList:[],
398
+            nurseTableData:[],
399
+            doctorTableData:[],
416
         }
400
         }
417
     },
401
     },
418
     methods:{
402
     methods:{
428
                 if(response.data.state == 1){
412
                 if(response.data.state == 1){
429
                     var list =  response.data.data.list
413
                     var list =  response.data.data.list
430
                     console.log("医护列表",list)
414
                     console.log("医护列表",list)
431
-                    this.tableData = list
432
-                    this.doctorlist = list
415
+                    // this.tableData = list
416
+                    // let arr = []
417
+                    // list.map(item => {
418
+                    //     if(item.is_sort == 1){
419
+                    //         arr.push(item)
420
+                    //     }
421
+                    // })
422
+                    // this.doctorlist = arr
433
                     //获取班种列表
423
                     //获取班种列表
434
                     this.getStaffScheduleList()
424
                     this.getStaffScheduleList()
435
 
425
 
436
                     var doctorlist =  response.data.data.doctorlist
426
                     var doctorlist =  response.data.data.doctorlist
427
+                    let arr = []
437
                     for(let i=0;i<doctorlist.length;i++){
428
                     for(let i=0;i<doctorlist.length;i++){
438
-                       if(doctorlist[i].sort == 0){
429
+                        if(doctorlist[i].sort == 0){
439
                           doctorlist[i].sort = ""
430
                           doctorlist[i].sort = ""
440
-                       }
431
+                        }
441
                     }
432
                     }
442
                     console.log('doctorlist',doctorlist)
433
                     console.log('doctorlist',doctorlist)
443
-                    this.doctorList = doctorlist
434
+                    this.doctorTableData = doctorlist
444
                     var nurselist = response.data.data.nurselist
435
                     var nurselist = response.data.data.nurselist
445
                     for(let i=0;i<nurselist.length;i++){
436
                     for(let i=0;i<nurselist.length;i++){
446
-                       if(nurselist[i].sort == 0){
437
+                        if(nurselist[i].sort == 0){
447
                            nurselist[i].sort = ""
438
                            nurselist[i].sort = ""
448
-                       }
439
+                        }
449
                     }
440
                     }
450
-                    this.nurseList = nurselist
441
+                    this.nurseTableData = nurselist
451
                 }
442
                 }
452
             })
443
             })
453
         },
444
         },
852
                                 user_name: staffList[i].user_name,
843
                                 user_name: staffList[i].user_name,
853
                                 admin_user_id:staffList[i].admin_user_id,
844
                                 admin_user_id:staffList[i].admin_user_id,
854
                                 user_type:staffList[i].doctor_type,
845
                                 user_type:staffList[i].doctor_type,
855
-                                user_type:staffList[i].doctor_type,
846
+                                is_sort:staffList[i].is_sort,
847
+                                sort:staffList[i].sort,
856
                                 list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
848
                                 list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
857
                             })
849
                             })
858
                             tempArr.push(staffList[i].user_name);
850
                             tempArr.push(staffList[i].user_name);
864
                             }
856
                             }
865
                         }
857
                         }
866
                     }
858
                     }
859
+
867
                     let arr = [...newArr]
860
                     let arr = [...newArr]
868
-                    arr.sort(this.compare('admin_user_id'))
869
-                    this.doctorlist.sort(this.compare('admin_user_id'))
870
-                    this.doctorlist.forEach((item, index) => {
871
-                      if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
861
+                    let newNurse = []
862
+                    let newDoctor = []
863
+                    arr.map(item => {
864
+                        if(item.user_type == 2){
865
+                            newDoctor.push(item)
866
+                        }
867
+                        if(item.user_type == 3){
868
+                            newNurse.push(item)
869
+                        }
870
+                    })
871
+                    //护士
872
+                    newNurse.sort(this.compare('admin_user_id'))
873
+                    let newNurseTableData = []
874
+                    this.nurseTableData.map(item => {
875
+                        if(item.is_sort == 1){
876
+                            newNurseTableData.push(item)
877
+                        }
878
+                    })
879
+                    newNurseTableData.sort(this.compare('admin_user_id'))
880
+                    newNurseTableData.map((item,index) => {
881
+                        if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
872
 
882
 
873
-                      }else{
874
-                        arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
875
-                      }
883
+                        }else{
884
+                            newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
885
+                        }
886
+                    })
887
+                    newNurse.sort(this.compare('sort'))
888
+
889
+                    //医生
890
+                    newDoctor.sort(this.compare('admin_user_id'))
891
+                    let newDoctorTableData = []
892
+                    this.doctorTableData.map(item => {
893
+                        if(item.is_sort == 1){
894
+                            newDoctorTableData.push(item)
895
+                        }
896
+                    })
897
+                    newDoctorTableData.sort(this.compare('admin_user_id'))
898
+                    newDoctorTableData.map((item,index) => {
899
+                        if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
900
+
901
+                        }else{
902
+                            newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
903
+                        }
876
                     })
904
                     })
877
-                    arr.sort(this.compare('user_type'))
905
+                    newDoctor.sort(this.compare('sort'))
878
 
906
 
907
+
908
+                    // arr.sort(this.compare('admin_user_id'))
909
+                    // this.doctorlist.sort(this.compare('admin_user_id'))
910
+                    // this.doctorlist.forEach((item, index) => {
911
+                    //   if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
912
+                    
913
+                    //   }else{
914
+                    //     arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
915
+                    //   }
916
+                    // })
917
+                    // arr.sort(this.compare('user_type'))
918
+                    
879
                     let arr2 = []
919
                     let arr2 = []
880
                     arr2.push({class_name:oneStr,schedule_week:1})
920
                     arr2.push({class_name:oneStr,schedule_week:1})
881
                     arr2.push({class_name:twoStr,schedule_week:2})
921
                     arr2.push({class_name:twoStr,schedule_week:2})
890
                     obj.user_type = 10
930
                     obj.user_type = 10
891
                     obj.list = arr2
931
                     obj.list = arr2
892
                     arr.push(obj)
932
                     arr.push(obj)
893
-                    this.tableData = arr
933
+
934
+                    let data = []
935
+                    data.push(...newNurse)
936
+                    data.push(...newDoctor)
937
+                    data.push(obj)
938
+                    this.tableData = data
894
 
939
 
895
 
940
 
896
                 }
941
                 }
1160
                     let tempArr = [], newArr = []
1205
                     let tempArr = [], newArr = []
1161
                     for (let i = 0; i < staffList.length; i++) {
1206
                     for (let i = 0; i < staffList.length; i++) {
1162
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1207
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1163
-                        newArr.push({
1164
-                            user_name: staffList[i].user_name,
1165
-                            admin_user_id:staffList[i].admin_user_id,
1166
-                            user_type:staffList[i].doctor_type,
1167
-                            list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
1168
-                        })
1169
-                        tempArr.push(staffList[i].user_name);
1208
+                            newArr.push({
1209
+                                user_name: staffList[i].user_name,
1210
+                                admin_user_id:staffList[i].admin_user_id,
1211
+                                user_type:staffList[i].doctor_type,
1212
+                                is_sort:staffList[i].is_sort,
1213
+                                sort:staffList[i].sort,
1214
+                                list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
1215
+                            })
1216
+                            tempArr.push(staffList[i].user_name);
1170
                         } else {
1217
                         } else {
1171
-                        for (let j = 0; j < newArr.length; j++) {
1172
-                            if (newArr[j].user_name == staffList[i].user_name) {
1173
-                            newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
1218
+                            for (let j = 0; j < newArr.length; j++) {
1219
+                                if (newArr[j].user_name == staffList[i].user_name) {
1220
+                                    newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
1221
+                                }
1174
                             }
1222
                             }
1175
                         }
1223
                         }
1176
-                        }
1177
                     }
1224
                     }
1225
+                    
1178
                     let arr = [...newArr]
1226
                     let arr = [...newArr]
1179
-                    arr.sort(this.compare('admin_user_id'))
1180
-                    this.doctorlist.sort(this.compare('admin_user_id'))
1181
-                    this.doctorlist.forEach((item, index) => {
1182
-                      if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1227
+                    let newNurse = []
1228
+                    let newDoctor = []
1229
+                    arr.map(item => {
1230
+                        if(item.user_type == 2){
1231
+                            newDoctor.push(item)
1232
+                        }
1233
+                        if(item.user_type == 3){
1234
+                            newNurse.push(item)
1235
+                        }
1236
+                    })
1237
+                    //护士
1238
+                    newNurse.sort(this.compare('admin_user_id'))
1239
+                    let newNurseTableData = []
1240
+                    this.nurseTableData.map(item => {
1241
+                        if(item.is_sort == 1){
1242
+                            newNurseTableData.push(item)
1243
+                        }
1244
+                    })
1245
+                    newNurseTableData.sort(this.compare('admin_user_id'))
1246
+                    newNurseTableData.map((item,index) => {
1247
+                        if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
1248
+
1249
+                        }else{
1250
+                            newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1251
+                        }
1252
+                    })
1253
+                    newNurse.sort(this.compare('sort'))
1183
 
1254
 
1184
-                      }else{
1185
-                        arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
1186
-                        // console.log("arr",arr)
1187
-                      }
1255
+                    //医生
1256
+                    newDoctor.sort(this.compare('admin_user_id'))
1257
+                    let newDoctorTableData = []
1258
+                    this.doctorTableData.map(item => {
1259
+                        if(item.is_sort == 1){
1260
+                            newDoctorTableData.push(item)
1261
+                        }
1262
+                    })
1263
+                    newDoctorTableData.sort(this.compare('admin_user_id'))
1264
+                    newDoctorTableData.map((item,index) => {
1265
+                        if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
1266
+                    
1267
+                        }else{
1268
+                            newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1269
+                        }
1188
                     })
1270
                     })
1189
-                    arr.sort(this.compare('user_type'))
1271
+                    newDoctor.sort(this.compare('sort'))
1272
+
1273
+
1274
+                    // arr.sort(this.compare('admin_user_id'))
1275
+                    // this.doctorlist.sort(this.compare('admin_user_id'))
1276
+                    // this.doctorlist.forEach((item, index) => {
1277
+                    //   if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1278
+                    
1279
+                    //   }else{
1280
+                    //     arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
1281
+                    //   }
1282
+                    // })
1283
+                    // arr.sort(this.compare('user_type'))
1284
+                    
1190
                     let arr2 = []
1285
                     let arr2 = []
1191
                     arr2.push({class_name:oneStr,schedule_week:1})
1286
                     arr2.push({class_name:oneStr,schedule_week:1})
1192
                     arr2.push({class_name:twoStr,schedule_week:2})
1287
                     arr2.push({class_name:twoStr,schedule_week:2})
1196
                     arr2.push({class_name:sixStr,schedule_week:6})
1291
                     arr2.push({class_name:sixStr,schedule_week:6})
1197
                     arr2.push({class_name:zeroStr,schedule_week:0})
1292
                     arr2.push({class_name:zeroStr,schedule_week:0})
1198
                     var obj = {}
1293
                     var obj = {}
1199
-                     obj.admin_user_id = "1000000"
1200
-                     obj.user_name = "合计"
1201
-                     obj.user_type = 10
1202
-                     obj.list = arr2
1203
-                     arr.push(obj)
1204
-                    this.tableData = arr
1294
+                    obj.admin_user_id = "1000000"
1295
+                    obj.user_name = "合计"
1296
+                    obj.user_type = 10
1297
+                    obj.list = arr2
1298
+                    arr.push(obj)
1299
+
1300
+                    let data = []
1301
+                    data.push(...newNurse)
1302
+                    data.push(...newDoctor)
1303
+                    data.push(obj)
1304
+                    this.tableData = data
1205
                 }
1305
                 }
1206
             })
1306
             })
1207
         },
1307
         },
1221
                     for (let i = 0; i < staffList.length; i++) {
1321
                     for (let i = 0; i < staffList.length; i++) {
1222
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1322
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1223
                             newArr.push({
1323
                             newArr.push({
1224
-                                user_type:staffList[i].doctor_type,
1225
                                 user_name: staffList[i].user_name,
1324
                                 user_name: staffList[i].user_name,
1226
                                 admin_user_id:staffList[i].admin_user_id,
1325
                                 admin_user_id:staffList[i].admin_user_id,
1227
-                                list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
1326
+                                user_type:staffList[i].doctor_type,
1327
+                                is_sort:staffList[i].is_sort,
1328
+                                sort:staffList[i].sort,
1329
+                                list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
1228
                             })
1330
                             })
1229
                             tempArr.push(staffList[i].user_name);
1331
                             tempArr.push(staffList[i].user_name);
1230
                         } else {
1332
                         } else {
1231
                             for (let j = 0; j < newArr.length; j++) {
1333
                             for (let j = 0; j < newArr.length; j++) {
1232
                                 if (newArr[j].user_name == staffList[i].user_name) {
1334
                                 if (newArr[j].user_name == staffList[i].user_name) {
1233
-                                    newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week, user_type:staffList[i].doctor_type})
1335
+                                    newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
1234
                                 }
1336
                                 }
1235
                             }
1337
                             }
1236
                         }
1338
                         }
1237
                     }
1339
                     }
1238
 
1340
 
1341
+                    let arr = [...newArr]
1342
+                    let newNurse = []
1343
+                    let newDoctor = []
1344
+                    arr.map(item => {
1345
+                        if(item.user_type == 2){
1346
+                            newDoctor.push(item)
1347
+                        }
1348
+                        if(item.user_type == 3){
1349
+                            newNurse.push(item)
1350
+                        }
1351
+                    })
1352
+
1239
                     if(id == 0){
1353
                     if(id == 0){
1240
-                        let arr = [...newArr]
1241
-                        arr.sort(this.compare('admin_user_id'))
1242
-                        this.doctorlist.sort(this.compare('admin_user_id'))
1243
-                        this.doctorlist.forEach((item, index) => {
1244
-                          if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1354
+                        //护士
1355
+                        newNurse.sort(this.compare('admin_user_id'))
1356
+                        let newNurseTableData = []
1357
+                        this.nurseTableData.map(item => {
1358
+                            if(item.is_sort == 1){
1359
+                                newNurseTableData.push(item)
1360
+                            }
1361
+                        })
1362
+                        newNurseTableData.sort(this.compare('admin_user_id'))
1363
+                        newNurseTableData.map((item,index) => {
1364
+                            if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
1245
 
1365
 
1246
-                          }else{
1247
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
1248
-                            // console.log("arr",arr)
1249
-                          }
1366
+                            }else{
1367
+                                newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1368
+                            }
1250
                         })
1369
                         })
1251
-                        arr.sort(this.compare('user_type'))
1252
-                        this.tableData = arr
1370
+                        newNurse.sort(this.compare('sort'))
1371
+
1372
+                        //医生
1373
+                        newDoctor.sort(this.compare('admin_user_id'))
1374
+                        let newDoctorTableData = []
1375
+                        this.doctorTableData.map(item => {
1376
+                            if(item.is_sort == 1){
1377
+                                newDoctorTableData.push(item)
1378
+                            }
1379
+                        })
1380
+                        newDoctorTableData.sort(this.compare('admin_user_id'))
1381
+                        newDoctorTableData.map((item,index) => {
1382
+                            if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
1383
+                        
1384
+                            }else{
1385
+                                newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1386
+                            }
1387
+                        })
1388
+                        newDoctor.sort(this.compare('sort'))
1389
+                        
1390
+                        let data = []
1391
+                        data.push(...newNurse)
1392
+                        data.push(...newDoctor)
1393
+                        this.tableData = data
1253
                     }
1394
                     }
1254
                     if(id == 2){
1395
                     if(id == 2){
1255
-                        let arr = [...newArr]
1256
-                        arr.sort(this.compare('admin_user_id'))
1257
-                        this.doctorlist.sort(this.compare('admin_user_id'))
1258
-                        let newDoctor = []
1259
-                        this.doctorlist.map(item => {
1260
-                        if (item.user_type == 2) {
1261
-                            newDoctor.push(item)
1262
-                        }
1396
+                        newDoctor.sort(this.compare('admin_user_id'))
1397
+                        let newDoctorTableData = []
1398
+                        this.doctorTableData.map(item => {
1399
+                            if(item.is_sort == 1){
1400
+                                newDoctorTableData.push(item)
1401
+                            }
1263
                         })
1402
                         })
1264
-                        newDoctor.map((item, index) => {
1265
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1403
+                        newDoctorTableData.sort(this.compare('admin_user_id'))
1404
+                        newDoctorTableData.map((item,index) => {
1405
+                            if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
1266
 
1406
 
1267
-                          }else{
1268
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
1269
-                            // console.log("arr",arr)
1270
-                          }
1407
+                            }else{
1408
+                                newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1409
+                            }
1271
                         })
1410
                         })
1272
-                        this.tableData = arr
1411
+                        newDoctor.sort(this.compare('sort'))
1412
+                        this.tableData = newDoctor
1273
                     }
1413
                     }
1274
                     if(id == 3){
1414
                     if(id == 3){
1275
-                        let arr = [...newArr]
1276
-                        arr.sort(this.compare('admin_user_id'))
1277
-                        this.doctorlist.sort(this.compare('admin_user_id'))
1278
-                        let newDoctor = []
1279
-                        this.doctorlist.map(item => {
1280
-                        if (item.user_type == 3) {
1281
-                            newDoctor.push(item)
1282
-                        }
1415
+                        newNurse.sort(this.compare('admin_user_id'))
1416
+                        let newNurseTableData = []
1417
+                        this.nurseTableData.map(item => {
1418
+                            if(item.is_sort == 1){
1419
+                                newNurseTableData.push(item)
1420
+                            }
1283
                         })
1421
                         })
1284
-                        newDoctor.map((item, index) => {
1285
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1422
+                        newNurseTableData.sort(this.compare('admin_user_id'))
1423
+                        newNurseTableData.map((item,index) => {
1424
+                            if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
1286
 
1425
 
1287
-                          }else{
1288
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
1289
-                            // console.log("arr",arr)
1290
-                          }
1426
+                            }else{
1427
+                                newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1428
+                            }
1291
                         })
1429
                         })
1292
-                        this.tableData = arr
1430
+                        newNurse.sort(this.compare('sort'))
1431
+                        this.tableData = newNurse
1293
                     }
1432
                     }
1294
 
1433
 
1295
             }
1434
             }

+ 371 - 320
src/xt_pages/medicalScheduling/medical_print.vue View File

79
           arrSix:[],
79
           arrSix:[],
80
           arrSeven:[],
80
           arrSeven:[],
81
           typevalue:0,
81
           typevalue:0,
82
+          
83
+          doctorTableData:[],
84
+          nurseTableData:[]
82
         }
85
         }
83
     },
86
     },
84
     methods:{
87
     methods:{
98
           var list =  response.data.data.list
101
           var list =  response.data.data.list
99
           this.doctorlist = list
102
           this.doctorlist = list
100
           this.getScheduleByDoctorId()
103
           this.getScheduleByDoctorId()
104
+
105
+          //
106
+          var doctorlist =  response.data.data.doctorlist
107
+          let arr = []
108
+          for(let i=0;i<doctorlist.length;i++){
109
+              if(doctorlist[i].sort == 0){
110
+                doctorlist[i].sort = ""
111
+              }
112
+          }
113
+          console.log('doctorlist',doctorlist)
114
+          this.doctorTableData = doctorlist
115
+          var nurselist = response.data.data.nurselist
116
+          for(let i=0;i<nurselist.length;i++){
117
+              if(nurselist[i].sort == 0){
118
+                  nurselist[i].sort = ""
119
+              }
120
+          }
121
+          this.nurseTableData = nurselist
101
         })
122
         })
102
       },
123
       },
103
       //获取本周的所有排班列表
124
       //获取本周的所有排班列表
104
       getScheduleByDoctorId(){
125
       getScheduleByDoctorId(){
105
-          const params = {
106
-            start_time:this.start_time,
107
-            end_time:this.end_time,
108
-            doctor_id:this.typevalue,
109
-         }
110
-         console.log("parasm",params)
111
-         getScheduleByDoctorId(params).then(response=>{
112
-            if(response.data.state == 1){
126
+        const params = {
127
+          start_time:this.start_time,
128
+          end_time:this.end_time,
129
+          doctor_id:this.typevalue,
130
+        }
131
+        console.log("parasm",params)
132
+        getScheduleByDoctorId(params).then(response=>{
133
+          if(response.data.state == 1){
113
               var staffList = response.data.data.staffList
134
               var staffList = response.data.data.staffList
114
-               console.log("stafflist",staffList)
135
+              console.log("stafflist",staffList)
115
 
136
 
116
-                   var sevenStr = ""
117
-                    var oneStr = ""
118
-                    var twoStr = ""
119
-                    var threeStr = ""
120
-                    var fourStr = ""
121
-                    var fiveStr = ""
122
-                    var sixStr = ""
123
-                    for(let i=0;i<staffList.length;i++){
124
-                    if(staffList[i].schedule_week == 0){
125
-                        staffList[i].class_index = 0
126
-                         var arr = []
127
-                        this.arrZero.push(staffList[i].class_name)
128
-                        for(let i=0;i<this.arrZero.length;i++){
129
-                           if(this.arrZero[i]!=''){
130
-                              arr.push(this.arrZero[i])
131
-                           }
132
-                        }
133
-                        var countedNames = arr.reduce(function (allNames, name) { 
134
-                            if (name in allNames) {
135
-                                allNames[name]++;
136
-                            }
137
-                            else {
138
-                                allNames[name] = 1;
139
-                            }
140
-                            return allNames;
141
-                        }, {});
142
-                        let objKey = Object.keys(countedNames)
143
-                        let objVal = Object.values(countedNames)
144
-                        var zeroStr = ''
145
-                        objKey.map((item,index) => {
146
-                        let objVal = Object.values(countedNames)
147
-                            zeroStr += item + objVal[index] + '\n'
148
-                        })
149
-                        sevenStr = zeroStr
150
-                    }
151
-                    if(staffList[i].schedule_week == 1){
152
-                        staffList[i].class_index = 1
153
-                        var arr = []
154
-                        this.arrOne.push(staffList[i].class_name)
155
-                        for(let i=0;i<this.arrOne.length;i++){
156
-                           if(this.arrOne[i]!=''){
157
-                              arr.push(this.arrOne[i])
158
-                           }
159
-                        }
160
-                        var countedNames = arr.reduce(function (allNames, name) { 
161
-                            if (name in allNames) {
162
-                                allNames[name]++;
163
-                            }
164
-                            else {
165
-                                allNames[name] = 1;
166
-                            }
167
-                            return allNames;
168
-                        }, {});
169
-                        let objKey = Object.keys(countedNames)
170
-                        let objVal = Object.values(countedNames)
171
-                        let strOne = ''
172
-                        objKey.map((item,index) => {
173
-                        let objVal = Object.values(countedNames)
174
-                            strOne += item + objVal[index] + '\n'
175
-                        })
176
-                        oneStr  = strOne
177
-                    }
178
-                    if(staffList[i].schedule_week == 2){
179
-                        staffList[i].class_index = 2
180
-                         var arr = []
181
-                        this.arrTwo.push(staffList[i].class_name)
182
-                        for(let i=0;i<this.arrTwo.length;i++){
183
-                           if(this.arrTwo[i]!=''){
184
-                              arr.push(this.arrTwo[i])
185
-                           }
186
-                        }
187
-                        var countedNames = arr.reduce(function (allNames, name) { 
188
-                            if (name in allNames) {
189
-                                allNames[name]++;
190
-                            }
191
-                            else {
192
-                                allNames[name] = 1;
193
-                            }
194
-                            return allNames;
195
-                        }, {});
196
-                        let objKey = Object.keys(countedNames)
197
-                        let objVal = Object.values(countedNames)
198
-                        let strTwo = ''
199
-                        objKey.map((item,index) => {
200
-                        let objVal = Object.values(countedNames)
201
-                            strTwo += item + objVal[index] + '\n'
202
-                        })
203
-                         twoStr = strTwo
204
-                    }
205
-                    if(staffList[i].schedule_week == 3){
206
-                        staffList[i].class_index = 3
207
-                         var arr = []
208
-                        this.arrThree.push(staffList[i].class_name)
209
-                        for(let i=0;i<this.arrThree.length;i++){
210
-                           if(this.arrThree[i]!=''){
211
-                              arr.push(this.arrThree[i])
212
-                           }
213
-                        }
214
-                        var countedNames = arr.reduce(function (allNames, name) { 
215
-                            if (name in allNames) {
216
-                                allNames[name]++;
217
-                            }
218
-                            else {
219
-                                allNames[name] = 1;
220
-                            }
221
-                            return allNames;
222
-                        }, {});
223
-                        let objKey = Object.keys(countedNames)
224
-                        let objVal = Object.values(countedNames)
225
-                        let strThree = ''
226
-                        objKey.map((item,index) => {
227
-                        let objVal = Object.values(countedNames)
228
-                            strThree += item + objVal[index] + '\n'
229
-                        })
230
-                        threeStr = strThree
231
-                    }
232
-                    if(staffList[i].schedule_week == 4){
233
-                        staffList[i].class_index = 4
234
-                        var arr = []
235
-                        this.arrFour.push(staffList[i].class_name)
236
-                        for(let i=0;i<this.arrFour.length;i++){
237
-                           if(this.arrFour[i]!=''){
238
-                              arr.push(this.arrFour[i])
239
-                           }
240
-                        }
241
-                        var countedNames = arr.reduce(function (allNames, name) { 
242
-                            if (name in allNames) {
243
-                                allNames[name]++;
244
-                            }
245
-                            else {
246
-                                allNames[name] = 1;
247
-                            }
248
-                            return allNames;
249
-                        }, {});
250
-                        let objKey = Object.keys(countedNames)
251
-                        let objVal = Object.values(countedNames)
252
-                        let strFour = ''
253
-                        objKey.map((item,index) => {
254
-                        let objVal = Object.values(countedNames)
255
-                            strFour += item + objVal[index] + '\n'
256
-                        })
257
-                        fourStr = strFour
258
-                    }
259
-                    if(staffList[i].schedule_week == 5){
260
-                        staffList[i].class_index = 5
137
+              var sevenStr = ""
138
+              var oneStr = ""
139
+              var twoStr = ""
140
+              var threeStr = ""
141
+              var fourStr = ""
142
+              var fiveStr = ""
143
+              var sixStr = ""
144
+              for(let i=0;i<staffList.length;i++){
145
+              if(staffList[i].schedule_week == 0){
146
+                  staffList[i].class_index = 0
147
+                    var arr = []
148
+                  this.arrZero.push(staffList[i].class_name)
149
+                  for(let i=0;i<this.arrZero.length;i++){
150
+                      if(this.arrZero[i]!=''){
151
+                        arr.push(this.arrZero[i])
152
+                      }
153
+                  }
154
+                  var countedNames = arr.reduce(function (allNames, name) { 
155
+                      if (name in allNames) {
156
+                          allNames[name]++;
157
+                      }
158
+                      else {
159
+                          allNames[name] = 1;
160
+                      }
161
+                      return allNames;
162
+                  }, {});
163
+                  let objKey = Object.keys(countedNames)
164
+                  let objVal = Object.values(countedNames)
165
+                  var zeroStr = ''
166
+                  objKey.map((item,index) => {
167
+                  let objVal = Object.values(countedNames)
168
+                      zeroStr += item + objVal[index] + '\n'
169
+                  })
170
+                  sevenStr = zeroStr
171
+              }
172
+              if(staffList[i].schedule_week == 1){
173
+                  staffList[i].class_index = 1
174
+                  var arr = []
175
+                  this.arrOne.push(staffList[i].class_name)
176
+                  for(let i=0;i<this.arrOne.length;i++){
177
+                      if(this.arrOne[i]!=''){
178
+                        arr.push(this.arrOne[i])
179
+                      }
180
+                  }
181
+                  var countedNames = arr.reduce(function (allNames, name) { 
182
+                      if (name in allNames) {
183
+                          allNames[name]++;
184
+                      }
185
+                      else {
186
+                          allNames[name] = 1;
187
+                      }
188
+                      return allNames;
189
+                  }, {});
190
+                  let objKey = Object.keys(countedNames)
191
+                  let objVal = Object.values(countedNames)
192
+                  let strOne = ''
193
+                  objKey.map((item,index) => {
194
+                  let objVal = Object.values(countedNames)
195
+                      strOne += item + objVal[index] + '\n'
196
+                  })
197
+                  oneStr  = strOne
198
+              }
199
+              if(staffList[i].schedule_week == 2){
200
+                  staffList[i].class_index = 2
201
+                    var arr = []
202
+                  this.arrTwo.push(staffList[i].class_name)
203
+                  for(let i=0;i<this.arrTwo.length;i++){
204
+                      if(this.arrTwo[i]!=''){
205
+                        arr.push(this.arrTwo[i])
206
+                      }
207
+                  }
208
+                  var countedNames = arr.reduce(function (allNames, name) { 
209
+                      if (name in allNames) {
210
+                          allNames[name]++;
211
+                      }
212
+                      else {
213
+                          allNames[name] = 1;
214
+                      }
215
+                      return allNames;
216
+                  }, {});
217
+                  let objKey = Object.keys(countedNames)
218
+                  let objVal = Object.values(countedNames)
219
+                  let strTwo = ''
220
+                  objKey.map((item,index) => {
221
+                  let objVal = Object.values(countedNames)
222
+                      strTwo += item + objVal[index] + '\n'
223
+                  })
224
+                    twoStr = strTwo
225
+              }
226
+              if(staffList[i].schedule_week == 3){
227
+                  staffList[i].class_index = 3
228
+                    var arr = []
229
+                  this.arrThree.push(staffList[i].class_name)
230
+                  for(let i=0;i<this.arrThree.length;i++){
231
+                      if(this.arrThree[i]!=''){
232
+                        arr.push(this.arrThree[i])
233
+                      }
234
+                  }
235
+                  var countedNames = arr.reduce(function (allNames, name) { 
236
+                      if (name in allNames) {
237
+                          allNames[name]++;
238
+                      }
239
+                      else {
240
+                          allNames[name] = 1;
241
+                      }
242
+                      return allNames;
243
+                  }, {});
244
+                  let objKey = Object.keys(countedNames)
245
+                  let objVal = Object.values(countedNames)
246
+                  let strThree = ''
247
+                  objKey.map((item,index) => {
248
+                  let objVal = Object.values(countedNames)
249
+                      strThree += item + objVal[index] + '\n'
250
+                  })
251
+                  threeStr = strThree
252
+              }
253
+              if(staffList[i].schedule_week == 4){
254
+                  staffList[i].class_index = 4
255
+                  var arr = []
256
+                  this.arrFour.push(staffList[i].class_name)
257
+                  for(let i=0;i<this.arrFour.length;i++){
258
+                      if(this.arrFour[i]!=''){
259
+                        arr.push(this.arrFour[i])
260
+                      }
261
+                  }
262
+                  var countedNames = arr.reduce(function (allNames, name) { 
263
+                      if (name in allNames) {
264
+                          allNames[name]++;
265
+                      }
266
+                      else {
267
+                          allNames[name] = 1;
268
+                      }
269
+                      return allNames;
270
+                  }, {});
271
+                  let objKey = Object.keys(countedNames)
272
+                  let objVal = Object.values(countedNames)
273
+                  let strFour = ''
274
+                  objKey.map((item,index) => {
275
+                  let objVal = Object.values(countedNames)
276
+                      strFour += item + objVal[index] + '\n'
277
+                  })
278
+                  fourStr = strFour
279
+              }
280
+              if(staffList[i].schedule_week == 5){
281
+                  staffList[i].class_index = 5
261
 
282
 
262
-                         var arr = []
263
-                        this.arrFive.push(staffList[i].class_name)
264
-                        for(let i=0;i<this.arrFive.length;i++){
265
-                           if(this.arrFive[i]!=''){
266
-                              arr.push(this.arrFive[i])
267
-                           }
268
-                        }
269
-                        var countedNames = arr.reduce(function (allNames, name) { 
270
-                            if (name in allNames) {
271
-                                allNames[name]++;
272
-                            }
273
-                            else {
274
-                                allNames[name] = 1;
275
-                            }
276
-                            return allNames;
277
-                        }, {});
278
-                        let objKey = Object.keys(countedNames)
279
-                        let objVal = Object.values(countedNames)
280
-                        let strFive = ''
281
-                        objKey.map((item,index) => {
282
-                        let objVal = Object.values(countedNames)
283
-                            strFive += item + objVal[index] + '\n'
284
-                        })
285
-                         fiveStr = strFive
286
-                    }
287
-                    if(staffList[i].schedule_week == 6){
288
-                        staffList[i].class_index = 6
289
-                         var arr = []
290
-                        this.arrSix.push(staffList[i].class_name)
291
-                        for(let i=0;i<this.arrSix.length;i++){
292
-                           if(this.arrSix[i]!=''){
293
-                              arr.push(this.arrSix[i])
294
-                           }
295
-                        }
296
-                        var countedNames = arr.reduce(function (allNames, name) { 
297
-                            if (name in allNames) {
298
-                                allNames[name]++;
299
-                            }
300
-                            else {
301
-                                allNames[name] = 1;
302
-                            }
303
-                            return allNames;
304
-                        }, {});
305
-                        let objKey = Object.keys(countedNames)
306
-                        let objVal = Object.values(countedNames)
307
-                        let strSix = ''
308
-                        objKey.map((item,index) => {
309
-                        let objVal = Object.values(countedNames)
310
-                            strSix += item + objVal[index] + '\n'
311
-                        })
312
-                        sixStr = strSix
313
-                     }
314
-                    }
283
+                    var arr = []
284
+                  this.arrFive.push(staffList[i].class_name)
285
+                  for(let i=0;i<this.arrFive.length;i++){
286
+                      if(this.arrFive[i]!=''){
287
+                        arr.push(this.arrFive[i])
288
+                      }
289
+                  }
290
+                  var countedNames = arr.reduce(function (allNames, name) { 
291
+                      if (name in allNames) {
292
+                          allNames[name]++;
293
+                      }
294
+                      else {
295
+                          allNames[name] = 1;
296
+                      }
297
+                      return allNames;
298
+                  }, {});
299
+                  let objKey = Object.keys(countedNames)
300
+                  let objVal = Object.values(countedNames)
301
+                  let strFive = ''
302
+                  objKey.map((item,index) => {
303
+                  let objVal = Object.values(countedNames)
304
+                      strFive += item + objVal[index] + '\n'
305
+                  })
306
+                    fiveStr = strFive
307
+              }
308
+              if(staffList[i].schedule_week == 6){
309
+                  staffList[i].class_index = 6
310
+                    var arr = []
311
+                  this.arrSix.push(staffList[i].class_name)
312
+                  for(let i=0;i<this.arrSix.length;i++){
313
+                      if(this.arrSix[i]!=''){
314
+                        arr.push(this.arrSix[i])
315
+                      }
316
+                  }
317
+                  var countedNames = arr.reduce(function (allNames, name) { 
318
+                      if (name in allNames) {
319
+                          allNames[name]++;
320
+                      }
321
+                      else {
322
+                          allNames[name] = 1;
323
+                      }
324
+                      return allNames;
325
+                  }, {});
326
+                  let objKey = Object.keys(countedNames)
327
+                  let objVal = Object.values(countedNames)
328
+                  let strSix = ''
329
+                  objKey.map((item,index) => {
330
+                  let objVal = Object.values(countedNames)
331
+                      strSix += item + objVal[index] + '\n'
332
+                  })
333
+                  sixStr = strSix
334
+                }
335
+              }
315
               let tempArr = [], newArr = []
336
               let tempArr = [], newArr = []
316
               for (let i = 0; i < staffList.length; i++) {
337
               for (let i = 0; i < staffList.length; i++) {
317
-                if(tempArr.indexOf(staffList[i].user_name) === -1) {
338
+                if (tempArr.indexOf(staffList[i].user_name) === -1) {
318
                   newArr.push({
339
                   newArr.push({
319
-                    user_type:staffList[i].doctor_type,
320
                     user_name: staffList[i].user_name,
340
                     user_name: staffList[i].user_name,
321
                     admin_user_id:staffList[i].admin_user_id,
341
                     admin_user_id:staffList[i].admin_user_id,
322
-                    list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
342
+                    user_type:staffList[i].doctor_type,
343
+                    is_sort:staffList[i].is_sort,
344
+                    sort:staffList[i].sort,
345
+                    list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
323
                   })
346
                   })
324
                   tempArr.push(staffList[i].user_name);
347
                   tempArr.push(staffList[i].user_name);
325
                 } else {
348
                 } else {
326
                   for (let j = 0; j < newArr.length; j++) {
349
                   for (let j = 0; j < newArr.length; j++) {
327
                     if (newArr[j].user_name == staffList[i].user_name) {
350
                     if (newArr[j].user_name == staffList[i].user_name) {
328
-                      newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type})
351
+                      newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
329
                     }
352
                     }
330
                   }
353
                   }
331
                 }
354
                 }
332
               }
355
               }
333
-              // let arr = [...newArr]
334
-              // arr.sort(this.compare('admin_user_id'))
335
-              // this.doctorlist.sort(this.compare('admin_user_id'))
336
-              // this.doctorlist.forEach((item, index) => {
337
-              //   if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
338
-              
339
-              //   }else{
340
-              //     arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
341
-              //   }
342
-              // })
343
-              // arr.sort(this.compare('user_type'))
344
-              // console.log("arr======",arr)
345
 
356
 
346
-                if(this.typevalue == 0){
347
-                   let arr = [...newArr]
348
-                    arr.sort(this.compare('admin_user_id'))
349
-                    this.doctorlist.sort(this.compare('admin_user_id'))
350
-                        this.doctorlist.forEach((item, index) => {
351
-                          if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
352
-                        
353
-                          }else{
354
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
355
-                            // console.log("arr",arr)
356
-                          }
357
-                        })
358
-                        arr.sort(this.compare('user_type'))
359
-                        let arr2 = []
360
-                          arr2.push({class_name:oneStr,schedule_week:1})
361
-                          arr2.push({class_name:twoStr,schedule_week:2})
362
-                          arr2.push({class_name:threeStr,schedule_week:3})
363
-                          arr2.push({class_name:fourStr,schedule_week:4})
364
-                          arr2.push({class_name:fiveStr,schedule_week:5})
365
-                          arr2.push({class_name:sixStr,schedule_week:6})
366
-                          arr2.push({class_name:zeroStr,schedule_week:0})
367
-                          var obj = {}
368
-                          obj.admin_user_id = "1000000"
369
-                          obj.user_name = "合计"
370
-                          obj.user_type = 10
371
-                          obj.list = arr2
372
-                          arr.push(obj)
373
-                          this.tableData = arr
357
+              let arr = [...newArr]
358
+              let newNurse = []
359
+              let newDoctor = []
360
+              arr.map(item => {
361
+                if(item.user_type == 2){
362
+                  newDoctor.push(item)
363
+                }
364
+                if(item.user_type == 3){
365
+                  newNurse.push(item)
366
+                }
367
+              })
368
+
369
+              if(this.typevalue == 0){
370
+                //护士
371
+                newNurse.sort(this.compare('admin_user_id'))
372
+                let newNurseTableData = []
373
+                this.nurseTableData.map(item => {
374
+                    if(item.is_sort == 1){
375
+                        newNurseTableData.push(item)
376
+                    }
377
+                })
378
+                newNurseTableData.sort(this.compare('admin_user_id'))
379
+                newNurseTableData.map((item,index) => {
380
+                    if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
381
+                
382
+                    }else{
383
+                        newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
384
+                    }
385
+                })
386
+                newNurse.sort(this.compare('sort'))
387
+
388
+                //医生
389
+                newDoctor.sort(this.compare('admin_user_id'))
390
+                let newDoctorTableData = []
391
+                this.doctorTableData.map(item => {
392
+                    if(item.is_sort == 1){
393
+                        newDoctorTableData.push(item)
374
                     }
394
                     }
375
-                    if(this.typevalue == 2){
376
-                        let arr = [...newArr]
377
-                        arr.sort(this.compare('admin_user_id'))
378
-                        this.doctorlist.sort(this.compare('admin_user_id'))
379
-                        let newDoctor = []
380
-                        this.doctorlist.map(item => {
381
-                        if (item.user_type == 2) {
382
-                            newDoctor.push(item)
383
-                        }
384
-                        })
385
-                        newDoctor.map((item, index) => {
386
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
387
-                        
388
-                          }else{
389
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
390
-                            // console.log("arr",arr)
391
-                          }
392
-                        })
393
-                        let arr2 = []
394
-                          arr2.push({class_name:oneStr,schedule_week:1})
395
-                          arr2.push({class_name:twoStr,schedule_week:2})
396
-                          arr2.push({class_name:threeStr,schedule_week:3})
397
-                          arr2.push({class_name:fourStr,schedule_week:4})
398
-                          arr2.push({class_name:fiveStr,schedule_week:5})
399
-                          arr2.push({class_name:sixStr,schedule_week:6})
400
-                          arr2.push({class_name:zeroStr,schedule_week:0})
401
-                          var obj = {}
402
-                          obj.admin_user_id = "1000000"
403
-                          obj.user_name = "合计"
404
-                          obj.user_type = 10
405
-                          obj.list = arr2
406
-                          arr.push(obj)
407
-                          this.tableData = arr
395
+                })
396
+                newDoctorTableData.sort(this.compare('admin_user_id'))
397
+                newDoctorTableData.map((item,index) => {
398
+                    if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
399
+                
400
+                    }else{
401
+                        newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
402
+                    }
403
+                })
404
+                newDoctor.sort(this.compare('sort'))
405
+                
406
+                
407
+
408
+                let arr2 = []
409
+                arr2.push({class_name:oneStr,schedule_week:1})
410
+                arr2.push({class_name:twoStr,schedule_week:2})
411
+                arr2.push({class_name:threeStr,schedule_week:3})
412
+                arr2.push({class_name:fourStr,schedule_week:4})
413
+                arr2.push({class_name:fiveStr,schedule_week:5})
414
+                arr2.push({class_name:sixStr,schedule_week:6})
415
+                arr2.push({class_name:zeroStr,schedule_week:0})
416
+                var obj = {}
417
+                obj.admin_user_id = "1000000"
418
+                obj.user_name = "合计"
419
+                obj.user_type = 10
420
+                obj.list = arr2
421
+                arr.push(obj)
422
+
423
+                let data = []
424
+                data.push(...newNurse)
425
+                data.push(...newDoctor)
426
+                data.push(obj)
427
+                this.tableData = data
428
+              }
429
+              if(this.typevalue == 2){
430
+                newDoctor.sort(this.compare('admin_user_id'))
431
+                let newDoctorTableData = []
432
+                this.doctorTableData.map(item => {
433
+                    if(item.is_sort == 1){
434
+                        newDoctorTableData.push(item)
408
                     }
435
                     }
409
-                    if(this.typevalue == 3){
410
-                        let arr = [...newArr]
411
-                        arr.sort(this.compare('admin_user_id'))
412
-                        this.doctorlist.sort(this.compare('admin_user_id'))
413
-                        let newDoctor = []
414
-                        this.doctorlist.map(item => {
415
-                        if (item.user_type == 3) {
416
-                            newDoctor.push(item)
417
-                        }
418
-                        })
419
-                        newDoctor.map((item, index) => {
420
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
421
-                        
422
-                          }else{
423
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
424
-                            // console.log("arr",arr)
425
-                          }
426
-                        })
427
-                          let arr2 = []
428
-                          arr2.push({class_name:oneStr,schedule_week:1})
429
-                          arr2.push({class_name:twoStr,schedule_week:2})
430
-                          arr2.push({class_name:threeStr,schedule_week:3})
431
-                          arr2.push({class_name:fourStr,schedule_week:4})
432
-                          arr2.push({class_name:fiveStr,schedule_week:5})
433
-                          arr2.push({class_name:sixStr,schedule_week:6})
434
-                          arr2.push({class_name:zeroStr,schedule_week:0})
435
-                          var obj = {}
436
-                          obj.admin_user_id = "1000000"
437
-                          obj.user_name = "合计"
438
-                          obj.user_type = 10
439
-                          obj.list = arr2
440
-                          arr.push(obj)
441
-                          this.tableData = arr
436
+                })
437
+                newDoctorTableData.sort(this.compare('admin_user_id'))
438
+                newDoctorTableData.map((item,index) => {
439
+                    if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
440
+                
441
+                    }else{
442
+                        newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
442
                     }
443
                     }
443
-            
444
-              
444
+                })
445
+                newDoctor.sort(this.compare('sort'))
446
+                
447
+                let arr2 = []
448
+                arr2.push({class_name:oneStr,schedule_week:1})
449
+                arr2.push({class_name:twoStr,schedule_week:2})
450
+                arr2.push({class_name:threeStr,schedule_week:3})
451
+                arr2.push({class_name:fourStr,schedule_week:4})
452
+                arr2.push({class_name:fiveStr,schedule_week:5})
453
+                arr2.push({class_name:sixStr,schedule_week:6})
454
+                arr2.push({class_name:zeroStr,schedule_week:0})
455
+                var obj = {}
456
+                obj.admin_user_id = "1000000"
457
+                obj.user_name = "合计"
458
+                obj.user_type = 10
459
+                obj.list = arr2
460
+                newDoctor.push(obj)
461
+                this.tableData = newDoctor
462
+              }
463
+              if(this.typevalue == 3){
464
+                newNurse.sort(this.compare('admin_user_id'))
465
+                let newNurseTableData = []
466
+                this.nurseTableData.map(item => {
467
+                    if(item.is_sort == 1){
468
+                        newNurseTableData.push(item)
469
+                    }
470
+                })
471
+                newNurseTableData.sort(this.compare('admin_user_id'))
472
+                newNurseTableData.map((item,index) => {
473
+                    if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
474
+                
475
+                    }else{
476
+                        newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
477
+                    }
478
+                })
479
+                newNurse.sort(this.compare('sort'))
480
+                let arr2 = []
481
+                arr2.push({class_name:oneStr,schedule_week:1})
482
+                arr2.push({class_name:twoStr,schedule_week:2})
483
+                arr2.push({class_name:threeStr,schedule_week:3})
484
+                arr2.push({class_name:fourStr,schedule_week:4})
485
+                arr2.push({class_name:fiveStr,schedule_week:5})
486
+                arr2.push({class_name:sixStr,schedule_week:6})
487
+                arr2.push({class_name:zeroStr,schedule_week:0})
488
+                var obj = {}
489
+                obj.admin_user_id = "1000000"
490
+                obj.user_name = "合计"
491
+                obj.user_type = 10
492
+                obj.list = arr2
493
+                newNurse.push(obj)
494
+                this.tableData = newNurse
495
+              }
445
             }
496
             }
446
-         })
497
+        })
447
       },
498
       },
448
       getClass(name,index){
499
       getClass(name,index){
449
         if(name != undefined){
500
         if(name != undefined){

+ 148 - 98
src/xt_pages/medicalScheduling/schedulingStatistics.vue View File

80
                 <line-chart :options="chart"></line-chart>
80
                 <line-chart :options="chart"></line-chart>
81
             </div>
81
             </div>
82
             <div class="tableTitle">统计表</div>
82
             <div class="tableTitle">统计表</div>
83
-            <el-table
84
-                :data="tableData"
85
-                height="250"
86
-                border
87
-                style="width: 100">
88
-                <el-table-column
89
-                align="center"
90
-                prop="date"
91
-                label="医护姓名"
92
-                width="180">
83
+            <el-table :data="tableData" height="250" border style="width: 100">
84
+                <el-table-column align="center" prop="date" label="医护姓名" width="100">
85
+                    <template slot-scope="scope">
86
+                        <span>{{scope.row.user_name}}</span>
87
+                    </template>
93
                 </el-table-column>
88
                 </el-table-column>
94
-                <el-table-column
95
-                 :label="modeItem.class_name"
96
-                 property="number"
97
-                 align="center"
98
-                 min-width="100"
99
-                 v-for="(modeItem, index) in scheduleList"
100
-                 :key="index"
101
-                >
89
+                <el-table-column :label="modeItem.class_name" property="number" align="center" min-width="100" v-for="(modeItem, index) in scheduleList" :key="index">
90
+                    <template slot-scope="scope">
91
+                        <span>{{ getCount(scope.row.doctor_id,modeItem.class_name) }}</span>
92
+                    </template>
102
                 </el-table-column>
93
                 </el-table-column>
103
-                <el-table-column
104
-                 align="center"
105
-                 prop="address"
106
-                 label="总工时/小时">
94
+                <el-table-column align="center" prop="address" label="总工时/小时">
95
+                   <template slot-scope="scope">
96
+                        <span v-if="scope.row.totalminute">{{ scope.row.totalminute / 60 }}</span>
97
+                    </template> 
107
                 </el-table-column>
98
                 </el-table-column>
108
-                <el-table-column
109
-                 align="center"
110
-                 prop="address"
111
-                 label="出勤/天">
99
+                <el-table-column align="center" prop="attendance" label="出勤/天">
100
+                    <!-- <span v-if='scope.row.attendance'>{{ scope.row.attendance ? scope.row.attendance : '' }}</span> -->
112
                 </el-table-column>
101
                 </el-table-column>
113
-                 <el-table-column
114
-                 align="center"
115
-                 prop="address"
116
-                 label="缺勤/天">
102
+                <el-table-column align="center" prop="absence" label="缺勤/天">
103
+                    <!-- <span v-if="scope.row.absence">{{ scope.row.absence ? scope.row.absence : '' }}</span> -->
117
                 </el-table-column>
104
                 </el-table-column>
118
             </el-table>
105
             </el-table>
119
         </div>
106
         </div>
125
 import echarts from "echarts";
112
 import echarts from "echarts";
126
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
113
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
127
 import LineChart from "../qcd/components/LineChart";
114
 import LineChart from "../qcd/components/LineChart";
128
-import {getDoctorList,getScheduleList,getScheduleListTotal,toSearchTotal,changeOption,getchartlist }  from '@/api/doctorSchedule'
115
+import {getDoctorList,getScheduleList,getScheduleListTotal,toSearchTotal,changeOption }  from '@/api/doctorSchedule'
129
 export default {
116
 export default {
130
     components:{
117
     components:{
131
         BreadCrumb,
118
         BreadCrumb,
268
             start_time:0,
255
             start_time:0,
269
             end_time:0,
256
             end_time:0,
270
 
257
 
258
+            doctorlist:[]
259
+
271
         }
260
         }
272
     },
261
     },
273
     created(){
262
     created(){
277
         this.weekNum = this.getYearWeek(year,month,date)
266
         this.weekNum = this.getYearWeek(year,month,date)
278
         this.todayDate=this.formatDate(new Date())
267
         this.todayDate=this.formatDate(new Date())
279
         this.setDate(new Date())
268
         this.setDate(new Date())
280
-        
281
 
269
 
282
-      //获取所有排班种
283
-      this.getScheduleList()
284
-   
285
-      // 获取统计表的数据
286
-      this.getlist()
270
+        //获取所以医护人员
271
+        this.getDoctorList()
272
+
287
 
273
 
288
-      //获取所以医护人员
289
-      this.getDoctorList()
274
+        //获取所有排班种
275
+        this.getScheduleList()
276
+    
277
+        // 获取统计表的数据
278
+        this.getlist()
290
 
279
 
291
-      //获取统计图列表
292
-      this.getchartlist()
280
+      
293
     },
281
     },
294
     methods:{
282
     methods:{
295
         getDoctorList(){
283
         getDoctorList(){
296
-            getDoctorList().then(response=>{
297
-             if(response.data.state == 1){  
284
+           getDoctorList().then(response=>{
285
+             if(response.data.state == 1){
298
                  var list =  response.data.data.list
286
                  var list =  response.data.data.list
299
-                 console.log("医护列表",list)
287
+                 var doctorlist =  response.data.data.doctorlist
288
+                 var nurselist =  response.data.data.nurselist
289
+                 this.doctorlist.push(...nurselist)
290
+                 this.doctorlist.push(...doctorlist)
291
+                 
292
+                 console.log("医护列表",this.doctorlist)
300
                }
293
                }
301
            })
294
            })
302
         },
295
         },
309
             const params = {
302
             const params = {
310
               keyword:this.keywords, 
303
               keyword:this.keywords, 
311
             }
304
             }
312
-           console.log("params",params)
313
-          toSearchTotal(params).then(response=>{
305
+            console.log("params",params)
306
+            toSearchTotal(params).then(response=>{
314
              if(response.data.state == 1){
307
              if(response.data.state == 1){
315
                 var scheduleTotal = response.data.data.scheduletotal 
308
                 var scheduleTotal = response.data.data.scheduletotal 
316
                 console.log("scheduletotal",scheduleTotal) 
309
                 console.log("scheduletotal",scheduleTotal) 
398
             this.end_time = this.getTimestamp(monthEndTime)
391
             this.end_time = this.getTimestamp(monthEndTime)
399
             console.log('monthEndTime',this.getTimestamp(monthEndTime))
392
             console.log('monthEndTime',this.getTimestamp(monthEndTime))
400
             this.getlist()
393
             this.getlist()
401
-            this.getchartlist()
402
         },
394
         },
403
         getFullDate(targetDate) {
395
         getFullDate(targetDate) {
404
             var D, y, m, d;
396
             var D, y, m, d;
437
                this.start_time = this.getTimestamp(this.weekDayArr[0]),
429
                this.start_time = this.getTimestamp(this.weekDayArr[0]),
438
                this.end_time = this.getTimestamp(this.weekDayArr[6])
430
                this.end_time = this.getTimestamp(this.weekDayArr[6])
439
             }
431
             }
440
-          const params = {
441
-              start_time:this.start_time,
442
-              end_time:this.end_time,
443
-           }
444
-           console.log("params",params)
445
-          getScheduleListTotal(params).then(response=>{
446
-             if(response.data.state == 1){
447
-                //获取每个班次对应的次数
448
-               var scheudleTotal =  response.data.data.scheudletotal
449
-               console.log("scheudletotal",scheudleTotal)
450
-               //获取总分钟数
451
-               var list = response.data.data.list
452
-               console.log("list",list)
453
-               var workday = response.data.data.workDay
454
-               console.log("workday",workday)
455
-               var noWorkDay = response.data.data.noWorkDay
456
-               console.log("noWorkDay",noWorkDay)
457
-             }
458
-          })
432
+            const params = {
433
+                start_time:this.start_time,
434
+                end_time:this.end_time,
435
+            }
436
+            console.log("params",params)
437
+            getScheduleListTotal(params).then(response=>{
438
+                if(response.data.state == 1){
439
+                    //获取每个班次对应的次数
440
+                    var scheudleTotal =  response.data.data.scheudletotal
441
+                    console.log("scheudletotal",scheudleTotal)
442
+                    //获取总分钟数
443
+                    var list = response.data.data.list
444
+                    console.log("list",list)
445
+                    var workday = response.data.data.workDay
446
+                    console.log("workday",workday)
447
+                    var noWorkDay = response.data.data.noWorkDay
448
+                    console.log("noWorkDay",noWorkDay)
449
+
450
+                    let tempArr = [], newArr = []
451
+                    for (let i = 0; i < scheudleTotal.length; i++) {
452
+                        if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
453
+                            newArr.push({
454
+                                user_name: scheudleTotal[i].user_name,
455
+                                doctor_id:scheudleTotal[i].doctor_id,
456
+                                list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
457
+                            })
458
+                            tempArr.push(scheudleTotal[i].user_name);
459
+                        } else {
460
+                            for (let j = 0; j < newArr.length; j++) {
461
+                                if (newArr[j].user_name == scheudleTotal[i].user_name) {
462
+                                    newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
463
+                                }
464
+                            }
465
+                        }
466
+                    }
467
+
468
+                    newArr.map(item => {
469
+                        list.map(it => {
470
+                            if(item.doctor_id == it.doctor_id){
471
+                                item.totalminute = it.totalminute
472
+                            }
473
+                        })
474
+                    })
475
+                    newArr.map(item => {
476
+                        workday.map(it => {
477
+                            if(item.doctor_id == it.doctor_id){
478
+                                item.attendance = it.Count
479
+                            }
480
+                        })
481
+                    })
482
+                    newArr.map(item => {
483
+                        noWorkDay.map(it => {
484
+                            if(item.doctor_id == it.doctor_id){
485
+                                item.absence = it.Count
486
+                            }
487
+                        })
488
+                    })
489
+                    
490
+                    let arr = [...newArr]
491
+
492
+                    arr.sort(this.compare('doctor_id'))
493
+                    this.doctorlist.sort(this.compare('admin_user_id'))
494
+                    this.doctorlist.forEach((item, index) => {
495
+                      if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
496
+                    
497
+                      }else{
498
+                        arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
499
+                      }
500
+                    })
501
+                    
502
+
503
+                    console.log('newArr',arr)
504
+                    this.tableData = arr
505
+                }
506
+            })
459
         },
507
         },
460
         changeOption(val){
508
         changeOption(val){
461
             if(this.timeSlot == 1){
509
             if(this.timeSlot == 1){
466
               doctor_type: parseInt(val),
514
               doctor_type: parseInt(val),
467
             }
515
             }
468
             console.log("params",params)
516
             console.log("params",params)
469
-           changeOption(params).then(response=>{
517
+            changeOption(params).then(response=>{
470
               if(response.data.state == 1){
518
               if(response.data.state == 1){
471
                 var scheduletotal =  response.data.data.scheduletotal
519
                 var scheduletotal =  response.data.data.scheduletotal
472
                 console.log("scheduletotal",scheduletotal)
520
                 console.log("scheduletotal",scheduletotal)
477
                 var worknoday = response.data.data.workday
525
                 var worknoday = response.data.data.workday
478
                 console.log("worknoday",worknoday)
526
                 console.log("worknoday",worknoday)
479
               }
527
               }
480
-           })
528
+            })
481
         },
529
         },
482
-       changeTime(val){
483
-         this.start_time = val.getTime()/1000
484
-         this.getlist()
485
-         this.getchartlist()
486
-       },
487
-       changeTimeTwo(val){
488
-         this.end_time = val.getTime()/1000
489
-         this.getlist()
490
-         this.getchartlist()
491
-       },
492
-
493
-       getchartlist(){
494
-           if(this.timeSlot == 1){
495
-               this.start_time = this.getTimestamp(this.weekDayArr[0]),
496
-               this.end_time = this.getTimestamp(this.weekDayArr[6])
530
+        changeTime(val){
531
+            this.start_time = val.getTime()/1000
532
+            this.getlist()
533
+        },
534
+        changeTimeTwo(val){
535
+            this.end_time = val.getTime()/1000
536
+            this.getlist()
537
+        },
538
+        compare(property){
539
+            return function(a,b){
540
+                var value1 = a[property];
541
+                var value2 = b[property];
542
+                return value2 - value1;
497
             }
543
             }
498
-           const params = {
499
-              start_time:this.start_time,
500
-              end_time:this.end_time,   
501
-           }
502
-          getchartlist(params).then(response=>{
503
-             if(response.data.state == 1){
504
-               //统计每个医护人员总工时  
505
-               var list = response.data.data.list 
506
-               console.log("总工时",list)
507
-               //统计每个医护人员出勤的总工时
508
-               var workDaylist =  response.data.data.workDaylist
509
-               console.log("出勤工时",workDaylist)
510
-             }
511
-          }) 
512
-       }
544
+        },
545
+        getCount(id,name){
546
+            if(id != undefined){
547
+                let Count = '';
548
+                this.tableData.map(item => {
549
+                    if(item.doctor_id == id){
550
+                        if(item.list){
551
+                            item.list.map(it => {
552
+                                if(it.class_name == name){
553
+                                    Count = it.Count
554
+                                }
555
+                            })
556
+                        }
557
+                        
558
+                    }
559
+                })
560
+                return Count
561
+            }   
562
+        }
513
     }
563
     }
514
 }
564
 }
515
 </script>
565
 </script>