Bladeren bron

电话统计页面

seimin 1 maand geleden
bovenliggende
commit
3ed37f411c
20 gewijzigde bestanden met toevoegingen van 1620 en 0 verwijderingen
  1. 97 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.html
  2. 115 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.less
  3. 308 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.ts
  4. 20 0
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.module.ts
  5. 5 0
      src/app/views/new-statistics/new-statistics-routing.module.ts
  6. 14 0
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics-routing.module.ts
  7. 83 0
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.html
  8. 71 0
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.less
  9. 257 0
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.ts
  10. 23 0
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.module.ts
  11. 14 0
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics-routing.module.ts
  12. 83 0
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.html
  13. 71 0
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.less
  14. 257 0
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.ts
  15. 21 0
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.module.ts
  16. 37 0
      src/app/views/new-statistics/phone-statistics/phone-statistics-routing.module.ts
  17. 10 0
      src/app/views/new-statistics/phone-statistics/phone-statistics.component.html
  18. 70 0
      src/app/views/new-statistics/phone-statistics/phone-statistics.component.less
  19. 41 0
      src/app/views/new-statistics/phone-statistics/phone-statistics.component.ts
  20. 23 0
      src/app/views/new-statistics/phone-statistics/phone-statistics.module.ts

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

@@ -0,0 +1,97 @@
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
+        <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
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
+
21
+        <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
22
+          <nz-form-label [nzSpan]="6" nzFor="userId">人<span style="visibility: hidden;">囧囧</span>员</nz-form-label>
23
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择人员!">
24
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择人员" (nzOpenChange)="openChangeUser($event)" (ngModelChange)="setIsSelecting(true)">
25
+              <ng-container *ngFor="let option of userList">
26
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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
+
35
+        <nz-form-item [hidden]="!fieldConfig.config.statisticsType">
36
+          <nz-form-label [nzSpan]="6" nzFor="statisticsTypeId">统计分类</nz-form-label>
37
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择统计分类!">
38
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear formControlName="statisticsTypeId" nzPlaceHolder="请选择统计分类">
39
+              <ng-container *ngFor="let option of statisticsTypeList">
40
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
41
+              </ng-container>
42
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
43
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
44
+              </nz-option>
45
+            </nz-select>
46
+          </nz-form-control>
47
+        </nz-form-item>
48
+
49
+        <nz-form-item [hidden]="!fieldConfig.config.taskType">
50
+          <nz-form-label [nzSpan]="6" nzFor="taskTypeId">任务类型</nz-form-label>
51
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择任务类型!">
52
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeTaskTypeInp($event)" formControlName="taskTypeId" nzPlaceHolder="请选择任务类型" (nzOpenChange)="openChangeTaskType($event)" (ngModelChange)="setIsSelecting(true)">
53
+              <ng-container *ngFor="let option of taskTypeList">
54
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.hosId.hosName + '-' + option.taskName" [nzValue]="option.id"></nz-option>
55
+              </ng-container>
56
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
57
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
58
+              </nz-option>
59
+            </nz-select>
60
+          </nz-form-control>
61
+        </nz-form-item>
62
+
63
+        <nz-form-item [hidden]="!fieldConfig.config.building">
64
+          <nz-form-label [nzSpan]="6" nzFor="buildingId">楼<span style="visibility: hidden;">囧囧</span>栋</nz-form-label>
65
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼栋!">
66
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeBuildingInp($event)" formControlName="buildingId" nzPlaceHolder="请选择楼栋" (nzOpenChange)="openChangeBuilding($event)" (ngModelChange)="setIsSelecting(true)">
67
+              <ng-container *ngFor="let option of buildingList">
68
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName + '-' + option.buildingName" [nzValue]="option.id"></nz-option>
69
+              </ng-container>
70
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
71
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
72
+              </nz-option>
73
+            </nz-select>
74
+          </nz-form-control>
75
+        </nz-form-item>
76
+
77
+        <nz-form-item [hidden]="!fieldConfig.config.dept">
78
+          <nz-form-label [nzSpan]="6" nzFor="deptId">科<span style="visibility: hidden;">囧囧</span>室</nz-form-label>
79
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室!">
80
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" formControlName="deptId" nzPlaceHolder="请选择科室" (nzOpenChange)="openChangeRepairDept($event)" (ngModelChange)="setIsSelecting(true)">
81
+              <ng-container *ngFor="let option of deptList">
82
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
83
+              </ng-container>
84
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
85
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
86
+              </nz-option>
87
+            </nz-select>
88
+          </nz-form-control>
89
+        </nz-form-item>
90
+      </form>
91
+    </div>
92
+    <div class="display_flex justify-content_flex-center">
93
+      <button nz-button nzType="default" (click)="hideModal()">取消</button>
94
+      <button nzType="primary" nz-button (click)="submitForm()">确认</button>
95
+    </div>
96
+  </div>
97
+</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
+}

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

