19 Revīzijas 9d73e5b22b ... cbef47604b

Autors SHA1 Ziņojums Datums
  seimin cbef47604b bugfix 1 nedēļu atpakaļ
  seimin 6a36a74b9f 半程陪检 1 nedēļu atpakaļ
  seimin 6a536e30dc bugfix 1 nedēļu atpakaļ
  seimin b2456ff79f Merge branch 'master' into develop 1 nedēļu atpakaļ
  seimin 2a6198ee52 bugfix 1 nedēļu atpakaļ
  seimin c47b74859c bugfix 1 nedēļu atpakaļ
  seimin c7b6fc6409 解决冲突代码 1 nedēļu atpakaļ
  seimin 94b5a9fbb2 按天月年及快捷选择 1 nedēļu atpakaļ
  seimin b6a324bd11 增加人员筛选 1 nedēļu atpakaļ
  seimin 4085a47886 科室排序 1 nedēļu atpakaļ
  seimin bc639a28a5 新增统计 1 nedēļu atpakaļ
  seimin 203bf3a760 电话统计 1 nedēļu atpakaļ
  seimin 3b5ef52907 统计 1 nedēļu atpakaļ
  seimin 3ee0636a9e 年月日组件封装 1 nedēļu atpakaļ
  maotao da3c2a889f Merge branch 'develop' of http://git.dashitech.com/seimin/zy-pc into develop 1 nedēļu atpakaļ
  seimin 5e9b4b964c 暂提 1 nedēļu atpakaļ
  seimin 3ed37f411c 电话统计页面 1 nedēļu atpakaļ
  seimin 477e67c3a6 Merge branch 'develop' into lmm 2 nedēļas atpakaļ
  seimin fa9da57e84 工时大类小类统计 2 nedēļas atpakaļ
100 mainītis faili ar 2976 papildinājumiem un 789 dzēšanām
  1. 69 0
      src/app/services/date.service.ts
  2. 7 7
      src/app/views/fuwutai/fuwutai.component.html
  3. 9 9
      src/app/views/fuwutai/fuwutai.component.ts
  4. 1 1
      src/app/views/hushijiandan/hushijiandan.component.html
  5. 33 0
      src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.html
  6. 15 0
      src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.less
  7. 341 0
      src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.ts
  8. 20 0
      src/app/views/new-statistics/components/custom-change-date/custom-change-date.module.ts
  9. 14 0
      src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.html
  10. 5 0
      src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.ts
  11. 70 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.html
  12. 115 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.less
  13. 235 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.ts
  14. 20 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.module.ts
  15. 29 1
      src/app/views/new-statistics/components/search-more/search-more.component.html
  16. 51 6
      src/app/views/new-statistics/components/search-more/search-more.component.ts
  17. 1 5
      src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.component.html
  18. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.component.less
  19. 17 25
      src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.component.ts
  20. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.module.ts
  21. 1 5
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.html
  22. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.less
  23. 19 25
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.ts
  24. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.module.ts
  25. 1 5
      src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.html
  26. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.less
  27. 19 25
      src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.ts
  28. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.module.ts
  29. 4 8
      src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.html
  30. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.less
  31. 20 27
      src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.ts
  32. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.module.ts
  33. 3 7
      src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.component.html
  34. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.component.less
  35. 20 27
      src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.component.ts
  36. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.module.ts
  37. 3 7
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.component.html
  38. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.component.less
  39. 22 31
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.component.ts
  40. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.module.ts
  41. 3 7
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.component.html
  42. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.component.less
  43. 20 27
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.component.ts
  44. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.module.ts
  45. 27 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics-routing.module.ts
  46. 154 156
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.html
  47. 4 1
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.less
  48. 30 42
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.ts
  49. 3 1
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.module.ts
  50. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics-routing.module.ts
  51. 79 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.html
  52. 1 1
      src/app/views/new-statistics/maintenance-statistics/work-hour-statistics/work-hour-statistics.component.less
  53. 278 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.ts
  54. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.module.ts
  55. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics-routing.module.ts
  56. 85 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.html
  57. 71 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.less
  58. 252 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.ts
  59. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.module.ts
  60. 1 5
      src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.component.html
  61. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.component.less
  62. 16 23
      src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.component.ts
  63. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.module.ts
  64. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics-routing.module.ts
  65. 81 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.html
  66. 71 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.less
  67. 276 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.ts
  68. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.module.ts
  69. 7 10
      src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.html
  70. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.less
  71. 42 47
      src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.ts
  72. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.module.ts
  73. 7 10
      src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.component.html
  74. 1 1
      src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.component.less
  75. 42 47
      src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.component.ts
  76. 2 0
      src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.module.ts
  77. 1 5
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.html
  78. 1 1
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.less
  79. 17 25
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts
  80. 2 0
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.module.ts
  81. 1 5
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.html
  82. 1 1
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.less
  83. 17 25
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts
  84. 2 0
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.module.ts
  85. 1 5
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.html
  86. 1 1
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.less
  87. 17 25
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts
  88. 2 0
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.module.ts
  89. 1 5
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.html
  90. 1 1
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.less
  91. 16 24
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts
  92. 2 0
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.module.ts
  93. 1 5
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.html
  94. 1 1
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.less
  95. 16 23
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts
  96. 2 0
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.module.ts
  97. 1 5
      src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.html
  98. 1 1
      src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.less
  99. 16 23
      src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.ts
  100. 0 0
      src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.module.ts

+ 69 - 0
src/app/services/date.service.ts

@@ -10,6 +10,8 @@ import {
10 10
   addYears,
11 11
   endOfYear,
12 12
   endOfWeek,
13
+  endOfDay,
14
+  format,
13 15
 } from "date-fns";
14 16
 
