瀏覽代碼

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

csx 4 年之前
父節點
當前提交
7594d0f87d

+ 3 - 3
package-lock.json 查看文件

@@ -3515,9 +3515,9 @@
3515 3515
       "dev": true
3516 3516
     },
3517 3517
     "element-ui": {
3518
-      "version": "2.13.0",
3519
-      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.0.tgz",
3520
-      "integrity": "sha512-KYsHWsBXYbLELS8cdfvgJTOMSUby3UEjvsPV1V1VmgJ/DdkOAS4z3MiOrPxrT9w2Cc5lZ4eVSQiGhYFR5NVChw==",
3518
+      "version": "2.13.2",
3519
+      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.2.tgz",
3520
+      "integrity": "sha512-r761DRPssMPKDiJZWFlG+4e4vr0cRG/atKr3Eqr8Xi0tQMNbtmYU1QXvFnKiFPFFGkgJ6zS6ASkG+sellcoHlQ==",
3521 3521
       "requires": {
3522 3522
         "async-validator": "~1.8.1",
3523 3523
         "babel-helper-vue-jsx-merge-props": "^2.0.0",

+ 1 - 1
package.json 查看文件

@@ -46,7 +46,7 @@
46 46
     "driver.js": "0.5.2",
47 47
     "dropzone": "5.2.0",
48 48
     "echarts": "3.8.5",
49
-    "element-ui": "^2.13.0",
49
+    "element-ui": "^2.13.2",
50 50
     "file-saver": "^1.3.3",
51 51
     "font-awesome": "4.7.0",
52 52
     "js-cookie": "2.2.0",

+ 13 - 13
src/router/modules/qcd.js 查看文件

@@ -240,25 +240,25 @@ export default {
240 240
       }
241 241
     },
242 242
     {
243
-      path: '/qcd/workAnalysis/doctor',
244
-      component: () => import('@/xt_pages/qcd/workAnalysis/doctor'),
243
+      path: '/qcd/workAnalysis/index',
244
+      component: () => import('@/xt_pages/qcd/workAnalysis/index'),
245 245
       name: 'workAnalysisDoctor',
246 246
       meta: {
247 247
         title: '工作量分析统计',
248 248
         noCache: true
249 249
       }
250 250
     },
251
-    {
252
-      path: '/qcd/workAnalysis/nurse',
253
-      hidden: true,
254
-      is_menu: false,
255
-      component: () => import('@/xt_pages/qcd/workAnalysis/nurse'),
256
-      name: 'workAnalysisNurse',
257
-      meta: {
258
-        title: '工作量分析统计护士',
259
-        noCache: true
260
-      }
261
-    },
251
+    // {
252
+    //   path: '/qcd/workAnalysis/nurse',
253
+    //   hidden: true,
254
+    //   is_menu: false,
255
+    //   component: () => import('@/xt_pages/qcd/workAnalysis/nurse'),
256
+    //   name: 'workAnalysisNurse',
257
+    //   meta: {
258
+    //     title: '工作量分析统计护士',
259
+    //     noCache: true
260
+    //   }
261
+    // },
262 262
     {
263 263
       path: '/qcd/patientanalysis/checkStatistical',
264 264
       hidden: true,

+ 31 - 30
src/xt_pages/data/druguseTemplate.vue 查看文件

@@ -50,7 +50,7 @@
50 50
               border
51 51
               fit
52 52
               :row-style="{ color: '#303133' }"
53
-          :header-cell-style="{
53
+              :header-cell-style="{
54 54
             backgroundColor: 'rgb(245, 247, 250)',
55 55
             color: '#606266'
56 56
           }"
@@ -126,10 +126,10 @@
126 126
                 prop="amount1"
127 127
                 align="center"
128 128
                 label="药品规格">
129
-                  <!-- {{drugDesc(scope.row)}} -->
130
-                  <template slot-scope="scope">
131
-                    <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
132
-                  </template>
129
+                <!-- {{drugDesc(scope.row)}} -->
130
+                <template slot-scope="scope">
131
+                  <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
132
+                </template>
133 133
               </el-table-column>
134 134
 
135 135
 
@@ -254,9 +254,9 @@
254 254
                     </template>
255 255
                   </el-table-column>
256 256
                   <el-table-column align="center" label="药品规格">
257
-                      <template slot-scope="scope">
258
-                        <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
259
-                      </template>
257
+                    <template slot-scope="scope">
258
+                      <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
259
+                    </template>
260 260
                   </el-table-column>
261 261
                   <el-table-column prop="prescribing_number" align="center" label="开药数量">
262 262
                     <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
@@ -483,7 +483,7 @@
483 483
                   </el-col>
484 484
                   <el-col :span="12">
485 485
 
486
-                  <el-form-item label="药品规格 :" prop="advice_desc">
486
+                    <el-form-item label="药品规格 :" prop="advice_desc">
487 487
                       <el-col :span="8">
488 488
                         <el-input v-model="templateFormEdit.advice_desc"></el-input>
489 489
                       </el-col>
@@ -664,10 +664,10 @@
664 664
                     </template>
665 665
                   </el-table-column>
666 666
                   <el-table-column align="center" label="药品规格">
667
-                      <!-- {{drugDesc(scope.row)}} -->
668
-                      <template slot-scope="scope">
669
-                        <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
670
-                      </template>
667
+                    <!-- {{drugDesc(scope.row)}} -->
668
+                    <template slot-scope="scope">
669
+                      <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
670
+                    </template>
671 671
                   </el-table-column>
672 672
                   <el-table-column prop="prescribing_number" align="center" label="开药数量">
673 673
                     <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
@@ -723,7 +723,7 @@
723 723
                   </el-col>
724 724
                   <el-col :span="12">
725 725
 
726
-                <el-form-item label="药品规格 :" prop="advice_desc">
726
+                    <el-form-item label="药品规格 :" prop="advice_desc">
727 727
                       <el-col :span="9">
728 728
                         <el-input v-model="templateForm.advice_desc"></el-input>
729 729
                       </el-col>
@@ -1030,7 +1030,7 @@
1030 1030
               border
1031 1031
               fit
1032 1032
               :row-style="{ color: '#303133' }"
1033
-          :header-cell-style="{
1033
+              :header-cell-style="{
1034 1034
             backgroundColor: 'rgb(245, 247, 250)',
1035 1035
             color: '#606266'
1036 1036
           }"