@@ -0,0 +1,308 @@
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
+    this.getSourceList();
37
+  }
38
+  // 隐藏模态框
39
+  hideModal() {
40
+    this.cancelEvent.emit()
41
+  }
42
+  // 初始化form表单
43
+  initForm() {
44
+    this.groupList = this.fieldConfig.fields.groupDTO ? [this.fieldConfig.fields.groupDTO] : [];
45
+    this.userList = this.fieldConfig.fields.userDTO ? [this.fieldConfig.fields.userDTO] : [];
46
+    this.statisticsTypeList = this.fieldConfig.fields.statisticsTypeDTO ? [this.fieldConfig.fields.statisticsTypeDTO] : [];
47
+    this.buildingList = this.fieldConfig.fields.buildingDTO ? [this.fieldConfig.fields.buildingDTO] : [];
48
+    this.taskTypeList = this.fieldConfig.fields.taskTypeDTO ? [this.fieldConfig.fields.taskTypeDTO] : [];
49
+    this.deptList = this.fieldConfig.fields.deptDTO ? [this.fieldConfig.fields.deptDTO] : [];
50
+
51
+    this.validateForm = this.fb.group({
52
+      groupId: [this.fieldConfig.fields.groupId || null],
53
+      userId: [this.fieldConfig.fields.userId === undefined ? null : this.fieldConfig.fields.userId],
54
+      statisticsTypeId: [this.fieldConfig.fields.statisticsTypeId || null],
55
+      buildingId: [this.fieldConfig.fields.buildingId || null],
56
+      taskTypeId: [this.fieldConfig.fields.taskTypeDTO ? this.fieldConfig.fields.taskTypeDTO.id  : null],
57
+      deptId: [this.fieldConfig.fields.deptDTO ? this.fieldConfig.fields.deptDTO.id  : null],
58
+    });
59
+  }
60
+  // 表单提交
61
+  submitForm(): void {
62
+    for (const i in this.validateForm.controls) {
63
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
64
+      this.validateForm.controls[i].updateValueAndValidity();
65
+    }
66
+    if (this.validateForm.invalid) return;
67
+
68
+    let fields:any = {}
69
+    if(this.fieldConfig.config.groupAndUser){
70
+      fields.groupId = this.validateForm.value.groupId;
71
+      fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
72
+      fields.userId = this.validateForm.value.userId;
73
+      fields.userDTO = this.userList.find(item => item.id == this.validateForm.value.userId);
74
+    }
75
+
76
+    if(this.fieldConfig.config.statisticsType){
77
+      fields.statisticsTypeId = this.validateForm.value.statisticsTypeId;
78
+      fields.statisticsTypeDTO = this.statisticsTypeList.find(item => item.id == this.validateForm.value.statisticsTypeId);
79
+    }
80
+    if(this.fieldConfig.config.building){
81
+      fields.buildingId = this.validateForm.value.buildingId;
82
+      fields.buildingDTO = this.buildingList.find(item => item.id == this.validateForm.value.buildingId);
83
+    }
84
+    if(this.fieldConfig.config.taskType){
85
+      fields.taskTypeId = this.validateForm.value.taskTypeId;
86
+      fields.taskTypeDTO = this.taskTypeList.find(item => item.id == this.validateForm.value.taskTypeId);
87
+    }
88
+    if(this.fieldConfig.config.dept){
89
+      fields.deptId = this.validateForm.value.deptId;
90
+      fields.deptDTO = this.deptList.find(item => item.id == this.validateForm.value.deptId);
91
+    }
92
+    this.submitEvent.emit(fields);
93
+    this.hideModal();
94
+  }
95
+
96
+  get getHosId(){
97
+    return this.parentDutyId || this.dutyId || this.hosId;
98
+  }
99
+
100
+  // 防抖
101
+  isLoading = false;
102
+  isSelecting:boolean = false; // 是否在选中状态
103
+  searchTimer(fun, e) {
104
+    if (this.isSelecting) {
105
+      this.isSelecting = false; // 重置标志
106
+      return; // 跳过处理
107
+    }
108
+    this.isLoading = true;
109
+    this.searchTimerSubject.next([fun, e]);
110
+  }
111
+
112
+  // 设置标志
113
+  setIsSelecting(flag){
114
+    this.isSelecting = flag; // 设置标志
115
+  }
116
+
117
+  // =================分组===================
118
+
119
+  // 分组搜索
120
+  changeGroupInp(e) {
121
+    this.searchTimer(this.getGroupList, e);
122
+  }
123
+
124
+  // 获取分组列表
125
+  groupList:any[] = [];
126
+  getGroupList(keyword?){
127
+    let postData: any = {
128
+      idx: 0,
129
+      sum: 20,
130
+      group2: {
131
+        statisticalHosId: this.getHosId,
132
+        groupName: keyword,
133
+        type: 1,
134
+      },
135
+    };
136
+    this.isLoading = true;
137
+    this.mainService.getFetchDataList("simple/data", "group2", postData).subscribe(result => {
138
+      this.isLoading = false;
139
+      if(result.status == 200){
140
+        this.groupList = result.list || [];
141
+      }else{
142
+        this.groupList = [];
143
+      }
144
+    });
145
+  }
146
+  openChangeGroup(flag){
147
+    flag && this.setIsSelecting(false);
148
+    flag && this.getGroupList();
149
+  }
150
+
151
+  changeGroup(id){
152
+    this.setIsSelecting(true);
153
+    this.userList = [];
154
+    this.validateForm.controls.userId.setValue(null);
155
+    this.getUserList();
156
+  }
157
+
158
+  // =================人员===================
159
+
160
+  // 人员搜索
161
+  changeUserInp(e) {
162
+    this.searchTimer(this.getUserList, e);
163
+  }
164
+
165
+  // 获取人员列表
166
+  userList:any[] = [];
167
+  getUserList(keyword = ''){
168
+    if(!this.validateForm.value.groupId){
169
+      this.isLoading = false;
170
+      this.userList = [];
171
+      return;
172
+    }
173
+    let postData: any = {
174
+      idx: 0,
175
+      sum: 20,
176
+      user: {
177
+        name: keyword,
178
+        simpleQuery: true,
179
+        groupdata: { id: this.validateForm.value.groupId },
180
+      },
181
+    };
182
+    this.isLoading = true;
183
+    this.mainService.getFetchDataList("simple/data", "user", postData).subscribe(result => {
184
+      this.isLoading = false;
185
+      if(result.status == 200){
186
+        this.userList = result.list || [];
187
+      }else{
188
+        this.userList = [];
189
+      }
190
+    });
191
+  }
192
+  openChangeUser(flag){
193
+    flag && this.setIsSelecting(false);
194
+    flag && this.getUserList();
195
+  }
196
+
197
+  // =================统计分类===================
198
+
199
+  // 获取统计分类列表
200
+  statisticsTypeList:any[] = [];
201
+  getSourceList(){
202
+    this.mainService.getDictionary("list", "statistics_date_type").subscribe(result => {
203
+      this.statisticsTypeList = result;
204
+    });
205
+  }
206
+
207
+  // =================楼栋===================
208
+
209
+  // 楼栋搜索
210
+  changeBuildingInp(e) {
211
+    this.searchTimer(this.getBuildingList, e);
212
+  }
213
+
214
+  // 获取楼栋列表
215
+  buildingList:any[] = [];
216
+  getBuildingList(keyword?){
217
+    let postData: any = {
218
+      idx: 0,
219
+      sum: 20,
220
+      building: {
221
+        simpleQuery: true,
222
+        buildingName: keyword,
223
+        statisticalHosId:this.getHosId,
224
+      },
225
+    };
226
+    this.isLoading = true;
227
+    this.mainService.getFetchDataList("simple/data", "building", postData).subscribe(result => {
228
+      this.isLoading = false;
229
+      if(result.status == 200){
230
+        this.buildingList = result.list || [];
231
+      }else{
232
+        this.buildingList = [];
233
+      }
234
+    });
235
+  }
236
+  openChangeBuilding(flag){
237
+    flag && this.setIsSelecting(false);
238
+    flag && this.getBuildingList();
239
+  }
240
+
241
+  // =================任务类型===================
242
+
243
+  // 任务类型搜索
244
+  changeTaskTypeInp(e) {
245
+    this.searchTimer(this.getTaskTypeList, e);
246
+  }
247
+
248
+  // 获取任务类型列表
249
+  taskTypeList:any[] = [];
250
+  getTaskTypeList(keyword?){
251
+    let postData: any = {
252
+      idx: 0,
253
+      sum: 20,
254
+      taskType: {
255
+        simpleQuery: true,
256
+        taskName: keyword,
257
+        statisticalHosId: this.getHosId,
258
+      },
259
+    };
260
+    this.isLoading = true;
261
+    this.mainService.getFetchDataList("simple/data", "taskType", postData).subscribe(result => {
262
+      this.isLoading = false;
263
+      if(result.status == 200){
264
+        this.taskTypeList = result.list || [];
265
+      }else{
266
+        this.taskTypeList = [];
267
+      }
268
+    });
269
+  }
270
+  openChangeTaskType(flag){
271
+    flag && this.setIsSelecting(false);
272
+    flag && this.getTaskTypeList();
273
+  }
274
+
275
+  // =================科室===================
276
+
277
+  // 科室搜索
278
+  changeRepairDeptInp(e) {
279
+    this.searchTimer(this.getRepairDeptList, e);
280
+  }
281
+
282
+  // 获取科室列表
283
+  deptList:any[] = [];
284
+  getRepairDeptList(keyword?){
285
+    let postData: any = {
286
+      idx: 0,
287
+      sum: 20,
288
+      department: {
289
+        statisticalHosId: this.getHosId,
290
+        dept: keyword,
291
+        searchType: 1,
292
+      },
293
+    };
294
+    this.isLoading = true;
295
+    this.mainService.getFetchDataList("simple/data", "department", postData).subscribe(result => {
296
+      this.isLoading = false;
297
+      if(result.status == 200){
298
+        this.deptList = result.list || [];
299
+      }else{
300
+        this.deptList = [];
301
+      }
302
+    });
303
+  }
304
+  openChangeRepairDept(flag){
305
+    flag && this.setIsSelecting(false);
306
+    flag && this.getRepairDeptList();
307
+  }
308
+}