15 17
 @Injectable({
@@ -17,10 +19,66 @@ import {
17 19
 })
18 20
 export class DateService {
19 21
   constructor() {}
22
+  // 获取日期快捷类型
23
+  getDateType(dateRange){
24
+    console.log('dateRange:', dateRange)
25
+    let [startDate, endDate] = dateRange;
26
+    if(startDate == format(this.date().yesterdayStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().yesterdayEndDate, 'yyyy-MM-dd HH:mm:ss')){
27
+      return 1;
28
+    }else if(startDate == format(this.date().thisWeekStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().thisWeekEndDate, 'yyyy-MM-dd HH:mm:ss')){
29
+      return 2;
30
+    }else if(startDate == format(this.date().thisMonthStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().thisMonthEndDate, 'yyyy-MM-dd HH:mm:ss')){
31
+      return 3;
32
+    }else if(startDate == format(this.date().thisYearStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().thisYearEndDate, 'yyyy-MM-dd HH:mm:ss')){
33
+      return 4;
34
+    }else if(startDate == format(this.date().lastWeekStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().lastWeekEndDate, 'yyyy-MM-dd HH:mm:ss')){
35
+      return 5;
36
+    }else if(startDate == format(this.date().lastMonthStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().lastMonthEndDate, 'yyyy-MM-dd HH:mm:ss')){
37
+      return 6;
38
+    }else if(startDate == format(this.date().lastYearStartDate, 'yyyy-MM-dd HH:mm:ss') && endDate == format(this.date().lastYearEndDate, 'yyyy-MM-dd HH:mm:ss')){
39
+      return 7;
40
+    }
41
+  }
20 42
   /**
21 43
    * 日期操作
22 44
    */
23 45
   date() {
46
+    //获得昨日的开始日期(昨日 00:00:00)
47
+    function getYesterdayStartDate() {
48
+      return addDays(startOfDay(new Date()), -1);
49
+    }
50
+    //获得昨日的结束日期(昨日 23:59:59)
51
+    function getYesterdayEndDate() {
52
+      return addDays(endOfDay(new Date()), -1);
53
+    }
54
+
55
+    //获得本周的开始日期(本周一 00:00:00)
56
+    function getThisWeekStartDate() {
57
+      return startOfWeek(new Date(), { weekStartsOn: 1 });
58
+    }
59
+    //获得本周的结束日期(本周日 23:59:59)
60
+    function getThisWeekEndDate() {
61
+      return endOfWeek(new Date(), { weekStartsOn: 1 });
62
+    }
63
+
64
+    //获得本月开始时间(本月1号 00:00:00)
65
+    function getThisMonthStartDate() {
66
+      return startOfMonth(new Date());
67
+    }
68
+    //获得本月结束时间(本月底 23:59:59)
69
+    function getThisMonthEndDate() {
70
+      return endOfMonth(new Date());
71
+    }
72
+
73
+    //获得本年的开始日期(本年1月1日 00:00:00)
74
+    function getThisYearStartDate() {
75
+      return startOfYear(new Date());
76
+    }
77
+    //获得本年的结束日期(本年12月31日 23:59:59)
78
+    function getThisYearEndDate() {
79
+      return endOfYear(new Date());
80
+    }
81
+
24 82
     //获得上周的开始日期(上周一 00:00:00)
25 83
     function getLastWeekStartDate() {
26 84
       return addDays(startOfWeek(new Date()), -6);
@@ -29,6 +87,7 @@ export class DateService {
29 87
     function getLastWeekEndDate() {
30 88
       return addDays(endOfWeek(new Date()), -6);
31 89
     }
90
+
32 91
     //获得上月开始时间(上月1号 00:00:00)
33 92
     function getLastMonthStartDate() {
34 93
       return startOfMonth(addMonths(new Date(), -1));
@@ -37,6 +96,7 @@ export class DateService {
37 96
     function getLastMonthEndDate() {
38 97
       return endOfMonth(addMonths(new Date(), -1));
39 98
     }
99
+
40 100
     //获得上年的开始日期(去年1月1日 00:00:00)
41 101
     function getLastYearStartDate() {
42 102
       return startOfYear(addYears(new Date(), -1));
@@ -45,7 +105,16 @@ export class DateService {
45 105
     function getLastYearEndDate() {
46 106
       return endOfYear(addYears(new Date(), -1));
47 107
     }
108
+
48 109
     return {
110
+      yesterdayStartDate: getYesterdayStartDate(),
111
+      yesterdayEndDate: getYesterdayEndDate(),
112
+      thisWeekStartDate: getThisWeekStartDate(),
113
+      thisWeekEndDate: getThisWeekEndDate(),
114
+      thisMonthStartDate: getThisMonthStartDate(),
115
+      thisMonthEndDate: getThisMonthEndDate(),
116
+      thisYearStartDate: getThisYearStartDate(),
117
+      thisYearEndDate: getThisYearEndDate(),
49 118
       lastWeekStartDate: getLastWeekStartDate(),
50 119
       lastWeekEndDate: getLastWeekEndDate(),
51 120
       lastMonthStartDate: getLastMonthStartDate(),

+ 7 - 7
src/app/views/fuwutai/fuwutai.component.html

@@ -118,7 +118,7 @@
118 118
                   <div class="gongdan" (click)="batchDispatchSelect(!data.checked, data.data.id, $event)">
119 119
                     <span class="left mr8" *ngIf="!flagList.itsmFlag1 && flagList.hsmsFlag1"><label nz-checkbox [ngModel]="data.checked" (ngModelChange)="batchDispatchSelect($event, data.data.id)"></label></span>
120 120
                     <span class="left gongdan_name" nz-tooltip [nzTooltipTitle]="data.data.taskType.taskName + (data.data.goodsRemark?'-'+data.data.goodsRemark:'')+'(' + data.data.gdcode + ')'">
121
-                      <strong>{{ data.data.isHalfInspect === 1 ? "半程陪检" : data.data.taskType.taskName }}</strong><ng-container *ngIf="data.data.goodsRemark">-{{data.data.goodsRemark}}</ng-container>({{ data.data.gdcode }})
121
+                      <strong>{{ data.data.taskType.taskName }}</strong><ng-container *ngIf="data.data.goodsRemark">-{{data.data.goodsRemark}}</ng-container>({{ data.data.gdcode }})
122 122
                     </span>
123 123
                     <div class="right_all">
124 124
                       <span nz-tooltip [nzTooltipTitle]="data.data.worker ? data.data.worker.phone : ''" class="right_all_name">{{ data.data.worker ? data.data.worker.name : "" }}</span>
@@ -315,7 +315,7 @@
315 315
                       <label nz-checkbox [ngModel]="data.checked" (ngModelChange)="batchWithdrawalSelect($event, data.data.id)"></label>
316 316
                     </span>
317 317
                     <span class="left gongdan_name" nz-tooltip [nzTooltipTitle]="data.data.taskType.taskName + (data.data.goodsRemark?'-'+data.data.goodsRemark:'')+'(' + data.data.gdcode + ')'">
318
-                      <strong>{{ data.data.isHalfInspect === 1 ? "半程陪检" : data.data.taskType.taskName }}</strong><ng-container *ngIf="data.data.goodsRemark">-{{data.data.goodsRemark}}</ng-container>({{ data.data.gdcode }})
318
+                      <strong>{{ data.data.taskType.taskName }}</strong><ng-container *ngIf="data.data.goodsRemark">-{{data.data.goodsRemark}}</ng-container>({{ data.data.gdcode }})
319 319
                     </span>
320 320
                     <div class="right_all">
321 321
                       <span nz-tooltip [nzTooltipTitle]="data.data.worker ? data.data.worker.phone : ''" class="right_all_name">{{ data.data.worker ? data.data.worker.name : "" }}</span>
@@ -500,7 +500,7 @@
500 500
                       <label nz-checkbox [ngModel]="data.checked" (ngModelChange)="batchWithdrawalSelect($event, data.data.id)"></label>
501 501
                     </span>
502 502
                     <span class="left gongdan_name" nz-tooltip [nzTooltipTitle]="data.data.taskType.taskName + (data.data.goodsRemark?'-'+data.data.goodsRemark:'')+'(' + data.data.gdcode + ')'">
503
-                      <strong>{{ data.data.isHalfInspect === 1 ? "半程陪检" : data.data.taskType.taskName }}</strong><ng-container *ngIf="data.data.goodsRemark">-{{data.data.goodsRemark}}</ng-container>({{ data.data.gdcode }})
503
+                      <strong>{{ data.data.taskType.taskName }}</strong><ng-container *ngIf="data.data.goodsRemark">-{{data.data.goodsRemark}}</ng-container>({{ data.data.gdcode }})
504 504
                     </span>
505 505
                     <div class="right_all">
506 506
                       <span nz-tooltip [nzTooltipTitle]="data.data.worker ? data.data.worker.phone : ''" class="right_all_name">{{ data.data.worker ? data.data.worker.name : "" }}</span>
@@ -787,7 +787,7 @@
787 787
       </div>
788 788
       <div class="fixedMenu">
789 789
         <div class="menuItems">
790
-          <div class="others" [ngStyle]="{ height: showLastItems ? mainRole ? 35 * 6 + 'px' : 35 * 5 + 'px' : 0 }">
790
+          <div class="others" [ngStyle]="{ height: showLastItems ? mainRole ? 35 * 5 + 'px' : 35 * 4 + 'px' : 0 }">
791 791
             <div [ngClass]="{ item: true, checked: fixedTab == 'orderScope' }" (click)="showOrderScope()">
792 792
               工单范围
793 793
             </div>
@@ -797,9 +797,9 @@
797 797
             <div [ngClass]="{ item: true, checked: fixedTab == 'nucleicAcidPrinting' }" (click)="checkFixedTab('nucleicAcidPrinting')" *ngIf="isShowNucleicAcidPrinting">
798 798
               核酸打印
799 799
             </div>
800
-            <div [ngClass]="{ item: true, checked: fixedTab == 'queueNum' }" (click)="checkFixedTab('queueNum')">
800
+            <!-- <div [ngClass]="{ item: true, checked: fixedTab == 'queueNum' }" (click)="checkFixedTab('queueNum')">
801 801
               叫号信息
802
-            </div>
802
+            </div> -->
803 803
             <div [ngClass]="{ item: true, checked: fixedTab == 'toSystem' }" *ngIf="mainRole" (click)="checkFixedTab('toSystem')">
804 804
               返回系统
805 805
             </div>
@@ -1097,7 +1097,7 @@
1097 1097
                               <nz-form-control class="control" [nzSpan]="16" nzErrorTip="请选择患者信息!">
1098 1098
                                 <nz-select style="width: 160px" formControlName="patient" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="searchPatientList(radioValueZy == deathTasktypeId && endDeptZy !== null ? endDeptZy : applyDept, $event)" nzAllowClear nzPlaceHolder="请选择患者信息" [(ngModel)]="patientZy" (ngModelChange)="selectPatientZy($event)">
1099 1099
                                   <ng-container *ngFor="let option of patientList">
1100
-                                    <nz-option *ngIf="!isLoadingPatient" [nzLabel]="(option.bednum || '') + '床 ' + (option.patientname || '') + ' ' + (option.residenceNo || '')" [nzValue]="option.patientCode"></nz-option>
1100
+                                    <nz-option *ngIf="!isLoadingPatient" [nzLabel]="(option.bednum ? option.bednum + '床 ' : '') + (option.patientname || '') + ' ' + (option.residenceNo || '')" [nzValue]="option.patientCode"></nz-option>
1101 1101
                                   </ng-container>
1102 1102
                                   <nz-option *ngIf="isLoadingPatient" nzDisabled nzCustomContent>
1103 1103
                                     <i nz-icon nzType="loading" class="loading-icon"></i>

+ 9 - 9
src/app/views/fuwutai/fuwutai.component.ts

@@ -2745,9 +2745,9 @@ export class FuwutaiComponent implements OnInit {
2745 2745
       this.isLoadingPatient = false;
2746 2746
       if (result["state"] == 200) {
2747 2747
         this.patientList = result["data"];
2748
-        if (this.patientList.length) {
2749
-          this.patientList = this.patientList.filter((item) => !!item.bednum);
2750
-        }
2748
+        // if (this.patientList.length) {
2749
+        //   this.patientList = this.patientList.filter((item) => !!item.bednum);
2750
+        // }
2751 2751
       }
2752 2752
     });
2753 2753
   }
@@ -3619,7 +3619,7 @@ export class FuwutaiComponent implements OnInit {
3619 3619
     this.endDeptZy = null;
3620 3620
     this.patientZy = null;
3621 3621
     this.goodsNow = [];
3622
-    this.patientList = [];
3622
+    // this.patientList = [];
3623 3623
     this.workOrderRemark = "";
3624 3624
     this.workOrderRemarkZy = "";
3625 3625
     this.deptZyList["startDept"] = [];
@@ -3738,12 +3738,12 @@ export class FuwutaiComponent implements OnInit {
3738 3738
       this.msg.warning('请选择优先级!');
3739 3739
       return;
3740 3740
     }
3741
-		
3741
+
3742 3742
 		if(!this.incidentModel.source){
3743 3743
 		  this.msg.warning('请选择事件来源!');
3744 3744
 		  return;
3745 3745
 		}
3746
-		
3746
+
3747 3747
     if(!this.incidentModel.description){
3748 3748
       this.msg.warning('请选择故障描述!');
3749 3749
       return;
@@ -3799,7 +3799,7 @@ export class FuwutaiComponent implements OnInit {
3799 3799
 		  this.msg.warning('请选择事件来源!');
3800 3800
 		  return;
3801 3801
 		}
3802
-		
3802
+
3803 3803
     if(!this.incidentModel.description){
3804 3804
       this.msg.warning('请选择故障描述!');
3805 3805
       return;
@@ -3986,12 +3986,12 @@ export class FuwutaiComponent implements OnInit {
3986 3986
       this.msg.warning('请选择优先级!');
3987 3987
       return;
3988 3988
     }
3989
-		
3989
+
3990 3990
 		if(!this.incidentModel.source){
3991 3991
 		  this.msg.warning('请选择事件来源!');
3992 3992
 		  return;
3993 3993
 		}
3994
-		
3994
+
3995 3995
     if(!this.incidentModel.description){
3996 3996
       this.msg.warning('请选择故障描述!');
3997 3997
       return;

+ 1 - 1
src/app/views/hushijiandan/hushijiandan.component.html

@@ -1331,7 +1331,7 @@
1331 1331
                         <div class="info">
1332 1332
                           <div class="row" nz-row>
1333 1333
                             <div nz-col nzSpan="12" class="col txtL">
1334
-                              {{ item.isHalfInspect === 1 ? "半程陪检" : item.taskType.taskName }}
1334
+                              {{ item.taskType.taskName }}
1335 1335
                               <ng-container *ngIf="item.taskType.associationType.value == 'drugsBag' && item.drugs">
1336 1336
                                 ({{ item.drugs.packid }})
1337 1337
                               </ng-container>

+ 33 - 0
src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.html

@@ -0,0 +1,33 @@
1
+<div class="customChangeDate">
2
+  <div class="searchDataItem" *ngIf="isShowType">
3
+    <nz-radio-group [(ngModel)]="dateType" (ngModelChange)="changeDateType($event)">
4
+      <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
5
+    </nz-radio-group>
6
+  </div>
7
+  <div class="searchDataItem">
8
+    <span class="label">{{name}}</span>:
9
+    <nz-range-picker [ngStyle]="{width: '260px'}" [nzAllowClear]="false" *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
10
+      [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
11
+    </nz-range-picker>
12
+    <nz-month-picker [ngStyle]="{width: '121px'}" [nzAllowClear]="false" *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
13
+      (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">
14
+    </nz-month-picker>
15
+    <span *ngIf="dateType=='month'"> ~ </span>
16
+    <nz-month-picker [ngStyle]="{width: '121px'}" [nzAllowClear]="false" *ngIf="dateType=='month'" [(ngModel)]="monthRangeEnd" [nzDisabledDate]="disabledMonthEnd"
17
+      (ngModelChange)="changeMonthEnd($event)" nzPlaceHolder="请选择截止月份">
18
+    </nz-month-picker>
19
+    <nz-year-picker [ngStyle]="{width: '121px'}" [nzAllowClear]="false" *ngIf="dateType=='year'" [(ngModel)]="yearRangeStart" [nzDisabledDate]="disabledYearStart"
20
+      (ngModelChange)="changeYearStart($event)" nzPlaceHolder="请选择开始年份">
21
+    </nz-year-picker>
22
+    <span *ngIf="dateType=='year'"> ~ </span>
23
+    <nz-year-picker [ngStyle]="{width: '121px'}" [nzAllowClear]="false" *ngIf="dateType=='year'" [(ngModel)]="yearRangeEnd" (ngModelChange)="changeYearEnd($event)"
24
+      [nzDisabledDate]="disabledYearEnd" nzPlaceHolder="请选择截止年份">
25
+    </nz-year-picker>
26
+  </div>
27
+  <div class="searchDataItem ml8">
28
+    <nz-select class="formItem" [ngStyle]="{width: '92px'}" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false"
29
+      nzPlaceHolder="请选择" [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
30
+      <nz-option [nzLabel]="data.label" [nzValue]="data.id" *ngFor="let data of defRanges"></nz-option>
31
+    </nz-select>
32
+  </div>
33
+</div>

+ 15 - 0
src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.less

@@ -0,0 +1,15 @@
1
+.customChangeDate{
2
+  display: flex;
3
+  align-items: center;
4
+  margin-right: 24px;
5
+  .searchDataItem{
6
+    margin-left: 16px;
7
+    &:first-of-type{
8
+      margin-left: 0;
9
+    }
10
+    .label{
11
+      font-size: 16px;
12
+    }
13
+  }
14
+}
15
+

+ 341 - 0
src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.ts

@@ -0,0 +1,341 @@
1
+import { Component, OnInit, Input } from '@angular/core';
2
+import { differenceInCalendarDays, endOfMonth, endOfYear, startOfDay, format, endOfDay, startOfMonth, startOfYear } from "date-fns";
3
+import { DateService } from 'src/app/services/date.service';
4
+
5
+@Component({
6
+  selector: 'app-custom-change-date',
7
+  templateUrl: './custom-change-date.component.html',
8
+  styleUrls: ['./custom-change-date.component.less']
9
+})
10
+export class CustomChangeDateComponent implements OnInit {
11
+  @Input() isShowType: boolean = true;
12
+  @Input() name: string = '建单时间';
13
+  constructor(
14
+    private dateService: DateService,
15
+  ) { }
16
+
17
+  dateType: string = "day"; //选中时间维度
18
+  dateTypes: any = [
19
+    {
20
+      label: "按天",
21
+      value: "day",
22
+    },
23
+    {
24
+      label: "按月",
25
+      value: "month",
26
+    },
27
+    {
28
+      label: "按年",
29
+      value: "year",
30
+    },
31
+  ]; //时间维度
32
+  defRange = 6; //默认上月
33
+  defRanges = [
34
+    {
35
+      label: "昨日",
36
+      id: 1,
37
+    },
38
+    {
39
+      label: "本周",
40
+      id: 2,
41
+    },
42
+    {
43
+      label: "本月",
44
+      id: 3,
45
+    },
46
+    {
47
+      label: "本年",
48
+      id: 4,
49
+    },
50
+    {
51
+      label: "上周",
52
+      id: 5,
53
+    },
54
+    {
55
+      label: "上月",
56
+      id: 6,
57
+    },
58
+    {
59
+      label: "上年",
60
+      id: 7,
61
+    },
62
+  ]; //时间默认区间
63
+
64
+  dateRange: any = []; //发起时间区间 天
65
+  monthRangeStart: any; //发起时间 月 起
66
+  monthRangeEnd: any; //发起时间 月 止
67
+  yearRangeStart: any; //发起时间 年 起
68
+  yearRangeEnd: any; //发起时间 年 止
69
+
70
+  ngOnInit() {
71
+    this.resetByDate();
72
+  }
73
+
74
+  // 根据时间区间重置
75
+  resetByDate(){
76
+    this.dateType = 'day';
77
+    this.changeDateType(this.dateType, 6);
78
+  }
79
+
80
+  // 根据时间区间初始化
81
+  initByDate(dateRange:any[]){
82
+    setTimeout(() => {
83
+      this.dateType = 'day';
84
+      this.dateRange = dateRange;
85
+      this.changeDateType(this.dateType, null);
86
+    }, 0)
87
+  }
88
+
89
+  // 修改时间展示维度
90
+  changeDateType(res, defRange) {
91
+    console.log(res, this.dateType);
92
+    this.dateType = res;
93
+    switch (res) {
94
+      case "day":
95
+        this.defRanges = [
96
+          {
97
+            label: "昨日",
98
+            id: 1,
99
+          },
100
+          {
101
+            label: "本周",
102
+            id: 2,
103
+          },
104
+          {
105
+            label: "本月",
106
+            id: 3,
107
+          },
108
+          {
109
+            label: "上周",
110
+            id: 5,
111
+          },
112
+          {
113
+            label: "上月",
114
+            id: 6,
115
+          },
116
+          {
117
+            label: "上年",
118
+            id: 7,
119
+          },
120
+        ]; //时间默认区间
121
+        this.defRange = defRange === undefined ? this.defRanges[0].id : defRange;
122
+        this.changeDateRange(defRange === undefined ? this.defRanges[0].id : defRange);
123
+        break;
124
+      case "month":
125
+        this.defRanges = [
126
+          {
127
+            label: "本月",
128
+            id: 3,
129
+          },
130
+          {
131
+            label: "上月",
132
+            id: 6,
133
+          },
134
+          {
135
+            label: "上年",
136
+            id: 7,
137
+          },
138
+        ]; //时间默认区间
139
+        this.defRange = defRange === undefined ? this.defRanges[0].id : defRange;
140
+        this.changeDateRange(defRange === undefined ? this.defRanges[0].id : defRange);
141
+        break;
142
+      case "year":
143
+        this.defRanges = [
144
+          {
145
+            label: "本年",
146
+            id: 4,
147
+          },
148
+          {
149
+            label: "上年",
150
+            id: 7,
151
+          },
152
+        ]; //时间默认区间
153
+        this.defRange = defRange === undefined ? this.defRanges[0].id : defRange;
154
+        this.changeDateRange(defRange === undefined ? this.defRanges[0].id : defRange);
155
+        break;
156
+    }
157
+  }
158
+
159
+  // 禁选日期
160
+  disabledDate = (current: Date): boolean => {
161
+    // Can not select days before today and today
162
+    return false;
163
+  };
164
+
165
+  // 禁选月份开始
166
+  disabledMonthStart = (current: Date): boolean => {
167
+    // Can not select days before today and today
168
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
169
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
170
+    return cur || staEnd;
171
+  };
172
+  // 禁选月份结束
173
+  disabledMonthEnd = (current: Date): boolean => {
174
+    // Can not select days before today and today
175
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
176
+    return staEnd;
177
+  };
178
+
179
+  // 禁选年份开始
180
+  disabledYearStart = (current: Date): boolean => {
181
+    // Can not select days before today and today
182
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
183
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
184
+    return cur || staEnd;
185
+  };
186
+
187
+  // 禁选年份结束
188
+  disabledYearEnd = (current: Date): boolean => {
189
+    // Can not select days before today and today
190
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
191
+    return staEnd;
192
+  };
193
+
194
+  // 日期选择 日
195
+  startDate: string; //发起时间开始
196
+  endDate: string; //发起时间结束
197
+  changeDate(result): void {
198
+    this.dateRange = result;
199
+    if (!this.quick) {
200
+      // 不是快捷选择
201
+      this.defRange = null;
202
+    }
203
+    if (!result || !result.length) {
204
+      this.startDate = this.endDate = "";
205
+      return;
206
+    }
207
+    this.startDate = format(startOfDay(result[0]), "yyyy-MM-dd HH:mm:ss");
208
+    this.endDate = format(endOfDay(result[1]), "yyyy-MM-dd HH:mm:ss");
209
+  }
210
+
211
+  // 月份选择
212
+  changeMonthStart(result) {
213
+    console.log(result);
214
+    this.monthRangeStart = result;
215
+    if (!this.quick) {
216
+      // 不是快捷选择
217
+      this.defRange = null;
218
+    }
219
+    if (!result) {
220
+      this.startDate = this.endDate = "";
221
+      return;
222
+    }
223
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
224
+  }
225
+  changeMonthEnd(result) {
226
+    console.log(result);
227
+    this.monthRangeEnd = result;
228
+    if (!this.quick) {
229
+      // 不是快捷选择
230
+      this.defRange = null;
231
+    }
232
+    if (!result) {
233
+      this.startDate = this.endDate = "";
234
+      return;
235
+    }
236
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
237
+  }
238
+  // 年份选择
239
+  changeYearStart(result) {
240
+    console.log(result);
241
+    this.yearRangeStart = result;
242
+    if (!this.quick) {
243
+      // 不是快捷选择
244
+      this.defRange = null;
245
+    }
246
+    if (!result) {
247
+      this.startDate = this.endDate = "";
248
+      return;
249
+    }
250
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
251
+  }
252
+  changeYearEnd(result) {
253
+    console.log(result);
254
+    this.yearRangeEnd = result;
255
+    if (!this.quick) {
256
+      // 不是快捷选择
257
+      this.defRange = null;
258
+    }
259
+    if (!result) {
260
+      this.startDate = this.endDate = "";
261
+      return;
262
+    }
263
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
264
+  }
265
+
266
+  // 日期选择 快速修改时间区间
267
+  today = new Date();
268
+  quick: boolean = false;
269
+  changeDateRange(res) {
270
+    console.log(res);
271
+    this.quick = true;
272
+    switch (res) {
273
+      case 1:
274
+        // 昨日
275
+        let yesterdaystartdate = this.dateService.date().yesterdayStartDate;
276
+        let yesterdayenddate = this.dateService.date().yesterdayEndDate;
277
+        console.log(yesterdaystartdate, yesterdayenddate);
278
+        this.changeDate([yesterdaystartdate, yesterdayenddate]);
279
+        break;
280
+      case 2:
281
+        // 本周
282
+        let thisweekstartdate = this.dateService.date().thisWeekStartDate;
283
+        let thisweekenddate = this.dateService.date().thisWeekEndDate;
284
+        console.log(thisweekstartdate, thisweekenddate);
285
+        this.changeDate([thisweekstartdate, thisweekenddate]);
286
+        break;
287
+      case 3:
288
+        // 本月
289
+        let thismonthstartdate = this.dateService.date().thisMonthStartDate;
290
+        let thismonthenddate = this.dateService.date().thisMonthEndDate;
291
+        console.log(thismonthstartdate, thismonthenddate);
292
+        this.changeDate([thismonthstartdate, thismonthenddate]);
293
+        this.changeMonthStart(thismonthstartdate);
294
+        this.changeMonthEnd(thismonthenddate);
295
+        break;
296
+      case 4:
297
+        // 本年
298
+        let thisyearstartdate = this.dateService.date().thisYearStartDate;
299
+        let thisyearenddate = this.dateService.date().thisYearEndDate;
300
+        console.log(thisyearstartdate, thisyearenddate);
301
+        this.changeDate([thisyearstartdate, thisyearenddate]);
302
+        this.changeMonthStart(thisyearstartdate);
303
+        this.changeMonthEnd(thisyearenddate);
304
+        this.changeYearStart(thisyearstartdate);
305
+        this.changeYearEnd(thisyearenddate);
306
+        break;
307
+      case 5:
308
+        // 上周
309
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
310
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
311
+        console.log(lastweekstartdate, lastweekenddate);
312
+        this.changeDate([lastweekstartdate, lastweekenddate]);
313
+        break;
314
+      case 6:
315
+        // 上月
316
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
317
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
318
+        console.log(lastmonthstartdate, lastmonthenddate);
319
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
320
+        this.changeMonthStart(lastmonthstartdate);
321
+        this.changeMonthEnd(lastmonthenddate);
322
+        break;
323
+      case 7:
324
+        // 上年
325
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
326
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
327
+        console.log(lastyearstartdate, lastyearenddate);
328
+        this.changeDate([lastyearstartdate, lastyearenddate]);
329
+        this.changeMonthStart(lastyearstartdate);
330
+        this.changeMonthEnd(lastyearenddate);
331
+        this.changeYearStart(lastyearstartdate);
332
+        this.changeYearEnd(lastyearenddate);
333
+        break;
334
+      default:
335
+        // 回显initByDate
336
+        this.changeDate([new Date(this.dateRange[0]), new Date(this.dateRange[1])]);
337
+        break;
338
+    }
339
+    this.quick = false;
340
+  }
341
+}

+ 20 - 0
src/app/views/new-statistics/components/custom-change-date/custom-change-date.module.ts

@@ -0,0 +1,20 @@
1
+import { CustomChangeDateComponent } from './custom-change-date.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { ShareModule } from 'src/app/share/share.module';
6
+
7
+
8
+@NgModule({
9
+  declarations: [
10
+    CustomChangeDateComponent,
11
+  ],
12
+  imports: [
13
+    CommonModule,
14
+    ShareModule,
15
+  ],
16
+  exports: [
17
+    CustomChangeDateComponent,
18
+  ]
19
+})
20
+export class CustomChangeDateModule { }

+ 14 - 0
src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.html

@@ -4,6 +4,20 @@
4 4
     </div>
5 5
     <div class="content">
6 6
       <form nz-form [formGroup]="validateForm" class="addForm">
7
+        <nz-form-item [hidden]="!fieldConfig.config.group">
8
+          <nz-form-label [nzSpan]="6" nzFor="groupId">分<span style="visibility: hidden;">囧囧</span>组</nz-form-label>
9
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择分组!">
10
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" formControlName="groupId" nzPlaceHolder="请选择分组" (nzOpenChange)="openChangeGroup($event)" (ngModelChange)="changeGroup($event)">
11
+              <ng-container *ngFor="let option of groupList">
12
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
13
+              </ng-container>
14
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
16
+              </nz-option>
17
+            </nz-select>
18
+          </nz-form-control>
19
+        </nz-form-item>
20
+
7 21
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
8 22
           <nz-form-label [nzSpan]="6" nzFor="groupId">分<span style="visibility: hidden;">囧囧</span>组</nz-form-label>
9 23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择分组!">

+ 5 - 0
src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.ts

@@ -66,6 +66,11 @@ export class DistributionSearchMoreComponent implements OnInit {
66 66
     if (this.validateForm.invalid) return;
67 67
 
68 68
     let fields:any = {}
69
+    if(this.fieldConfig.config.group){
70
+      fields.groupId = this.validateForm.value.groupId;
71
+      fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
72
+    }
73
+
69 74
     if(this.fieldConfig.config.groupAndUser){
70 75
       fields.groupId = this.validateForm.value.groupId;
71 76
       fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);

+ 70 - 0
src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.html

@@ -0,0 +1,70 @@
1
+<div class="save add display_flex align-items_center justify-content_flex-center">
2
+  <div class="modalBody">
3
+    <div class="title">更多搜索<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
4
+    </div>
5
+    <div class="content">
6
+      <form nz-form [formGroup]="validateForm" class="addForm">
7
+
8
+        <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
9
+          <nz-form-label [nzSpan]="6" nzFor="buildingId">楼<span style="visibility: hidden;">囧囧</span>栋</nz-form-label>
10
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼栋!">
11
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeBuildingInp($event)" formControlName="buildingId" nzPlaceHolder="请选择楼栋" (nzOpenChange)="openChangeBuilding($event)" (ngModelChange)="changeBuilding($event)">
12
+              <ng-container *ngFor="let option of buildingList">
13
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName + '-' + option.buildingName" [nzValue]="option.id"></nz-option>
14
+              </ng-container>
15
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
16
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
17
+              </nz-option>
18
+            </nz-select>
19
+          </nz-form-control>
20
+        </nz-form-item>
21
+
22
+        <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
23
+          <nz-form-label [nzSpan]="6" nzFor="floorId">楼<span style="visibility: hidden;">囧囧</span>层</nz-form-label>
24
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼层!">
25
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeFloorInp($event)" formControlName="floorId" nzPlaceHolder="请选择楼层" (nzOpenChange)="openChangeFloor($event)" (ngModelChange)="setIsSelecting(true)">
26
+              <ng-container *ngFor="let option of floorList">
27
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
28
+              </ng-container>
29
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
30
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
31
+              </nz-option>
32
+            </nz-select>
33
+          </nz-form-control>
34
+        </nz-form-item>
35
+
36
+        <nz-form-item [hidden]="!fieldConfig.config.dept">
37
+          <nz-form-label [nzSpan]="6" nzFor="deptId">科<span style="visibility: hidden;">囧囧</span>室</nz-form-label>
38
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室!">
39
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeDeptInp($event)" formControlName="deptId" nzPlaceHolder="请选择科室" (nzOpenChange)="openChangeDept($event)" (ngModelChange)="setIsSelecting(true)">
40
+              <ng-container *ngFor="let option of deptList">
41
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
42
+              </ng-container>
43
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
44
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
45
+              </nz-option>
46
+            </nz-select>
47
+          </nz-form-control>
48
+        </nz-form-item>
49
+
50
+				<nz-form-item [hidden]="!fieldConfig.config.deptType">
51
+				  <nz-form-label [nzSpan]="6" nzFor="deptTypeId">科室类型</nz-form-label>
52
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室类型!">
53
+				    <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzShowSearch formControlName="deptTypeId" nzPlaceHolder="请选择科室类型" (nzOpenChange)="openChangeDeptType($event)">
54
+				      <ng-container *ngFor="let option of deptTypeList">
55
+				        <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
56
+				      </ng-container>
57
+				      <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
58
+				        <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
59
+				      </nz-option>
60
+				    </nz-select>
61
+				  </nz-form-control>
62
+				</nz-form-item>
63
+      </form>
64
+    </div>
65
+    <div class="display_flex justify-content_flex-center">
66
+      <button nz-button nzType="default" (click)="hideModal()">取消</button>
67
+      <button nzType="primary" nz-button (click)="submitForm()">确认</button>
68
+    </div>
69
+  </div>
70
+</div>

+ 115 - 0
src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.less

@@ -0,0 +1,115 @@
1
+.save {
2
+  position: fixed;
3
+  left: 0;
4
+  top: 0;
5
+  width: 100%;
6
+  height: 100%;
7
+  background: rgba(0, 0, 0, 0.4);
8
+  z-index: 99;
9
+
10
+  .modalBody {
11
+    width: 350px;
12
+    background: #fff;
13
+    border-radius: 5px;
14
+    padding: 10px 20px;
15
+    color: #333;
16
+
17
+    .title {
18
+      width: 100%;
19
+      text-align: center;
20
+      font-size: 16px;
21
+      position: relative;
22
+      padding: 16px 0;
23
+
24
+      i {
25
+        position: absolute;
26
+        right: 0;
27
+        top: 50%;
28
+        font-size: 20px;
29
+        color: #666;
30
+        cursor: pointer;
31
+        transform: translateY(-50%);
32
+      }
33
+    }
34
+
35
+    .content {
36
+      width: 100%;
37
+      height: 117px;
38
+      background: #f9fafb;
39
+      border: 1px solid #e5e9ed;
40
+      border-radius: 5px;
41
+      overflow: hidden;
42
+
43
+      div {
44
+        text-align: center;
45
+        margin: 0;
46
+
47
+        &.icon {
48
+          margin-top: 17px;
49
+
50
+          i {
51
+            color: #34b349;
52
+            font-size: 30px !important;
53
+
54
+            &.transport-wenhao {
55
+              color: #f5a523;
56
+            }
57
+
58
+            &.transport-shibai {
59
+              color: #ff3a52;
60
+            }
61
+          }
62
+        }
63
+
64
+        &.defeat {
65
+          color: #333;
66
+          font-size: 16px;
67
+        }
68
+
69
+        &:nth-child(3) {
70
+          font-size: 14px;
71
+          color: #666;
72
+        }
73
+      }
74
+    }
75
+
76
+    button {
77
+      margin-top: 10px;
78
+      margin-bottom: 10px;
79
+    }
80
+  }
81
+
82
+  // 新增
83
+  &.add {
84
+    .modalBody {
85
+      width: 400px;
86
+      padding: 0 24px;
87
+
88
+      .content {
89
+        width: 100%;
90
+        padding: 10px 24px 0;
91
+        height: auto;
92
+        overflow-y: auto;
93
+
94
+        .addForm {
95
+          .ant-form-item {
96
+            margin-bottom: 14px;
97
+            .ant-form-item-label {
98
+              text-align: left;
99
+            }
100
+            &.mb0{
101
+              margin-bottom: 6px;
102
+            }
103
+            .ant-radio-wrapper{
104
+              margin-right: 0;
105
+            }
106
+          }
107
+        }
108
+      }
109
+
110
+      button:nth-child(1) {
111
+        margin-right: 8px;
112
+      }
113
+    }
114
+  }
115
+}

+ 235 - 0
src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.ts

@@ -0,0 +1,235 @@
1
+import { Subject } from 'rxjs';
2
+import { debounceTime } from 'rxjs/operators';
3
+import { ToolService } from './../../../../services/tool.service';
4
+import { Component, OnInit, Output, Input } from '@angular/core';
5
+import { FormGroup, FormBuilder, Validators } from '@angular/forms';
6
+import { EventEmitter } from '@angular/core';
7
+import { MainService } from 'src/app/services/main.service';
8
+
9
+@Component({
10
+  selector: 'app-phone-search-more',
11
+  templateUrl: './phone-search-more.component.html',
12
+  styleUrls: ['./phone-search-more.component.less']
13
+})
14
+export class PhoneSearchMoreComponent implements OnInit {
15
+  @Output() submitEvent = new EventEmitter();
16
+  @Output() cancelEvent = new EventEmitter();
17
+  @Input() fieldConfig: any = { fields: [], config: [] };
18
+  @Input() hosId: any;
19
+  @Input() parentDutyId: any;
20
+  @Input() dutyId: any;
21
+  @Input() queryType: any;
22
+  validateForm: FormGroup;//表单
23
+  searchTimerSubject = new Subject();
24
+  constructor(
25
+    private fb: FormBuilder,
26
+    private tool: ToolService,
27
+    private mainService: MainService,
28
+  ) { }
29
+
30
+  ngOnInit() {
31
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
+      let fun = v[0];
33
+      fun.call(this, v[1]);
34
+    });
35
+    this.initForm();
36
+  }
37
+  // 隐藏模态框
38
+  hideModal() {
39
+    this.cancelEvent.emit()
40
+  }
41
+  // 初始化form表单
42
+  initForm() {
43
+    this.buildingList = this.fieldConfig.fields.buildingDTO ? [this.fieldConfig.fields.buildingDTO] : [];
44
+    this.floorList = this.fieldConfig.fields.floorDTO ? [this.fieldConfig.fields.floorDTO] : [];
45
+    this.deptList = this.fieldConfig.fields.deptDTO ? [this.fieldConfig.fields.deptDTO] : [];
46
+		this.deptTypeList = this.fieldConfig.fields.deptTypeDTO ? [this.fieldConfig.fields.deptTypeDTO] : [];
47
+
48
+    this.validateForm = this.fb.group({
49
+      buildingId: [this.fieldConfig.fields.buildingId || null],
50
+      floorId: [this.fieldConfig.fields.floorId === undefined ? null : this.fieldConfig.fields.floorId],
51
+      deptId: [this.fieldConfig.fields.deptDTO ? this.fieldConfig.fields.deptDTO.id  : null],
52
+			deptTypeId: [this.fieldConfig.fields.deptTypeId || null],
53
+		});
54
+  }
55
+  // 表单提交
56
+  submitForm(): void {
57
+    for (const i in this.validateForm.controls) {
58
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
59
+      this.validateForm.controls[i].updateValueAndValidity();
60
+    }
61
+    if (this.validateForm.invalid) return;
62
+
63
+    let fields:any = {}
64
+    if(this.fieldConfig.config.buildingAndFloor){
65
+      fields.buildingId = this.validateForm.value.buildingId;
66
+      fields.buildingDTO = this.buildingList.find(item => item.id == this.validateForm.value.buildingId);
67
+      fields.floorId = this.validateForm.value.floorId;
68
+      fields.floorDTO = this.floorList.find(item => item.id == this.validateForm.value.floorId);
69
+    }
70
+    if(this.fieldConfig.config.dept){
71
+      fields.deptId = this.validateForm.value.deptId;
72
+      fields.deptDTO = this.deptList.find(item => item.id == this.validateForm.value.deptId);
73
+    }
74
+		if(this.fieldConfig.config.deptType){
75
+		  fields.deptTypeId = this.validateForm.value.deptTypeId;
76
+		  fields.deptTypeDTO = this.deptTypeList.find(item => item.id == this.validateForm.value.deptTypeId);
77
+		}
78
+
79
+    this.submitEvent.emit(fields);
80
+    this.hideModal();
81
+  }
82
+
83
+  get getHosId(){
84
+    return this.parentDutyId || this.dutyId || this.hosId;
85
+  }
86
+
87
+  // 防抖
88
+  isLoading = false;
89
+  isSelecting:boolean = false; // 是否在选中状态
90
+  searchTimer(fun, e) {
91
+    if (this.isSelecting) {
92
+      this.isSelecting = false; // 重置标志
93
+      return; // 跳过处理
94
+    }
95
+    this.isLoading = true;
96
+    this.searchTimerSubject.next([fun, e]);
97
+  }
98
+
99
+  // 设置标志
100
+  setIsSelecting(flag){
101
+    this.isSelecting = flag; // 设置标志
102
+  }
103
+
104
+	// =================科室类型===================
105
+
106
+	// 科室类型
107
+	openChangeDeptType(flag){
108
+	  flag && this.getDeptTypeList();
109
+	}
110
+
111
+	// 获取科室类型列表
112
+	deptTypeList:any[] = [];
113
+	getDeptTypeList(keyword?) {
114
+	  this.isLoading = true;
115
+	  this.mainService
116
+	    .getDictionary("list", "dept_type")
117
+	    .subscribe((data) => {
118
+	      this.isLoading = false;
119
+	      this.deptTypeList = data;
120
+	    });
121
+	}
122
+
123
+  // =================楼栋===================
124
+
125
+  // 楼栋搜索
126
+  changeBuildingInp(e) {
127
+    this.searchTimer(this.getBuildingList, e);
128
+  }
129
+
130
+  // 获取楼栋列表
131
+  buildingList:any[] = [];
132
+  getBuildingList(keyword?){
133
+    let postData: any = {
134
+      idx: 0,
135
+      sum: 20,
136
+      building: {
137
+        simpleQuery: true,
138
+        buildingName: keyword,
139
+        statisticalHosId:this.getHosId,
140
+      },
141
+    };
142
+    this.isLoading = true;
143
+    this.mainService.getFetchDataList("simple/data", "building", postData).subscribe(result => {
144
+      this.isLoading = false;
145
+      if(result.status == 200){
146
+        this.buildingList = result.list || [];
147
+      }else{
148
+        this.buildingList = [];
149
+      }
150
+    });
151
+  }
152
+  openChangeBuilding(flag){
153
+    flag && this.setIsSelecting(false);
154
+    flag && this.getBuildingList();
155
+  }
156
+
157
+  changeBuilding(id){
158
+    this.setIsSelecting(true);
159
+    this.floorList = [];
160
+    this.validateForm.controls.floorId.setValue(null);
161
+    this.getFloorList();
162
+  }
163
+
164
+  // =================楼层===================
165
+
166
+  // 楼层搜索
167
+  changeFloorInp(e) {
168
+    this.searchTimer(this.getFloorList, e);
169
+  }
170
+
171
+  // 获取楼层列表
172
+  floorList:any[] = [];
173
+  getFloorList(keyword = ''){
174
+    if(!this.validateForm.value.buildingId){
175
+      this.isLoading = false;
176
+      this.floorList = [];
177
+      return;
178
+    }
179
+    let postData: any = {
180
+      idx: 0,
181
+      sum: 20,
182
+      floor: {
183
+        floorName: keyword,
184
+        buildId : this.validateForm.value.buildingId,
185
+      },
186
+    };
187
+    this.isLoading = true;
188
+    this.mainService.getFetchDataList("simple/data", "floor", postData).subscribe(result => {
189
+      this.isLoading = false;
190
+      if(result.status == 200){
191
+        this.floorList = result.list || [];
192
+      }else{
193
+        this.floorList = [];
194
+      }
195
+    });
196
+  }
197
+  openChangeFloor(flag){
198
+    flag && this.setIsSelecting(false);
199
+    flag && this.getFloorList();
200
+  }
201
+
202
+  // =================科室===================
203
+
204
+  // 科室搜索
205
+  changeDeptInp(e) {
206
+    this.searchTimer(this.getDeptList, e);
207
+  }
208
+
209
+  // 获取科室列表
210
+  deptList:any[] = [];
211
+  getDeptList(keyword?){
212
+    let postData: any = {
213
+      idx: 0,
214
+      sum: 20,
215
+      department: {
216
+        statisticalHosId: this.getHosId,
217
+        dept: keyword,
218
+        searchType: 1,
219
+      },
220
+    };
221
+    this.isLoading = true;
222
+    this.mainService.getFetchDataList("simple/data", "department", postData).subscribe(result => {
223
+      this.isLoading = false;
224
+      if(result.status == 200){
225
+        this.deptList = result.list || [];
226
+      }else{
227
+        this.deptList = [];
228
+      }
229
+    });
230
+  }
231
+  openChangeDept(flag){
232
+    flag && this.setIsSelecting(false);
233
+    flag && this.getDeptList();
234
+  }
235
+}

+ 20 - 0
src/app/views/new-statistics/components/phone-search-more/phone-search-more.module.ts

@@ -0,0 +1,20 @@
1
+import { PhoneSearchMoreComponent } from './phone-search-more.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { ShareModule } from 'src/app/share/share.module';
6
+
7
+
8
+@NgModule({
9
+  declarations: [
10
+    PhoneSearchMoreComponent,
11
+  ],
12
+  imports: [
13
+    CommonModule,
14
+    ShareModule,
15
+  ],
16
+  exports: [
17
+    PhoneSearchMoreComponent,
18
+  ]
19
+})
20
+export class PhoneSearchMoreModule { }

+ 29 - 1
src/app/views/new-statistics/components/search-more/search-more.component.html

@@ -4,6 +4,34 @@
4 4
     </div>
5 5
     <div class="content">
6 6
       <form nz-form [formGroup]="validateForm" class="addForm">
7
+        <nz-form-item [hidden]="!fieldConfig.config.workHourParent">
8
+          <nz-form-label [nzSpan]="6" nzFor="workHourParentId">工时大类</nz-form-label>
9
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择工时大类!">
10
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeWorkHourParentInp($event)" formControlName="workHourParentId" nzPlaceHolder="请选择工时大类" (nzOpenChange)="openChangeWorkHourParent($event)" (ngModelChange)="setIsSelecting(true)">
11
+              <ng-container *ngFor="let option of workHourParentList">
12
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.workName" [nzValue]="option.id"></nz-option>
13
+              </ng-container>
14
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
16
+              </nz-option>
17
+            </nz-select>
18
+          </nz-form-control>
19
+        </nz-form-item>
20
+
21
+        <nz-form-item [hidden]="!fieldConfig.config.group">
22
+          <nz-form-label [nzSpan]="6" nzFor="groupId">维修分组</nz-form-label>
23
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修分组!">
24
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" formControlName="groupId" nzPlaceHolder="请选择维修分组" (nzOpenChange)="openChangeGroup($event)" (ngModelChange)="changeGroup($event)">
25
+              <ng-container *ngFor="let option of groupList">
26
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
27
+              </ng-container>
28
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
29
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
30
+              </nz-option>
31
+            </nz-select>
32
+          </nz-form-control>
33
+        </nz-form-item>
34
+
7 35
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
8 36
           <nz-form-label [nzSpan]="6" nzFor="groupId">维修分组</nz-form-label>
9 37
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修分组!">
@@ -143,7 +171,7 @@
143 171
             </nz-select>
144 172
           </nz-form-control>
145 173
         </nz-form-item>
146
-				
174
+
147 175
 				<nz-form-item [hidden]="!fieldConfig.config.deptType">
148 176
 				  <nz-form-label [nzSpan]="6" nzFor="deptTypeId">科室类型</nz-form-label>
149 177
 				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室类型!">

+ 51 - 6
src/app/views/new-statistics/components/search-more/search-more.component.ts

@@ -50,9 +50,10 @@ export class SearchMoreComponent implements OnInit {
50 50
     this.buildingList = this.fieldConfig.fields.buildingDTO ? [this.fieldConfig.fields.buildingDTO] : [];
51 51
     this.floorList = this.fieldConfig.fields.floorDTO ? [this.fieldConfig.fields.floorDTO] : [];
52 52
     this.companyList = this.fieldConfig.fields.companyDTO ? [this.fieldConfig.fields.companyDTO] : [];
53
+    this.workHourParentList = this.fieldConfig.fields.workHourParentDTO ? [this.fieldConfig.fields.workHourParentDTO] : [];
53 54
     this.repairDeptList = this.fieldConfig.fields.repairDeptDTO ? [this.fieldConfig.fields.repairDeptDTO] : [];
54 55
 		this.deptTypeList = this.fieldConfig.fields.deptTypeDTO ? [this.fieldConfig.fields.deptTypeDTO] : [];
55
-		 
56
+
56 57
     this.validateForm = this.fb.group({
57 58
       groupId: [this.fieldConfig.fields.groupId || null],
58 59
       userId: [this.fieldConfig.fields.userId === undefined ? null : this.fieldConfig.fields.userId],
@@ -63,6 +64,7 @@ export class SearchMoreComponent implements OnInit {
63 64
       buildingId: [this.fieldConfig.fields.buildingId || null],
64 65
       floorId: [this.fieldConfig.fields.floorId === undefined ? null : this.fieldConfig.fields.floorId],
65 66
       companyId: [this.fieldConfig.fields.companyDTO ? this.fieldConfig.fields.companyDTO.id  : null],
67
+      workHourParentId: [this.fieldConfig.fields.workHourParentDTO ? this.fieldConfig.fields.workHourParentDTO.id  : null],
66 68
       repairDeptId: [this.fieldConfig.fields.repairDeptDTO ? this.fieldConfig.fields.repairDeptDTO.id  : null],
67 69
 			deptTypeId: [this.fieldConfig.fields.deptTypeId || null],
68 70
 		});
@@ -87,6 +89,11 @@ export class SearchMoreComponent implements OnInit {
87 89
       hierarchy = 1;
88 90
     }
89 91
     let fields:any = {}
92
+    if(this.fieldConfig.config.group){
93
+      fields.groupId = this.validateForm.value.groupId;
94
+      fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
95
+    }
96
+
90 97
     if(this.fieldConfig.config.groupAndUser){
91 98
       fields.groupId = this.validateForm.value.groupId;
92 99
       fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
@@ -114,6 +121,10 @@ export class SearchMoreComponent implements OnInit {
114 121
       fields.companyId = this.validateForm.value.companyId;
115 122
       fields.companyDTO = this.companyList.find(item => item.id == this.validateForm.value.companyId);
116 123
     }
124
+    if(this.fieldConfig.config.workHourParent){
125
+      fields.workHourParentId = this.validateForm.value.workHourParentId;
126
+      fields.workHourParentDTO = this.workHourParentList.find(item => item.id == this.validateForm.value.workHourParentId);
127
+    }
117 128
     if(this.fieldConfig.config.repairDept){
118 129
       fields.repairDeptId = this.validateForm.value.repairDeptId;
119 130
       fields.repairDeptDTO = this.repairDeptList.find(item => item.id == this.validateForm.value.repairDeptId);
@@ -122,7 +133,7 @@ export class SearchMoreComponent implements OnInit {
122 133
 		  fields.deptTypeId = this.validateForm.value.deptTypeId;
123 134
 		  fields.deptTypeDTO = this.deptTypeList.find(item => item.id == this.validateForm.value.deptTypeId);
124 135
 		}
125
-		
136
+
126 137
     this.submitEvent.emit(fields);
127 138
     this.hideModal();
128 139
   }
@@ -188,14 +199,14 @@ export class SearchMoreComponent implements OnInit {
188 199
     this.validateForm.controls.userId.setValue(null);
189 200
     this.getUserList();
190 201
   }
191
-	
202
+
192 203
 	// =================科室类型===================
193
-	
204
+
194 205
 	// 科室类型
195 206
 	openChangeDeptType(flag){
196 207
 	  flag && this.getDeptTypeList();
197 208
 	}
198
-	
209
+
199 210
 	// 获取科室类型列表
200 211
 	deptTypeList:any[] = [];
201 212
 	getDeptTypeList(keyword?) {
@@ -207,7 +218,7 @@ export class SearchMoreComponent implements OnInit {
207 218
 	      this.deptTypeList = data;
208 219
 	    });
209 220
 	}
210
-	
221
+
211 222
   // =================维修人员===================
212 223
 
213 224
   // 维修人员搜索
@@ -529,4 +540,38 @@ export class SearchMoreComponent implements OnInit {
529 540
     flag && this.setIsSelecting(false);
530 541
     flag && this.getRepairDeptList();
531 542
   }
543
+
544
+  // =================工时大类===================
545
+
546
+  // 工时大类搜索
547
+  changeWorkHourParentInp(e) {
548
+    this.searchTimer(this.getWorkHourParentList, e);
549
+  }
550
+
551
+  // 获取工时大类列表
552
+  workHourParentList:any[] = [];
553
+  getWorkHourParentList(keyword?){
554
+    let postData: any = {
555
+      idx: 0,
556
+      sum: 20,
557
+      workHourManagement: {
558
+        keyWords: keyword,
559
+        treeLevel: 1,
560
+        statisticalHosId: this.getHosId,
561
+      },
562
+    };
563
+    this.isLoading = true;
564
+    this.mainService.getFetchDataList("simple/data", "workHourManagement", postData).subscribe(result => {
565
+      this.isLoading = false;
566
+      if(result.status == 200){
567
+        this.workHourParentList = result.list || [];
568
+      }else{
569
+        this.workHourParentList = [];
570
+      }
571
+    });
572
+  }
573
+  openChangeWorkHourParent(flag){
574
+    flag && this.setIsSelecting(false);
575
+    flag && this.getWorkHourParentList();
576
+  }
532 577
 }

+ 1 - 5
src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
   </div>
9 5
   <div class="operation">
10 6
     <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 17 - 25
src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.component.ts

@@ -1,15 +1,16 @@
1 1
 import { TabService } from './../../services/tab.service';
2 2
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 4
 import { MainService } from 'src/app/services/main.service';
6 5
 import { ActivatedRoute } from '@angular/router';
6
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
7 7
 @Component({
8 8
   selector: "app-business-classify-statistics",
9 9
   templateUrl: "./business-classify-statistics.component.html",
10 10
   styleUrls: ["./business-classify-statistics.component.less"],
11 11
 })
12 12
 export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewInit {
13
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
13 14
   constructor(
14 15
     private mainService: MainService,
15 16
     private message: NzMessageService,
@@ -25,13 +26,14 @@ export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewIni
25 26
 
26 27
   statisticsTypeId;//统计分类id
27 28
 
28
-  ngOnInit() {
29
-    this.initSessionData();
30
-    this.getQueryParams();
31
-    this.search();
32
-  }
29
+  ngOnInit() {}
33 30
 
34 31
   ngAfterViewInit(){
32
+    this.initSessionData();
33
+    this.getQueryParams();
34
+    setTimeout(() => {
35
+      this.search();
36
+    }, 0)
35 37
     this.onResize();
36 38
   }
37 39
 
@@ -49,6 +51,7 @@ export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewIni
49 51
     this.tabService.clearQueryParams();
50 52
     if(queryParams.dateRange){
51 53
       this.dateRange = queryParams.dateRange;
54
+      this.customChangeDateComponent.initByDate(this.dateRange);
52 55
     }
53 56
   }
54 57
 
@@ -105,8 +108,8 @@ export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewIni
105 108
     let postData:any = {
106 109
       idx: this.pageIndex - 1,
107 110
       sum: this.pageSize,
108
-      startDate: this.dateRange[0] || undefined,
109
-      endDate: this.dateRange[1] || undefined,
111
+      startDate: this.customChangeDateComponent.startDate || undefined,
112
+      endDate: this.customChangeDateComponent.endDate || undefined,
110 113
       hosId: this.getHosId,
111 114
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
112 115
       userId: this.fieldConfig.fields.userId || undefined,
@@ -144,19 +147,7 @@ export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewIni
144 147
   }
145 148
 
146 149
   // 日期选择
147
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
148
-  changeDate(result?): void {
149
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
150
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
151
-    this.dateRange = result;
152
-  }
153
-
154
-  onCalendarChangeDate(dateArr){
155
-    console.log(dateArr)
156
-    if(dateArr.length == 2){
157
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
158
-    }
159
-  }
150
+  dateRange: any = [];
160 151
 
161 152
   // 导出
162 153
   excelExportLoading:any = false;
@@ -165,8 +156,8 @@ export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewIni
165 156
       nzDuration: 0,
166 157
     }).messageId;
167 158
     let postData:any = {
168
-      startDate: this.dateRange[0] || undefined,
169
-      endDate: this.dateRange[1] || undefined,
159
+      startDate: this.customChangeDateComponent.startDate || undefined,
160
+      endDate: this.customChangeDateComponent.endDate || undefined,
170 161
       hosId: this.getHosId,
171 162
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
172 163
       userId: this.fieldConfig.fields.userId || undefined,
@@ -204,8 +195,9 @@ export class BusinessClassifyStatisticsComponent implements OnInit, AfterViewIni
204 195
     this.sortCurrentKey = "";
205 196
 		this.sortCurrentValue = "";
206 197
 		this.sortCurrent = {};
207
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
198
+    this.dateRange = []
208 199
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, deptId: undefined};
200
+    this.customChangeDateComponent.resetByDate();
209 201
     this.search();
210 202
   }
211 203
 

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/business-classify-statistics/business-classify-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { BusinessClassifyStatisticsRoutingModule } from './business-classify-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     BusinessClassifyStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class BusinessClassifyStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="true"></app-custom-change-date>
8 4
   </div>
9 5
   <div class="operation">
10 6
     <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 19 - 25
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.ts

@@ -1,16 +1,17 @@
1 1
 import { TabService } from './../../services/tab.service';
2 2
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 4
 import { MainService } from 'src/app/services/main.service';
6 5
 import { ActivatedRoute } from '@angular/router';
7 6
 import cloneDeep from 'lodash-es/cloneDeep'
7
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
8 8
 @Component({
9 9
   selector: "app-date-business-statistics",
10 10
   templateUrl: "./date-business-statistics.component.html",
11 11
   styleUrls: ["./date-business-statistics.component.less"],
12 12
 })
13 13
 export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
14
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
14 15
   constructor(
15 16
     private mainService: MainService,
16 17
     private message: NzMessageService,
@@ -25,13 +26,14 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
25 26
   listLength: number = 0; //表格总数据量
26 27
   widthConfig: any[] = [];
27 28
 
28
-  ngOnInit() {
29
-    this.initSessionData();
30
-    this.getQueryParams();
31
-    this.search();
32
-  }
29
+  ngOnInit() {}
33 30
 
34 31
   ngAfterViewInit(){
32
+    this.initSessionData();
33
+    this.getQueryParams();
34
+    setTimeout(() => {
35
+      this.search();
36
+    }, 0)
35 37
     this.onResize();
36 38
   }
37 39
 
@@ -49,6 +51,7 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
49 51
     this.tabService.clearQueryParams();
50 52
     if(queryParams.dateRange){
51 53
       this.dateRange = queryParams.dateRange;
54
+      this.customChangeDateComponent.initByDate(this.dateRange);
52 55
     }
53 56
   }
54 57
 
@@ -113,8 +116,9 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
113 116
       let postData:any = {
114 117
         idx: this.pageIndex - 1,
115 118
         sum: this.pageSize,
116
-        startDate: this.dateRange[0] || undefined,
117
-        endDate: this.dateRange[1] || undefined,
119
+        dateType: this.customChangeDateComponent.dateType,
120
+        startDate: this.customChangeDateComponent.startDate || undefined,
121
+        endDate: this.customChangeDateComponent.endDate || undefined,
118 122
         hosId: this.getHosId,
119 123
         groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
120 124
         userId: this.fieldConfig.fields.userId || undefined,
@@ -153,19 +157,7 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
153 157
   }
154 158
 
155 159
   // 日期选择
156
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
157
-  changeDate(result?): void {
158
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
159
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
160
-    this.dateRange = result;
161
-  }
162
-
163
-  onCalendarChangeDate(dateArr){
164
-    console.log(dateArr)
165
-    if(dateArr.length == 2){
166
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
167
-    }
168
-  }
160
+  dateRange: any = [];
169 161
 
170 162
   // 导出
171 163
   excelExportLoading:any = false;
@@ -174,8 +166,9 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
174 166
       nzDuration: 0,
175 167
     }).messageId;
176 168
     let postData:any = {
177
-      startDate: this.dateRange[0] || undefined,
178
-      endDate: this.dateRange[1] || undefined,
169
+      dateType: this.customChangeDateComponent.dateType,
170
+      startDate: this.customChangeDateComponent.startDate || undefined,
171
+      endDate: this.customChangeDateComponent.endDate || undefined,
179 172
       hosId: this.getHosId,
180 173
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
181 174
       userId: this.fieldConfig.fields.userId || undefined,
@@ -213,8 +206,9 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
213 206
     this.sortCurrentKey = "";
214 207
 		this.sortCurrentValue = "";
215 208
 		this.sortCurrent = {};
216
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
209
+    this.dateRange = []
217 210
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, deptId: undefined};
211
+    this.customChangeDateComponent.resetByDate();
218 212
     this.search();
219 213
   }
220 214
 

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.module.ts

@@ -6,6 +6,7 @@ import { DateBusinessStatisticsRoutingModule } from './date-business-statistics-
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8 8
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
9
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9 10
 
10 11
 
11 12
 @NgModule({
@@ -18,6 +19,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
18 19
     ShareModule,
19 20
     VirtualScrollerModule,
20 21
     DistributionSearchMoreModule,
22
+    CustomChangeDateModule,
21 23
   ]
22 24
 })
23 25
 export class DateBusinessStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="true"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">统计分类</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType($event)">

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 19 - 25
src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.ts

@@ -1,15 +1,16 @@
1 1
 import { TabService } from './../../services/tab.service';
2 2
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 4
 import { MainService } from 'src/app/services/main.service';
6 5
 import { ActivatedRoute } from '@angular/router';
6
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
7 7
 @Component({
8 8
   selector: "app-date-quality-control-statistics",
9 9
   templateUrl: "./date-quality-control-statistics.component.html",
10 10
   styleUrls: ["./date-quality-control-statistics.component.less"],
11 11
 })
12 12
 export class DateQualityControlStatisticsComponent implements OnInit, AfterViewInit {
13
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
13 14
   constructor(
14 15
     private mainService: MainService,
15 16
     private message: NzMessageService,
@@ -25,13 +26,14 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
25 26
 
26 27
   statisticsTypeId;//统计分类id
27 28
 
28
-  ngOnInit() {
29
-    this.initSessionData();
30
-    this.getQueryParams();
31
-    this.search();
32
-  }
29
+  ngOnInit() {}
33 30
 
34 31
   ngAfterViewInit(){
32
+    this.initSessionData();
33
+    this.getQueryParams();
34
+    setTimeout(() => {
35
+      this.search();
36
+    }, 0)
35 37
     this.onResize();
36 38
   }
37 39
 
@@ -49,6 +51,7 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
49 51
     this.tabService.clearQueryParams();
50 52
     if(queryParams.dateRange){
51 53
       this.dateRange = queryParams.dateRange;
54
+      this.customChangeDateComponent.initByDate(this.dateRange);
52 55
     }
53 56
   }
54 57
 
@@ -105,8 +108,9 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
105 108
     let postData:any = {
106 109
       idx: this.pageIndex - 1,
107 110
       sum: this.pageSize,
108
-      startDate: this.dateRange[0] || undefined,
109
-      endDate: this.dateRange[1] || undefined,
111
+      dateType: this.customChangeDateComponent.dateType,
112
+      startDate: this.customChangeDateComponent.startDate || undefined,
113
+      endDate: this.customChangeDateComponent.endDate || undefined,
110 114
       hosId: this.getHosId,
111 115
       statisticsTypeId: this.statisticsTypeId || undefined,
112 116
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
@@ -146,19 +150,7 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
146 150
   }
147 151
 
148 152
   // 日期选择
149
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
150
-  changeDate(result?): void {
151
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
152
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
153
-    this.dateRange = result;
154
-  }
155
-
156
-  onCalendarChangeDate(dateArr){
157
-    console.log(dateArr)
158
-    if(dateArr.length == 2){
159
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
160
-    }
161
-  }
153
+  dateRange: any = [];
162 154
 
163 155
   // 导出
164 156
   excelExportLoading:any = false;
@@ -167,8 +159,9 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
167 159
       nzDuration: 0,
168 160
     }).messageId;
169 161
     let postData:any = {
170
-      startDate: this.dateRange[0] || undefined,
171
-      endDate: this.dateRange[1] || undefined,
162
+      dateType: this.customChangeDateComponent.dateType,
163
+      startDate: this.customChangeDateComponent.startDate || undefined,
164
+      endDate: this.customChangeDateComponent.endDate || undefined,
172 165
       hosId: this.getHosId,
173 166
       statisticsTypeId: this.statisticsTypeId || undefined,
174 167
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
@@ -208,9 +201,10 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
208 201
     this.sortCurrentKey = "";
209 202
 		this.sortCurrentValue = "";
210 203
 		this.sortCurrent = {};
211
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
204
+    this.dateRange = []
212 205
     this.statisticsTypeId = undefined;
213 206
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined};
207
+    this.customChangeDateComponent.resetByDate();
214 208
     this.search();
215 209
   }
216 210
 

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { DateQualityControlStatisticsRoutingModule } from './date-quality-control-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     DateQualityControlStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class DateQualityControlStatisticsModule { }

+ 4 - 8
src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.html

@@ -1,11 +1,7 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
8
-		
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
4
+
9 5
 		<div class="searchDataItem">
10 6
 		  <span class="label">科室</span>:
11 7
 		  <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" nzServerSearch nzShowSearch (nzOnSearch)="changeInp($event)">
@@ -34,8 +30,8 @@
34 30
   <nz-table class="table" [ngStyle]="{ width: widthValue + 'px' }" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl" [nzWidthConfig]="widthConfig" nzBordered>
35 31
     <thead (nzSortChange)="sort($event)" nzSingleSort>
36 32
       <tr>
37
-				<th rowspan="2" *ngIf="parent==1">父级科室(编码)</th>
38
-        <th rowspan="2">科室(编码)</th>
33
+				<th rowspan="2" *ngIf="parent==1" nzShowSort nzSortKey="parentOrders" [(nzSort)]="sortCurrent.parentOrders">父级科室(编码)</th>
34
+        <th rowspan="2" nzShowSort nzSortKey="orders" [(nzSort)]="sortCurrent.orders">科室(编码)</th>
39 35
         <th rowspan="2" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
40 36
         <th rowspan="2" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">积分总和</th>
41 37
         <th rowspan="2" nzShowSort nzSortKey="totalPrice" [(nzSort)]="sortCurrent.totalPrice">总费用</th>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 20 - 27
src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.ts

@@ -2,12 +2,12 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
9 8
 import cloneDeep from 'lodash-es/cloneDeep'
10 9
 import { ToolService } from "../../../../services/tool.service";
10
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
11 11
 
12 12
 @Component({
13 13
   selector: "app-department-business-statistics",
@@ -15,6 +15,7 @@ import { ToolService } from "../../../../services/tool.service";
15 15
   styleUrls: ["./department-business-statistics.component.less"],
16 16
 })
17 17
 export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewInit {
18
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
18 19
   constructor(
19 20
     private mainService: MainService,
20 21
     private message: NzMessageService,
@@ -41,13 +42,15 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
41 42
       let fun = v[0];
42 43
       fun.call(this, v[1]);
43 44
     });
44
-    this.initSessionData();
45
-    this.getQueryParams();
46
-		this.getDeparts();
47
-    this.search();
48 45
   }
49 46
 
50 47
   ngAfterViewInit(){
48
+    this.initSessionData();
49
+    this.getQueryParams();
50
+    this.getDeparts();
51
+    setTimeout(() => {
52
+      this.search();
53
+    }, 0)
51 54
     this.onResize();
52 55
   }
53 56
 
@@ -65,6 +68,7 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
65 68
     this.tabService.clearQueryParams();
66 69
     if(queryParams.dateRange){
67 70
       this.dateRange = queryParams.dateRange;
71
+      this.customChangeDateComponent.initByDate(this.dateRange);
68 72
     }
69 73
   }
70 74
 
@@ -140,8 +144,8 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
140 144
 				showParentDept: this.parent==1 ? 'true' : undefined,
141 145
 				deptId: this.deptId || undefined,
142 146
 				buildingId: this.fieldConfig.fields.buildingId || undefined,
143
-        startDate: this.dateRange[0] || undefined,
144
-        endDate: this.dateRange[1] || undefined,
147
+        startDate: this.customChangeDateComponent.startDate || undefined,
148
+        endDate: this.customChangeDateComponent.endDate || undefined,
145 149
         hosId: this.getHosId,
146 150
         groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
147 151
         userId: this.fieldConfig.fields.userId || undefined
@@ -178,19 +182,7 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
178 182
   }
179 183
 
180 184
   // 日期选择
181
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
182
-  changeDate(result?): void {
183
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
184
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
185
-    this.dateRange = result;
186
-  }
187
-
188
-  onCalendarChangeDate(dateArr){
189
-    console.log(dateArr)
190
-    if(dateArr.length == 2){
191
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
192
-    }
193
-  }
185
+  dateRange: any = [];
194 186
 
195 187
   // 导出
196 188
   excelExportLoading:any = false;
@@ -202,8 +194,8 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
202 194
 			showParentDept: this.parent==1 ? 'true' : undefined,
203 195
 			deptId: this.deptId || undefined,
204 196
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
205
-      startDate: this.dateRange[0] || undefined,
206
-      endDate: this.dateRange[1] || undefined,
197
+      startDate: this.customChangeDateComponent.startDate || undefined,
198
+      endDate: this.customChangeDateComponent.endDate || undefined,
207 199
       hosId: this.getHosId,
208 200
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
209 201
       userId: this.fieldConfig.fields.userId || undefined,
@@ -239,9 +231,10 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
239 231
     this.sortCurrentKey = "";
240 232
 		this.sortCurrentValue = "";
241 233
 		this.sortCurrent = {};
242
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
234
+    this.dateRange = []
243 235
     this.deptId = undefined;
244 236
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined};
237
+    this.customChangeDateComponent.resetByDate();
245 238
     this.search();
246 239
   }
247 240
 
@@ -260,12 +253,12 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
260 253
   openChangeBuilding(flag){
261 254
     flag && this.getBuildingList();
262 255
   }
263
-	
256
+
264 257
 	// 科室搜索
265 258
 	changeInp(e) {
266 259
 	  this.searchTimer(this.getDeparts, e);
267 260
 	}
268
-	
261
+
269 262
 	// 获取所有科室
270 263
 	alldepart:any;
271 264
 	getDeparts(dept?) {
@@ -285,7 +278,7 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
285 278
 	      this.alldepart = data.list;
286 279
 	    });
287 280
 	}