@@ -1106,7 +1106,7 @@
1106 1106
               border
1107 1107
               fit
1108 1108
               :row-style="{ color: '#303133' }"
1109
-          :header-cell-style="{
1109
+              :header-cell-style="{
1110 1110
             backgroundColor: 'rgb(245, 247, 250)',
1111 1111
             color: '#606266'
1112 1112
           }"
@@ -1376,7 +1376,7 @@
1376 1376
           this.loading = true
1377 1377
           PostInitAdviceTemplate(params).then(response => {
1378 1378
             if (response.data.state == 1) {
1379
-                this.is_init = response.data.data.init_config.is_init
1379
+              this.is_init = response.data.data.init_config.is_init
1380 1380
               this.getAdviceConfig()
1381 1381
               this.loading = false
1382 1382
 
@@ -1531,8 +1531,9 @@
1531 1531
         const params = {
1532 1532
           'data': this.adviceTableData
1533 1533
         }
1534
-        this.form.name =  encodeURIComponent(this.form.name)
1535
-        postAdviceTemplate(params, this.form.name, this.form.advice_type).then(response => {
1534
+        // this.form.name =  encodeURIComponent(this.form.name)
1535
+        let name = encodeURIComponent(this.form.name)
1536
+        postAdviceTemplate(params, name, this.form.advice_type).then(response => {
1536 1537
           if (response.data.state == 0) {
1537 1538
             this.$message.error(response.data.msg)
1538 1539
             return false
@@ -2532,7 +2533,7 @@
2532 2533
           }
2533 2534
         })
2534 2535
 
2535
-      }
2536
+      },
2536 2537
     }
2537 2538
   }
2538 2539
 </script>
@@ -2546,15 +2547,15 @@
2546 2547
     text-align: left;
2547 2548
   }
2548 2549
   .el-table td,
2549
-.el-table th.is-leaf,
2550
-.el-table--border,
2551
-.el-table--group {
2552
-  border-color: #d0d3da;
2553
-}
2554
-.el-table--border::after,
2555
-.el-table--group::after,
2556
-.el-table::before {
2557
-  background-color: #d0d3da;
2558
-}
2550
+  .el-table th.is-leaf,
2551
+  .el-table--border,
2552
+  .el-table--group {
2553
+    border-color: #d0d3da;
2554
+  }
2555
+  .el-table--border::after,
2556
+  .el-table--group::after,
2557
+  .el-table::before {
2558
+    background-color: #d0d3da;
2559
+  }
2559 2560
 </style>