+ 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 { }

+ 5 - 0
src/app/views/new-statistics/new-statistics-routing.module.ts

@@ -18,6 +18,11 @@ const routes: Routes = [
18 18
         path: 'distributionInspectionStatistics',
19 19
         loadChildren: () => import('./distribution-inspection-statistics/distribution-inspection-statistics.module').then(m => m.DistributionInspectionStatisticsModule),
20 20
       },
21
+      {
22
+        // 电话统计
23
+        path: 'phoneStatistics',
24
+        loadChildren: () => import('./phone-statistics/phone-statistics.module').then(m => m.PhoneStatisticsModule),
25
+      },
21 26
     ]
22 27
   }
23 28
 ];

+ 14 - 0
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics-routing.module.ts

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

+ 83 - 0
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.html

@@ -0,0 +1,83 @@
1
+<div class="searchDataWrap">
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
+    <div class="searchDataItem">
9
+      <span class="label">统计分类</span>:
10
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType($event)">
11
+        <ng-container *ngFor="let option of statisticsTypeList">
12
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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
+    </div>
19
+  </div>
20
+  <div class="operation">
21
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
22
+    <button nz-button class="btn default" (click)="search()">查询</button>
23
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
24
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
+  </div>
26
+</div>
27
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
28
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
+  <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
+  <span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
31
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
32
+  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
33
+</div>
34
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
35
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
36
+    <tr>
37
+      <th nzWidth="12%" nzShowSort nzSortKey="date" [(nzSort)]="sortCurrent.date">日期</th>
38
+      <th nzWidth="11%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
39
+      <th nzWidth="11%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
40
+      <th nzWidth="11%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
41
+      <th nzWidth="11%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
42
+      <th nzWidth="11%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时完成达标率</th>
43
+      <th nzWidth="11%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
44
+      <th nzWidth="11%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
45
+      <th nzWidth="11%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
46
+    </tr>
47
+  </thead>
48
+  <tbody>
49
+    <tr *ngFor="let data of listOfData">
50
+      <td>{{ data.date }}</td>
51
+      <td>{{ data.totalCount }}</td>
52
+      <td>{{ data.totalGrade }}</td>
53
+      <td>{{ data.response_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: 12%">{{ data.date }}</td>
65
+        <td style="width: 11%">{{ data.totalCount }}</td>
66
+        <td style="width: 11%">{{ data.totalGrade }}</td>
67
+        <td style="width: 11%">{{ data.response_time_num }}</td>
68
+        <td style="width: 11%">{{ data.execution_time_num }}</td>
69
+        <td style="width: 11%">{{ data.aveper }}</td>
70
+        <td style="width: 11%">{{ data.total_time }}</td>
71
+        <td style="width: 11%">{{ data.five_count }}</td>
72
+        <td style="width: 11%">{{ data.special_close }}</td>
73
+      </tr>
74
+    </table>
75
+  </ng-template>
76
+</nz-table>
77
+<div class="pagination">
78
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
79
+  <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>
80
+</div>
81
+
82
+<!-- 详细搜索 -->
83
+<app-phone-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-phone-search-more>

+ 71 - 0
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-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: 224px;
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
+}

+ 257 - 0
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.ts

@@ -0,0 +1,257 @@
1
+import { TabService } from './../../services/tab.service';
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";
5
+import { MainService } from 'src/app/services/main.service';
6
+import { ActivatedRoute } from '@angular/router';
7
+@Component({
8
+  selector: "app-date-phone-statistics",
9
+  templateUrl: "./date-phone-statistics.component.html",
10
+  styleUrls: ["./date-phone-statistics.component.less"],
11
+})
12
+export class DatePhoneStatisticsComponent implements OnInit, AfterViewInit {
13
+  constructor(
14
+    private mainService: MainService,
15
+    private message: NzMessageService,
16
+    private route: ActivatedRoute,
17
+    private tabService: TabService,
18
+  ) {}
19
+
20
+  listOfData: any[] = []; //表格数据
21
+  listOfDataEnd: any[] = []; //表格合计
22
+  pageIndex: number = 1; //表格当前页码
23
+  pageSize: number = 30; //表格每页展示条数
24
+  listLength: number = 0; //表格总数据量
25
+
26
+  statisticsTypeId;//统计分类id
27
+
28
+  ngOnInit() {
29
+    this.initSessionData();
30
+    this.getQueryParams();
31
+    this.search();
32
+  }
33
+
34
+  ngAfterViewInit(){
35
+    this.onResize();
36
+  }
37
+
38
+  tableHeight:number = 0;
39
+  @HostListener('window:resize')
40
+  onResize(): void {
41
+    setTimeout(() => {
42
+      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;
43
+
44
+    }, 0)
45
+  }
46
+
47
+  getQueryParams(){
48
+    let queryParams = this.tabService.getQueryParams();
49
+    this.tabService.clearQueryParams();
50
+    if(queryParams.dateRange){
51
+      this.dateRange = queryParams.dateRange;
52
+    }
53
+  }
54
+
55
+  get getMoreFilter(){
56
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.taskTypeDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.deptDTO;
57
+    return flag ? 37 : 0;
58
+  }
59
+
60
+  // 初始化缓存数据
61
+  queryType:any;
62
+  hosId:any;
63
+  dutyId:any;
64
+  parentDutyId:any;
65
+  initSessionData(){
66
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
67
+    let queryType:any = newStatistics.queryType;
68
+    let hosId:any = newStatistics.hospitalId;
69
+    let dutyId:any = newStatistics.dutyId;
70
+
71
+    queryType = queryType ? +queryType : undefined;
72
+    hosId = hosId ? +hosId : undefined;
73
+    dutyId = dutyId ? +dutyId : undefined;
74
+
75
+    this.queryType = queryType;
76
+    if(queryType == 1){
77
+      this.hosId = undefined;
78
+      this.dutyId = undefined;
79
+      this.parentDutyId = undefined;
80
+    }else if(queryType == 2){
81
+      this.hosId = hosId;
82
+      this.dutyId = undefined;
83
+      this.parentDutyId = undefined;
84
+    }else if(queryType == 3){
85
+      this.hosId = undefined;
86
+      this.dutyId = dutyId;
87
+      this.parentDutyId = undefined;
88
+    }else if(queryType == 4){
89
+      this.hosId = undefined;
90
+      this.dutyId = undefined;
91
+      this.parentDutyId = dutyId;
92
+    }
93
+  }
94
+
95
+  get getHosId(){
96
+    return this.parentDutyId || this.dutyId || this.hosId;
97
+  }
98
+
99
+  // 表格数据
100
+  loading1 = false;
101
+  getList(num?: number, field?: string, sort?: string) {
102
+    if (num !== undefined) {
103
+      this.pageIndex = num;
104
+    }
105
+    let postData:any = {
106
+      idx: this.pageIndex - 1,
107
+      sum: this.pageSize,
108
+      startDate: this.dateRange[0] || undefined,
109
+      endDate: this.dateRange[1] || undefined,
110
+      hosId: this.getHosId,
111
+      statisticsTypeId: this.statisticsTypeId || undefined,
112
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
113
+      userId: this.fieldConfig.fields.userId || undefined,
114
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
115
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
116
+      deptId: this.fieldConfig.fields.deptId || undefined,
117
+    };
118
+    if (field && sort) {
119
+      postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
120
+    }
121
+    this.loading1 = true;
122
+    this.mainService
123
+      .postCustom("itsm/report", "dateTransOrderQc", postData)
124
+      .subscribe((result) => {
125
+        this.loading1 = false;
126
+        this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
127
+        this.listOfDataEnd = result.dataList.filter((v, i) => { return i == result.dataList.length - 1 });
128
+        this.listLength = result.totalCount;
129
+      });
130
+  }
131
+
132
+  // 列表排序
133
+  sortCurrent:any = {};
134
+  sortCurrentKey: string = "";
135
+  sortCurrentValue: string | null = "";
136
+  sort(e) {
137
+    const { key, value } = e;
138
+    this.sortCurrentKey = key;
139
+    this.sortCurrentValue = value;
140
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
141
+  }
142
+
143
+  // 搜索
144
+  search() {
145
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
146
+  }
147
+
148
+  // 日期选择
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
+  }
162
+
163
+  // 导出
164
+  excelExportLoading:any = false;
165
+  excelExport(){
166
+    this.excelExportLoading = this.message.loading("导出中..", {
167
+      nzDuration: 0,
168
+    }).messageId;
169
+    let postData:any = {
170
+      startDate: this.dateRange[0] || undefined,
171
+      endDate: this.dateRange[1] || undefined,
172
+      hosId: this.getHosId,
173
+      statisticsTypeId: this.statisticsTypeId || undefined,
174
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
175
+      userId: this.fieldConfig.fields.userId || undefined,
176
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
177
+      buildingId: this.fieldConfig.fields.buildingId || 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/exportMergeTitle", "dateTransOrderQc", 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 = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
212
+    this.statisticsTypeId = undefined;
213
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined};
214
+    this.search();
215
+  }
216
+
217
+  // 防抖
218
+  isLoading = false;
219
+
220
+  openChangeStatisticsType(flag){
221
+    flag && this.getStatisticsTypeList();
222
+  }
223
+
224
+  // 获取统计分类列表
225
+  statisticsTypeList:any[] = [];
226
+  getStatisticsTypeList(keyword?) {
227
+    this.isLoading = true;
228
+    this.mainService
229
+      .getDictionary("list", "statistics_date_type")
230
+      .subscribe((data) => {
231
+        this.isLoading = false;
232
+        this.statisticsTypeList = data;
233
+      });
234
+  }
235
+
236
+  // 详细搜索
237
+  fieldConfig:any = {
238
+    fields: {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined},
239
+    config: {groupAndUser: true, taskType: true, building: true, dept: true},
240
+  }
241
+  showSearchMore:boolean = false;
242
+  showMore(){
243
+    this.showSearchMore = true;
244
+  }
245
+
246
+  cancelEvent(){
247
+    this.showSearchMore = false;
248
+  }
249
+
250
+  submitEvent(fields){
251
+    this.showSearchMore = false;
252
+    this.fieldConfig.fields = fields;
253
+    console.log('this.fieldConfig.fields:', this.fieldConfig.fields)
254
+    this.search();
255
+    this.onResize();
256
+  }
257
+}