288
-	
281
+
289 282
   // 获取报修科室列表
290 283
   buildingList:any[] = [];
291 284
   getBuildingList(keyword?) {

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.module.ts

@@ -6,6 +6,7 @@ import { DepartmentBusinessStatisticsRoutingModule } from './department-business
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8 8
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
9
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9 10
 
10 11
 
11 12
 @NgModule({
@@ -18,6 +19,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
18 19
     ShareModule,
19 20
     VirtualScrollerModule,
20 21
     DistributionSearchMoreModule,
22
+    CustomChangeDateModule,
21 23
   ]
22 24
 })
23 25
 export class DepartmentBusinessStatisticsModule { }

+ 3 - 7
src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">科室</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" nzServerSearch nzShowSearch (nzOnSearch)="changeInp($event)">
@@ -35,8 +31,8 @@
35 31
 	<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 32
 		<thead (nzSortChange)="sort($event)" nzSingleSort>
37 33
 			<tr>
38
-				<th [nzWidth]="widthStyle" *ngIf="parent==1">父级科室(编码)</th>
39
-				<th [nzWidth]="widthStyle">科室(编码)</th>
34
+				<th [nzWidth]="widthStyle" *ngIf="parent==1" nzShowSort nzSortKey="parentOrders" [(nzSort)]="sortCurrent.parentOrders">父级科室(编码)</th>
35
+				<th [nzWidth]="widthStyle" nzShowSort nzSortKey="orders" [(nzSort)]="sortCurrent.orders">科室(编码)</th>
40 36
 				<th [nzWidth]="widthStyle" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