2560 2561
 

+ 47 - 1
src/xt_pages/dialysis/details/index.vue 查看文件

@@ -623,7 +623,8 @@ export default {
623 623
       treat_state: [
624 624
         { value: 0, label: '全部治疗' },
625 625
         { value: 1, label: '待开处方' },
626
-        { value: 2, label: '待开小结' }
626
+        { value: 2, label: '待开小结' },
627
+        { value: 3, label: '待医嘱核对' },
627 628
       ],
628 629
       treatStateVal: 0,
629 630
       schedule_options: [
@@ -1296,6 +1297,28 @@ export default {
1296 1297
             }
1297 1298
           }
1298 1299
           arr2 = arr
1300
+        } else if(this.treatStateVal == 3){
1301
+          let arr = []
1302
+          arr = JSON.parse(JSON.stringify(arr1))
1303
+          for (let i = 0; i < arr.length; i++) {
1304
+            for (let j = 0; j < arr[i].schedules.length; j++) {
1305
+              if(arr[i].schedules[j].doctor_advice.length == 0){
1306
+                arr[i].schedules.splice(j--, 1)
1307
+              }
1308
+              if(arr[i].schedules && arr[i].schedules[j] && arr[i].schedules[j].doctor_advice){
1309
+                let sign = 0
1310
+                arr[i].schedules[j].doctor_advice.map(item => {
1311
+                  if(item.check_state == 1){
1312
+                    sign++
1313
+                  }
1314
+                })
1315
+                if(sign == arr[i].schedules[j].doctor_advice.length && arr[i].schedules[j].doctor_advice.length > 0){
1316
+                  arr[i].schedules.splice(j--, 1)
1317
+                }
1318
+              }
1319
+            }
1320
+          }
1321
+          arr2 = arr
1299 1322
         }
1300 1323
 
1301 1324
         let arr3 = []
@@ -1437,6 +1460,29 @@ export default {
1437 1460
             }
1438 1461
           }
1439 1462
           arr2 = arr
1463
+        } else if(this.treatStateVal == 3){
1464
+          let arr = []
1465
+          arr = JSON.parse(JSON.stringify(arr1))
1466
+          for (let i = 0; i < arr.length; i++) {
1467
+            for (let j = 0; j < arr[i].schedules.length; j++) {
1468
+              console.log(77777777777,arr[i].schedules)
1469
+              if(arr[i].schedules[j].doctor_advice.length == 0){
1470
+                arr[i].schedules.splice(j--, 1)
1471
+              }
1472
+              if(arr[i].schedules && arr[i].schedules[j] && arr[i].schedules[j].doctor_advice){
1473
+                let sign = 0
1474
+                arr[i].schedules[j].doctor_advice.map(item => {
1475
+                  if(item.check_state == 1){
1476
+                    sign++
1477
+                  }
1478
+                })
1479
+                if(sign == arr[i].schedules[j].doctor_advice.length && arr[i].schedules[j].doctor_advice.length > 0){
1480
+                  arr[i].schedules.splice(j--, 1)
1481
+                }
1482
+              }
1483
+            }
1484
+          }
1485
+          arr2 = arr
1440 1486
         }
1441 1487
 
1442 1488
         let arr3 = []

+ 23 - 0
src/xt_pages/dialysis/schedualPatient.vue 查看文件

@@ -163,6 +163,7 @@ import { getDialysisRecordInitData, getDialysisSchedules } from '@/api/dialysis_
163 163
           {value: 0,label: '全部'},
164 164
           {value: 1,label: '待开处方'},
165 165
           {value: 2,label: '待开小结'},
166
+          {value: 3,label: '待医嘱核对'},
166 167
         ],
167 168
         treatStateVal: 0,
168 169
         allPatient:[]
@@ -514,6 +515,28 @@ import { getDialysisRecordInitData, getDialysisSchedules } from '@/api/dialysis_
514 515
             }
515 516
           }
516 517
           arr2 = arr