+ 23 - 0
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { DatePhoneStatisticsComponent } from './date-phone-statistics.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { DatePhoneStatisticsRoutingModule } from './date-phone-statistics-routing.module';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8
+import { PhoneSearchMoreModule } from '../../components/phone-search-more/phone-search-more.module';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    DatePhoneStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    DatePhoneStatisticsRoutingModule,
18
+    ShareModule,
19
+    VirtualScrollerModule,
20
+    PhoneSearchMoreModule,
21
+  ]
22
+})
23
+export class DatePhoneStatisticsModule { }

+ 14 - 0
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics-routing.module.ts

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

+ 83 - 0
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.html

@@ -0,0 +1,83 @@
1
+<div class="searchDataWrap">
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
+    <div class="searchDataItem">
9
+      <span class="label">统计分类</span>:
10
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType($event)">
11
+        <ng-container *ngFor="let option of statisticsTypeList">
12
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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
+    </div>
19
+  </div>
20
+  <div class="operation">
21
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
22
+    <button nz-button class="btn default" (click)="search()">查询</button>
23
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
24
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
+  </div>
26
+</div>
27
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
28
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
+  <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
+  <span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
31
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
32
+  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
33
+</div>
34
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
35
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
36
+    <tr>
37
+      <th nzWidth="12%" nzShowSort nzSortKey="date" [(nzSort)]="sortCurrent.date">日期</th>
38
+      <th nzWidth="11%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
39
+      <th nzWidth="11%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
40
+      <th nzWidth="11%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
41
+      <th nzWidth="11%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
42
+      <th nzWidth="11%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时完成达标率</th>
43
+      <th nzWidth="11%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
44
+      <th nzWidth="11%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
45
+      <th nzWidth="11%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
46
+    </tr>
47
+  </thead>
48
+  <tbody>
49
+    <tr *ngFor="let data of listOfData">
50
+      <td>{{ data.date }}</td>
51
+      <td>{{ data.totalCount }}</td>
52
+      <td>{{ data.totalGrade }}</td>
53
+      <td>{{ data.response_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: 12%">{{ data.date }}</td>
65
+        <td style="width: 11%">{{ data.totalCount }}</td>
66
+        <td style="width: 11%">{{ data.totalGrade }}</td>
67
+        <td style="width: 11%">{{ data.response_time_num }}</td>
68
+        <td style="width: 11%">{{ data.execution_time_num }}</td>
69
+        <td style="width: 11%">{{ data.aveper }}</td>
70
+        <td style="width: 11%">{{ data.total_time }}</td>
71
+        <td style="width: 11%">{{ data.five_count }}</td>
72
+        <td style="width: 11%">{{ data.special_close }}</td>
73
+      </tr>
74
+    </table>
75
+  </ng-template>
76
+</nz-table>
77
+<div class="pagination">
78
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
79
+  <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>
80
+</div>
81
+
82
+<!-- 详细搜索 -->
83
+<app-phone-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-phone-search-more>

+ 71 - 0
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-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: 224px;
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
+}

+ 257 - 0
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.ts

@@ -0,0 +1,257 @@
1
+import { TabService } from './../../services/tab.service';
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";
5
+import { MainService } from 'src/app/services/main.service';
6
+import { ActivatedRoute } from '@angular/router';
7
+@Component({
8
+  selector: "app-department-phone-statistics",
9
+  templateUrl: "./department-phone-statistics.component.html",
10
+  styleUrls: ["./department-phone-statistics.component.less"],
11
+})
12
+export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit {
13
+  constructor(
14
+    private mainService: MainService,
15
+    private message: NzMessageService,
16
+    private route: ActivatedRoute,
17
+    private tabService: TabService,
18
+  ) {}
19
+
20
+  listOfData: any[] = []; //表格数据
21
+  listOfDataEnd: any[] = []; //表格合计
22
+  pageIndex: number = 1; //表格当前页码
23
+  pageSize: number = 30; //表格每页展示条数
24
+  listLength: number = 0; //表格总数据量
25
+
26
+  statisticsTypeId;//统计分类id
27
+
28
+  ngOnInit() {
29
+    this.initSessionData();
30
+    this.getQueryParams();
31
+    this.search();
32
+  }
33
+
34
+  ngAfterViewInit(){
35
+    this.onResize();
36
+  }
37
+
38
+  tableHeight:number = 0;
39
+  @HostListener('window:resize')
40
+  onResize(): void {
41
+    setTimeout(() => {
42
+      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;
43
+
44
+    }, 0)
45
+  }
46
+
47
+  getQueryParams(){
48
+    let queryParams = this.tabService.getQueryParams();
49
+    this.tabService.clearQueryParams();
50
+    if(queryParams.dateRange){
51
+      this.dateRange = queryParams.dateRange;
52
+    }
53
+  }
54
+
55
+  get getMoreFilter(){
56
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.taskTypeDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.deptDTO;
57
+    return flag ? 37 : 0;
58
+  }
59
+
60
+  // 初始化缓存数据
61
+  queryType:any;
62
+  hosId:any;
63
+  dutyId:any;
64
+  parentDutyId:any;
65
+  initSessionData(){
66
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
67
+    let queryType:any = newStatistics.queryType;
68
+    let hosId:any = newStatistics.hospitalId;
69
+    let dutyId:any = newStatistics.dutyId;
70
+
71
+    queryType = queryType ? +queryType : undefined;
72
+    hosId = hosId ? +hosId : undefined;
73
+    dutyId = dutyId ? +dutyId : undefined;
74
+
75
+    this.queryType = queryType;
76
+    if(queryType == 1){
77
+      this.hosId = undefined;
78
+      this.dutyId = undefined;
79
+      this.parentDutyId = undefined;
80
+    }else if(queryType == 2){
81
+      this.hosId = hosId;
82
+      this.dutyId = undefined;
83
+      this.parentDutyId = undefined;
84
+    }else if(queryType == 3){
85
+      this.hosId = undefined;
86
+      this.dutyId = dutyId;
87
+      this.parentDutyId = undefined;
88
+    }else if(queryType == 4){
89
+      this.hosId = undefined;
90
+      this.dutyId = undefined;
91
+      this.parentDutyId = dutyId;
92
+    }
93
+  }
94
+
95
+  get getHosId(){
96
+    return this.parentDutyId || this.dutyId || this.hosId;
97
+  }
98
+
99
+  // 表格数据
100
+  loading1 = false;
101
+  getList(num?: number, field?: string, sort?: string) {
102
+    if (num !== undefined) {
103
+      this.pageIndex = num;
104
+    }
105
+    let postData:any = {
106
+      idx: this.pageIndex - 1,
107
+      sum: this.pageSize,
108
+      startDate: this.dateRange[0] || undefined,
109
+      endDate: this.dateRange[1] || undefined,
110
+      hosId: this.getHosId,
111
+      statisticsTypeId: this.statisticsTypeId || undefined,
112
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
113
+      userId: this.fieldConfig.fields.userId || undefined,
114
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
115
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
116
+      deptId: this.fieldConfig.fields.deptId || undefined,
117
+    };
118
+    if (field && sort) {
119
+      postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
120
+    }
121
+    this.loading1 = true;
122
+    this.mainService
123
+      .postCustom("itsm/report", "dateTransOrderQc", postData)
124
+      .subscribe((result) => {
125
+        this.loading1 = false;
126
+        this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
127
+        this.listOfDataEnd = result.dataList.filter((v, i) => { return i == result.dataList.length - 1 });
128
+        this.listLength = result.totalCount;
129
+      });
130
+  }
131
+
132
+  // 列表排序
133
+  sortCurrent:any = {};
134
+  sortCurrentKey: string = "";
135
+  sortCurrentValue: string | null = "";
136
+  sort(e) {
137
+    const { key, value } = e;
138
+    this.sortCurrentKey = key;
139
+    this.sortCurrentValue = value;
140
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
141
+  }
142
+
143
+  // 搜索
144
+  search() {
145
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
146
+  }
147
+
148
+  // 日期选择
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
+  }
162
+
163
+  // 导出
164
+  excelExportLoading:any = false;
165
+  excelExport(){
166
+    this.excelExportLoading = this.message.loading("导出中..", {
167
+      nzDuration: 0,
168
+    }).messageId;
169
+    let postData:any = {
170
+      startDate: this.dateRange[0] || undefined,
171
+      endDate: this.dateRange[1] || undefined,
172
+      hosId: this.getHosId,
173
+      statisticsTypeId: this.statisticsTypeId || undefined,
174
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
175
+      userId: this.fieldConfig.fields.userId || undefined,
176
+      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
177
+      buildingId: this.fieldConfig.fields.buildingId || 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/exportMergeTitle", "dateTransOrderQc", 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 = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]
212
+    this.statisticsTypeId = undefined;
213
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined};
214
+    this.search();
215
+  }
216
+
217
+  // 防抖
218
+  isLoading = false;
219
+
220
+  openChangeStatisticsType(flag){
221
+    flag && this.getStatisticsTypeList();
222
+  }
223
+
224
+  // 获取统计分类列表
225
+  statisticsTypeList:any[] = [];
226
+  getStatisticsTypeList(keyword?) {
227
+    this.isLoading = true;
228
+    this.mainService
229
+      .getDictionary("list", "statistics_date_type")
230
+      .subscribe((data) => {
231
+        this.isLoading = false;
232
+        this.statisticsTypeList = data;
233
+      });
234
+  }
235
+
236
+  // 详细搜索
237
+  fieldConfig:any = {
238
+    fields: {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined},
239
+    config: {groupAndUser: true, taskType: true, building: true, dept: true},
240
+  }
241
+  showSearchMore:boolean = false;
242
+  showMore(){
243
+    this.showSearchMore = true;
244
+  }
245
+
246
+  cancelEvent(){
247
+    this.showSearchMore = false;
248
+  }
249
+
250
+  submitEvent(fields){
251
+    this.showSearchMore = false;
252
+    this.fieldConfig.fields = fields;
253
+    console.log('this.fieldConfig.fields:', this.fieldConfig.fields)
254
+    this.search();
255
+    this.onResize();
256
+  }
257
+}