41 37
 				<th [nzWidth]="widthStyle" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
42 38
 				<th [nzWidth]="widthStyle" nzShowSort nzSortKey="totalPrice" [(nzSort)]="sortCurrent.totalPrice">总费用</th>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 20 - 27
src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.component.ts

@@ -2,17 +2,18 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
9 8
 import { ToolService } from "../../../../services/tool.service";
9
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10 10
 @Component({
11 11
   selector: "app-department-quality-control-statistics",
12 12
   templateUrl: "./department-quality-control-statistics.component.html",
13 13
   styleUrls: ["./department-quality-control-statistics.component.less"],
14 14
 })
15 15
 export class DepartmentQualityControlStatisticsComponent implements OnInit, AfterViewInit {
16
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
16 17
   constructor(
17 18
     private mainService: MainService,
18 19
     private message: NzMessageService,
@@ -38,13 +39,15 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
38 39
       let fun = v[0];
39 40
       fun.call(this, v[1]);
40 41
     });
41
-    this.initSessionData();
42
-    this.getQueryParams();
43
-		this.getDeparts();
44
-    this.search();
45 42
   }
46 43
 
47 44
   ngAfterViewInit(){
45
+    this.initSessionData();
46
+    this.getQueryParams();
47
+    this.getDeparts();
48
+    setTimeout(() => {
49
+      this.search();
50
+    }, 0)
48 51
     this.onResize();
49 52
   }
50 53
 
@@ -62,6 +65,7 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
62 65
     this.tabService.clearQueryParams();
63 66
     if(queryParams.dateRange){
64 67
       this.dateRange = queryParams.dateRange;
68
+      this.customChangeDateComponent.initByDate(this.dateRange);
65 69
     }
66 70
   }
67 71
 
@@ -126,8 +130,8 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
126 130
 			showParentDept: this.parent==1 ? 'true' : undefined,
127 131
 			deptId: this.deptId || undefined,
128 132
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
129
-      startDate: this.dateRange[0] || undefined,
130
-      endDate: this.dateRange[1] || undefined,
133
+      startDate: this.customChangeDateComponent.startDate || undefined,
134
+      endDate: this.customChangeDateComponent.endDate || undefined,
131 135
       hosId: this.getHosId,
132 136
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
133 137
       userId: this.fieldConfig.fields.userId || undefined,
@@ -174,19 +178,7 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
174 178
   }
175 179
 
176 180
   // 日期选择
177
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
178
-  changeDate(result?): void {
179
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
180
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
181
-    this.dateRange = result;
182
-  }
183
-
184
-  onCalendarChangeDate(dateArr){
185
-    console.log(dateArr)
186
-    if(dateArr.length == 2){
187
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
188
-    }
189
-  }
181
+  dateRange: any = [];
190 182
 
191 183
   // 导出
192 184
   excelExportLoading:any = false;
@@ -198,8 +190,8 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
198 190
 			showParentDept: this.parent==1 ? 'true' : undefined,
199 191
 			deptId: this.deptId || undefined,
200 192
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
201
-      startDate: this.dateRange[0] || undefined,
202
-      endDate: this.dateRange[1] || undefined,
193
+      startDate: this.customChangeDateComponent.startDate || undefined,
194
+      endDate: this.customChangeDateComponent.endDate || undefined,
203 195
       hosId: this.getHosId,
204 196
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
205 197
       userId: this.fieldConfig.fields.userId || undefined,
@@ -237,9 +229,10 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
237 229
     this.sortCurrentKey = "";
238 230
 		this.sortCurrentValue = "";
239 231
 		this.sortCurrent = {};
240
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
232
+    this.dateRange = []
241 233
     this.deptId = undefined;
242 234
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, statisticsTypeId: undefined, taskTypeId: undefined, buildingId: undefined};
235
+    this.customChangeDateComponent.resetByDate();
243 236
     this.search();
244 237
   }
245 238
 
@@ -258,12 +251,12 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
258 251
   openChangeBuilding(flag){
259 252
     flag && this.getBuildingList();
260 253
   }
261
-	
254
+
262 255
 	// 科室搜索
263 256
 	changeInp(e) {
264 257
 	  this.searchTimer(this.getDeparts, e);
265 258
 	}
266
-	
259
+
267 260
 	// 获取所有科室
268 261
 	alldepart:any;
269 262
 	getDeparts(dept?) {
@@ -283,7 +276,7 @@ export class DepartmentQualityControlStatisticsComponent implements OnInit, Afte
283 276
 	      this.alldepart = data.list;
284 277
 	    });
285 278
 	}
286
-	
279
+
287 280
   // 获取报修科室列表
288 281
   buildingList:any[] = [];
289 282
   getBuildingList(keyword?) {

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/department-quality-control-statistics/department-quality-control-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { DepartmentQualityControlStatisticsRoutingModule } from './department-quality-control-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     DepartmentQualityControlStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class DepartmentQualityControlStatisticsModule { }

+ 3 - 7
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">科室</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" nzServerSearch nzShowSearch (nzOnSearch)="changeInp($event)">
@@ -34,8 +30,8 @@
34 30
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
35 31
   <thead (nzSortChange)="sort($event)" nzSingleSort>
36 32
     <tr>
37
-			<th [nzWidth]="widthStyle" *ngIf="parent==1">父级科室(编码)</th>
38
-      <th [nzWidth]="widthStyle">科室(编码)</th>
33
+			<th [nzWidth]="widthStyle" *ngIf="parent==1" nzShowSort nzSortKey="parentOrders" [(nzSort)]="sortCurrent.parentOrders">父级科室(编码)</th>
34
+      <th [nzWidth]="widthStyle" nzShowSort nzSortKey="orders" [(nzSort)]="sortCurrent.orders">科室(编码)</th>
39 35
       <th [nzWidth]="widthThStyle" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
40 36
       <th [nzWidth]="widthThStyle" nzShowSort nzSortKey="evaCount" [(nzSort)]="sortCurrent.evaCount">评价总工单数</th>
41 37
       <th [nzWidth]="widthThStyle" nzShowSort nzSortKey="eva1" [(nzSort)]="sortCurrent.eva1">一星评价数</th>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 22 - 31
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.component.ts

@@ -2,23 +2,22 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
9
-import { ToolService } from "../../../../services/tool.service";
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10 9
 @Component({
11 10
   selector: "app-distribution-department-evaluate-statistics",
12 11
   templateUrl: "./distribution-department-evaluate-statistics.component.html",
13 12
   styleUrls: ["./distribution-department-evaluate-statistics.component.less"],
14 13
 })
15 14
 export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
16 16
   constructor(
17 17
     private mainService: MainService,
18 18
     private message: NzMessageService,
19 19
     private route: ActivatedRoute,
20 20
     private tabService: TabService,
21
-		private tool: ToolService,
22 21
   ) {}
23 22
 
24 23
   listOfData: any[] = []; //表格数据
@@ -38,13 +37,15 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
38 37
       let fun = v[0];
39 38
       fun.call(this, v[1]);
40 39
     });
41
-    this.initSessionData();
42
-    this.getQueryParams();
43
-		this.getDeparts();
44
-    this.search();
45 40
   }
46 41
 
47 42
   ngAfterViewInit(){
43
+    this.initSessionData();
44
+    this.getQueryParams();
45
+    this.getDeparts();
46
+    setTimeout(() => {
47
+      this.search();
48
+    }, 0)
48 49
     this.onResize();
49 50
   }
50 51
 
@@ -62,11 +63,12 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
62 63
     this.tabService.clearQueryParams();
63 64
     if(queryParams.dateRange){
64 65
       this.dateRange = queryParams.dateRange;
66
+      this.customChangeDateComponent.initByDate(this.dateRange);
65 67
     }
66 68
   }
67 69
 
68 70
   get getMoreFilter(){
69
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.taskTypeDTO || this.fieldConfig.fields.statisticsTypeDTO;
71
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.taskTypeDTO || this.fieldConfig.fields.statisticsTypeDTO || this.fieldConfig.fields.buildingDTO;
70 72
     return flag ? 37 : 0;
71 73
   }
72 74
 
@@ -122,11 +124,11 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
122 124
     let postData:any = {
123 125
       idx: this.pageIndex - 1,
124 126
       sum: this.pageSize,
127
+      startDate: this.customChangeDateComponent.startDate || undefined,
128
+      endDate: this.customChangeDateComponent.endDate || undefined,
125 129
 			showParentDept: this.parent==1 ? 'true' : undefined,
126 130
 			deptId: this.deptId || undefined,
127 131
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
128
-      startDate: this.dateRange[0] || undefined,
129
-      endDate: this.dateRange[1] || undefined,
130 132
       hosId: this.getHosId,
131 133
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
132 134
       userId: this.fieldConfig.fields.userId || undefined,
@@ -171,19 +173,7 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
171 173
   }
172 174
 
173 175
   // 日期选择
174
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
175
-  changeDate(result?): void {
176
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
177
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
178
-    this.dateRange = result;
179
-  }
180
-
181
-  onCalendarChangeDate(dateArr){
182
-    console.log(dateArr)
183
-    if(dateArr.length == 2){
184
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
185
-    }
186
-  }
176
+  dateRange: any = [];
187 177
 
188 178
   // 导出
189 179
   excelExportLoading:any = false;
@@ -192,11 +182,11 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
192 182
       nzDuration: 0,
193 183
     }).messageId;
194 184
     let postData:any = {
185
+      startDate: this.customChangeDateComponent.startDate || undefined,
186
+      endDate: this.customChangeDateComponent.endDate || undefined,
195 187
 			showParentDept: this.parent==1 ? 'true' : undefined,
196 188
 			deptId: this.deptId || undefined,
197 189
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
198
-      startDate: this.dateRange[0] || undefined,
199
-      endDate: this.dateRange[1] || undefined,
200 190
       hosId: this.getHosId,
201 191
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
202 192
       userId: this.fieldConfig.fields.userId || undefined,
@@ -234,9 +224,10 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
234 224
     this.sortCurrentKey = "";
235 225
 		this.sortCurrentValue = "";
236 226
 		this.sortCurrent = {};
237
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
238
-    this.deptId = undefined;
227
+    this.dateRange = []
228
+    this.buildingId = undefined;
239 229
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, statisticsTypeId: undefined, taskTypeId: undefined, buildingId: undefined};
230
+    this.customChangeDateComponent.resetByDate();
240 231
     this.search();
241 232
   }
242 233
 
@@ -244,12 +235,12 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
244 235
   changeBuildingInp(e) {
245 236
     this.searchTimer(this.getBuildingList, e);
246 237
   }
247
-	
238
+
248 239
 	// 科室搜索
249 240
 	changeInp(e) {
250 241
 	  this.searchTimer(this.getDeparts, e);
251 242
 	}
252
-	
243
+
253 244
 	// 获取所有科室
254 245
 	alldepart:any;
255 246
 	getDeparts(dept?) {
@@ -269,7 +260,7 @@ export class DistributionDepartmentEvaluateStatisticsComponent implements OnInit
269 260
 	      this.alldepart = data.list;
270 261
 	    });
271 262
 	}
272
-	
263
+
273 264
   // 防抖
274 265
   isLoading = false;
275 266
   searchTimer(fun, e) {

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-evaluate-statistics/distribution-department-evaluate-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { DistributionDepartmentEvaluateStatisticsRoutingModule } from './distribution-department-evaluate-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     DistributionDepartmentEvaluateStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class DistributionDepartmentEvaluateStatisticsModule { }

+ 3 - 7
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">科室</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" nzServerSearch nzShowSearch (nzOnSearch)="changeInp($event)">
@@ -34,8 +30,8 @@
34 30
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
35 31
   <thead (nzSortChange)="sort($event)" nzSingleSort>
36 32
     <tr>
37
-			<th nzWidth="20%" *ngIf="parent==1">父级科室(编码)</th>
38
-      <th nzWidth="20%">科室(编码)</th>
33
+			<th nzWidth="20%" *ngIf="parent==1" nzShowSort nzSortKey="parentOrders" [(nzSort)]="sortCurrent.parentOrders">父级科室(编码)</th>
34
+      <th nzWidth="20%" nzShowSort nzSortKey="orders" [(nzSort)]="sortCurrent.orders">科室(编码)</th>
39 35
       <th nzWidth="15%" nzShowSort nzSortKey="service" [(nzSort)]="sortCurrent.service">服务台建单数</th>
40 36
       <th nzWidth="15%" nzShowSort nzSortKey="nurse" [(nzSort)]="sortCurrent.nurse">护士端建单数</th>
41 37
       <th nzWidth="15%" nzShowSort nzSortKey="system" [(nzSort)]="sortCurrent.system">系统自动建单数</th>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 20 - 27
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.component.ts

@@ -2,17 +2,18 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
9 8
 import { ToolService } from "../../../../services/tool.service";
9
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10 10
 @Component({
11 11
   selector: "app-distribution-department-source-statistics",
12 12
   templateUrl: "./distribution-department-source-statistics.component.html",
13 13
   styleUrls: ["./distribution-department-source-statistics.component.less"],
14 14
 })
15 15
 export class DistributionDepartmentSourceStatisticsComponent implements OnInit, AfterViewInit {
16
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
16 17
   constructor(
17 18
     private mainService: MainService,
18 19
     private message: NzMessageService,
@@ -38,13 +39,15 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
38 39
       let fun = v[0];
39 40
       fun.call(this, v[1]);
40 41
     });
41
-    this.initSessionData();
42
-    this.getQueryParams();
43
-		this.getDeparts();
44
-    this.search();
45 42
   }
46 43
 
47 44
   ngAfterViewInit(){
45
+    this.initSessionData();
46
+    this.getQueryParams();
47
+    this.getDeparts();
48
+    setTimeout(() => {
49
+      this.search();
50
+    }, 0)
48 51
     this.onResize();
49 52
   }
50 53
 
@@ -62,6 +65,7 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
62 65
     this.tabService.clearQueryParams();
63 66
     if(queryParams.dateRange){
64 67
       this.dateRange = queryParams.dateRange;
68
+      this.customChangeDateComponent.initByDate(this.dateRange);
65 69
     }
66 70
   }
67 71
 
@@ -123,8 +127,8 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
123 127
 			showParentDept: this.parent==1 ? 'true' : undefined,
124 128
 			deptId: this.deptId || undefined,
125 129
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
126
-      startDate: this.dateRange[0] || undefined,
127
-      endDate: this.dateRange[1] || undefined,
130
+      startDate: this.customChangeDateComponent.startDate || undefined,
131
+      endDate: this.customChangeDateComponent.endDate || undefined,
128 132
       hosId: this.getHosId,
129 133
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
130 134
       userId: this.fieldConfig.fields.userId || undefined,
@@ -162,19 +166,7 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
162 166
   }
163 167
 
164 168
   // 日期选择
165
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
166
-  changeDate(result?): void {
167
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
168
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
169
-    this.dateRange = result;
170
-  }
171
-
172
-  onCalendarChangeDate(dateArr){
173
-    console.log(dateArr)
174
-    if(dateArr.length == 2){
175
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
176
-    }
177
-  }
169
+  dateRange: any = [];
178 170
 
179 171
   // 导出
180 172
   excelExportLoading:any = false;
@@ -186,8 +178,8 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
186 178
 			showParentDept: this.parent==1 ? 'true' : undefined,
187 179
 			deptId: this.deptId || undefined,
188 180
 			buildingId: this.fieldConfig.fields.buildingId || undefined,
189
-      startDate: this.dateRange[0] || undefined,
190
-      endDate: this.dateRange[1] || undefined,
181
+      startDate: this.customChangeDateComponent.startDate || undefined,
182
+      endDate: this.customChangeDateComponent.endDate || undefined,
191 183
       hosId: this.getHosId,
192 184
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
193 185
       userId: this.fieldConfig.fields.userId || undefined,
@@ -225,9 +217,10 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
225 217
     this.sortCurrentKey = "";
226 218
 		this.sortCurrentValue = "";
227 219
 		this.sortCurrent = {};
228
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
220
+    this.dateRange = []
229 221
 		this.deptId = undefined;
230 222
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, statisticsTypeId: undefined, taskTypeId: undefined, buildingId: undefined};
223
+    this.customChangeDateComponent.resetByDate();
231 224
     this.search();
232 225
   }
233 226
 
@@ -235,12 +228,12 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
235 228
   changeBuildingInp(e) {
236 229
     this.searchTimer(this.getBuildingList, e);
237 230
   }
238
-	
231
+
239 232
 	// 科室搜索
240 233
 	changeInp(e) {
241 234
 	  this.searchTimer(this.getDeparts, e);
242 235
 	}
243
-	
236
+
244 237
 	// 获取所有科室
245 238
 	alldepart:any;
246 239
 	getDeparts(dept?) {
@@ -260,7 +253,7 @@ export class DistributionDepartmentSourceStatisticsComponent implements OnInit,
260 253
 	      this.alldepart = data.list;
261 254
 	    });
262 255
 	}
263
-	
256
+
264 257
   // 防抖
265 258
   isLoading = false;
266 259
   searchTimer(fun, e) {

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-department-source-statistics/distribution-department-source-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { DistributionDepartmentSourceStatisticsRoutingModule } from './distribution-department-source-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     DistributionDepartmentSourceStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class DistributionDepartmentSourceStatisticsModule { }

+ 27 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics-routing.module.ts

@@ -107,6 +107,33 @@ const routes: Routes = [
107 107
 			    title: '配-业务分类统计'
108 108
 			  }
109 109
 			},
110
+			{
111
+			  // 任务类型质控统计
112
+			  path: 'taskTypeQualityControlStatistics',
113
+			  loadChildren: () => import('./taskType-quality-control-statistics/taskType-quality-control-statistics.module').then(m => m.TaskTypeQualityControlStatisticsModule),
114
+			  data: {
115
+			    reuse: true,
116
+			    title: '配-任务类型质控统计'
117
+			  }
118
+			},
119
+			{
120
+			  // 人员评价统计
121
+			  path: 'distributionUserEvaluateStatistics',
122
+			  loadChildren: () => import('./distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.module').then(m => m.DistributionUserEvaluateStatisticsModule),
123
+			  data: {
124
+			    reuse: true,
125
+			    title: '配-人员评价统计'
126
+			  }
127
+			},
128
+      {
129
+			  // 24小时质控统计
130
+			  path: 'hourQualityControlStatistics',
131
+			  loadChildren: () => import('./hour-quality-control-statistics/hour-quality-control-statistics.module').then(m => m.HourQualityControlStatisticsModule),
132
+			  data: {
133
+			    reuse: true,
134
+			    title: '配-24小时质控统计'
135
+			  }
136
+			},
110 137
     ]
111 138
   }
112 139
 ];

+ 154 - 156
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.html

@@ -1,170 +1,168 @@
1
-<div class="synthesize-box" *ngIf="!isLoading">
1
+<div class="synthesize-box">
2 2
 	<div class="searchDataWrap">
3 3
 		<div class="searchData">
4
-			<div class="searchDataItem">
5
-				<span class="label">选择日期</span>:
6
-				<nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
7
-				</nz-range-picker>
8
-			</div>
4
+			<app-custom-change-date #customChangeDate [isShowType]="true" name="选择日期"></app-custom-change-date>
9 5
 		</div>
10 6
 		<div class="operation">
11 7
 			<button nz-button class="btn default" (click)="search()">搜索</button>
12 8
 			<button nz-button class="btn default ml8" (click)="reset()">重置</button>
13 9
 		</div>
14 10
 	</div>
15
-	<div class="top1-statistics">
16
-		<div class="top-list">
17
-			<div class="special-box">
18
-				<div class="num">{{workData.totalCount || 0}}</div>
19
-				<div class="describe">工单总数</div>
20
-			</div>
21
-			<div class="special-box-right">
22
-				<div class="sign-describe">已完成: <span class="sign-num">{{workData.doneCount || 0}}</span></div>
23
-				<div class="sign-describe">待接单: <span class="sign-num">{{workData.waitCount || 0}}</span></div>
24
-				<div class="sign-describe">处理中: <span class="sign-num">{{workData.doingCount || 0}}</span></div>
25
-			</div>
26
-			<div class="border"></div>
27
-		</div>
28
-		<div class="top-list">
29
-			<div class="special-box">
30
-				<div class="num">{{workData.workerCount || 0}}</div>
31
-				<div class="describe">总人数</div>
32
-			</div>
33
-			<div class="border"></div>
34
-		</div>
35
-		<div class="top-list">
36
-			<div class="special-box">
37
-				<div class="num">{{workData.totalGrade || 0}}</div>
38
-				<div class="describe">总积分</div>
39
-			</div>
40
-			<div class="border"></div>
41
-		</div>
42
-		<div class="top-list">
43
-			<div class="special-box">
44
-				<div class="num">{{workData.badCount || 0}}</div>
45
-				<div class="describe">差评单数</div>
46
-			</div>
47
-			<div class="border"></div>
48
-		</div>
49
-		<div class="top-list">
50
-			<div class="special-box">
51
-				<div class="num">{{workData.doneRate || 0}}%</div>
52
-				<div class="describe">按时完成率</div>
53
-			</div>
54
-		</div>
55
-	</div>
56
-<!--  <div class="top0-statistics">
57
-    <div>标本<span class="num">{{businessData.specimenCount || 0}}</span></div>
58
-    <div>病理<span class="num">{{businessData.pathologyCount || 0}}</span></div>
59
-    <div>陪检<span class="num">{{businessData.inspectCount || 0}}</span></div>
60
-    <div>药品<span class="num">{{businessData.drugsCount || 0}}</span></div>
61
-    <div>静配<span class="num">{{businessData.drugsJpCount || 0}}</span></div>
62
-    <div>中药<span class="num">{{businessData.drugsHerbalCount || 0}}</span></div>
63
-    <div>血制品<span class="num">{{businessData.bloodCount || 0}}</span></div>
64
-  </div> -->
65
-	<div class="top2-statistics">
66
-    <div class="statistics width-60 mar-right-8">
67
-			<div class="statistics-box">
68
-				<div class="sign-green"></div>
69
-				<div class="statistics-title">业务分类top5</div>
70
-				<div class="more" *ngIf="showMore('businessClassifyStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/businessClassifyStatistics')">更多></div>
71
-			</div>
72
-			<div class="echarts-repairs">
73
-				<div echarts class="echarts" [options]='businessOptions'></div>
74
-			</div>
75
-		</div>
76
-		<div class="statistics width-40">
77
-			<div class="statistics-box">
78
-				<div class="sign-green"></div>
79
-				<div class="statistics-title">申请来源</div>
80
-				<div class="more" *ngIf="showMore('sourceStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/sourceStatistics')">更多></div>
81
-			</div>
82
-			<div class="echarts-repairs">
83
-			  <div echarts class="echarts" [options]='applyOptions'></div>
84
-			</div>
85
-		</div>
86
-	</div>
87
-  <div class="top2-statistics">
88
-		<div class="statistics width-49 mar-right-8">
89
-			<div class="statistics-box">
90
-				<div class="sign-green"></div>
91
-				<div class="statistics-title">科室Top5</div>
92
-				<div class="more" *ngIf="showMore('departmentQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/departmentQualityControlStatistics')">更多></div>
93
-			</div>
94
-			<div class="table">
95
-				<div class="td">
96
-					<div class="table-td-4">排名</div>
97
-					<div class="table-td-4">科室名称</div>
98
-					<div class="table-td-4">工单量</div>
99
-					<div class="table-td-4">好评率</div>
100
-				</div>
101
-				<div class="th" *ngFor="let item of deptTopData; let index = index;">
102
-          <div class="table-list-4">
103
-						<img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
104
-						<img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
105
-						<img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
106
-						<span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
107
-					</div>
108
-					<div class="table-list-4 ellipsis-oneline" title="{{item.dept}}">{{item.dept}}</div>
109
-					<div class="table-list-4">{{item.sum || 0}}</div>
110
-					<div class="table-list-4">{{item.goodRate || '0%'}}</div>
111
-				</div>
112
-			</div>
113
-		</div>
114
-		<div class="statistics width-50">
115
-			<div class="statistics-box">
116
-				<div class="sign-green"></div>
117
-				<div class="statistics-title">人员Top5</div>
118
-				<div class="more" *ngIf="showMore('userQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/userQualityControlStatistics')">更多></div>
119
-			</div>
120
-			<div class="table">
121
-				<div class="td">
122
-					<div class="table-td-4">排名</div>
123
-					<div class="table-td-4">人员名称</div>
124
-					<div class="table-td-4">工单量</div>
125
-					<div class="table-td-4">积分总数</div>
126
-				</div>
127
-				<div class="th" *ngFor="let item of userTopData; let index = index;">
128
-					<div class="table-list-4">
129
-						<img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
130
-						<img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
131
-						<img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
132
-						<span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
133
-					</div>
134
-					<div class="table-list-4 ellipsis-oneline" title="{{item.userName}}({{item.userAccount}})">{{item.userName}}<ng-container *ngIf="item.userAccount">({{item.userAccount}})</ng-container></div>
135
-					<div class="table-list-4">{{item.sum || 0}}</div>
136
-					<div class="table-list-4">{{item.totalGrade || 0}}</div>
137
-				</div>
138
-			</div>
139
-		</div>
140
-	</div>
141
-  <div class="top2-statistics">
142
-    <div class="statistics width-100">
143
-      <div class="statistics-box">
144
-        <div class="sign-green"></div>
145
-        <div class="statistics-title">日趋势图</div>
146
-        <div class="statistics-select">
147
-					<div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'day'}" (click)="selectCheck('day')">日</div>
148
-					<div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'hour'}" (click)="selectCheck('hour')">时</div>
149
-				</div>
150
-        <div class="searchDataItem ml8">
151
-          <span class="label">统计分类</span>:
152
-          <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (ngModelChange)="changeStatisticsType($event)">
153
-            <ng-container *ngFor="let option of statisticsTypeList">
154
-              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
155
-            </ng-container>
156
-            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
157
-              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
158
-            </nz-option>
159
-          </nz-select>
160
-        </div>
161
-        <div class="more" *ngIf="showMore('dateQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/dateQualityControlStatistics')">更多></div>
11
+  <ng-container *ngIf="!isLoading">
12
+    <div class="top1-statistics">
13
+      <div class="top-list">
14
+        <div class="special-box">
15
+          <div class="num">{{workData.totalCount || 0}}</div>
16
+          <div class="describe">工单总数</div>
17
+        </div>
18
+        <div class="special-box-right">
19
+          <div class="sign-describe">已完成: <span class="sign-num">{{workData.doneCount || 0}}</span></div>
20
+          <div class="sign-describe">待接单: <span class="sign-num">{{workData.waitCount || 0}}</span></div>
21
+          <div class="sign-describe">处理中: <span class="sign-num">{{workData.doingCount || 0}}</span></div>
22
+        </div>
23
+        <div class="border"></div>
24
+      </div>
25
+      <div class="top-list">
26
+        <div class="special-box">
27
+          <div class="num">{{workData.workerCount || 0}}</div>
28
+          <div class="describe">总人数</div>
29
+        </div>
30
+        <div class="border"></div>
31
+      </div>
32
+      <div class="top-list">
33
+        <div class="special-box">
34
+          <div class="num">{{workData.totalGrade || 0}}</div>
35
+          <div class="describe">总积分</div>
36
+        </div>
37
+        <div class="border"></div>
38
+      </div>
39
+      <div class="top-list">
40
+        <div class="special-box">
41
+          <div class="num">{{workData.badCount || 0}}</div>
42
+          <div class="describe">差评单数</div>
43
+        </div>
44
+        <div class="border"></div>
162 45
       </div>