518
+        }else if(this.treatStateVal == 3){
519
+          let arr = []
520
+          arr = JSON.parse(JSON.stringify(arr1))
521
+          for (let i = 0; i < arr.length; i++) {
522
+            for (let j = 0; j < arr[i].schedules.length; j++) {
523
+              if(arr[i].schedules[j].doctor_advice.length == 0){
524
+                arr[i].schedules.splice(j--, 1)
525
+              }
526
+              if(arr[i].schedules && arr[i].schedules[j] && arr[i].schedules[j].doctor_advice){
527
+                let sign = 0
528
+                arr[i].schedules[j].doctor_advice.map(item => {
529
+                  if(item.check_state == 1){
530
+                    sign++
531
+                  }
532
+                })
533
+                if(sign == arr[i].schedules[j].doctor_advice.length && arr[i].schedules[j].doctor_advice.length > 0){
534
+                  arr[i].schedules.splice(j--, 1)
535
+                }
536
+              }
537
+            }
538
+          }
539
+          arr2 = arr
517 540
         }
518 541
 
519 542
 

+ 94 - 16
src/xt_pages/qcd/workAnalysis/doctor.vue 查看文件

@@ -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)

+ 42 - 0
src/xt_pages/qcd/workAnalysis/index.vue 查看文件

@@ -0,0 +1,42 @@
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">
9
+          <el-tab-pane label="医生" name="first">
10
+              <doctor v-if="activeName == 'first'"></doctor>
11
+          </el-tab-pane>
12
+          <el-tab-pane label="护士" name="second">
13
+              <nurse v-if="activeName == 'second'"></nurse>
14
+          </el-tab-pane>
15
+        </el-tabs>
16
+      </div>
17
+    </div>
18
+  </div>
19
+</template>
20
+
21
+
22
+<script>
23
+import doctor from './doctor'
24
+import nurse from './nurse'
25
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
26
+export default {
27
+    components:{
28
+        doctor,
29
+        nurse,
30
+        BreadCrumb
31
+    },
32
+    data(){
33
+        return{
34
+            crumbs: [
35
+                { path: false, name: "质控管理" },
36
+                { path: false, name: "工作量分析统计" }
37
+            ],
38
+            activeName:'first'
39
+        }
40
+    }
41
+}
42
+</script>

+ 98 - 16
src/xt_pages/qcd/workAnalysis/nurse.vue 查看文件

@@ -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="changeNurse"
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"
@@ -148,13 +148,11 @@
148 148
               </template>
149 149
             </el-table-column>
150 150
           </el-table>
151
-
152
-        </div>
153
-      </div>
154 151
     </div>
155 152
   </div>
156 153
 </template>
157 154
 <script>
155
+  const moment = require('moment')
158 156
   import echarts from "echarts";
159 157
   import BreadCrumb from "@/xt_pages/components/bread-crumb";
160 158
   import LineChart from "../../qcd/components/LineChart";
@@ -187,6 +185,9 @@
187 185
           limit:20,
188 186
           page:1,
189 187
         },
188
+        start_time:'',
189
+        end_time:'',
190
+        monthValue:'',
190 191
         nurse_options:[
191 192
           {id:0,user_name:"全部",admin_user_id:0}
192 193
         ],
@@ -383,13 +384,20 @@
383 384
         return new Date(time).getTime() / 1000;
384 385
       },
