See999 4 years ago
parent
commit
0894d07741

+ 11 - 0
src/router/modules/medical_scheduling.js View File

@@ -47,5 +47,16 @@ export default {
47 47
       noCache: true
48 48
     }
49 49
   },
50
+  {
51
+    path: '/medicalScheduling/statistics/print',
52
+    component: () => import('@/xt_pages/medicalScheduling/statistics_print'),
53
+    name: 'statistics_print',
54
+    hidden: true,
55
+    is_menu: false,
56
+    meta: {
57
+      title: 'statistics_print',
58
+      noCache: true
59
+    }
60
+  },
50 61
   ]
51 62
 }

+ 175 - 17
src/xt_pages/medicalScheduling/schedulingStatistics.vue View File

@@ -3,7 +3,7 @@
3 3
         <div class="position">
4 4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
             <div style="display:flex;align-items:center">
6
-                <el-button type="primary" icon="el-icon-printer">打印</el-button>
6
+                <el-button type="primary" icon="el-icon-printer" @click='toPrint'>打印</el-button>
7 7
             </div>
8 8
         </div>
9 9
         <div class="app-container">
@@ -255,7 +255,9 @@ export default {
255 255
             start_time:0,
256 256
             end_time:0,
257 257
 
258
-            doctorlist:[]
258
+            doctorlist:[],
259
+            doctorArr:[],
260
+            nurseArr:[]
259 261
 
260 262
         }
261 263
     },
@@ -281,16 +283,20 @@ export default {
281 283
     },
282 284
     methods:{
283 285
         getDoctorList(){
284
-           getDoctorList().then(response=>{
286
+            getDoctorList().then(response=>{
285 287
              if(response.data.state == 1){
286
-                 var list =  response.data.data.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)
293
-               }
288
+                var list =  response.data.data.list
289
+                var doctorlist =  response.data.data.doctorlist
290
+                var nurselist =  response.data.data.nurselist
291
+                this.doctorArr = doctorlist
292
+                this.nurseArr = nurselist
293
+
294
+                this.doctorlist.push(...nurselist)
295
+                this.doctorlist.push(...doctorlist)
296
+                
297
+                console.log("医护列表",this.doctorlist)
298
+             }
299
+               
294 300
            })
295 301
         },
296 302
         //搜索
@@ -305,14 +311,73 @@ export default {
305 311
             console.log("params",params)
306 312
             toSearchTotal(params).then(response=>{
307 313
              if(response.data.state == 1){
308
-                var scheduleTotal = response.data.data.scheduletotal 
309
-                console.log("scheduletotal",scheduleTotal) 
314
+                var scheudleTotal = response.data.data.scheduletotal 
315
+                console.log("scheduletotal",scheudleTotal) 
310 316
                 var list = response.data.data.list
311 317
                 console.log("list",list)
312 318
                 var workday = response.data.data.workDay
313 319
                 console.log("workday",workday)
314 320
                 var noWorkDay = response.data.data.noWorkDay
315 321
                 console.log("noworkday",noWorkDay)
322
+
323
+
324
+                let tempArr = [], newArr = []
325
+                for (let i = 0; i < scheudleTotal.length; i++) {
326
+                    if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
327
+                        newArr.push({
328
+                            user_name: scheudleTotal[i].user_name,
329
+                            doctor_id:scheudleTotal[i].doctor_id,
330
+                            list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
331
+                        })
332
+                        tempArr.push(scheudleTotal[i].user_name);
333
+                    } else {
334
+                        for (let j = 0; j < newArr.length; j++) {
335
+                            if (newArr[j].user_name == scheudleTotal[i].user_name) {
336
+                                newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
337
+                            }
338
+                        }
339
+                    }
340
+                }
341
+
342
+                newArr.map(item => {
343
+                    list.map(it => {
344
+                        if(item.doctor_id == it.doctor_id){
345
+                            item.totalminute = it.totalminute
346
+                        }
347
+                    })
348
+                })
349
+                newArr.map(item => {
350
+                    workday.map(it => {
351
+                        if(item.doctor_id == it.doctor_id){
352
+                            item.attendance = it.Count
353
+                        }
354
+                    })
355
+                })
356
+                newArr.map(item => {
357
+                    noWorkDay.map(it => {
358
+                        if(item.doctor_id == it.doctor_id){
359
+                            item.absence = it.Count
360
+                        }
361
+                    })
362
+                })
363
+                
364
+                let arr = [...newArr]
365
+                
366
+                if(this.keywords != ''){
367
+                    this.tableData = arr
368
+                }else {
369
+                    arr.sort(this.compare('doctor_id'))
370
+                    this.doctorlist.sort(this.compare('admin_user_id'))
371
+                    this.doctorlist.forEach((item, index) => {
372
+                      if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
373
+                    
374
+                      }else{
375
+                        arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
376
+                      }
377
+                    })
378
+                    console.log('newArr',arr)
379
+                    this.tableData = arr
380
+                }
316 381
               }
317 382
           })  