163
-      <div class="echarts-repairs">
164
-        <div echarts class="echarts" [options]='trendOptions'></div>
46
+      <div class="top-list">
47
+        <div class="special-box">
48
+          <div class="num">{{workData.doneRate || 0}}%</div>
49
+          <div class="describe">按时完成率</div>
50
+        </div>
51
+      </div>
52
+    </div>
53
+    <!--  <div class="top0-statistics">
54
+      <div>标本<span class="num">{{businessData.specimenCount || 0}}</span></div>
55
+      <div>病理<span class="num">{{businessData.pathologyCount || 0}}</span></div>
56
+      <div>陪检<span class="num">{{businessData.inspectCount || 0}}</span></div>
57
+      <div>药品<span class="num">{{businessData.drugsCount || 0}}</span></div>
58
+      <div>静配<span class="num">{{businessData.drugsJpCount || 0}}</span></div>
59
+      <div>中药<span class="num">{{businessData.drugsHerbalCount || 0}}</span></div>
60
+      <div>血制品<span class="num">{{businessData.bloodCount || 0}}</span></div>
61
+    </div> -->
62
+    <div class="top2-statistics">
63
+      <div class="statistics width-60 mar-right-8">
64
+        <div class="statistics-box">
65
+          <div class="sign-green"></div>
66
+          <div class="statistics-title">业务分类top5</div>
67
+          <div class="more" *ngIf="showMore('businessClassifyStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/businessClassifyStatistics')">更多></div>
68
+        </div>
69
+        <div class="echarts-repairs">
70
+          <div echarts class="echarts" [options]='businessOptions'></div>
71
+        </div>
72
+      </div>
73
+      <div class="statistics width-40">
74
+        <div class="statistics-box">
75
+          <div class="sign-green"></div>
76
+          <div class="statistics-title">申请来源</div>
77
+          <div class="more" *ngIf="showMore('sourceStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/sourceStatistics')">更多></div>
78
+        </div>
79
+        <div class="echarts-repairs">
80
+          <div echarts class="echarts" [options]='applyOptions'></div>
81
+        </div>
82
+      </div>
83
+    </div>
84
+    <div class="top2-statistics">
85
+      <div class="statistics width-49 mar-right-8">
86
+        <div class="statistics-box">
87
+          <div class="sign-green"></div>
88
+          <div class="statistics-title">科室Top5</div>
89
+          <div class="more" *ngIf="showMore('departmentQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/departmentQualityControlStatistics')">更多></div>
90
+        </div>
91
+        <div class="table">
92
+          <div class="td">
93
+            <div class="table-td-4">排名</div>
94
+            <div class="table-td-4">科室名称</div>
95
+            <div class="table-td-4">工单量</div>
96
+            <div class="table-td-4">好评率</div>
97
+          </div>
98
+          <div class="th" *ngFor="let item of deptTopData; let index = index;">
99
+            <div class="table-list-4">
100
+              <img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
101
+              <img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
102
+              <img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
103
+              <span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
104
+            </div>
105
+            <div class="table-list-4 ellipsis-oneline" title="{{item.dept}}">{{item.dept}}</div>
106
+            <div class="table-list-4">{{item.sum || 0}}</div>
107
+            <div class="table-list-4">{{item.goodRate || '0%'}}</div>
108
+          </div>
109
+        </div>
110
+      </div>
111
+      <div class="statistics width-50">
112
+        <div class="statistics-box">
113
+          <div class="sign-green"></div>
114
+          <div class="statistics-title">人员Top5</div>
115
+          <div class="more" *ngIf="showMore('userQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/userQualityControlStatistics')">更多></div>
116
+        </div>
117
+        <div class="table">
118
+          <div class="td">
119
+            <div class="table-td-4">排名</div>
120
+            <div class="table-td-4">人员名称</div>
121
+            <div class="table-td-4">工单量</div>
122
+            <div class="table-td-4">积分总数</div>
123
+          </div>
124
+          <div class="th" *ngFor="let item of userTopData; let index = index;">
125
+            <div class="table-list-4">
126
+              <img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
127
+              <img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
128
+              <img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
129
+              <span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
130
+            </div>
131
+            <div class="table-list-4 ellipsis-oneline" title="{{item.userName}}({{item.userAccount}})">{{item.userName}}<ng-container *ngIf="item.userAccount">({{item.userAccount}})</ng-container></div>
132
+            <div class="table-list-4">{{item.sum || 0}}</div>
133
+            <div class="table-list-4">{{item.totalGrade || 0}}</div>
134
+          </div>
135
+        </div>
136
+      </div>
137
+    </div>
138
+    <div class="top2-statistics">
139
+      <div class="statistics width-100">
140
+        <div class="statistics-box">
141
+          <div class="sign-green"></div>
142
+          <div class="statistics-title">日趋势图</div>
143
+          <div class="statistics-select">
144
+            <div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'day'}" (click)="selectCheck('day')">日</div>
145
+            <div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'hour'}" (click)="selectCheck('hour')">时</div>
146
+          </div>
147
+          <div class="searchDataItem ml8">
148
+            <span class="label">统计分类</span>:
149
+            <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (ngModelChange)="changeStatisticsType($event)">
150
+              <ng-container *ngFor="let option of statisticsTypeList">
151
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
152
+              </ng-container>
153
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
154
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
155
+              </nz-option>
156
+            </nz-select>
157
+          </div>
158
+          <div class="more" *ngIf="showMore(activeIndex == 'hour' ? 'hourQualityControlStatistics' : 'dateQualityControlStatistics')" (click)="toPath(activeIndex == 'hour' ? '/newStatistics/distributionInspectionStatistics/hourQualityControlStatistics' : '/newStatistics/distributionInspectionStatistics/dateQualityControlStatistics')">更多></div>
159
+        </div>
160
+        <div class="echarts-repairs">
161
+          <div echarts class="echarts" [options]='trendOptions'></div>
162
+        </div>
165 163
       </div>
166 164
     </div>
167
-  </div>
165
+  </ng-container>
168 166
 </div>
169 167
 <div class="mask-style" *ngIf="isLoading">
170 168
 	<nz-spin nzSimple class="spin-style"></nz-spin>

+ 4 - 1
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.less

@@ -23,6 +23,9 @@
23 23
 		      .label{
24 24
 		        font-size: 16px;
25 25
 		      }
26
+          .selectItem{
27
+            width: 160px;
28
+          }
26 29
 		    }
27 30
 		  }
28 31
 		}
@@ -144,7 +147,7 @@
144 147
 					}
145 148
           .searchDataItem{
146 149
             .selectItem{
147
-              width: 224px;
150
+              width: 160px;
148 151
             }
149 152
           }
