|
@@ -1,14 +1,5 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="main-contain">
|
3
|
|
- <div class="position">
|
4
|
|
- <bread-crumb :crumbs="crumbs"></bread-crumb>
|
5
|
|
- </div>
|
6
|
|
- <div class="app-container">
|
7
|
|
- <div class="page_workAnalysis">
|
8
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
9
|
|
- <el-tab-pane label="医生" name="first"></el-tab-pane>
|
10
|
|
- <el-tab-pane label="护士" name="second"></el-tab-pane>
|
11
|
|
- </el-tabs>
|
|
2
|
+ <div>
|
12
|
3
|
<div class="cell clearfix">
|
13
|
4
|
<el-select v-model="query.admin_user_id" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeDoctor"
|
14
|
5
|
>
|
|
@@ -32,11 +23,20 @@
|
32
|
23
|
:value="item.value"
|
33
|
24
|
></el-option>
|
34
|
25
|
</el-select>
|
|
26
|
+ <label class="title">
|
|
27
|
+ <span class="name">月份查询</span> :
|
|
28
|
+ </label>
|
|
29
|
+ <el-date-picker
|
|
30
|
+ @change='changeMonth'
|
|
31
|
+ v-model="monthValue"
|
|
32
|
+ type="month"
|
|
33
|
+ placeholder="选择月">
|
|
34
|
+ </el-date-picker>
|
35
|
35
|
<label class="title">
|
36
|
36
|
<span class="name">日期查询</span> :
|
37
|
37
|
</label>
|
38
|
38
|
<el-date-picker
|
39
|
|
- v-model="query.start_time"
|
|
39
|
+ v-model="start_time"
|
40
|
40
|
prefix-icon="el-icon-date"
|
41
|
41
|
@change="changeTime"
|
42
|
42
|
:editable="false"
|
|
@@ -50,7 +50,7 @@
|
50
|
50
|
></el-date-picker>
|
51
|
51
|
<span class>-</span>
|
52
|
52
|
<el-date-picker
|
53
|
|
- v-model="query.end_time"
|
|
53
|
+ v-model="end_time"
|
54
|
54
|
prefix-icon="el-icon-date"
|
55
|
55
|
@change="changeEndTime"
|
56
|
56
|
:editable="false"
|
|
@@ -113,12 +113,11 @@
|
113
|
113
|
</el-table>
|
114
|
114
|
|
115
|
115
|
</div>
|
116
|
|
- </div>
|
117
|
|
- </div>
|
118
|
116
|
</div>
|
119
|
117
|
</template>
|
120
|
118
|
|
121
|
119
|
<script>
|
|
120
|
+const moment = require('moment')
|
122
|
121
|
import echarts from "echarts";
|
123
|
122
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
124
|
123
|
import LineChart from "../../qcd/components/LineChart";
|
|
@@ -152,7 +151,9 @@ export default {
|
152
|
151
|
limit:20,
|
153
|
152
|
page:1,
|
154
|
153
|
},
|
155
|
|
-
|
|
154
|
+ start_time:'',
|
|
155
|
+ end_time:'',
|
|
156
|
+ monthValue:'',
|
156
|
157
|
|
157
|
158
|
doctor_options:[
|
158
|
159
|
{id:0,user_name:"全部",admin_user_id:0}
|
|
@@ -354,6 +355,7 @@ export default {
|
354
|
355
|
return new Date(time).getTime() / 1000;
|
355
|
356
|
},
|
356
|
357
|
changeTime(val) {
|
|
358
|
+ this.query.end_time = ''
|
357
|
359
|
var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
|
358
|
360
|
if (time > 0) {
|
359
|
361
|
this.$message.error("结束时间不能小于开始时间");
|
|
@@ -361,6 +363,11 @@ export default {
|
361
|
363
|
} else {
|
362
|
364
|
// this.getDialysisList()
|
363
|
365
|
this.query.page = 1;
|
|
366
|
+ this.query.start_time = val
|
|
367
|
+ this.query.end_time = this.end_time
|
|
368
|
+ this.monthValue = ''
|
|
369
|
+ sessionStorage.setItem("doctor_start_time", val)
|
|
370
|
+ sessionStorage.removeItem("doctorMonth");
|
364
|
371
|
this.GetDoctorWorkloadChartData(this.query)
|
365
|
372
|
this.GetDoctorWorkloadTableData(this.query)
|
366
|
373
|
|
|
@@ -411,7 +418,12 @@ export default {
|
411
|
418
|
this.$message.error("结束时间不能小于开始时间");
|
412
|
419
|
this.query.end_time = "";
|
413
|
420
|
} else {
|
|
421
|
+ this.query.start_time = this.start_time
|
|
422
|
+ this.query.end_time = val
|
|
423
|
+ this.monthValue = ''
|
414
|
424
|
this.query.page = 1;
|
|
425
|
+ sessionStorage.setItem("doctor_end_time", val)
|
|
426
|
+ sessionStorage.removeItem("doctorMonth");
|
415
|
427
|
this.GetDoctorWorkloadChartData(this.query)
|
416
|
428
|
this.GetDoctorWorkloadTableData(this.query)
|
417
|
429
|
|
|
@@ -430,7 +442,41 @@ export default {
|
430
|
442
|
var dataZoom_end = 100;
|
431
|
443
|
this.bar.dataZoom[0].end = dataZoom_end
|
432
|
444
|
}
|
433
|
|
- }
|
|
445
|
+ },
|
|
446
|
+ changeMonth(value){
|
|
447
|
+ sessionStorage.removeItem("doctor_start_time");
|
|
448
|
+ sessionStorage.removeItem("doctor_end_time");
|
|
449
|
+ let monthStartTime = value.getTime() / 1000
|
|
450
|
+ var nowDate = new Date(value);
|
|
451
|
+ var cloneNowDate = new Date(value);
|
|
452
|
+ var fullYear = nowDate.getFullYear();
|
|
453
|
+ var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
|
|
454
|
+ var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
|
|
455
|
+ let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
|
|
456
|
+ this.query.start_time = moment(new Date(monthStartTime * 1000)).format('YYYY-MM-DD')
|
|
457
|
+ this.query.end_time = moment(new Date(monthEndTime)).format('YYYY-MM-DD')
|
|
458
|
+ this.end_time = ''
|
|
459
|
+ this.start_time = ''
|
|
460
|
+ sessionStorage.setItem("doctorMonth", monthStartTime);
|
|
461
|
+ this.GetDoctorWorkloadChartData(this.query)
|
|
462
|
+ this.GetDoctorWorkloadTableData(this.query)
|
|
463
|
+ },
|
|
464
|
+ getFullDate(targetDate) {
|
|
465
|
+ var D, y, m, d;
|
|
466
|
+ if (targetDate) {
|
|
467
|
+ D = new Date(targetDate);
|
|
468
|
+ y = D.getFullYear();
|
|
469
|
+ m = D.getMonth() + 1;
|
|
470
|
+ d = D.getDate();
|
|
471
|
+ } else {
|
|
472
|
+ y = fullYear;
|
|
473
|
+ m = month;
|
|
474
|
+ d = date;
|
|
475
|
+ }
|
|
476
|
+ m = m > 9 ? m : '0' + m;
|
|
477
|
+ d = d > 9 ? d : '0' + d;
|
|
478
|
+ return y + '-' + m + '-' + d;
|
|
479
|
+ },
|
434
|
480
|
},created(){
|
435
|
481
|
var date = new Date()
|
436
|
482
|
var year = date.getFullYear() //获取完整的年份(4位)
|
|
@@ -441,6 +487,38 @@ export default {
|
441
|
487
|
this.query.end_time = year + '-' + month + '-' + day
|
442
|
488
|
this.query.start_time = year + '-' + last_month + '-' + day
|
443
|
489
|
this.query.statistics_type = 1
|
|
490
|
+
|
|
491
|
+ this.start_time = this.query.start_time
|
|
492
|
+ this.end_time = this.query.end_time
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+ if(sessionStorage.getItem("doctor_start_time") == null){
|
|
496
|
+ sessionStorage.setItem("doctor_start_time", this.start_time);
|
|
497
|
+ }else{
|
|
498
|
+ this.start_time = sessionStorage.getItem("doctor_start_time")
|
|
499
|
+ this.query.start_time = sessionStorage.getItem("doctor_start_time")
|
|
500
|
+ }
|
|
501
|
+ if(sessionStorage.getItem("doctor_end_time") == null){
|
|
502
|
+ sessionStorage.setItem("doctor_end_time", this.end_time);
|
|
503
|
+ }else{
|
|
504
|
+ this.end_time = sessionStorage.getItem("doctor_end_time")
|
|
505
|
+ this.query.end_time = sessionStorage.getItem("doctor_end_time")
|
|
506
|
+ }
|
|
507
|
+ if(sessionStorage.getItem("doctorMonth") != null){
|
|
508
|
+ let value = parseInt(sessionStorage.getItem("doctorMonth")) * 1000
|
|
509
|
+ let monthStartTime = new Date(value)
|
|
510
|
+ this.monthValue = monthStartTime
|
|
511
|
+ var nowDate = new Date(value);
|
|
512
|
+ var cloneNowDate = new Date(value);
|
|
513
|
+ var fullYear = nowDate.getFullYear();
|
|
514
|
+ var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
|
|
515
|
+ var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
|
|
516
|
+ let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
|
|
517
|
+ this.query.start_time = moment(new Date(monthStartTime)).format('YYYY-MM-DD')
|
|
518
|
+ this.query.end_time = moment(new Date(monthEndTime)).format('YYYY-MM-DD')
|
|
519
|
+ this.start_time = ''
|
|
520
|
+ this.end_time = ''
|
|
521
|
+ }
|
444
|
522
|
this.GetAllDoctor()
|
445
|
523
|
this.GetDoctorWorkloadChartData(this.query)
|
446
|
524
|
this.GetDoctorWorkloadTableData(this.query)
|