318 383
         },
@@ -516,14 +581,101 @@ export default {
516 581
             console.log("params",params)
517 582
             changeOption(params).then(response=>{
518 583
               if(response.data.state == 1){
519
-                var scheduletotal =  response.data.data.scheduletotal
520
-                console.log("scheduletotal",scheduletotal)
584
+                var scheudleTotal =  response.data.data.scheduletotal
585
+                console.log("scheduletotal",scheudleTotal)
521 586
                 var list = response.data.data.list
522 587
                 console.log("list",list)
523 588
                 var workday = response.data.data.workday
524 589
                 console.log("workday",workday)
525
-                var worknoday = response.data.data.workday
526
-                console.log("worknoday",worknoday)
590
+                var noWorkDay = response.data.data.workday
591
+                console.log("worknoday",noWorkDay)
592
+
593
+
594
+                let tempArr = [], newArr = []
595
+                    for (let i = 0; i < scheudleTotal.length; i++) {
596
+                        if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
597
+                            newArr.push({
598
+                                user_name: scheudleTotal[i].user_name,
599
+                                doctor_id:scheudleTotal[i].doctor_id,
600
+                                list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
601
+                            })
602
+                            tempArr.push(scheudleTotal[i].user_name);
603
+                        } else {
604
+                            for (let j = 0; j < newArr.length; j++) {
605
+                                if (newArr[j].user_name == scheudleTotal[i].user_name) {
606
+                                    newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
607
+                                }
608
+                            }
609
+                        }
610
+                    }
611
+
612
+                    newArr.map(item => {
613
+                        list.map(it => {
614
+                            if(item.doctor_id == it.doctor_id){
615
+                                item.totalminute = it.totalminute
616
+                            }
617
+                        })
618
+                    })
619
+                    newArr.map(item => {
620
+                        workday.map(it => {
621
+                            if(item.doctor_id == it.doctor_id){
622
+                                item.attendance = it.Count
623
+                            }
624
+                        })
625
+                    })
626
+                    newArr.map(item => {
627
+                        noWorkDay.map(it => {
628
+                            if(item.doctor_id == it.doctor_id){
629
+                                item.absence = it.Count
630
+                            }
631
+                        })
632
+                    })
633
+                    
634
+                    let arr = [...newArr]
635
+                    if(val == 0){
636
+                        arr.sort(this.compare('doctor_id'))
637
+                        this.doctorlist.sort(this.compare('admin_user_id'))
638
+                        this.doctorlist.forEach((item, index) => {
639
+                          if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
640
+                        
641
+                          }else{
642
+                            arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
643
+                          }
644
+                        })
645
+                        
646
+
647
+                        console.log('newArr',arr)
648
+                        this.tableData = arr
649
+                    }else if(val == 2){
650
+                        arr.sort(this.compare('doctor_id'))
651
+                        this.doctorArr.sort(this.compare('admin_user_id'))
652
+                        this.doctorArr.forEach((item, index) => {
653
+                          if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
654
+                        
655
+                          }else{
656
+                            arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
657
+                          }
658
+                        })
659
+                        
660
+
661
+                        console.log('newArr',arr)
662
+                        this.tableData = arr
663
+                    }else if(val == 3){
664
+                        arr.sort(this.compare('doctor_id'))
665
+                        this.nurseArr.sort(this.compare('admin_user_id'))
666
+                        this.nurseArr.forEach((item, index) => {
667
+                          if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
668
+                        
669
+                          }else{
670
+                            arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
671
+                          }
672
+                        })
673
+                        
674
+
675
+                        console.log('newArr',arr)
676
+                        this.tableData = arr
677
+                    }
678
+                    
527 679
               }