150 153
 					.more{

+ 30 - 42
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.ts

@@ -1,14 +1,15 @@
1 1
 import { Router } from '@angular/router';
2
-import { format, addMonths, startOfMonth, endOfMonth } from 'date-fns';
3
-import { Component, OnInit } from "@angular/core";
2
+import { Component, OnInit, ViewChild, AfterViewInit } from "@angular/core";
4 3
 import { MainService } from 'src/app/services/main.service';
5 4
 import { TabService } from '../../services/tab.service';
5
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
6 6
 @Component({
7 7
   selector: "app-distribution-synthesize-statistics",
8 8
   templateUrl: "./distribution-synthesize-statistics.component.html",
9 9
   styleUrls: ["./distribution-synthesize-statistics.component.less"],
10 10
 })
11
-export class DistributionSynthesizeStatisticsComponent implements OnInit {
11
+export class DistributionSynthesizeStatisticsComponent implements OnInit, AfterViewInit {
12
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
12 13
   constructor(
13 14
     private mainService: MainService,
14 15
     private tabService: TabService,
@@ -60,8 +61,12 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
60 61
 			name:'王'
61 62
 		}
62 63
 	] //人员top5
63
-  ngOnInit() {
64
-    this.search();
64
+  ngOnInit() {}
65
+
66
+  ngAfterViewInit(){
67
+    setTimeout(() => {
68
+      this.search();
69
+    }, 0)
65 70
   }
66 71
 
67 72
 	// 维修处理类型切换
@@ -73,8 +78,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
73 78
 	// 申请来源
74 79
 	applyChart() {
75 80
 		let postData:any = {
76
-	    startDate: this.dateRange[0],
77
-	    endDate: this.dateRange[1],
81
+	    startDate: this.customChangeDateComponent.startDate || undefined,
82
+      endDate: this.customChangeDateComponent.endDate || undefined,
78 83
 			type: 'sourceCount',
79 84
 	    hosId: this.getHosId,
80 85
 	    businessType: 'hsms',
@@ -148,8 +153,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
148 153
 	// 日趋势图
149 154
 	trendChart(){
150 155
 		let postData:any = {
151
-	    startDate: this.dateRange[0],
152
-	    endDate: this.dateRange[1],
156
+	    startDate: this.customChangeDateComponent.startDate || undefined,
157
+      endDate: this.customChangeDateComponent.endDate || undefined,
153 158
 			type: 'dateTimeTrend',
154 159
 	    hosId: this.getHosId,
155 160
 	    businessType: 'hsms',
@@ -234,8 +239,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
234 239
   // 业务分类
235 240
 	businessChart(){
236 241
     let postData:any = {
237
-	    startDate: this.dateRange[0],
238
-	    endDate: this.dateRange[1],
242
+	    startDate: this.customChangeDateComponent.startDate || undefined,
243
+      endDate: this.customChangeDateComponent.endDate || undefined,
239 244
 			type: 'statisticsDateTypeTop5',
240 245
 	    hosId: this.getHosId,
241 246
 	    businessType: 'hsms',
@@ -316,8 +321,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
316 321
 	// 科室Top5
317 322
 	getDeptTopData() {
318 323
 	  let postData:any = {
319
-	    startDate: this.dateRange[0],
320
-	    endDate: this.dateRange[1],
324
+	    startDate: this.customChangeDateComponent.startDate || undefined,
325
+      endDate: this.customChangeDateComponent.endDate || undefined,
321 326
 			type: 'deptTop5',
322 327
 	    hosId: this.getHosId,
323 328
 	    businessType: 'hsms',
@@ -332,8 +337,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
332 337
 	// 人员Top5
333 338
 	getUserTopData() {
334 339
 	  let postData:any = {
335
-	    startDate: this.dateRange[0],
336
-	    endDate: this.dateRange[1],
340
+	    startDate: this.customChangeDateComponent.startDate || undefined,
341
+      endDate: this.customChangeDateComponent.endDate || undefined,
337 342
 			type: 'userTop5',
338 343
 	    hosId: this.getHosId,
339 344
 	    businessType: 'hsms',
@@ -350,7 +355,7 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
350 355
 	toPath(path){
351 356
     let flag = this.tabService.tabs.some(v => v.path === path);
352 357
     flag && this.tabService.deleteRouteSnapshot(path);
353
-    this.tabService.setQueryParams('dateRange', this.dateRange);
358
+    this.tabService.setQueryParams('dateRange', [this.customChangeDateComponent.startDate, this.customChangeDateComponent.endDate]);
354 359
     this.router.navigate([path], { replaceUrl: true });
355 360
 	}
356 361
 
@@ -418,8 +423,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
418 423
     let postData:any = {
419 424
       idx: this.pageIndex - 1,
420 425
       sum: this.pageSize,
421
-      startDate: this.dateRange[0],
422
-      endDate: this.dateRange[1],
426
+      startDate: this.customChangeDateComponent.startDate || undefined,
427
+      endDate: this.customChangeDateComponent.endDate || undefined,
423 428
       hosId: this.hosId,
424 429
       dutyId: this.dutyId,
425 430
       parentDutyId: this.parentDutyId,
@@ -437,8 +442,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
437 442
 	// 头部工单数据
438 443
 	getWorkData() {
439 444
 	  let postData:any = {
440
-	    startDate: this.dateRange[0],
441
-	    endDate: this.dateRange[1],
445
+	    startDate: this.customChangeDateComponent.startDate || undefined,
446
+      endDate: this.customChangeDateComponent.endDate || undefined,
442 447
 			type: 'headerCount',
443 448
 	    hosId: this.getHosId,
444 449
 	    businessType: 'hsms',
@@ -453,8 +458,8 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
453 458
   // 头部业务数据
454 459
 	getBusinessData() {
455 460
 	  let postData:any = {
456
-	    startDate: this.dateRange[0],
457
-	    endDate: this.dateRange[1],
461
+	    startDate: this.customChangeDateComponent.startDate || undefined,
462
+      endDate: this.customChangeDateComponent.endDate || undefined,
458 463
 			type: 'businessCount',
459 464
 	    hosId: this.getHosId,
460 465
 	    businessType: 'hsms',
@@ -468,8 +473,9 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
468 473
 
469 474
 	// 重置
470 475
 	reset(){
471
-		this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
476
+		this.dateRange = [];
472 477
 		this.activeIndex = 'day';
478
+    this.customChangeDateComponent.resetByDate();
473 479
 		this.search();
474 480
 	}
475 481
 
@@ -479,25 +485,7 @@ export class DistributionSynthesizeStatisticsComponent implements OnInit {
479 485
   }
480 486
 
481 487
   // 日期选择 日
482
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]; //发起时间区间 天
483
-  changeDate(result?): void {
484
-    result[0] = format(result[0], 'yyyy-MM-dd') + ' ' + '00:00:00';
485
-    result[1] = format(result[1], 'yyyy-MM-dd') + ' ' + '23:59:59';
486
-    this.dateRange = result;
487
-    // this.search();
488
-		console.log(this.dateRange);
489
-  }
490
-
491
-  onCalendarChangeDate(dateArr){
492
-    // console.log(dateArr)
493
-    // if(dateArr.length == 2){
494
-    //   let dateStart = new Date(dateArr[0]);
495
-    //   let dateEnd = new Date(dateArr[1]);
496
-    //   dateStart.setHours(0,0,0);
497
-    //   dateEnd.setHours(23,59,59);
498
-    //   this.dateRange = [dateStart,dateEnd];
499
-    // }
500
-  }
488
+  dateRange: any = []; //发起时间区间 天
501 489
 
502 490
   // 获取统计分类列表
503 491
   statisticsTypeList:any[] = [];

+ 3 - 1
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.module.ts

@@ -6,6 +6,7 @@ import { DistributionSynthesizeStatisticsRoutingModule } from './distribution-sy
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8 8
 import { NgxEchartsModule } from 'ngx-echarts';
9
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9 10
 
10 11
 
11 12
 @NgModule({
@@ -17,7 +18,8 @@ import { NgxEchartsModule } from 'ngx-echarts';
17 18
     DistributionSynthesizeStatisticsRoutingModule,
18 19
     ShareModule,
19 20
     VirtualScrollerModule,
20
-		NgxEchartsModule
21
+		NgxEchartsModule,
22
+    CustomChangeDateModule,
21 23
   ]
22 24
 })
23 25
 export class DistributionSynthesizeStatisticsModule { }

+ 14 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DistributionUserEvaluateStatisticsComponent } from './distribution-user-evaluate-statistics.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: DistributionUserEvaluateStatisticsComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class DistributionUserEvaluateStatisticsRoutingModule { }

+ 79 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.html

@@ -0,0 +1,79 @@
1
+<div class="searchDataWrap">
2
+  <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
4
+    <div class="searchDataItem">
5
+      <span class="label">人员</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" nzAllowClear nzPlaceHolder="请选择人员" [(ngModel)]="userId" (nzOpenChange)="openChangeUser($event)">
7
+        <ng-container *ngFor="let option of userList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
9
+        </ng-container>
10
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
12
+        </nz-option>
13
+      </nz-select>
14
+    </div>
15
+  </div>
16
+  <div class="operation">
17
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
18
+    <button nz-button class="btn default" (click)="search()">查询</button>
19
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
20
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
21
+  </div>
22
+</div>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.deptDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.statisticsTypeDTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
25
+  <span>{{fieldConfig.fields.statisticsTypeDTO?.name}}</span>
26
+  <span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
27
+	<span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
28
+  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
29
+</div>
30
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
31
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
32
+    <tr>
33
+      <th nzWidth="12%">人员(编码)</th>
34
+      <th nzWidth="11%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
35
+      <th nzWidth="11%" nzShowSort nzSortKey="evaCount" [(nzSort)]="sortCurrent.evaCount">评价总工单数</th>
36
+      <th nzWidth="11%" nzShowSort nzSortKey="eva1" [(nzSort)]="sortCurrent.eva1">一星评价数</th>
37
+      <th nzWidth="11%" nzShowSort nzSortKey="eva2" [(nzSort)]="sortCurrent.eva2">二星评价数</th>
38
+      <th nzWidth="11%" nzShowSort nzSortKey="eva3" [(nzSort)]="sortCurrent.eva3">三星评价数</th>
39
+      <th nzWidth="11%" nzShowSort nzSortKey="eva4" [(nzSort)]="sortCurrent.eva4">四星评价数</th>
40
+      <th nzWidth="11%" nzShowSort nzSortKey="eva5" [(nzSort)]="sortCurrent.eva5">五星评价数</th>
41
+      <th nzWidth="11%" nzShowSort nzSortKey="avgCount" [(nzSort)]="sortCurrent.avgCount">平均总星级</th>
42
+    </tr>
43
+  </thead>
44
+  <tbody>
45
+    <tr *ngFor="let data of listOfData">
46
+      <td>{{ data.userName }}<ng-container *ngIf="data.userAccount">({{ data.userAccount }})</ng-container></td>
47
+      <td>{{ data.totalCount }}</td>
48
+      <td>{{ data.evaCount }}</td>
49
+      <td>{{ data.eva1 }}</td>
50
+      <td>{{ data.eva2 }}</td>
51
+      <td>{{ data.eva3 }}</td>
52
+      <td>{{ data.eva4 }}</td>
53
+      <td>{{ data.eva5 }}</td>
54
+      <td>{{ data.avgCount }}</td>
55
+    </tr>
56
+  </tbody>
57
+  <ng-template #footerTpl>
58
+    <table class="footTable">
59
+      <tr *ngFor="let data of listOfDataEnd">
60
+        <td style="width: 12%">{{ data.userName }}</td>
61
+        <td style="width: 11%">{{ data.totalCount }}</td>
62
+        <td style="width: 11%">{{ data.evaCount }}</td>
63
+        <td style="width: 11%">{{ data.eva1 }}</td>
64
+        <td style="width: 11%">{{ data.eva2 }}</td>
65
+        <td style="width: 11%">{{ data.eva3 }}</td>
66
+        <td style="width: 11%">{{ data.eva4 }}</td>
67
+        <td style="width: 11%">{{ data.eva5 }}</td>
68
+        <td style="width: 11%">{{ data.avgCount }}</td>
69
+      </tr>
70
+    </table>
71
+  </ng-template>
72
+</nz-table>
73
+<div class="pagination">
74
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
75
+  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
76
+</div>
77
+
78
+<!-- 详细搜索 -->
79
+<app-distribution-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-distribution-search-more>

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/work-hour-statistics/work-hour-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 278 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.ts

@@ -0,0 +1,278 @@
1
+import { TabService } from './../../services/tab.service';
2
+import { debounceTime } from 'rxjs/operators';
3
+import { Subject } from 'rxjs';
4
+import { NzMessageService } from 'ng-zorro-antd/message';
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
6
+import { MainService } from 'src/app/services/main.service';
7
+import { ActivatedRoute } from '@angular/router';
8
+import { ToolService } from "../../../../services/tool.service";
9
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10
+@Component({
11
+  selector: "app-distribution-user-evaluate-statistics",
12
+  templateUrl: "./distribution-user-evaluate-statistics.component.html",
13
+  styleUrls: ["./distribution-user-evaluate-statistics.component.less"],
14
+})
15
+export class DistributionUserEvaluateStatisticsComponent implements OnInit, AfterViewInit {
16
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
17
+  constructor(
18
+    private mainService: MainService,
19
+    private message: NzMessageService,
20
+    private route: ActivatedRoute,
21
+    private tabService: TabService,
22
+		private tool: ToolService,
23
+  ) {}
24
+
25
+  listOfData: any[] = []; //表格数据
26
+  listOfDataEnd: any[] = []; //表格合计
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 30; //表格每页展示条数
29
+  listLength: number = 0; //表格总数据量
30
+
31
+  userId;//人员id
32
+
33
+  searchTimerSubject = new Subject();
34
+
35
+  ngOnInit() {
36
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
37
+      let fun = v[0];
38
+      fun.call(this, v[1]);
39
+    });
40
+  }
41
+
42
+  ngAfterViewInit(){
43
+    this.initSessionData();
44
+    this.getQueryParams();
45
+    setTimeout(() => {
46
+      this.search();
47
+    }, 0)
48
+    this.onResize();
49
+  }
50
+
51
+  tableHeight:number = 0;
52
+  @HostListener('window:resize')
53
+  onResize(): void {
54
+    setTimeout(() => {
55
+      this.tableHeight = window.innerHeight - (document.querySelector('.searchDataWrap') as HTMLElement).offsetHeight - 64 - 36 - 48 - 8 - (document.querySelector('.ant-table-header') as HTMLElement).offsetHeight - 55 - this.getMoreFilter + 14;
56
+
57
+    }, 0)
58
+  }
59
+
60
+  getQueryParams(){
61
+    let queryParams = this.tabService.getQueryParams();
62
+    this.tabService.clearQueryParams();
63
+    if(queryParams.dateRange){
64
+      this.dateRange = queryParams.dateRange;
65
+      this.customChangeDateComponent.initByDate(this.dateRange);
66
+    }
67
+  }
68
+
69
+  get getMoreFilter(){
70
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.deptDTO;
71
+    return flag ? 37 : 0;
72
+  }
73
+
74
+  // 初始化缓存数据
75
+  queryType:any;
76
+  hosId:any;
77
+  dutyId:any;
78
+  parentDutyId:any;
79
+  initSessionData(){
80
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
81
+    let queryType:any = newStatistics.queryType;
82
+    let hosId:any = newStatistics.hospitalId;
83
+    let dutyId:any = newStatistics.dutyId;
84
+
85
+    queryType = queryType ? +queryType : undefined;
86
+    hosId = hosId ? +hosId : undefined;
87
+    dutyId = dutyId ? +dutyId : undefined;
88
+
89
+    this.queryType = queryType;
90
+    if(queryType == 1){
91
+      this.hosId = undefined;
92
+      this.dutyId = undefined;
93
+      this.parentDutyId = undefined;
94
+    }else if(queryType == 2){
95
+      this.hosId = hosId;
96
+      this.dutyId = undefined;
97
+      this.parentDutyId = undefined;
98
+    }else if(queryType == 3){
99
+      this.hosId = undefined;
100
+      this.dutyId = dutyId;
101
+      this.parentDutyId = undefined;
102
+    }else if(queryType == 4){
103
+      this.hosId = undefined;
104
+      this.dutyId = undefined;
105
+      this.parentDutyId = dutyId;
106
+    }
107
+  }
108
+
109
+  get getHosId(){
110
+    return this.parentDutyId || this.dutyId || this.hosId;
111
+  }
112
+
113
+  // 表格数据
114
+  loading1 = false;
115
+  getList(num?: number, field?: string, sort?: string) {
116
+    if (num !== undefined) {
117
+      this.pageIndex = num;
118
+    }
119
+    let postData:any = {
120
+      idx: this.pageIndex - 1,
121
+      sum: this.pageSize,
122
+			userId: this.userId || undefined,
123
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
124
+      startDate: this.customChangeDateComponent.startDate || undefined,
125
+      endDate: this.customChangeDateComponent.endDate || undefined,
126
+      hosId: this.getHosId,
127
+      groupId: this.fieldConfig.fields.groupId || undefined,
128
+      deptId: this.fieldConfig.fields.deptId || undefined,
129
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
130
+      statisticsTypeId: this.fieldConfig.fields.statisticsTypeId || undefined,
131
+    };
132
+    if (field && sort) {
133
+      postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
134
+    }
135
+    this.loading1 = true;
136
+    this.mainService
137
+      .postCustom("itsm/report", "userDegreeTransOrder", postData)
138
+      .subscribe((result) => {
139
+        this.loading1 = false;
140
+        this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
141
+        this.listOfDataEnd = result.dataList.filter((v, i) => { return i == result.dataList.length - 1 });
142
+        this.listLength = result.totalCount;
143
+      });
144
+  }
145
+
146
+  // 列表排序
147
+  sortCurrent:any = {};
148
+  sortCurrentKey: string = "";
149
+  sortCurrentValue: string | null = "";
150
+  sort(e) {
151
+    const { key, value } = e;
152
+    this.sortCurrentKey = key;
153
+    this.sortCurrentValue = value;
154
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
155
+  }
156
+
157
+  // 搜索
158
+  search() {
159
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
160
+  }
161
+
162
+  // 日期选择
163
+  dateRange: any = [];
164
+
165
+  // 导出
166
+  excelExportLoading:any = false;
167
+  excelExport(){
168
+    this.excelExportLoading = this.message.loading("导出中..", {
169
+      nzDuration: 0,
170
+    }).messageId;
171
+    let postData:any = {
172
+			userId: this.userId || undefined,
173
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
174
+      startDate: this.customChangeDateComponent.startDate || undefined,
175
+      endDate: this.customChangeDateComponent.endDate || undefined,
176
+      hosId: this.getHosId,
177
+      groupId: this.fieldConfig.fields.groupId || undefined,
178
+      deptId: this.fieldConfig.fields.deptId || undefined,
179
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
180
+      statisticsTypeId: this.fieldConfig.fields.statisticsTypeId || undefined,
181
+    };
182
+    if (this.sortCurrentKey && this.sortCurrentValue) {
183
+      postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
184
+    }
185
+    this.mainService
186
+      .postExportCustom("itsm/export", "userDegreeTransOrder", postData)
187
+      .subscribe((data) => {
188
+        this.message.remove(this.excelExportLoading);
189
+        this.excelExportLoading = false;
190
+        this.message.success('导出成功');
191
+        var file = new Blob([data], {
192
+          type: "application/vnd.ms-excel",
193
+        });
194
+        //trick to download store a file having its URL
195
+        var fileURL = URL.createObjectURL(file);
196
+        var a = document.createElement("a");
197
+        a.href = fileURL;
198
+        a.target = "_blank";
199
+        a.download = `${this.route.parent.routeConfig.data.title}.xls`;
200
+        document.body.appendChild(a);
201
+        a.click();
202
+      },(err) => {
203
+        this.message.remove(this.excelExportLoading);
204
+        this.excelExportLoading = false;
205
+        this.message.error('导出失败');
206
+      });
207
+  }
208
+  // 重置
209
+  reset(){
210
+    this.sortCurrentKey = "";
211
+		this.sortCurrentValue = "";
212
+		this.sortCurrent = {};
213
+    this.dateRange = []
214
+    this.userId = undefined;
215
+    this.fieldConfig.fields = {groupId: undefined, deptId: undefined, buildingId: undefined, taskTypeId: undefined, statisticsTypeId: undefined};
216
+    this.customChangeDateComponent.resetByDate();
217
+    this.search();
218
+  }
219
+
220
+  // 人员搜索
221
+  changeUserInp(e) {
222
+    this.searchTimer(this.getUserList, e);
223
+  }
224
+
225
+  // 防抖
226
+  isLoading = false;
227
+  searchTimer(fun, e) {
228
+    this.isLoading = true;
229
+    this.searchTimerSubject.next([fun, e]);
230
+  }
231
+
232
+  openChangeUser(flag){
233
+    flag && this.getUserList();
234
+  }
235
+
236
+  // 获取人员列表
237
+  userList:any[] = [];
238
+  getUserList(keyword?) {
239
+    let postData: any = {
240
+      idx: 0,
241
+      sum: 20,
242
+      user: {
243
+        name: keyword,
244
+        simpleQuery: true,
245
+        statisticalHosId: this.getHosId,
246
+      },
247
+    };
248
+    this.isLoading = true;
249
+    this.mainService
250
+      .getFetchDataList("simple/data", "user", postData)
251
+      .subscribe((data) => {
252
+        this.isLoading = false;
253
+        this.userList = data.list;
254
+      });
255
+  }
256
+
257
+  // 详细搜索
258
+  fieldConfig:any = {
259
+    fields: {groupId: undefined, deptId: undefined, buildingId: undefined, taskTypeId: undefined, statisticsTypeId: undefined},
260
+    config: {group: true, dept: true, building: true, taskType: true, statisticsType: true},
261
+  }
262
+  showSearchMore:boolean = false;
263
+  showMore(){
264
+    this.showSearchMore = true;
265
+  }
266
+
267
+  cancelEvent(){
268
+    this.showSearchMore = false;
269
+  }
270
+
271
+  submitEvent(fields){
272
+    this.showSearchMore = false;
273
+    this.fieldConfig.fields = fields;
274
+    console.log('this.fieldConfig.fields:', this.fieldConfig.fields)
275
+    this.search();
276
+    this.onResize();
277
+  }
278
+}

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { DistributionUserEvaluateStatisticsComponent } from './distribution-user-evaluate-statistics.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { DistributionUserEvaluateStatisticsRoutingModule } from './distribution-user-evaluate-statistics-routing.module';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    DistributionUserEvaluateStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    DistributionUserEvaluateStatisticsRoutingModule,
18
+    ShareModule,
19
+    DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
21
+  ]
22
+})
23
+export class DistributionUserEvaluateStatisticsModule { }

+ 14 - 0
src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { HourQualityControlStatisticsComponent } from './hour-quality-control-statistics.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: HourQualityControlStatisticsComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class HourQualityControlStatisticsRoutingModule { }

+ 85 - 0
src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.html

@@ -0,0 +1,85 @@
1
+<div class="searchDataWrap">
2
+  <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
4
+    <div class="searchDataItem">
5
+      <span class="label">统计分类</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType($event)">
7
+        <ng-container *ngFor="let option of statisticsTypeList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
9
+        </ng-container>
10
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
12
+        </nz-option>
13
+      </nz-select>
14
+    </div>
15
+  </div>
16
+  <div class="operation">
17
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
18
+    <button nz-button class="btn default" (click)="search()">查询</button>
19
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
20
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
21
+  </div>
22
+</div>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.deptDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.taskTypeDTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
25
+  <span>{{fieldConfig.fields.userDTO?.name}}</span>
26
+	<span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
27
+	<span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
28
+  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
29
+</div>
30
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
31
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
32
+    <tr>
33
+      <th nzWidth="10%" nzShowSort nzSortKey="date" [(nzSort)]="sortCurrent.date">时</th>
34
+      <th nzWidth="9%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
35
+      <th nzWidth="9%" nzShowSort nzSortKey="avgCount" [(nzSort)]="sortCurrent.avgCount">平均单量</th>
36
+      <th nzWidth="9%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
37
+			<th nzWidth="9%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
38
+			<th nzWidth="9%" nzShowSort nzSortKey="arrive_time_num" [(nzSort)]="sortCurrent.arrive_time_num">平均到达时间</th>
39
+      <th nzWidth="9%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
40
+      <th nzWidth="9%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时达标率</th>
41
+      <th nzWidth="9%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
42
+      <th nzWidth="9%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
43
+      <th nzWidth="9%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
44
+    </tr>
45
+  </thead>
46
+  <tbody>
47
+    <tr *ngFor="let data of listOfData">
48
+      <td>{{ data.date }}</td>
49
+      <td>{{ data.totalCount }}</td>
50
+      <td>{{ data.avgCount }}</td>
51
+      <td>{{ data.totalGrade }}</td>
52
+      <td>{{ data.response_time_num }}</td>
53
+      <td>{{ data.arrive_time_num }}</td>
54
+      <td>{{ data.execution_time_num }}</td>
55
+      <td>{{ data.aveper }}</td>
56
+      <td>{{ data.total_time }}</td>
57
+      <td>{{ data.five_count }}</td>
58
+      <td>{{ data.special_close }}</td>
59
+    </tr>
60
+  </tbody>
61
+  <ng-template #footerTpl>
62
+    <table class="footTable">
63
+      <tr *ngFor="let data of listOfDataEnd">
64
+        <td style="width: 10%">{{ data.date }}</td>
65
+        <td style="width: 9%">{{ data.totalCount }}</td>
66
+        <td style="width: 9%">{{ data.avgCount }}</td>
67
+        <td style="width: 9%">{{ data.totalGrade }}</td>
68
+        <td style="width: 9%">{{ data.response_time_num }}</td>
69
+        <td style="width: 9%">{{ data.arrive_time_num }}</td>
70
+        <td style="width: 9%">{{ data.execution_time_num }}</td>
71
+        <td style="width: 9%">{{ data.aveper }}</td>
72
+        <td style="width: 9%">{{ data.total_time }}</td>
73
+        <td style="width: 9%">{{ data.five_count }}</td>
74
+        <td style="width: 9%">{{ data.special_close }}</td>
75
+      </tr>
76
+    </table>
77
+  </ng-template>
78
+</nz-table>
79
+<div class="pagination">
80
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
81
+  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
82
+</div>
83
+
84
+<!-- 详细搜索 -->
85
+<app-distribution-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-distribution-search-more>

+ 71 - 0
src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.less

@@ -0,0 +1,71 @@
1
+@import "../../../../../../src/theme.less";
2
+:host{
3
+  position: absolute;
4
+  top: 0;
5
+  right: 0;
6
+  bottom: 0;
7
+  left: 0;
8
+  ::ng-deep .ant-table-footer{
9
+    padding: 16px 0;
10
+    width: calc(100% - 15px);
11
+    font-weight: bold;
12
+  }
13
+  tr, th{
14
+    text-align: center;
15
+  }
16
+  .searchDataWrap{
17
+    display: flex;
18
+    align-items: center;
19
+    justify-content: space-between;
20
+    .searchData{
21
+      padding: 16px;
22
+      display: flex;
23
+      align-items: center;
24
+      .searchDataItem{
25
+        margin-right: 24px;
26
+        .label{
27
+          font-size: 16px;
28
+        }
29
+        .selectItem{
30
+          width: 160px;
31
+        }
32
+      }
33
+    }
34
+    .operation{
35
+      margin-right: 16px;
36
+      display: flex;
37
+      align-items: center;
38
+      cursor: pointer;
39
+      .icon_transport{
40
+        margin-right: 16px;
41
+        font-size: 24px;
42
+      }
43
+      .btn{
44
+        &.default{
45
+          height: 32px;
46
+          line-height: 32px;
47
+          min-width: 70px;
48
+        }
49
+      }
50
+    }
51
+  }
52
+
53
+  .table{
54
+    margin: 0 8px;
55
+  }
56
+
57
+  .moreFilter{
58
+    margin-bottom: 16px;
59
+    span{
60
+      margin-left: 16px;
61
+      color: @primary-color;
62
+    }
63
+  }
64
+
65
+  .pagination{
66
+    padding: 16px;
67
+    display: flex;
68
+    justify-content: flex-end;
69
+    align-items: center;
70
+  }
71
+}

+ 252 - 0
src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.ts

@@ -0,0 +1,252 @@
1
+import { TabService } from './../../services/tab.service';
2
+import { NzMessageService } from 'ng-zorro-antd/message';
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
4
+import { MainService } from 'src/app/services/main.service';
5
+import { ActivatedRoute } from '@angular/router';
6
+import { ToolService } from "../../../../services/tool.service";
7
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
8
+@Component({
9
+  selector: "app-hour-quality-control-statistics",
10
+  templateUrl: "./hour-quality-control-statistics.component.html",
11
+  styleUrls: ["./hour-quality-control-statistics.component.less"],
12
+})
13
+export class HourQualityControlStatisticsComponent implements OnInit, AfterViewInit {
14
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15
+  constructor(
16
+    private mainService: MainService,
17
+    private message: NzMessageService,
18
+    private route: ActivatedRoute,
19
+    private tabService: TabService,
20
+		private tool: ToolService,
21
+  ) {}
22
+
23
+  listOfData: any[] = []; //表格数据
24
+  listOfDataEnd: any[] = []; //表格合计
25
+  pageIndex: number = 1; //表格当前页码
26
+  pageSize: number = 30; //表格每页展示条数
27
+  listLength: number = 0; //表格总数据量
28
+
29
+  statisticsTypeId;//统计分类id
30
+
31
+
32
+  ngOnInit() {}
33
+
34
+  ngAfterViewInit(){
35
+    this.initSessionData();
36
+    this.getQueryParams();
37
+    setTimeout(() => {
38
+      this.search();
39
+    }, 0)
40
+    this.onResize();
41
+  }
42
+
43
+  tableHeight:number = 0;
44
+  @HostListener('window:resize')
45
+  onResize(): void {
46
+    setTimeout(() => {
47
+      this.tableHeight = window.innerHeight - (document.querySelector('.searchDataWrap') as HTMLElement).offsetHeight - 64 - 36 - 48 - 8 - (document.querySelector('.ant-table-header') as HTMLElement).offsetHeight - 55 - this.getMoreFilter + 14;
48
+
49
+    }, 0)
50
+  }
51
+
52
+  getQueryParams(){
53
+    let queryParams = this.tabService.getQueryParams();
54
+    this.tabService.clearQueryParams();
55
+    if(queryParams.dateRange){
56
+      this.dateRange = queryParams.dateRange;
57
+      this.customChangeDateComponent.initByDate(this.dateRange);
58
+    }
59
+  }
60
+
61
+  get getMoreFilter(){
62
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.deptDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.taskTypeDTO;
63
+    return flag ? 37 : 0;
64
+  }
65
+
66
+  // 初始化缓存数据
67
+  queryType:any;
68
+  hosId:any;
69
+  dutyId:any;
70
+  parentDutyId:any;
71
+  initSessionData(){
72
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
73
+    let queryType:any = newStatistics.queryType;
74
+    let hosId:any = newStatistics.hospitalId;
75
+    let dutyId:any = newStatistics.dutyId;
76
+
77
+    queryType = queryType ? +queryType : undefined;
78
+    hosId = hosId ? +hosId : undefined;
79
+    dutyId = dutyId ? +dutyId : undefined;
80
+
81
+    this.queryType = queryType;
82
+    if(queryType == 1){
83
+      this.hosId = undefined;
84
+      this.dutyId = undefined;
85
+      this.parentDutyId = undefined;
86
+    }else if(queryType == 2){
87
+      this.hosId = hosId;
88
+      this.dutyId = undefined;
89
+      this.parentDutyId = undefined;
90
+    }else if(queryType == 3){
91
+      this.hosId = undefined;
92
+      this.dutyId = dutyId;
93
+      this.parentDutyId = undefined;
94
+    }else if(queryType == 4){
95
+      this.hosId = undefined;
96
+      this.dutyId = undefined;
97
+      this.parentDutyId = dutyId;
98
+    }
99
+  }
100
+
101
+  get getHosId(){
102
+    return this.parentDutyId || this.dutyId || this.hosId;
103
+  }
104
+
105
+  // 表格数据
106
+  loading1 = false;
107
+  getList(num?: number, field?: string, sort?: string) {
108
+    if (num !== undefined) {
109
+      this.pageIndex = num;
110
+    }
111
+    let postData:any = {
112
+      idx: this.pageIndex - 1,
113
+      sum: this.pageSize,
114
+			statisticsTypeId: this.statisticsTypeId || undefined,
115
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
116
+      startDate: this.customChangeDateComponent.startDate || undefined,
117
+      endDate: this.customChangeDateComponent.endDate || undefined,
118
+      hosId: this.getHosId,
119
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
120
+      userId: this.fieldConfig.fields.userId || undefined,
121
+      deptId: this.fieldConfig.fields.deptId || undefined,
122
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
123
+    };
124
+    if (field && sort) {
125
+      postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
126
+    }
127
+    this.loading1 = true;
128
+    this.mainService
129
+      .postCustom("itsm/report", "hourTransOrderQc", postData)
130
+      .subscribe((result) => {
131
+        this.loading1 = false;
132
+        this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
133
+        this.listOfDataEnd = result.dataList.filter((v, i) => { return i == result.dataList.length - 1 });
134
+        this.listLength = result.totalCount;
135
+      });
136
+  }
137
+
138
+  // 列表排序
139
+  sortCurrent:any = {};
140
+  sortCurrentKey: string = "";
141
+  sortCurrentValue: string | null = "";
142
+  sort(e) {
143
+    const { key, value } = e;
144
+    this.sortCurrentKey = key;
145
+    this.sortCurrentValue = value;
146
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
147
+  }
148
+
149
+  // 搜索
150
+  search() {
151
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
152
+  }
153
+
154
+  // 日期选择
155
+  dateRange: any = [];
156
+
157
+  // 导出
158
+  excelExportLoading:any = false;
159
+  excelExport(){
160
+    this.excelExportLoading = this.message.loading("导出中..", {
161
+      nzDuration: 0,
162
+    }).messageId;
163
+    let postData:any = {
164
+			statisticsTypeId: this.statisticsTypeId || undefined,
165
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
166
+      startDate: this.customChangeDateComponent.startDate || undefined,
167
+      endDate: this.customChangeDateComponent.endDate || undefined,
168
+      hosId: this.getHosId,
169
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
170
+      userId: this.fieldConfig.fields.userId || undefined,
171
+      deptId: this.fieldConfig.fields.deptId || undefined,
172
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
173
+    };
174
+    if (this.sortCurrentKey && this.sortCurrentValue) {
175
+      postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
176
+    }
177
+    this.mainService
178
+      .postExportCustom("itsm/export", "hourTransOrderQc", postData)
179
+      .subscribe((data) => {
180
+        this.message.remove(this.excelExportLoading);
181
+        this.excelExportLoading = false;
182
+        this.message.success('导出成功');
183
+        var file = new Blob([data], {
184
+          type: "application/vnd.ms-excel",
185
+        });
186
+        //trick to download store a file having its URL
187
+        var fileURL = URL.createObjectURL(file);
188
+        var a = document.createElement("a");
189
+        a.href = fileURL;
190
+        a.target = "_blank";
191
+        a.download = `${this.route.parent.routeConfig.data.title}.xls`;
192
+        document.body.appendChild(a);
193
+        a.click();
194
+      },(err) => {
195
+        this.message.remove(this.excelExportLoading);
196
+        this.excelExportLoading = false;
197
+        this.message.error('导出失败');
198
+      });
199
+  }
200
+  // 重置
201
+  reset(){
202
+    this.sortCurrentKey = "";
203
+		this.sortCurrentValue = "";
204
+		this.sortCurrent = {};
205
+    this.dateRange = []
206
+    this.statisticsTypeId = undefined;
207
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, deptId: undefined, buildingId: undefined, taskTypeId: undefined};
208
+    this.customChangeDateComponent.resetByDate();
209
+    this.search();
210
+  }
211
+
212
+  // 防抖
213
+  isLoading = false;
214
+
215
+  openChangeStatisticsType(flag){
216
+    flag && this.getStatisticsTypeList();
217
+  }
218
+
219
+  // 获取统计分类列表
220
+  statisticsTypeList:any[] = [];
221
+  getStatisticsTypeList(keyword?) {
222
+    this.isLoading = true;
223
+    this.mainService
224
+      .getDictionary("list", "statistics_date_type")
225
+      .subscribe((data) => {
226
+        this.isLoading = false;
227
+        this.statisticsTypeList = data;
228
+      });
229
+  }
230
+
231
+  // 详细搜索
232
+  fieldConfig:any = {
233
+    fields: {groupId: undefined, userId: undefined, deptId: undefined, buildingId: undefined, taskTypeId: undefined},
234
+    config: {groupAndUser: true, dept: true, building: true, taskType: true},
235
+  }
236
+  showSearchMore:boolean = false;
237
+  showMore(){
238
+    this.showSearchMore = true;
239
+  }
240
+
241
+  cancelEvent(){
242
+    this.showSearchMore = false;
243
+  }
244
+
245
+  submitEvent(fields){
246
+    this.showSearchMore = false;
247
+    this.fieldConfig.fields = fields;
248
+    console.log('this.fieldConfig.fields:', this.fieldConfig.fields)
249
+    this.search();
250
+    this.onResize();
251
+  }
252
+}

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { HourQualityControlStatisticsComponent } from './hour-quality-control-statistics.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { HourQualityControlStatisticsRoutingModule } from './hour-quality-control-statistics-routing.module';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    HourQualityControlStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    HourQualityControlStatisticsRoutingModule,
18
+    ShareModule,
19
+    DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
21
+  ]
22
+})
23
+export class HourQualityControlStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">科室</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeDeptInp($event)" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" (nzOpenChange)="openChangeDept($event)">

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 16 - 23
src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.component.ts

@@ -2,16 +2,17 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
9 9
 @Component({
10 10
   selector: "app-source-statistics",
11 11
   templateUrl: "./source-statistics.component.html",
12 12
   styleUrls: ["./source-statistics.component.less"],
13 13
 })
14 14
 export class SourceStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15 16
   constructor(
16 17
     private mainService: MainService,
17 18
     private message: NzMessageService,
@@ -34,12 +35,14 @@ export class SourceStatisticsComponent implements OnInit, AfterViewInit {
34 35
       let fun = v[0];
35 36
       fun.call(this, v[1]);
36 37
     });
37
-    this.initSessionData();
38
-    this.getQueryParams();
39
-    this.search();
40 38
   }
41 39
 
42 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
43 46
     this.onResize();
44 47
   }
45 48
 
@@ -57,6 +60,7 @@ export class SourceStatisticsComponent implements OnInit, AfterViewInit {
57 60
     this.tabService.clearQueryParams();
58 61
     if(queryParams.dateRange){
59 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
60 64
     }
61 65
   }
62 66
 
@@ -113,8 +117,8 @@ export class SourceStatisticsComponent implements OnInit, AfterViewInit {
113 117
     let postData:any = {
114 118
       idx: this.pageIndex - 1,
115 119
       sum: this.pageSize,
116
-      startDate: this.dateRange[0] || undefined,
117
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
118 122
       hosId: this.getHosId,
119 123
       deptId: this.deptId || undefined,
120 124
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
@@ -154,19 +158,7 @@ export class SourceStatisticsComponent implements OnInit, AfterViewInit {
154 158
   }
155 159
 
156 160
   // 日期选择
157
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
158
-  changeDate(result?): void {
159
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
160
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
161
-    this.dateRange = result;
162
-  }
163
-
164
-  onCalendarChangeDate(dateArr){
165
-    console.log(dateArr)
166
-    if(dateArr.length == 2){
167
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
168
-    }
169
-  }
161
+  dateRange: any = [];
170 162
 
171 163
   // 导出
172 164
   excelExportLoading:any = false;
@@ -175,8 +167,8 @@ export class SourceStatisticsComponent implements OnInit, AfterViewInit {
175 167
       nzDuration: 0,
176 168
     }).messageId;
177 169
     let postData:any = {
178
-      startDate: this.dateRange[0] || undefined,
179
-      endDate: this.dateRange[1] || undefined,
170
+      startDate: this.customChangeDateComponent.startDate || undefined,
171
+      endDate: this.customChangeDateComponent.endDate || undefined,
180 172
       hosId: this.getHosId,
181 173
       deptId: this.deptId || undefined,
182 174
       groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
@@ -216,9 +208,10 @@ export class SourceStatisticsComponent implements OnInit, AfterViewInit {
216 208
     this.sortCurrentKey = "";
217 209
 		this.sortCurrentValue = "";
218 210
 		this.sortCurrent = {};
219
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
211
+    this.dateRange = []
220 212
     this.deptId = undefined;
221 213
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, statisticsTypeId: undefined};
214
+    this.customChangeDateComponent.resetByDate();
222 215
     this.search();
223 216
   }
224 217
 

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/source-statistics/source-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { SourceStatisticsRoutingModule } from './source-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     SourceStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class SourceStatisticsModule { }

+ 14 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { TaskTypeQualityControlStatisticsComponent } from './taskType-quality-control-statistics.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: TaskTypeQualityControlStatisticsComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class TaskTypeQualityControlStatisticsRoutingModule { }

+ 81 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.html

@@ -0,0 +1,81 @@
1
+<div class="searchDataWrap">
2
+  <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
4
+    <div class="searchDataItem">
5
+      <span class="label">任务类型</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeTaskTypeInp($event)" nzAllowClear nzPlaceHolder="请选择任务类型" [(ngModel)]="taskTypeId" (nzOpenChange)="openChangeTaskType($event)">
7
+        <ng-container *ngFor="let option of taskTypeList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.hosId.hosName + '-' + option.taskName" [nzValue]="option.id"></nz-option>
9
+        </ng-container>
10
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
12
+        </nz-option>
13
+      </nz-select>
14
+    </div>
15
+  </div>
16
+  <div class="operation">
17
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
18
+    <button nz-button class="btn default" (click)="search()">查询</button>
19
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
20
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
21
+  </div>
22
+</div>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.deptDTO || fieldConfig.fields.buildingDTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
25
+  <span>{{fieldConfig.fields.userDTO?.name}}</span>
26
+  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
27
+	<span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
28
+</div>
29
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
30
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
31
+    <tr>
32
+      <th nzWidth="10%">任务类型名称</th>
33
+      <th nzWidth="10%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
34
+      <th nzWidth="10%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
35
+			<th nzWidth="10%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
36
+			<th nzWidth="10%" nzShowSort nzSortKey="arrive_time_num" [(nzSort)]="sortCurrent.arrive_time_num">平均到达时间</th>
37
+      <th nzWidth="10%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
38
+      <th nzWidth="10%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时达标率</th>
39
+      <th nzWidth="10%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
40
+      <th nzWidth="10%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
41
+      <th nzWidth="10%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
42
+    </tr>
43
+  </thead>
44
+  <tbody>
45
+    <tr *ngFor="let data of listOfData">
46
+      <td>{{ data.taskName }}</td>
47
+      <td>{{ data.totalCount }}</td>
48
+      <td>{{ data.totalGrade }}</td>
49
+      <td>{{ data.response_time_num }}</td>
50
+      <td>{{ data.arrive_time_num }}</td>
51
+      <td>{{ data.execution_time_num }}</td>
52
+      <td>{{ data.aveper }}</td>
53
+      <td>{{ data.total_time }}</td>
54
+      <td>{{ data.five_count }}</td>
55
+      <td>{{ data.special_close }}</td>
56
+    </tr>
57
+  </tbody>
58
+  <ng-template #footerTpl>
59
+    <table class="footTable">
60
+      <tr *ngFor="let data of listOfDataEnd">
61
+        <td style="width: 10%">{{ data.taskName }}</td>
62
+        <td style="width: 10%">{{ data.totalCount }}</td>
63
+        <td style="width: 10%">{{ data.totalGrade }}</td>
64
+        <td style="width: 10%">{{ data.response_time_num }}</td>
65
+        <td style="width: 10%">{{ data.arrive_time_num }}</td>
66
+        <td style="width: 10%">{{ data.execution_time_num }}</td>
67
+        <td style="width: 10%">{{ data.aveper }}</td>
68
+        <td style="width: 10%">{{ data.total_time }}</td>
69
+        <td style="width: 10%">{{ data.five_count }}</td>
70
+        <td style="width: 10%">{{ data.special_close }}</td>
71
+      </tr>
72
+    </table>
73
+  </ng-template>
74
+</nz-table>
75
+<div class="pagination">
76
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
77
+  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
78
+</div>
79
+
80
+<!-- 详细搜索 -->
81
+<app-distribution-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-distribution-search-more>

+ 71 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.less

@@ -0,0 +1,71 @@
1
+@import "../../../../../../src/theme.less";
2
+:host{
3
+  position: absolute;
4
+  top: 0;
5
+  right: 0;
6
+  bottom: 0;
7
+  left: 0;
8
+  ::ng-deep .ant-table-footer{
9
+    padding: 16px 0;
10
+    width: calc(100% - 15px);
11
+    font-weight: bold;
12
+  }
13
+  tr, th{
14
+    text-align: center;
15
+  }
16
+  .searchDataWrap{
17
+    display: flex;
18
+    align-items: center;
19
+    justify-content: space-between;
20
+    .searchData{
21
+      padding: 16px;
22
+      display: flex;
23
+      align-items: center;
24
+      .searchDataItem{
25
+        margin-right: 24px;
26
+        .label{
27
+          font-size: 16px;
28
+        }
29
+        .selectItem{
30
+          width: 160px;
31
+        }
32
+      }
33
+    }
34
+    .operation{
35
+      margin-right: 16px;
36
+      display: flex;
37
+      align-items: center;
38
+      cursor: pointer;
39
+      .icon_transport{
40
+        margin-right: 16px;
41
+        font-size: 24px;
42
+      }
43
+      .btn{
44
+        &.default{
45
+          height: 32px;
46
+          line-height: 32px;
47
+          min-width: 70px;
48
+        }
49
+      }
50
+    }
51
+  }
52
+
53
+  .table{
54
+    margin: 0 8px;
55
+  }
56
+
57
+  .moreFilter{
58
+    margin-bottom: 16px;
59
+    span{
60
+      margin-left: 16px;
61
+      color: @primary-color;
62
+    }
63
+  }
64
+
65
+  .pagination{
66
+    padding: 16px;
67
+    display: flex;
68
+    justify-content: flex-end;
69
+    align-items: center;
70
+  }
71
+}

+ 276 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.ts

@@ -0,0 +1,276 @@
1
+import { TabService } from './../../services/tab.service';
2
+import { debounceTime } from 'rxjs/operators';
3
+import { Subject } from 'rxjs';
4
+import { NzMessageService } from 'ng-zorro-antd/message';
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
6
+import { MainService } from 'src/app/services/main.service';
7
+import { ActivatedRoute } from '@angular/router';
8
+import { ToolService } from "../../../../services/tool.service";
9
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10
+@Component({
11
+  selector: "app-taskType-quality-control-statistics",
12
+  templateUrl: "./taskType-quality-control-statistics.component.html",
13
+  styleUrls: ["./taskType-quality-control-statistics.component.less"],
14
+})
15
+export class TaskTypeQualityControlStatisticsComponent implements OnInit, AfterViewInit {
16
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
17
+  constructor(
18
+    private mainService: MainService,
19
+    private message: NzMessageService,
20
+    private route: ActivatedRoute,
21
+    private tabService: TabService,
22
+		private tool: ToolService,
23
+  ) {}
24
+
25
+  listOfData: any[] = []; //表格数据
26
+  listOfDataEnd: any[] = []; //表格合计
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 30; //表格每页展示条数
29
+  listLength: number = 0; //表格总数据量
30
+
31
+  taskTypeId;//任务类型id
32
+
33
+  searchTimerSubject = new Subject();
34
+
35
+  ngOnInit() {
36
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
37
+      let fun = v[0];
38
+      fun.call(this, v[1]);
39
+    });
40
+  }
41
+
42
+  ngAfterViewInit(){
43
+    this.initSessionData();
44
+    this.getQueryParams();
45
+    setTimeout(() => {
46
+      this.search();
47
+    }, 0)
48
+    this.onResize();
49
+  }
50
+
51
+  tableHeight:number = 0;
52
+  @HostListener('window:resize')
53
+  onResize(): void {
54
+    setTimeout(() => {
55
+      this.tableHeight = window.innerHeight - (document.querySelector('.searchDataWrap') as HTMLElement).offsetHeight - 64 - 36 - 48 - 8 - (document.querySelector('.ant-table-header') as HTMLElement).offsetHeight - 55 - this.getMoreFilter + 14;
56
+
57
+    }, 0)
58
+  }
59
+
60
+  getQueryParams(){
61
+    let queryParams = this.tabService.getQueryParams();
62
+    this.tabService.clearQueryParams();
63
+    if(queryParams.dateRange){
64
+      this.dateRange = queryParams.dateRange;
65
+      this.customChangeDateComponent.initByDate(this.dateRange);
66
+    }
67
+  }
68
+
69
+  get getMoreFilter(){
70
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.deptDTO;
71
+    return flag ? 37 : 0;
72
+  }
73
+
74
+  // 初始化缓存数据
75
+  queryType:any;
76
+  hosId:any;
77
+  dutyId:any;
78
+  parentDutyId:any;
79
+  initSessionData(){
80
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
81
+    let queryType:any = newStatistics.queryType;
82
+    let hosId:any = newStatistics.hospitalId;
83
+    let dutyId:any = newStatistics.dutyId;
84
+
85
+    queryType = queryType ? +queryType : undefined;
86
+    hosId = hosId ? +hosId : undefined;
87
+    dutyId = dutyId ? +dutyId : undefined;
88
+
89
+    this.queryType = queryType;
90
+    if(queryType == 1){
91
+      this.hosId = undefined;
92
+      this.dutyId = undefined;
93
+      this.parentDutyId = undefined;
94
+    }else if(queryType == 2){
95
+      this.hosId = hosId;
96
+      this.dutyId = undefined;
97
+      this.parentDutyId = undefined;
98
+    }else if(queryType == 3){
99
+      this.hosId = undefined;
100
+      this.dutyId = dutyId;
101
+      this.parentDutyId = undefined;
102
+    }else if(queryType == 4){
103
+      this.hosId = undefined;
104
+      this.dutyId = undefined;
105
+      this.parentDutyId = dutyId;
106
+    }
107
+  }
108
+
109
+  get getHosId(){
110
+    return this.parentDutyId || this.dutyId || this.hosId;
111
+  }
112
+
113
+  // 表格数据
114
+  loading1 = false;
115
+  getList(num?: number, field?: string, sort?: string) {
116
+    if (num !== undefined) {
117
+      this.pageIndex = num;
118
+    }
119
+    let postData:any = {
120
+      idx: this.pageIndex - 1,
121
+      sum: this.pageSize,
122
+			taskTypeId: this.taskTypeId || undefined,
123
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
124
+      startDate: this.customChangeDateComponent.startDate || undefined,
125
+      endDate: this.customChangeDateComponent.endDate || undefined,
126
+      hosId: this.getHosId,
127
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
128
+      userId: this.fieldConfig.fields.userId || undefined,
129
+      deptId: this.fieldConfig.fields.deptId || undefined,
130
+    };
131
+    if (field && sort) {
132
+      postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
133
+    }
134
+    this.loading1 = true;
135
+    this.mainService
136
+      .postCustom("itsm/report", "taskTypeTransOrderQc", postData)
137
+      .subscribe((result) => {
138
+        this.loading1 = false;
139
+        this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
140
+        this.listOfDataEnd = result.dataList.filter((v, i) => { return i == result.dataList.length - 1 });
141
+        this.listLength = result.totalCount;
142
+      });
143
+  }
144
+
145
+  // 列表排序
146
+  sortCurrent:any = {};
147
+  sortCurrentKey: string = "";
148
+  sortCurrentValue: string | null = "";
149
+  sort(e) {
150
+    const { key, value } = e;
151
+    this.sortCurrentKey = key;
152
+    this.sortCurrentValue = value;
153
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
154
+  }
155
+
156
+  // 搜索
157
+  search() {
158
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
159
+  }
160
+
161
+  // 日期选择
162
+  dateRange: any = [];
163
+
164
+  // 导出
165
+  excelExportLoading:any = false;
166
+  excelExport(){
167
+    this.excelExportLoading = this.message.loading("导出中..", {
168
+      nzDuration: 0,
169
+    }).messageId;
170
+    let postData:any = {
171
+			taskTypeId: this.taskTypeId || undefined,
172
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
173
+      startDate: this.customChangeDateComponent.startDate || undefined,
174
+      endDate: this.customChangeDateComponent.endDate || undefined,
175
+      hosId: this.getHosId,
176
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
177
+      userId: this.fieldConfig.fields.userId || undefined,
178
+      deptId: this.fieldConfig.fields.deptId || undefined,
179
+    };
180
+    if (this.sortCurrentKey && this.sortCurrentValue) {
181
+      postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
182
+    }
183
+    this.mainService
184
+      .postExportCustom("itsm/export", "taskTypeTransOrderQc", postData)
185
+      .subscribe((data) => {
186
+        this.message.remove(this.excelExportLoading);
187
+        this.excelExportLoading = false;
188
+        this.message.success('导出成功');
189
+        var file = new Blob([data], {
190
+          type: "application/vnd.ms-excel",
191
+        });
192
+        //trick to download store a file having its URL
193
+        var fileURL = URL.createObjectURL(file);
194
+        var a = document.createElement("a");
195
+        a.href = fileURL;
196
+        a.target = "_blank";
197
+        a.download = `${this.route.parent.routeConfig.data.title}.xls`;
198
+        document.body.appendChild(a);
199
+        a.click();
200
+      },(err) => {
201
+        this.message.remove(this.excelExportLoading);
202
+        this.excelExportLoading = false;
203
+        this.message.error('导出失败');
204
+      });
205
+  }
206
+  // 重置
207
+  reset(){
208
+    this.sortCurrentKey = "";
209
+		this.sortCurrentValue = "";
210
+		this.sortCurrent = {};
211
+    this.dateRange = []
212
+    this.taskTypeId = undefined;
213
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, deptId: undefined, buildingId: undefined};
214
+    this.customChangeDateComponent.resetByDate();
215
+    this.search();
216
+  }
217
+
218
+  // 任务类型搜索
219
+  changeTaskTypeInp(e) {
220
+    this.searchTimer(this.getTaskTypeList, e);
221
+  }
222
+
223
+  // 防抖
224
+  isLoading = false;
225
+  searchTimer(fun, e) {
226
+    this.isLoading = true;
227
+    this.searchTimerSubject.next([fun, e]);
228
+  }
229
+
230
+  openChangeTaskType(flag){
231
+    flag && this.getTaskTypeList();
232
+  }
233
+
234
+  // 获取任务类型列表
235
+  taskTypeList:any[] = [];
236
+  getTaskTypeList(keyword?) {
237
+    let postData: any = {
238
+      idx: 0,
239
+      sum: 20,
240
+      taskType: {
241
+        simpleQuery: true,
242
+        taskName: keyword,
243
+        statisticalHosId: this.getHosId,
244
+      },
245
+    };
246
+    this.isLoading = true;
247
+    this.mainService
248
+      .getFetchDataList("simple/data", "taskType", postData)
249
+      .subscribe((data) => {
250
+        this.isLoading = false;
251
+        this.taskTypeList = data.list;
252
+      });
253
+  }
254
+
255
+  // 详细搜索
256
+  fieldConfig:any = {
257
+    fields: {groupId: undefined, userId: undefined, deptId: undefined, buildingId: undefined},
258
+    config: {groupAndUser: true, dept: true, building: true},
259
+  }
260
+  showSearchMore:boolean = false;
261
+  showMore(){
262
+    this.showSearchMore = true;
263
+  }
264
+
265
+  cancelEvent(){
266
+    this.showSearchMore = false;
267
+  }
268
+
269
+  submitEvent(fields){
270
+    this.showSearchMore = false;
271
+    this.fieldConfig.fields = fields;
272
+    console.log('this.fieldConfig.fields:', this.fieldConfig.fields)
273
+    this.search();
274
+    this.onResize();
275
+  }
276
+}

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { TaskTypeQualityControlStatisticsComponent } from './taskType-quality-control-statistics.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { TaskTypeQualityControlStatisticsRoutingModule } from './taskType-quality-control-statistics-routing.module';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    TaskTypeQualityControlStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    TaskTypeQualityControlStatisticsRoutingModule,
18
+    ShareModule,
19
+    DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
21
+  ]
22
+})
23
+export class TaskTypeQualityControlStatisticsModule { }