+ 21 - 0
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.module.ts

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

+ 37 - 0
src/app/views/new-statistics/phone-statistics/phone-statistics-routing.module.ts

@@ -0,0 +1,37 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { PhoneStatisticsComponent } from './phone-statistics.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: PhoneStatisticsComponent,
10
+    children: [
11
+      {
12
+        // 日期电话统计
13
+        path: 'datePhoneStatistics',
14
+        loadChildren: () => import('./date-phone-statistics/date-phone-statistics.module').then(m => m.DatePhoneStatisticsModule),
15
+        data: {
16
+          reuse: true,
17
+          title: '电-日期电话统计'
18
+        }
19
+      },
20
+      {
21
+        // 科室电话统计
22
+        path: 'departmentPhoneStatistics',
23
+        loadChildren: () => import('./department-phone-statistics/department-phone-statistics.module').then(m => m.DepartmentPhoneStatisticsModule),
24
+        data: {
25
+          reuse: true,
26
+          title: '电-科室电话统计'
27
+        }
28
+      },
29
+    ]
30
+  }
31
+];
32
+
33
+@NgModule({
34
+  imports: [RouterModule.forChild(routes)],
35
+  exports: [RouterModule]
36
+})
37
+export class PhoneStatisticsRoutingModule { }

+ 10 - 0
src/app/views/new-statistics/phone-statistics/phone-statistics.component.html