385 386
       changeTime(val) {
387
+        this.query.end_time = ''
386 388
         var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
387 389
         if (time > 0) {
388 390
           this.$message.error("结束时间不能小于开始时间");
389 391
           this.query.start_time = "";
390 392
         } else {
391 393
           // this.getDialysisList()
394
+          console.log(val)
392 395
           this.query.page = 1;
396
+          this.query.start_time = val
397
+          this.query.end_time = this.end_time
398
+          this.monthValue = ''
399
+          sessionStorage.setItem("nurse_start_time", val)
400
+          sessionStorage.removeItem("nurseMonth");
393 401
           this.GetNurseWorkloadChartData(this.query)
394 402
           this.GetNurseWorkloadTableData(this.query)
395 403
 
@@ -433,7 +441,12 @@
433 441
           this.$message.error("结束时间不能小于开始时间");
434 442
           this.query.end_time = "";
435 443
         } else {
444
+          this.query.start_time = this.start_time
445
+          this.query.end_time = val
446
+          this.monthValue = ''
436 447
           this.query.page = 1;
448
+          sessionStorage.setItem("nurse_end_time", val)
449
+          sessionStorage.removeItem("nurseMonth");
437 450
           this.GetNurseWorkloadChartData(this.query)
438 451
           this.GetNurseWorkloadTableData(this.query)
439 452
 
@@ -452,7 +465,42 @@
452 465
           var dataZoom_end = 100;
453 466
           this.bar.dataZoom[0].end = dataZoom_end
454 467
         }
455
-      }
468
+      },
469
+      changeMonth(value){
470
+        // console.log('monthStartTime',value.getTime() / 1000)
471
+        sessionStorage.removeItem("nurse_start_time");
472
+        sessionStorage.removeItem("nurse_end_time");
473
+        let monthStartTime = value.getTime() / 1000
474
+        var nowDate = new Date(value);
475
+        var cloneNowDate = new Date(value);
476
+        var fullYear = nowDate.getFullYear();
477
+        var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
478
+        var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
479
+        let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
480
+        this.query.start_time = moment(new Date(monthStartTime * 1000)).format('YYYY-MM-DD')
481
+        this.query.end_time = moment(new Date(monthEndTime)).format('YYYY-MM-DD')
482
+        this.end_time = ''
483
+        this.start_time = ''
484
+        sessionStorage.setItem("nurseMonth", monthStartTime);
485
+        this.GetNurseWorkloadChartData(this.query)
486
+        this.GetNurseWorkloadTableData(this.query)
487
+      },
488
+      getFullDate(targetDate) {
489
+        var D, y, m, d;
490
+        if (targetDate) {
491
+          D = new Date(targetDate);
492
+          y = D.getFullYear();
493
+          m = D.getMonth() + 1;
494
+          d = D.getDate();
495
+        } else {
496
+          y = fullYear;
497
+          m = month;
498
+          d = date;
499
+        }
500
+        m = m > 9 ? m : '0' + m;
501
+        d = d > 9 ? d : '0' + d;
502
+        return y + '-' + m + '-' + d;
503
+      },
456 504
     },created(){
457 505
       var date = new Date()
458 506
       var year = date.getFullYear() //获取完整的年份(4位)
@@ -463,6 +511,40 @@
463 511
       this.query.end_time = year + '-' + month + '-' + day
464 512
       this.query.start_time = year + '-' + last_month + '-' + day
465 513
       this.query.statistics_type = 1
514
+      
515
+      this.start_time = year + '-' + last_month + '-' + day
516
+      this.end_time = year + '-' + month + '-' + day
517
+
518
+      if(sessionStorage.getItem("nurse_start_time") == null){
519
+        sessionStorage.setItem("nurse_start_time", this.start_time);
520
+      }else{
521
+        this.start_time = sessionStorage.getItem("nurse_start_time")
522
+        this.query.start_time = sessionStorage.getItem("nurse_start_time")
523
+      }
524
+      if(sessionStorage.getItem("nurse_end_time") == null){
525
+        sessionStorage.setItem("nurse_end_time", this.end_time);
526
+      }else{
527
+        this.end_time = sessionStorage.getItem("nurse_end_time")
528
+        this.query.end_time = sessionStorage.getItem("nurse_end_time")
529
+      }
530
+      if(sessionStorage.getItem("nurseMonth") != null){
531
+        console.log("tjos")
532
+        let value = parseInt(sessionStorage.getItem("nurseMonth")) * 1000
533
+        let monthStartTime = new Date(value)
534
+        this.monthValue = monthStartTime
535
+        var nowDate = new Date(value);
536
+        var cloneNowDate = new Date(value);
537
+        var fullYear = nowDate.getFullYear();
538
+        var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
539
+        var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
540
+        let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
541
+        this.query.start_time = moment(new Date(monthStartTime)).format('YYYY-MM-DD')
542
+        this.query.end_time = moment(new Date(monthEndTime)).format('YYYY-MM-DD')
543
+        this.start_time = ''
544
+        this.end_time = ''
545
+      }
546
+      // console.log('this.query2',this.query)
547
+      
466 548
       this.GetAllNurse()
467 549
       this.GetNurseWorkloadChartData(this.query)
468 550
       this.GetNurseWorkloadTableData(this.query)