+ 7 - 10
src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.html

@@ -1,15 +1,11 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
3 4
     <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
8
-    <div class="searchDataItem">
9
-      <span class="label">分组</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" nzAllowClear nzPlaceHolder="请选择分组" [(ngModel)]="groupId" (nzOpenChange)="openChangeGroup($event)">
11
-        <ng-container *ngFor="let option of groupList">
12
-          <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
5
+      <span class="label">人员</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" nzAllowClear nzPlaceHolder="请选择人员" [(ngModel)]="userId" (nzOpenChange)="openChangeUser($event)">
7
+        <ng-container *ngFor="let option of userList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
13 9
         </ng-container>
14 10
         <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15 11
           <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -24,7 +20,8 @@
24 20
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 21
   </div>
26 22
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
28 25
   <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
29 26
   <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
30 27
 </div>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 42 - 47
src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.ts

@@ -2,17 +2,18 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
9 8
 import cloneDeep from 'lodash-es/cloneDeep'
9
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10 10
 @Component({
11 11
   selector: "app-user-business-statistics",
12 12
   templateUrl: "./user-business-statistics.component.html",
13 13
   styleUrls: ["./user-business-statistics.component.less"],
14 14
 })
15 15
 export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
16
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
16 17
   constructor(
17 18
     private mainService: MainService,
18 19
     private message: NzMessageService,
@@ -27,7 +28,7 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
27 28
   listLength: number = 0; //表格总数据量
28 29
   widthConfig: any[] = [];
29 30
 
30
-  groupId;//分组id
31
+  userId;//人员id
31 32
 
32 33
   searchTimerSubject = new Subject();
33 34
 
@@ -36,12 +37,14 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
36 37
       let fun = v[0];
37 38
       fun.call(this, v[1]);
38 39
     });
39
-    this.initSessionData();
40
-    this.getQueryParams();
41
-    this.search();
42 40
   }
43 41
 
44 42
   ngAfterViewInit(){
43
+    this.initSessionData();
44
+    this.getQueryParams();
45
+    setTimeout(() => {
46
+      this.search();
47
+    }, 0)
45 48
     this.onResize();
46 49
   }
47 50
 
@@ -59,11 +62,12 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
59 62
     this.tabService.clearQueryParams();
60 63
     if(queryParams.dateRange){
61 64
       this.dateRange = queryParams.dateRange;
65
+      this.customChangeDateComponent.initByDate(this.dateRange);
62 66
     }
63 67
   }
64 68
 
65 69
   get getMoreFilter(){
66
-    let flag = this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.deptDTO;
70
+    let flag = this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.deptDTO || this.fieldConfig.fields.groupDTO;
67 71
     return flag ? 37 : 0;
68 72
   }
69 73
 
@@ -123,12 +127,13 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
123 127
       let postData:any = {
124 128
         idx: this.pageIndex - 1,
125 129
         sum: this.pageSize,
126
-        startDate: this.dateRange[0] || undefined,
127
-        endDate: this.dateRange[1] || undefined,
130
+        startDate: this.customChangeDateComponent.startDate || undefined,
131
+        endDate: this.customChangeDateComponent.endDate || undefined,
128 132
         hosId: this.getHosId,
129 133
         buildingId: this.fieldConfig.fields.buildingId || undefined,
134
+        groupId: this.fieldConfig.fields.groupId || undefined,
130 135
         deptId: this.fieldConfig.fields.deptId || undefined,
131
-        groupId: this.groupId || undefined,
136
+        userId: this.userId || undefined,
132 137
       };
133 138
       if (field && sort) {
134 139
         postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
@@ -162,19 +167,7 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
162 167
   }
163 168
 
164 169
   // 日期选择
165
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
166
-  changeDate(result?): void {
167
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
168
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
169
-    this.dateRange = result;
170
-  }
171
-
172
-  onCalendarChangeDate(dateArr){
173
-    console.log(dateArr)
174
-    if(dateArr.length == 2){
175
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
176
-    }
177
-  }
170
+  dateRange: any = [];
178 171
 
179 172
   // 导出
180 173
   excelExportLoading:any = false;
@@ -183,12 +176,13 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
183 176
       nzDuration: 0,
184 177
     }).messageId;
185 178
     let postData:any = {
186
-      startDate: this.dateRange[0] || undefined,
187
-      endDate: this.dateRange[1] || undefined,
179
+      startDate: this.customChangeDateComponent.startDate || undefined,
180
+      endDate: this.customChangeDateComponent.endDate || undefined,
188 181
       hosId: this.getHosId,
189 182
       buildingId: this.fieldConfig.fields.buildingId || undefined,
183
+      groupId: this.fieldConfig.fields.groupId || undefined,
190 184
       deptId: this.fieldConfig.fields.deptId || undefined,
191
-      groupId: this.groupId || undefined,
185
+      userId: this.userId || undefined,
192 186
     };
193 187
     if (this.sortCurrentKey && this.sortCurrentValue) {
194 188
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
@@ -221,15 +215,16 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
221 215
     this.sortCurrentKey = "";
222 216
 		this.sortCurrentValue = "";
223 217
 		this.sortCurrent = {};
224
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
225
-    this.groupId = undefined;
226
-    this.fieldConfig.fields = {buildingId: undefined, deptId: undefined};
218
+    this.dateRange = []
219
+    this.userId = undefined;
220
+    this.fieldConfig.fields = {buildingId: undefined, deptId: undefined, groupId: undefined};
221
+    this.customChangeDateComponent.resetByDate();
227 222
     this.search();
228 223
   }
229 224
 
230
-  // 分组搜索
231
-  changeGroupInp(e) {
232
-    this.searchTimer(this.getGroupList, e);
225
+  // 人员搜索
226
+  changeUserInp(e) {
227
+    this.searchTimer(this.getUserList, e);
233 228
   }
234 229
 
235 230
   // 防抖
@@ -239,35 +234,35 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
239 234
     this.searchTimerSubject.next([fun, e]);
240 235
   }
241 236
 
242
-  openChangeGroup(flag){
243
-    flag && this.getGroupList();
237
+  openChangeUser(flag){
238
+    flag && this.getUserList();
244 239
   }
245 240
 
246
-  // 获取分组列表
247
-  groupList:any[] = [];
248
-  getGroupList(keyword?) {
249
-    let data = {
250
-      group2: {
251
-        statisticalHosId: this.getHosId,
252
-        groupName: keyword,
253
-        type: 1,
254
-      },
241
+  // 获取人员列表
242
+  userList:any[] = [];
243
+  getUserList(keyword?) {
244
+    let postData: any = {
255 245
       idx: 0,
256 246
       sum: 20,
247
+      user: {
248
+        name: keyword,
249
+        simpleQuery: true,
250
+        statisticalHosId: this.getHosId,
251
+      },
257 252
     };
258 253
     this.isLoading = true;
259 254
     this.mainService
260
-      .getFetchDataList("data", "group2", data)
255
+      .getFetchDataList("simple/data", "user", postData)
261 256
       .subscribe((data) => {
262 257
         this.isLoading = false;
263
-        this.groupList = data.list;
258
+        this.userList = data.list;
264 259
       });
265 260
   }
266 261
 
267 262
   // 详细搜索
268 263
   fieldConfig:any = {
269
-    fields: {buildingId: undefined, deptId: undefined},
270
-    config: {building: true, dept: true},
264
+    fields: {buildingId: undefined, deptId: undefined, groupId: undefined},
265
+    config: {building: true, dept: true, group: undefined},
271 266
   }
272 267
   showSearchMore:boolean = false;
273 268
   showMore(){

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.module.ts

@@ -6,6 +6,7 @@ import { UserBusinessStatisticsRoutingModule } from './user-business-statistics-
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8 8
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
9
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9 10
 
10 11
 
11 12
 @NgModule({
@@ -18,6 +19,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
18 19
     ShareModule,
19 20
     VirtualScrollerModule,
20 21
     DistributionSearchMoreModule,
22
+    CustomChangeDateModule,
21 23
   ]
22 24
 })
23 25
 export class UserBusinessStatisticsModule { }

+ 7 - 10
src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.component.html

@@ -1,15 +1,11 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
3 4
     <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
8
-    <div class="searchDataItem">
9
-      <span class="label">分组</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" nzAllowClear nzPlaceHolder="请选择分组" [(ngModel)]="groupId" (nzOpenChange)="openChangeGroup($event)">
11
-        <ng-container *ngFor="let option of groupList">
12
-          <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
5
+      <span class="label">人员</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" nzAllowClear nzPlaceHolder="请选择人员" [(ngModel)]="userId" (nzOpenChange)="openChangeUser($event)">
7
+        <ng-container *ngFor="let option of userList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
13 9
         </ng-container>
14 10
         <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15 11
           <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -24,7 +20,8 @@
24 20
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 21
   </div>
26 22
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
28 25
   <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
29 26
   <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
30 27
 </div>

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 42 - 47
src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.component.ts

@@ -2,16 +2,17 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
9 9
 @Component({
10 10
   selector: "app-user-quality-control-statistics",
11 11
   templateUrl: "./user-quality-control-statistics.component.html",
12 12
   styleUrls: ["./user-quality-control-statistics.component.less"],
13 13
 })
14 14
 export class UserQualityControlStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15 16
   constructor(
16 17
     private mainService: MainService,
17 18
     private message: NzMessageService,
@@ -25,7 +26,7 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
25 26
   pageSize: number = 30; //表格每页展示条数
26 27
   listLength: number = 0; //表格总数据量
27 28
 
28
-  groupId;//分组id
29
+  userId;//人员id
29 30
 
30 31
   searchTimerSubject = new Subject();
31 32
 
@@ -34,12 +35,14 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
34 35
       let fun = v[0];
35 36
       fun.call(this, v[1]);
36 37
     });
37
-    this.initSessionData();
38
-    this.getQueryParams();
39
-    this.search();
40 38
   }
41 39
 
42 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
43 46
     this.onResize();
44 47
   }
45 48
 
@@ -57,11 +60,12 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
57 60
     this.tabService.clearQueryParams();
58 61
     if(queryParams.dateRange){
59 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
60 64
     }
61 65
   }
62 66
 
63 67
   get getMoreFilter(){
64
-    let flag = this.fieldConfig.fields.userDTO || this.fieldConfig.fields.deptDTO || this.fieldConfig.fields.buildingDTO;
68
+    let flag = this.fieldConfig.fields.userDTO || this.fieldConfig.fields.deptDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.groupDTO;
65 69
     return flag ? 37 : 0;
66 70
   }
67 71
 
@@ -113,11 +117,12 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
113 117
     let postData:any = {
114 118
       idx: this.pageIndex - 1,
115 119
       sum: this.pageSize,
116
-      startDate: this.dateRange[0] || undefined,
117
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
118 122
       hosId: this.getHosId,
119
-      groupId: this.groupId || undefined,
123
+      userId: this.userId || undefined,
120 124
       buildingId: this.fieldConfig.fields.buildingId || undefined,
125
+      groupId: this.fieldConfig.fields.groupId || undefined,
121 126
       deptId: this.fieldConfig.fields.deptId || undefined,
122 127
     };