@@ -0,0 +1,10 @@
1
+<!-- content -->
2
+<div class="content">
3
+  <virtual-scroller #osComponentRef1 [items]="secondMenuList" class="secondMenu">
4
+    <a replaceUrl [routerLink]="'/newStatistics/' + route.parent.snapshot.routeConfig.path + '/' + data.link" class="secondMenuItem ellipsis-oneline" routerLinkActive="active" [title]="data.title" *ngFor="let data of osComponentRef1.viewPortItems">{{data.title}}</a>
5
+  </virtual-scroller>
6
+  <div class="main">
7
+    <app-custom-tabs></app-custom-tabs>
8
+    <router-outlet></router-outlet>
9
+  </div>
10
+</div>

+ 70 - 0
src/app/views/new-statistics/phone-statistics/phone-statistics.component.less

@@ -0,0 +1,70 @@
1
+@import "../../../../../src/theme.less";
2
+
3
+:host{
4
+  background-color: #F0F2F5;
5
+  width: 100%;
6
+  height: calc(100vh - 48px);
7
+  font-size: 14px;
8
+  display: flex;
9
+  flex-direction: column;
10
+  ::ng-deep .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
11
+    height: 36px!important;
12
+    line-height: 34px!important;
13
+    padding: 0 12px!important;
14
+  }
15
+  ::ng-deep .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
16
+    height: 36px!important;
17
+  }
18
+  ::ng-deep .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
19
+    background: #E9EAEC;
20
+  }
21
+  ::ng-deep .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
22
+    background: #fff;
23
+  }
24
+
25
+  .content{
26
+    margin-top: 8px;
27
+    display: flex;
28
+    flex: 1;
29
+    min-height: 0;
30
+		overflow-x: hidden;
31
+    height: 100%;
32
+    .secondMenu{
33
+      width: 175px;
34
+      height: 100%;
35
+      background-color: #fff;
36
+      margin-right: 8px;
37
+      flex-shrink: 0;
38
+      .secondMenuItem{
39
+        height: 44px;
40
+        line-height: 44px;
41
+        padding: 0 36px;
42
+        border-bottom: 1px solid #E9E9E9;
43
+        cursor: pointer;
44
+        display: block;
45
+        color: rgba(0,0,0,0.65);
46
+        &.active{
47
+          background-color: #E9F7E9;
48
+          border-color: #E9F7E9;
49
+          position: relative;
50
+          &::after{
51
+            content: '';
52
+            position: absolute;
53
+            right: 0;
54
+            top: 0;
55
+            width: 5px;
56
+            height: 100%;
57
+            background-color: @primary-color;
58
+          }
59
+        }
60
+      }
61
+    }
62
+    .main{
63
+      flex: 1;
64
+      height: calc(100% - 36px);
65
+      background-color: #fff;
66
+      position: relative;
67
+      top: 36px;
68
+    }
69
+  }
70
+}

