Browse Source

医护管理

XMLWAN 4 years ago
parent
commit
c0bcb63ff8

+ 24 - 0
src/api/doctorSchedule.js View File

@@ -148,3 +148,27 @@ export function getScheduleListTotal(params) {
148 148
     params: params
149 149
   })
150 150
 }
151
+
152
+export function toSearchTotal(params) {
153
+  return request({
154
+    url: '/api/schedule/tosearchtotal',
155
+    methods: 'get',
156
+    params: params
157
+  })
158
+}
159
+
160
+export function changeOption(params) {
161
+  return request({
162
+    url: '/api/schedule/changeoption',
163
+    methods: 'get',
164
+    params: params
165
+  })
166
+}
167
+
168
+export function getchartlist(params) {
169
+  return request({
170
+    url: '/api/schedule/getchartlist',
171
+    methods: 'get',
172
+    params: params
173
+  })
174
+}

+ 1 - 1
src/xt_pages/medicalScheduling/index.vue View File

@@ -1508,7 +1508,7 @@ export default {
1508 1508
     created(){
1509 1509
         //获取医护人员
1510 1510
         this.getDoctorList()
1511
-        //获取班种
1511
+        //获取班种班种
1512 1512
         this.getScheduleList()
1513 1513
 
1514 1514
         let year = new Date().getFullYear()

+ 116 - 14
src/xt_pages/medicalScheduling/schedulingStatistics.vue View File

@@ -57,14 +57,16 @@
57 57
                     v-model="customTime1"
58 58
                     type="date"
59 59
                     placeholder="选择日期"
60
-                    :picker-options="pickerOptions">
60
+                    :picker-options="pickerOptions"
61
+                    @change="changeTime">
61 62
                     </el-date-picker>-
62 63
                     <el-date-picker
63 64
                     style="width:140px;"
64 65
                     v-model="customTime2"
65 66
                     type="date"
66 67
                     placeholder="选择日期"
67
-                    :picker-options="pickerOptions">
68
+                    :picker-options="pickerOptions"
69
+                    @change="changeTimeTwo">
68 70
                     </el-date-picker>
69 71
                 </div>
70 72
 
@@ -123,7 +125,7 @@
123 125
 import echarts from "echarts";
124 126
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
125 127
 import LineChart from "../qcd/components/LineChart";
126
-import { getScheduleList,getScheduleListTotal }  from '@/api/doctorSchedule'
128
+import {getDoctorList,getScheduleList,getScheduleListTotal,toSearchTotal,changeOption,getchartlist }  from '@/api/doctorSchedule'
127 129
 export default {
128 130
     components:{
129 131
         BreadCrumb,
@@ -263,6 +265,8 @@ export default {
263 265
             },
264 266
             tableData: [],
265 267
             scheduleList:[],
268
+            start_time:0,
269
+            end_time:0,
266 270
 
267 271
         }
268 272
     },
@@ -273,16 +277,52 @@ export default {
273 277
         this.weekNum = this.getYearWeek(year,month,date)
274 278
         this.todayDate=this.formatDate(new Date())
275 279
         this.setDate(new Date())
276
-
280
+        
277 281
 
278 282
       //获取所有排班种
279 283
       this.getScheduleList()
280
-
284
+   
281 285
       // 获取统计表的数据
282
-      // this.getlist()
286
+      this.getlist()
287
+
288
+      //获取所以医护人员
289
+      this.getDoctorList()
290
+
291
+      //获取统计图列表
292
+      this.getchartlist()
283 293
     },
284 294
     methods:{
285
-        toSearch(){},
295
+        getDoctorList(){
296
+            getDoctorList().then(response=>{
297
+             if(response.data.state == 1){  
298
+                 var list =  response.data.data.list
299
+                 console.log("医护列表",list)
300
+               }
301
+           })
302
+        },
303
+        //搜索
304
+        toSearch(){
305
+            if(this.timeSlot == 1){
306
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
307
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
308
+            }
309
+            const params = {
310
+              keyword:this.keywords, 
311
+            }
312
+           console.log("params",params)
313
+          toSearchTotal(params).then(response=>{
314
+             if(response.data.state == 1){
315
+                var scheduleTotal = response.data.data.scheduletotal 
316
+                console.log("scheduletotal",scheduleTotal) 
317
+                var list = response.data.data.list
318
+                console.log("list",list)
319
+                var workday = response.data.data.workDay
320
+                console.log("workday",workday)
321
+                var noWorkDay = response.data.data.noWorkDay
322
+                console.log("noworkday",noWorkDay)
323
+              }
324
+          })  
325
+        },
286 326
         formatDate(date){
287 327
             var year = date.getFullYear()+'.'
288 328
             var month = (date.getMonth()+1)+'.';
@@ -354,10 +394,11 @@ export default {
354 394
             var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
355 395
             var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
356 396
             let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
357
-
358
-
397
+            this.start_time = monthStartTime
398
+            this.end_time = this.getTimestamp(monthEndTime)
359 399
             console.log('monthEndTime',this.getTimestamp(monthEndTime))
360
-
400
+            this.getlist()
401
+            this.getchartlist()
361 402
         },
362 403
         getFullDate(targetDate) {
363 404
             var D, y, m, d;
@@ -392,10 +433,15 @@ export default {
392 433
 
393 434
         //获取统计表数据
394 435
         getlist(){
436
+            if(this.timeSlot == 1){
437
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
438
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
439
+            }
395 440
           const params = {
396
-             start_time:this.getTimestamp(this.weekDayArr[0]),
397
-             end_time:this.getTimestamp(this.weekDayArr[6])
441
+              start_time:this.start_time,
442
+              end_time:this.end_time,
398 443
            }
444
+           console.log("params",params)
399 445
           getScheduleListTotal(params).then(response=>{
400 446
              if(response.data.state == 1){
401 447
                 //获取每个班次对应的次数
@@ -404,10 +450,66 @@ export default {
404 450
                //获取总分钟数
405 451
                var list = response.data.data.list
406 452
                console.log("list",list)
407
-
453
+               var workday = response.data.data.workDay
454
+               console.log("workday",workday)
455
+               var noWorkDay = response.data.data.noWorkDay
456
+               console.log("noWorkDay",noWorkDay)
408 457
              }
409 458
           })
410
-        }
459
+        },
460
+        changeOption(val){
461
+            if(this.timeSlot == 1){
462
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
463
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
464
+            }
465
+            const params = {
466
+              doctor_type: parseInt(val),
467
+            }
468
+            console.log("params",params)
469
+           changeOption(params).then(response=>{
470
+              if(response.data.state == 1){
471
+                var scheduletotal =  response.data.data.scheduletotal
472
+                console.log("scheduletotal",scheduletotal)
473
+                var list = response.data.data.list
474
+                console.log("list",list)
475
+                var workday = response.data.data.workday
476
+                console.log("workday",workday)
477
+                var worknoday = response.data.data.workday
478
+                console.log("worknoday",worknoday)
479
+              }
480
+           })
481
+        },
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])
497
+            }
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
+       }
411 513
     }
412 514
 }
413 515
 </script>