528 680
             })
529 681
         },
@@ -559,6 +711,12 @@ export default {
559 711
                 })
560 712
                 return Count
561 713
             }   
714
+        },
715
+        toPrint(){
716
+            this.$router.push({
717
+                path: '/medicalScheduling/statistics/print',
718
+                // query: { date: date }
719
+            }) 
562 720
         }
563 721
     }
564 722
 }

+ 142 - 0
src/xt_pages/medicalScheduling/statistics_print.vue View File

@@ -0,0 +1,142 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <span class="main_title">{{ $store.getters.xt_user.org.org_name }}医护排班统计表</span>
16
+                    </div>
17
+                    <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18
+                      打印时间:
19
+                    </div>
20
+                    <div class="table_panel">
21
+                        <table class="table">
22
+                            <thead>
23
+                                <tr>
24
+                                    <td width="120">医护姓名</td>
25
+                                    <td width="120">医护姓名</td>
26
+                                    <td width="120">医护姓名</td>
27
+                                    <td width="120">医护姓名</td>
28
+                                    <td width="120">医护姓名</td>
29
+                                    <td width="120">医护姓名</td>
30
+                                </tr>
31
+                            </thead>
32
+                            <tbody>
33
+                                <tr>
34
+                                    <td width="120">医护姓名</td>
35
+                                    <td width="120">医护姓名</td>
36
+                                    <td width="120">医护姓名</td>
37
+                                    <td width="120">医护姓名</td>
38
+                                    <td width="120">医护姓名</td>
39
+                                    <td width="120">医护姓名</td>
40
+                                </tr>
41
+                            </tbody>
42
+                        </table>
43
+                    </div>
44
+                </div>
45
+            </div>
46
+        </div>
47
+    </div>
48
+</template>
49
+
50
+<script>
51
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
52
+import print from 'print-js'
53
+export default {
54
+    components:{
55
+        BreadCrumb
56
+    },
57
+    data(){
58
+        return{
59
+            crumbs: [
60
+                { path: false, name: '医护排班' },
61
+                { path: false, name: '排班统计打印' }
62
+            ],
63
+        }
64
+    },
65
+    created(){
66
+
67
+    },
68
+    methods:{
69
+
70
+    }
71
+}
72
+</script>
73
+
74
+
75
+<style rel="stylesheet/scss" lang="scss" scoped>
76
+.print_main_content {
77
+  background-color: white;
78
+  max-width: 1500px;
79
+  margin: 0 auto;
80
+  padding: 0 0 20px 0;
81
+
82
+  .order_title_panl {
83
+    text-align: center;
84
+
85
+    .main_title {
86
+      font-size: 18px;
87
+      line-height: 40px;
88
+      font-weight: 500;
89
+    }
90
+  }
91
+  .table_panel {
92
+    .table {
93
+      width: 100%;
94
+      border: 1px solid;
95
+      border-collapse: collapse;
96
+      padding: 2px;
97
+      
98
+
99
+      thead {
100
+        tr {
101
+          td {
102
+            border: 1px solid;
103
+            text-align: center;
104
+            font-size: 18px;
105
+            padding: 15px 5px;
106
+          }
107
+        }
108
+      }
109
+      tbody {
110
+        tr {
111
+          td {
112
+            border: 1px solid;
113
+            text-align: center;
114
+            font-size: 18px;
115
+            padding: 10px 5px;
116
+            white-space: pre-line;
117
+            .proj {
118
+              padding: 5px 0;
119
+              text-align: left;
120
+
121
+              .proj_title {
122
+                font-size: 16px;
123
+                font-weight: 500;
124
+                line-height: 25px;
125
+              }
126
+
127
+              .proj_item {
128
+                font-size: 15px;
129
+                line-height: 20px;
130
+
131
+                .zone_name {
132
+                  font-weight: 500;
133
+                }
134
+              }
135
+            }
136
+          }
137
+        }
138
+      }
139
+    }
140
+  }
141
+}
142
+</style>