123 128
     if (field && sort) {
@@ -151,19 +156,7 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
151 156
   }
152 157
 
153 158
   // 日期选择
154
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
155
-  changeDate(result?): void {
156
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
157
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
158
-    this.dateRange = result;
159
-  }
160
-
161
-  onCalendarChangeDate(dateArr){
162
-    console.log(dateArr)
163
-    if(dateArr.length == 2){
164
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
165
-    }
166
-  }
159
+  dateRange: any = [];
167 160
 
168 161
   // 导出
169 162
   excelExportLoading:any = false;
@@ -172,11 +165,12 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
172 165
       nzDuration: 0,
173 166
     }).messageId;
174 167
     let postData:any = {
175
-      startDate: this.dateRange[0] || undefined,
176
-      endDate: this.dateRange[1] || undefined,
168
+      startDate: this.customChangeDateComponent.startDate || undefined,
169
+      endDate: this.customChangeDateComponent.endDate || undefined,
177 170
       hosId: this.getHosId,
178
-      groupId: this.groupId || undefined,
171
+      userId: this.userId || undefined,
179 172
       buildingId: this.fieldConfig.fields.buildingId || undefined,
173
+      groupId: this.fieldConfig.fields.groupId || undefined,
180 174
       deptId: this.fieldConfig.fields.deptId || undefined,
181 175
     };
182 176
     if (this.sortCurrentKey && this.sortCurrentValue) {
@@ -210,15 +204,16 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
210 204
     this.sortCurrentKey = "";
211 205
 		this.sortCurrentValue = "";
212 206
 		this.sortCurrent = {};
213
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
214
-    this.groupId = undefined;
215
-    this.fieldConfig.fields = {buildingId: undefined, deptId: undefined};
207
+    this.dateRange = []
208
+    this.userId = undefined;
209
+    this.fieldConfig.fields = {buildingId: undefined, deptId: undefined, groupId: undefined};
210
+    this.customChangeDateComponent.resetByDate();
216 211
     this.search();
217 212
   }
218 213
 
219
-  // 楼栋搜索
220
-  changeGroupInp(e) {
221
-    this.searchTimer(this.getGroupList, e);
214
+  // 人员搜索
215
+  changeUserInp(e) {
216
+    this.searchTimer(this.getUserList, e);
222 217
   }
223 218
 
224 219
   // 防抖
@@ -228,35 +223,35 @@ export class UserQualityControlStatisticsComponent implements OnInit, AfterViewI
228 223
     this.searchTimerSubject.next([fun, e]);
229 224
   }
230 225
 
231
-  openChangeGroup(flag){
232
-    flag && this.getGroupList();
226
+  openChangeUser(flag){
227
+    flag && this.getUserList();
233 228
   }
234 229
 
235
-  // 获取分组列表
236
-  groupList:any[] = [];
237
-  getGroupList(keyword?) {
238
-    let data = {
239
-      group2: {
240
-        statisticalHosId: this.getHosId,
241
-        groupName: keyword,
242
-        type: 1,
243
-      },
230
+  // 获取人员列表
231
+  userList:any[] = [];
232
+  getUserList(keyword?) {
233
+    let postData: any = {
244 234
       idx: 0,
245 235
       sum: 20,
236
+      user: {
237
+        name: keyword,
238
+        simpleQuery: true,
239
+        statisticalHosId: this.getHosId,
240
+      },
246 241
     };
247 242
     this.isLoading = true;
248 243
     this.mainService
249
-      .getFetchDataList("data", "group2", data)
244
+      .getFetchDataList("simple/data", "user", postData)
250 245
       .subscribe((data) => {
251 246
         this.isLoading = false;
252
-        this.groupList = data.list;
247
+        this.userList = data.list;
253 248
       });
254 249
   }
255 250
 
256 251
   // 详细搜索
257 252
   fieldConfig:any = {
258
-    fields: {buildingId: undefined, deptId: undefined},
259
-    config: {building: true, dept: true},
253
+    fields: {buildingId: undefined, deptId: undefined, groupId: undefined},
254
+    config: {building: true, dept: true, group: true},
260 255
   }
261 256
   showSearchMore:boolean = false;
262 257
   showMore(){

+ 2 - 0
src/app/views/new-statistics/distribution-inspection-statistics/user-quality-control-statistics/user-quality-control-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { UserQualityControlStatisticsRoutingModule } from './user-quality-control-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { DistributionSearchMoreModule } from '../../components/distribution-sear
16 17
     UserQualityControlStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class UserQualityControlStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
   </div>
9 5
   <div class="operation">
10 6
     <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 17 - 25
src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts

@@ -1,15 +1,16 @@
1 1
 import { TabService } from './../../services/tab.service';
2 2
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 4
 import { MainService } from 'src/app/services/main.service';
6 5
 import { ActivatedRoute } from '@angular/router';
6
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
7 7
 @Component({
8 8
   selector: "app-building-statistics",
9 9
   templateUrl: "./building-statistics.component.html",
10 10
   styleUrls: ["./building-statistics.component.less"],
11 11
 })
12 12
 export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
13
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
13 14
   constructor(
14 15
     private mainService: MainService,
15 16
     private message: NzMessageService,
@@ -23,13 +24,14 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
23 24
   pageSize: number = 30; //表格每页展示条数
24 25
   listLength: number = 0; //表格总数据量
25 26
 
26
-  ngOnInit() {
27
-    this.initSessionData();
28
-    this.getQueryParams();
29
-    this.search();
30
-  }
27
+  ngOnInit() {}
31 28
 
32 29
   ngAfterViewInit(){
30
+    this.initSessionData();
31
+    this.getQueryParams();
32
+    setTimeout(() => {
33
+      this.search();
34
+    }, 0)
33 35
     this.onResize();
34 36
   }
35 37
 
@@ -47,6 +49,7 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
47 49
     this.tabService.clearQueryParams();
48 50
     if(queryParams.dateRange){
49 51
       this.dateRange = queryParams.dateRange;
52
+      this.customChangeDateComponent.initByDate(this.dateRange);
50 53
     }
51 54
   }
52 55
 
@@ -103,8 +106,8 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
103 106
     let postData:any = {
104 107
       idx: this.pageIndex - 1,
105 108
       sum: this.pageSize,
106
-      startDate: this.dateRange[0] || undefined,
107
-      endDate: this.dateRange[1] || undefined,
109
+      startDate: this.customChangeDateComponent.startDate || undefined,
110
+      endDate: this.customChangeDateComponent.endDate || undefined,
108 111
       hosId: this.hosId || undefined,
109 112
       dutyId: this.dutyId || undefined,
110 113
       parentDutyId: this.parentDutyId || undefined,
@@ -142,19 +145,7 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
142 145
   }
143 146
 
144 147
   // 日期选择
145
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
146
-  changeDate(result?): void {
147
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
148
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
149
-    this.dateRange = result;
150
-  }
151
-
152
-  onCalendarChangeDate(dateArr){
153
-    console.log(dateArr)
154
-    if(dateArr.length == 2){
155
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
156
-    }
157
-  }
148
+  dateRange: any = [];
158 149
 
159 150
   // 导出
160 151
   excelExportLoading:any = false;
@@ -163,8 +154,8 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
163 154
       nzDuration: 0,
164 155
     }).messageId;
165 156
     let postData:any = {
166
-      startDate: this.dateRange[0] || undefined,
167
-      endDate: this.dateRange[1] || undefined,
157
+      startDate: this.customChangeDateComponent.startDate || undefined,
158
+      endDate: this.customChangeDateComponent.endDate || undefined,
168 159
       hosId: this.hosId || undefined,
169 160
       dutyId: this.dutyId || undefined,
170 161
       parentDutyId: this.parentDutyId || undefined,
@@ -202,8 +193,9 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
202 193
     this.sortCurrentKey = "";
203 194
 		this.sortCurrentValue = "";
204 195
 		this.sortCurrent = {};
205
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
196
+    this.dateRange = []
206 197
     this.fieldConfig.fields = {category123: true};
198
+    this.customChangeDateComponent.resetByDate();
207 199
     this.search();
208 200
   }
209 201
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { BuildingStatisticsRoutingModule } from './building-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { SearchMoreModule } from '../../components/search-more/search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { SearchMoreModule } from '../../components/search-more/search-more.modul
16 17
     BuildingStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     SearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class BuildingStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
   </div>
9 5
   <div class="operation">
10 6
     <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 17 - 25
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts

@@ -1,15 +1,16 @@
1 1
 import { TabService } from './../../services/tab.service';
2 2
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 4
 import { MainService } from 'src/app/services/main.service';
6 5
 import { ActivatedRoute } from '@angular/router';
6
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
7 7
 @Component({
8 8
   selector: "app-category-one-statistics",
9 9
   templateUrl: "./category-one-statistics.component.html",
10 10
   styleUrls: ["./category-one-statistics.component.less"],
11 11
 })
12 12
 export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
13
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
13 14
   constructor(
14 15
     private mainService: MainService,
15 16
     private message: NzMessageService,
@@ -23,13 +24,14 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
23 24
   pageSize: number = 30; //表格每页展示条数
24 25
   listLength: number = 0; //表格总数据量
25 26
 
26
-  ngOnInit() {
27
-    this.initSessionData();
28
-    this.getQueryParams();
29
-    this.search();
30
-  }
27
+  ngOnInit() {}
31 28
 
32 29
   ngAfterViewInit(){
30
+    this.initSessionData();
31
+    this.getQueryParams();
32
+    setTimeout(() => {
33
+      this.search();
34
+    }, 0)
33 35
     this.onResize();
34 36
   }
35 37
 
@@ -47,6 +49,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
47 49
     this.tabService.clearQueryParams();
48 50
     if(queryParams.dateRange){
49 51
       this.dateRange = queryParams.dateRange;
52
+      this.customChangeDateComponent.initByDate(this.dateRange);
50 53
     }
51 54
   }
52 55
 
@@ -103,8 +106,8 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
103 106
     let postData:any = {
104 107
       idx: this.pageIndex - 1,
105 108
       sum: this.pageSize,
106
-      startDate: this.dateRange[0] || undefined,
107
-      endDate: this.dateRange[1] || undefined,
109
+      startDate: this.customChangeDateComponent.startDate || undefined,
110
+      endDate: this.customChangeDateComponent.endDate || undefined,
108 111
       hosId: this.hosId || undefined,
109 112
       dutyId: this.dutyId || undefined,
110 113
       parentDutyId: this.parentDutyId || undefined,
@@ -147,19 +150,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
147 150
   }
148 151
 
149 152
   // 日期选择
150
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
151
-  changeDate(result?): void {
152
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
153
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
154
-    this.dateRange = result;
155
-  }
156
-
157
-  onCalendarChangeDate(dateArr){
158
-    console.log(dateArr)
159
-    if(dateArr.length == 2){
160
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
161
-    }
162
-  }
153
+  dateRange: any = [];
163 154
 
164 155
   // 导出
165 156
   excelExportLoading:any = false;
@@ -168,8 +159,8 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
168 159
       nzDuration: 0,
169 160
     }).messageId;
170 161
     let postData:any = {
171
-      startDate: this.dateRange[0] || undefined,
172
-      endDate: this.dateRange[1] || undefined,
162
+      startDate: this.customChangeDateComponent.startDate || undefined,
163
+      endDate: this.customChangeDateComponent.endDate || undefined,
173 164
       hosId: this.hosId || undefined,
174 165
       dutyId: this.dutyId || undefined,
175 166
       parentDutyId: this.parentDutyId || undefined,
@@ -212,8 +203,9 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
212 203
     this.sortCurrentKey = "";
213 204
 		this.sortCurrentValue = "";
214 205
 		this.sortCurrent = {};
215
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
206
+    this.dateRange = []
216 207
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined};
208
+    this.customChangeDateComponent.resetByDate();
217 209
     this.search();
218 210
   }
219 211
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { CategoryOneStatisticsRoutingModule } from './category-one-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { SearchMoreModule } from '../../components/search-more/search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { SearchMoreModule } from '../../components/search-more/search-more.modul
16 17
     CategoryOneStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     SearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class CategoryOneStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
   </div>
9 5
   <div class="operation">
10 6
     <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 17 - 25
src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts

@@ -1,15 +1,16 @@
1 1
 import { TabService } from './../../services/tab.service';
2 2
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 4
 import { MainService } from 'src/app/services/main.service';
6 5
 import { ActivatedRoute } from '@angular/router';
6
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
7 7
 @Component({
8 8
   selector: "app-category-source-statistics",
9 9
   templateUrl: "./category-source-statistics.component.html",
10 10
   styleUrls: ["./category-source-statistics.component.less"],
11 11
 })
12 12
 export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit {
13
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
13 14
   constructor(
14 15
     private mainService: MainService,
15 16
     private message: NzMessageService,
@@ -23,13 +24,14 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
23 24
   pageSize: number = 30; //表格每页展示条数
24 25
   listLength: number = 0; //表格总数据量
25 26
 
26
-  ngOnInit() {
27
-    this.initSessionData();
28
-    this.getQueryParams();
29
-    this.search();
30
-  }
27
+  ngOnInit() {}
31 28
 
32 29
   ngAfterViewInit(){
30
+    this.initSessionData();
31
+    this.getQueryParams();
32
+    setTimeout(() => {
33
+      this.search();
34
+    }, 0)
33 35
     this.onResize();
34 36
   }
35 37
 
@@ -47,6 +49,7 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
47 49
     this.tabService.clearQueryParams();
48 50
     if(queryParams.dateRange){
49 51
       this.dateRange = queryParams.dateRange;
52
+      this.customChangeDateComponent.initByDate(this.dateRange);
50 53
     }
51 54
   }
52 55
 
@@ -103,8 +106,8 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
103 106
     let postData:any = {
104 107
       idx: this.pageIndex - 1,
105 108
       sum: this.pageSize,
106
-      startDate: this.dateRange[0] || undefined,
107
-      endDate: this.dateRange[1] || undefined,
109
+      startDate: this.customChangeDateComponent.startDate || undefined,
110
+      endDate: this.customChangeDateComponent.endDate || undefined,
108 111
       hosId: this.hosId || undefined,
109 112
       dutyId: this.dutyId || undefined,
110 113
       parentDutyId: this.parentDutyId || undefined,
@@ -146,19 +149,7 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
146 149
   }
147 150
 
148 151
   // 日期选择
149
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
150
-  changeDate(result?): void {
151
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
152
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
153
-    this.dateRange = result;
154
-  }
155
-
156
-  onCalendarChangeDate(dateArr){
157
-    console.log(dateArr)
158
-    if(dateArr.length == 2){
159
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
160
-    }
161
-  }
152
+  dateRange: any = [];
162 153
 
163 154
   // 导出
164 155
   excelExportLoading:any = false;
@@ -167,8 +158,8 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
167 158
       nzDuration: 0,
168 159
     }).messageId;
169 160
     let postData:any = {
170
-      startDate: this.dateRange[0] || undefined,
171
-      endDate: this.dateRange[1] || undefined,
161
+      startDate: this.customChangeDateComponent.startDate || undefined,
162
+      endDate: this.customChangeDateComponent.endDate || undefined,
172 163
       hosId: this.hosId || undefined,
173 164
       dutyId: this.dutyId || undefined,
174 165
       parentDutyId: this.parentDutyId || undefined,
@@ -210,8 +201,9 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
210 201
     this.sortCurrentKey = "";
211 202
 		this.sortCurrentValue = "";
212 203
 		this.sortCurrent = {};
213
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
204
+    this.dateRange = []
214 205
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, buildingId: undefined, floorId: undefined};
206
+    this.customChangeDateComponent.resetByDate();
215 207
     this.search();
216 208
   }
217 209
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { CategorySourceStatisticsRoutingModule } from './category-source-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { SearchMoreModule } from '../../components/search-more/search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { SearchMoreModule } from '../../components/search-more/search-more.modul
16 17
     CategorySourceStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     SearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class CategorySourceStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCategory1Inp($event)" nzAllowClear nzPlaceHolder="请选择一级分类" [(ngModel)]="category1Id" (nzOpenChange)="openChangeCategory1($event)" (ngModelChange)="changeCategory1($event)">
10 6
         <ng-container *ngFor="let option of category1List">

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 16 - 24
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts

@@ -2,16 +2,17 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
9 9
 @Component({
10 10
   selector: "app-category-three-statistics",
11 11
   templateUrl: "./category-three-statistics.component.html",
12 12
   styleUrls: ["./category-three-statistics.component.less"],
13 13
 })
14 14
 export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15 16
   constructor(
16 17
     private mainService: MainService,
17 18
     private message: NzMessageService,
@@ -35,12 +36,13 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
35 36
       let fun = v[0];
36 37
       fun.call(this, v[1]);
37 38
     });
38
-    this.initSessionData();
39
-    this.getQueryParams();
40
-    this.search();
41 39
   }
42
-
43 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
44 46
     this.onResize();
45 47
   }
46 48
 
@@ -58,6 +60,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
58 60
     this.tabService.clearQueryParams();
59 61
     if(queryParams.dateRange){
60 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
61 64
     }
62 65
   }
63 66
 
@@ -114,8 +117,8 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
114 117
     let postData:any = {
115 118
       idx: this.pageIndex - 1,
116 119
       sum: this.pageSize,
117
-      startDate: this.dateRange[0] || undefined,
118
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
119 122
       hosId: this.hosId || undefined,
120 123
       dutyId: this.dutyId || undefined,
121 124
       parentDutyId: this.parentDutyId || undefined,
@@ -160,19 +163,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
160 163
   }
161 164
 
162 165
   // 日期选择
163
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
164
-  changeDate(result?): void {
165
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
166
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
167
-    this.dateRange = result;
168
-  }
169
-
170
-  onCalendarChangeDate(dateArr){
171
-    console.log(dateArr)
172
-    if(dateArr.length == 2){
173
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
174
-    }
175
-  }
166
+  dateRange: any = [];
176 167
 
177 168
   // 导出
178 169
   excelExportLoading:any = false;
@@ -181,8 +172,8 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
181 172
       nzDuration: 0,
182 173
     }).messageId;
183 174
     let postData:any = {
184
-      startDate: this.dateRange[0] || undefined,
185
-      endDate: this.dateRange[1] || undefined,
175
+      startDate: this.customChangeDateComponent.startDate || undefined,
176
+      endDate: this.customChangeDateComponent.endDate || undefined,
186 177
       hosId: this.hosId || undefined,
187 178
       dutyId: this.dutyId || undefined,
188 179
       parentDutyId: this.parentDutyId || undefined,
@@ -227,10 +218,11 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
227 218
     this.sortCurrentKey = "";
228 219
 		this.sortCurrentValue = "";
229 220
 		this.sortCurrent = {};
230
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
221
+    this.dateRange = []
231 222
     this.category1Id = undefined;
232 223
     this.category2Id = undefined;
233 224
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined};
225
+    this.customChangeDateComponent.resetByDate();
234 226
     this.search();
235 227
   }
236 228
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { CategoryThreeStatisticsRoutingModule } from './category-three-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { SearchMoreModule } from '../../components/search-more/search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { SearchMoreModule } from '../../components/search-more/search-more.modul
16 17
     CategoryThreeStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     SearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class CategoryThreeStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCategory1Inp($event)" nzAllowClear nzPlaceHolder="请选择一级分类" [(ngModel)]="category1Id" (nzOpenChange)="openChangeCategory1($event)">
10 6
         <ng-container *ngFor="let option of category1List">

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 16 - 23
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts

@@ -2,16 +2,17 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
9 9
 @Component({
10 10
   selector: "app-category-two-statistics",
11 11
   templateUrl: "./category-two-statistics.component.html",
12 12
   styleUrls: ["./category-two-statistics.component.less"],
13 13
 })
14 14
 export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15 16
   constructor(
16 17
     private mainService: MainService,
17 18
     private message: NzMessageService,
@@ -34,12 +35,14 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
34 35
       let fun = v[0];
35 36
       fun.call(this, v[1]);
36 37
     });
37
-    this.initSessionData();
38
-    this.getQueryParams();
39
-    this.search();
40 38
   }
41 39
 
42 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
43 46
     this.onResize();
44 47
   }
45 48
 
@@ -57,6 +60,7 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
57 60
     this.tabService.clearQueryParams();
58 61
     if(queryParams.dateRange){
59 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
60 64
     }
61 65
   }
62 66
 
@@ -113,8 +117,8 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
113 117
     let postData:any = {
114 118
       idx: this.pageIndex - 1,
115 119
       sum: this.pageSize,
116
-      startDate: this.dateRange[0] || undefined,
117
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
118 122
       hosId: this.hosId || undefined,
119 123
       dutyId: this.dutyId || undefined,
120 124
       parentDutyId: this.parentDutyId || undefined,
@@ -159,19 +163,7 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
159 163
   }
160 164
 
161 165
   // 日期选择
162
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
163
-  changeDate(result?): void {
164
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
165
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
166
-    this.dateRange = result;
167
-  }
168
-
169
-  onCalendarChangeDate(dateArr){
170
-    console.log(dateArr)
171
-    if(dateArr.length == 2){
172
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
173
-    }
174
-  }
166
+  dateRange: any = [];
175 167
 
176 168
   // 导出
177 169
   excelExportLoading:any = false;
@@ -180,8 +172,8 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
180 172
       nzDuration: 0,
181 173
     }).messageId;
182 174
     let postData:any = {
183
-      startDate: this.dateRange[0] || undefined,
184
-      endDate: this.dateRange[1] || undefined,
175
+      startDate: this.customChangeDateComponent.startDate || undefined,
176
+      endDate: this.customChangeDateComponent.endDate || undefined,
185 177
       hosId: this.hosId || undefined,
186 178
       dutyId: this.dutyId || undefined,
187 179
       parentDutyId: this.parentDutyId || undefined,
@@ -226,9 +218,10 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
226 218
     this.sortCurrentKey = "";
227 219
 		this.sortCurrentValue = "";
228 220
 		this.sortCurrent = {};
229
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
221
+    this.dateRange = []
230 222
     this.category1Id = undefined;
231 223
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined};
224
+    this.customChangeDateComponent.resetByDate();
232 225
     this.search();
233 226
   }
234 227
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.module.ts

@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
5 5
 import { CategoryTwoStatisticsRoutingModule } from './category-two-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { SearchMoreModule } from '../../components/search-more/search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 9
 
9 10
 
10 11
 @NgModule({
@@ -16,6 +17,7 @@ import { SearchMoreModule } from '../../components/search-more/search-more.modul
16 17
     CategoryTwoStatisticsRoutingModule,
17 18
     ShareModule,
18 19
     SearchMoreModule,
20
+    CustomChangeDateModule,
19 21
   ]
20 22
 })
21 23
 export class CategoryTwoStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">报修科室</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 16 - 23
src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.ts

@@ -2,16 +2,17 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
9 9
 @Component({
10 10
   selector: "app-consumable-statistics",
11 11
   templateUrl: "./consumable-statistics.component.html",
12 12
   styleUrls: ["./consumable-statistics.component.less"],
13 13
 })
14 14
 export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15 16
   constructor(
16 17
     private mainService: MainService,
17 18
     private message: NzMessageService,
@@ -34,12 +35,14 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
34 35
       let fun = v[0];
35 36
       fun.call(this, v[1]);
36 37
     });
37
-    this.initSessionData();
38
-    this.getQueryParams();
39
-    this.search();
40 38
   }
41 39
 
42 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
43 46
     this.onResize();
44 47
   }
45 48
 
@@ -57,6 +60,7 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
57 60
     this.tabService.clearQueryParams();
58 61
     if(queryParams.dateRange){
59 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
60 64
     }
61 65
   }
62 66
 
@@ -113,8 +117,8 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
113 117
     let postData:any = {
114 118
       idx: this.pageIndex - 1,
115 119
       sum: this.pageSize,
116
-      startDate: this.dateRange[0] || undefined,
117
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
118 122
       hosId: this.hosId || undefined,
119 123
       dutyId: this.dutyId || undefined,
120 124
       parentDutyId: this.parentDutyId || undefined,
@@ -158,19 +162,7 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
158 162
   }
159 163
 
160 164
   // 日期选择
161
-  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
162
-  changeDate(result?): void {
163
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
164
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
165
-    this.dateRange = result;
166
-  }
167
-
168
-  onCalendarChangeDate(dateArr){
169
-    console.log(dateArr)
170
-    if(dateArr.length == 2){
171
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
172
-    }
173
-  }
165
+  dateRange: any = [];
174 166
 
175 167
   // 导出
176 168
   excelExportLoading:any = false;
@@ -179,8 +171,8 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
179 171
       nzDuration: 0,
180 172
     }).messageId;
181 173
     let postData:any = {
182
-      startDate: this.dateRange[0] || undefined,
183
-      endDate: this.dateRange[1] || undefined,
174
+      startDate: this.customChangeDateComponent.startDate || undefined,
175
+      endDate: this.customChangeDateComponent.endDate || undefined,
184 176
       hosId: this.hosId || undefined,
185 177
       dutyId: this.dutyId || undefined,
186 178
       parentDutyId: this.parentDutyId || undefined,
@@ -224,9 +216,10 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
224 216
     this.sortCurrentKey = "";
225 217
 		this.sortCurrentValue = "";
226 218
 		this.sortCurrent = {};
227
-    this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
219
+    this.dateRange = []
228 220
     this.repairDeptId = undefined;
229 221
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined};
222
+    this.customChangeDateComponent.resetByDate();
230 223
     this.search();
231 224
   }
232 225
 

+ 0 - 0
src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.module.ts


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels