See999 4 vuotta sitten
vanhempi
commit
355cba80b3

+ 27 - 30
src/xt_pages/medicalScheduling/index.vue Näytä tiedosto

1509
 
1509
 
1510
         copyStaffSchedule(){
1510
         copyStaffSchedule(){
1511
             this.newVisible = true
1511
             this.newVisible = true
1512
-            // const params = {
1513
-            //     start_time:this.getTimestamp(this.weekDayArr[0]),
1514
-            //     end_time:this.getTimestamp(this.weekDayArr[6])
1515
-            // }
1516
-            // copyStaffSchedule(params).then(response=>{
1517
-            //     if(response.data.state == 1){
1518
-            //     var msg =  response.data.data.msg
1519
-            //     console.log("msg",msg)
1520
-            //     this.$message.success("复制成功")
1521
-            //     }else{
1522
-            //     this.$message.error("排班已存在")
1523
-            //     }
1524
-            // })
1512
+            const params = {
1513
+                start_time:this.getTimestamp(this.weekDayArr[0]),
1514
+                end_time:this.getTimestamp(this.weekDayArr[6])
1515
+            }
1516
+            copyStaffSchedule(params).then(response=>{
1517
+                if(response.data.state == 1){
1518
+                var msg =  response.data.data.msg
1519
+                console.log("msg",msg)
1520
+                this.$message.success("复制成功")
1521
+                }else{
1522
+                this.$message.error("排班已存在")
1523
+                }
1524
+            })
1525
         },
1525
         },
1526
         toContinuous(){
1526
         toContinuous(){
1527
             var is_status = 0
1527
             var is_status = 0
1600
             if (week.length == 14) {
1600
             if (week.length == 14) {
1601
                 weeks = week[4]+week[5]+week[6]+week[7]+week[8]+week[9]+week[10]+week[11]+week[12]
1601
                 weeks = week[4]+week[5]+week[6]+week[7]+week[8]+week[9]+week[10]+week[11]+week[12]
1602
             }
1602
             }
1603
-
1604
-            //  console.log("week",week)
1605
-            //  console.log("weeks",weeks)
1606
             var weekdate =  this.getTimestamp(weeks)
1603
             var weekdate =  this.getTimestamp(weeks)
1607
             if(weekdate  < this.timeNow){
1604
             if(weekdate  < this.timeNow){
1608
             return 'background-color:#e5e5e5;'
1605
             return 'background-color:#e5e5e5;'
1621
               id:val.id,
1618
               id:val.id,
1622
             }
1619
             }
1623
             console.log("params",params)
1620
             console.log("params",params)
1624
-          // SaveNurseSort(params).then(response=>{
1625
-          //    if(response.data.state == 1){
1626
-          //      var role = response.data.data.role
1627
-          //      this.$message.success("保存成功")
1628
-          //      this.getDoctorList()
1629
-          //    }
1630
-          // })
1621
+          SaveNurseSort(params).then(response=>{
1622
+             if(response.data.state == 1){
1623
+               var role = response.data.data.role
1624
+               this.$message.success("保存成功")
1625
+               this.getDoctorList()
1626
+             }
1627
+          })
1631
         },
1628
         },
1632
        changeRadio(val){
1629
        changeRadio(val){
1633
           console.log("val",val)
1630
           console.log("val",val)
1635
               id:val.id,
1632
               id:val.id,
1636
               is_sort:val.is_sort,
1633
               is_sort:val.is_sort,
1637
            }
1634
            }
1638
-         // SaveIsSchedule(params).then(response=>{
1639
-         //    if(response.data.state == 1){
1640
-         //      var role =  response.data.data.role
1641
-         //      this.$message.success("保存成功")
1642
-         //      this.getDoctorList()
1643
-         //    }
1644
-         // })
1635
+         SaveIsSchedule(params).then(response=>{
1636
+            if(response.data.state == 1){
1637
+              var role =  response.data.data.role
1638
+              this.$message.success("保存成功")
1639
+              this.getDoctorList()
1640
+            }
1641
+         })
1645
        }
1642
        }
1646
     },
1643
     },
1647
     created(){
1644
     created(){

+ 54 - 78
src/xt_pages/medicalScheduling/schedulingStatistics.vue Näytä tiedosto

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