+ 41 - 0
src/app/views/new-statistics/phone-statistics/phone-statistics.component.ts

@@ -0,0 +1,41 @@
1
+import { ActivatedRoute, Router } from '@angular/router';
2
+import { Component, OnInit } from "@angular/core";
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { TabService } from '../services/tab.service';
5
+@Component({
6
+  selector: "app-phone-statistics",
7
+  templateUrl: "./phone-statistics.component.html",
8
+  styleUrls: ["./phone-statistics.component.less"],
9
+})
10
+export class PhoneStatisticsComponent implements OnInit {
11
+  constructor(
12
+    public tool: ToolService,
13
+    public route: ActivatedRoute,
14
+    public router: Router,
15
+    public tabService: TabService,
16
+  ) {}
17
+
18
+  menuList: any[] = [];
19
+  secondMenuList:any[] = [];
20
+
21
+  ngOnInit() {
22
+    this.getMenuList();
23
+    console.log('this.menuList:', this.menuList)
24
+  }
25
+
26
+  initSecondMenu(){
27
+    this.secondMenuList = this.menuList.find(v => v.link == this.route.parent.routeConfig.path).childrens || [];
28
+    if(location.hash == '#/newStatistics/phoneStatistics'){
29
+      this.router.navigate([`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.secondMenuList[0].link}`], { replaceUrl: true });
30
+    }else{
31
+      let tab = this.tabService.tabs.find(v => v.active);
32
+      this.router.navigate([tab.path], { replaceUrl: true });
33
+    }
34
+  }
35
+
36
+  getMenuList(){
37
+    this.menuList = this.tool.getMenuAutoType();
38
+    this.initSecondMenu();
39
+  }
40
+
41
+}

+ 23 - 0
src/app/views/new-statistics/phone-statistics/phone-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { CustomTabsModule } from './../components/custom-tabs/custom-tabs.module';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { PhoneStatisticsRoutingModule } from './phone-statistics-routing.module';
6
+import { PhoneStatisticsComponent } from './phone-statistics.component';
7
+import { ShareModule } from 'src/app/share/share.module';
8
+import { VirtualScrollerModule } from 'ngx-virtual-scroller';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    PhoneStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    PhoneStatisticsRoutingModule,
18
+    ShareModule,
19
+    VirtualScrollerModule,
20
+    CustomTabsModule,
21
+  ],
22
+})
23
+export class PhoneStatisticsModule { }