seimin 1 month ago
parent
commit
749e190e3a
37 changed files with 921 additions and 232 deletions
  1. 2 4
      src/app/services/tool.service.ts
  2. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics-routing.module.ts
  3. 90 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.html
  4. 71 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.less
  5. 287 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.ts
  6. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.module.ts
  7. 28 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics-routing.module.ts
  8. 10 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics.component.html
  9. 68 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics.component.less
  10. 55 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics.component.ts
  11. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics.module.ts
  12. 4 4
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts
  13. 4 4
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts
  14. 4 4
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts
  15. 4 4
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts
  16. 4 4
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts
  17. 4 4
      src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.ts
  18. 4 4
      src/app/views/new-statistics/maintenance-statistics/department-evaluate-statistics/department-evaluate-statistics.component.ts
  19. 4 4
      src/app/views/new-statistics/maintenance-statistics/department-incident-statistics/department-incident-statistics.component.ts
  20. 4 4
      src/app/views/new-statistics/maintenance-statistics/department-source-statistics/department-source-statistics.component.ts
  21. 4 4
      src/app/views/new-statistics/maintenance-statistics/floor-statistics/floor-statistics.component.ts
  22. 4 4
      src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.ts
  23. 4 4
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts
  24. 0 14
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.html
  25. 0 35
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.less
  26. 9 108
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.ts
  27. 0 2
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.module.ts
  28. 4 4
      src/app/views/new-statistics/maintenance-statistics/synthesize-statistics/synthesize-statistics.component.ts
  29. 4 4
      src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.ts
  30. 4 4
      src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.ts
  31. 4 4
      src/app/views/new-statistics/maintenance-statistics/work-hour-statistics/work-hour-statistics.component.ts
  32. 5 0
      src/app/views/new-statistics/new-statistics-routing.module.ts
  33. 13 0
      src/app/views/new-statistics/new-statistics.component.html
  34. 35 0
      src/app/views/new-statistics/new-statistics.component.less
  35. 121 4
      src/app/views/new-statistics/new-statistics.component.ts
  36. 2 0
      src/app/views/new-statistics/new-statistics.module.ts
  37. 1 1
      src/app/views/new-statistics/services/tab.service.ts

+ 2 - 4
src/app/services/tool.service.ts

@@ -97,11 +97,9 @@ export class ToolService {
97 97
     return JSON.parse(localStorage.getItem("user")).user.group || [];
98 98
   }
99 99
   // 根据route查询菜单-新版统计专用
100
-  getMenuAutoType(route) {
100
+  getMenuAutoType() {
101 101
     let menu: any = JSON.parse(localStorage.getItem("menu")) || []; //菜单
102
-    let link = route.parent.parent.parent.snapshot.routeConfig.path; //当前路由
103
-    console.log(link, route);
104
-    return menu.filter( v => v.type == link);
102
+    return menu.filter( v => v.type == 'newStatistics');
105 103
   }
106 104
   //获取当前菜单的权限
107 105
   initCoopBtns(route) {

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

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

+ 90 - 0
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.html

@@ -0,0 +1,90 @@
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" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
+        <ng-container *ngFor="let option of repairDeptList">
12
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [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" (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.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
28
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
+  <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
+  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
+  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
+  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
+  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
34
+</div>
35
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
37
+    <tr>
38
+      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
39
+      <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
+      <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均接单时长</th>
41
+      <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时长</th>
42
+      <th nzWidth="9%" nzShowSort nzSortKey="resolvedOverNum" [(nzSort)]="sortCurrent.resolvedOverNum">超时单数</th>
43
+      <th nzWidth="9%" nzShowSort nzSortKey="overTimeNum" [(nzSort)]="sortCurrent.overTimeNum">挂起单数</th>
44
+      <th nzWidth="9%" nzShowSort nzSortKey="consumablePrice" [(nzSort)]="sortCurrent.consumablePrice">耗材费用(元)</th>
45
+      <th nzWidth="9%" nzShowSort nzSortKey="workHourPrice" [(nzSort)]="sortCurrent.workHourPrice">工时费用(元)</th>
46
+      <th nzWidth="9%" nzShowSort nzSortKey="totalPrice" [(nzSort)]="sortCurrent.totalPrice">总费用(元)</th>
47
+      <th nzWidth="9%" nzShowSort nzSortKey="negativeNum" [(nzSort)]="sortCurrent.negativeNum">差评单数</th>
48
+      <th nzWidth="9%" nzShowSort nzSortKey="favorableRate" [(nzSort)]="sortCurrent.favorableRate">好评率</th>
49
+    </tr>
50
+  </thead>
51
+  <tbody>
52
+    <tr *ngFor="let data of listOfData">
53
+      <td>{{ data.startDate }}</td>
54
+      <td>{{ data.sum }}</td>
55
+      <td>{{ data.avgResponseTime }}</td>
56
+      <td>{{ data.avgResolvedTime }}</td>
57
+      <td>{{ data.resolvedOverNum }}</td>
58
+      <td>{{ data.overTimeNum }}</td>
59
+      <td>{{ data.consumablePrice }}</td>
60
+      <td>{{ data.workHourPrice }}</td>
61
+      <td>{{ data.totalPrice }}</td>
62
+      <td>{{ data.negativeNum }}</td>
63
+      <td>{{ data.favorableRate }}</td>
64
+    </tr>
65
+  </tbody>
66
+  <ng-template #footerTpl>
67
+    <table class="footTable">
68
+      <tr *ngFor="let data of listOfDataEnd">
69
+        <td style="width: 10%">{{ data.startDate }}</td>
70
+        <td style="width: 9%">{{ data.sum }}</td>
71
+        <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
+        <td style="width: 9%">{{ data.avgResolvedTime }}</td>
73
+        <td style="width: 9%">{{ data.resolvedOverNum }}</td>
74
+        <td style="width: 9%">{{ data.overTimeNum }}</td>
75
+        <td style="width: 9%">{{ data.consumablePrice }}</td>
76
+        <td style="width: 9%">{{ data.workHourPrice }}</td>
77
+        <td style="width: 9%">{{ data.totalPrice }}</td>
78
+        <td style="width: 9%">{{ data.negativeNum }}</td>
79
+        <td style="width: 9%">{{ data.favorableRate }}</td>
80
+      </tr>
81
+    </table>
82
+  </ng-template>
83
+</nz-table>
84
+<div class="pagination">
85
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
86
+  <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>
87
+</div>
88
+
89
+<!-- 详细搜索 -->
90
+<app-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-search-more>

+ 71 - 0
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-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% - 16px);
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
+}

+ 287 - 0
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.ts

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

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

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

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

@@ -0,0 +1,28 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DistributionInspectionStatisticsComponent } from './distribution-inspection-statistics.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: DistributionInspectionStatisticsComponent,
10
+    children: [
11
+      {
12
+        // 日期业务统计
13
+        path: 'dateBusinessStatistics',
14
+        loadChildren: () => import('./date-business-statistics/date-business-statistics.module').then(m => m.DateBusinessStatisticsModule),
15
+        data: {
16
+          reuse: true,
17
+          title: '日期业务统计'
18
+        }
19
+      },
20
+    ]
21
+  }
22
+];
23
+
24
+@NgModule({
25
+  imports: [RouterModule.forChild(routes)],
26
+  exports: [RouterModule]
27
+})
28
+export class DistributionInspectionStatisticsRoutingModule { }

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

@@ -0,0 +1,10 @@
1
+<!-- content -->
2
+<div class="content">
3
+  <virtual-scroller #osComponentRef1 [items]="secondMenuList" class="secondMenu">
4
+    <div class="secondMenuItem ellipsis-oneline" [ngClass]="{ active: activeSecondMenuLink == data.link }" [title]="data.title" *ngFor="let data of osComponentRef1.viewPortItems" (click)="clickSecondMenu(data)">{{data.title}}</div>
5
+  </virtual-scroller>
6
+  <div class="main">
7
+    <app-custom-tabs (selectTabEmit)="selectTabEmit($event)"></app-custom-tabs>
8
+    <router-outlet></router-outlet>
9
+  </div>
10
+</div>

+ 68 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics.component.less

@@ -0,0 +1,68 @@
1
+@import "../../../../../src/theme.less";
2
+
3
+:host{
4
+  background-color: #F0F2F5;
5
+  width: 100%;
6
+  height: 100vh;
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
+        &.active{
45
+          background-color: #E9F7E9;
46
+          border-color: #E9F7E9;
47
+          position: relative;
48
+          &::after{
49
+            content: '';
50
+            position: absolute;
51
+            right: 0;
52
+            top: 0;
53
+            width: 5px;
54
+            height: 100%;
55
+            background-color: @primary-color;
56
+          }
57
+        }
58
+      }
59
+    }
60
+    .main{
61
+      flex: 1;
62
+      height: calc(100% - 36px);
63
+      background-color: #fff;
64
+      position: relative;
65
+      top: 36px;
66
+    }
67
+  }
68
+}

+ 55 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics.component.ts

@@ -0,0 +1,55 @@
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-distribution-inspection-statistics",
7
+  templateUrl: "./distribution-inspection-statistics.component.html",
8
+  styleUrls: ["./distribution-inspection-statistics.component.less"],
9
+})
10
+export class DistributionInspectionStatisticsComponent 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
+    console.log(this.tabService.tabs)
29
+    let activeTab = this.tabService.tabs.find(v => v.active);
30
+    if(this.secondMenuList.length){
31
+      if(activeTab.path === `/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.secondMenuList[0].link}`){
32
+        this.clickSecondMenu(this.secondMenuList[0]);
33
+      }else{
34
+        this.activeSecondMenuLink = activeTab.path.split('/').reverse()[0];
35
+      }
36
+    }
37
+  }
38
+
39
+  getMenuList(){
40
+    this.menuList = this.tool.getMenuAutoType();
41
+    this.initSecondMenu();
42
+  }
43
+
44
+  // 点击二级菜单
45
+  activeSecondMenuLink:string;
46
+  clickSecondMenu(data){
47
+    this.activeSecondMenuLink = data.link;
48
+    this.router.navigate([`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`], { replaceUrl: true });
49
+  }
50
+
51
+  // 回显二级菜单
52
+  selectTabEmit(link){
53
+    this.activeSecondMenuLink = link;
54
+  }
55
+}

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-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 { DistributionInspectionStatisticsRoutingModule } from './distribution-inspection-statistics-routing.module';
6
+import { DistributionInspectionStatisticsComponent } from './distribution-inspection-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
+    DistributionInspectionStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    DistributionInspectionStatisticsRoutingModule,
18
+    ShareModule,
19
+    VirtualScrollerModule,
20
+    CustomTabsModule,
21
+  ],
22
+})
23
+export class DistributionInspectionStatisticsModule { }

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

@@ -61,10 +61,10 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
61 61
   dutyId:any;
62 62
   parentDutyId:any;
63 63
   initSessionData(){
64
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
65
-    let queryType:any = maintenanceStatistics.queryType;
66
-    let hosId:any = maintenanceStatistics.hospitalId;
67
-    let dutyId:any = maintenanceStatistics.dutyId;
64
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
65
+    let queryType:any = newStatistics.queryType;
66
+    let hosId:any = newStatistics.hospitalId;
67
+    let dutyId:any = newStatistics.dutyId;
68 68
 
69 69
     queryType = queryType ? +queryType : undefined;
70 70
     hosId = hosId ? +hosId : undefined;

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

@@ -61,10 +61,10 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
61 61
   dutyId:any;
62 62
   parentDutyId:any;
63 63
   initSessionData(){
64
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
65
-    let queryType:any = maintenanceStatistics.queryType;
66
-    let hosId:any = maintenanceStatistics.hospitalId;
67
-    let dutyId:any = maintenanceStatistics.dutyId;
64
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
65
+    let queryType:any = newStatistics.queryType;
66
+    let hosId:any = newStatistics.hospitalId;
67
+    let dutyId:any = newStatistics.dutyId;
68 68
 
69 69
     queryType = queryType ? +queryType : undefined;
70 70
     hosId = hosId ? +hosId : undefined;

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

@@ -61,10 +61,10 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
61 61
   dutyId:any;
62 62
   parentDutyId:any;
63 63
   initSessionData(){
64
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
65
-    let queryType:any = maintenanceStatistics.queryType;
66
-    let hosId:any = maintenanceStatistics.hospitalId;
67
-    let dutyId:any = maintenanceStatistics.dutyId;
64
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
65
+    let queryType:any = newStatistics.queryType;
66
+    let hosId:any = newStatistics.hospitalId;
67
+    let dutyId:any = newStatistics.dutyId;
68 68
 
69 69
     queryType = queryType ? +queryType : undefined;
70 70
     hosId = hosId ? +hosId : undefined;

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

@@ -72,10 +72,10 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
72 72
   dutyId:any;
73 73
   parentDutyId:any;
74 74
   initSessionData(){
75
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
76
-    let queryType:any = maintenanceStatistics.queryType;
77
-    let hosId:any = maintenanceStatistics.hospitalId;
78
-    let dutyId:any = maintenanceStatistics.dutyId;
75
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
76
+    let queryType:any = newStatistics.queryType;
77
+    let hosId:any = newStatistics.hospitalId;
78
+    let dutyId:any = newStatistics.dutyId;
79 79
 
80 80
     queryType = queryType ? +queryType : undefined;
81 81
     hosId = hosId ? +hosId : undefined;

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

@@ -71,10 +71,10 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

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

@@ -71,10 +71,10 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/department-evaluate-statistics/department-evaluate-statistics.component.ts

@@ -63,10 +63,10 @@ export class DepartmentEvaluateStatisticsComponent implements OnInit, AfterViewI
63 63
   dutyId:any;
64 64
   parentDutyId:any;
65 65
   initSessionData(){
66
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
67
-    let queryType:any = maintenanceStatistics.queryType;
68
-    let hosId:any = maintenanceStatistics.hospitalId;
69
-    let dutyId:any = maintenanceStatistics.dutyId;
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 70
 
71 71
     queryType = queryType ? +queryType : undefined;
72 72
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/department-incident-statistics/department-incident-statistics.component.ts

@@ -63,10 +63,10 @@ export class DepartmentIncidentStatisticsComponent implements OnInit, AfterViewI
63 63
   dutyId:any;
64 64
   parentDutyId:any;
65 65
   initSessionData(){
66
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
67
-    let queryType:any = maintenanceStatistics.queryType;
68
-    let hosId:any = maintenanceStatistics.hospitalId;
69
-    let dutyId:any = maintenanceStatistics.dutyId;
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 70
 
71 71
     queryType = queryType ? +queryType : undefined;
72 72
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/department-source-statistics/department-source-statistics.component.ts

@@ -63,10 +63,10 @@ export class DepartmentSourceStatisticsComponent implements OnInit, AfterViewIni
63 63
   dutyId:any;
64 64
   parentDutyId:any;
65 65
   initSessionData(){
66
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
67
-    let queryType:any = maintenanceStatistics.queryType;
68
-    let hosId:any = maintenanceStatistics.hospitalId;
69
-    let dutyId:any = maintenanceStatistics.dutyId;
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 70
 
71 71
     queryType = queryType ? +queryType : undefined;
72 72
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/floor-statistics/floor-statistics.component.ts

@@ -71,10 +71,10 @@ export class FloorStatisticsComponent implements OnInit, AfterViewInit {
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.ts

@@ -61,10 +61,10 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
61 61
   dutyId:any;
62 62
   parentDutyId:any;
63 63
   initSessionData(){
64
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
65
-    let queryType:any = maintenanceStatistics.queryType;
66
-    let hosId:any = maintenanceStatistics.hospitalId;
67
-    let dutyId:any = maintenanceStatistics.dutyId;
64
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
65
+    let queryType:any = newStatistics.queryType;
66
+    let hosId:any = newStatistics.hospitalId;
67
+    let dutyId:any = newStatistics.dutyId;
68 68
 
69 69
     queryType = queryType ? +queryType : undefined;
70 70
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts

@@ -71,10 +71,10 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

+ 0 - 14
src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.html

@@ -1,14 +1,3 @@
1
-<!-- header -->
2
-<div class="header">
3
-  <span class="title" *ngFor="let data of menuList" [ngClass]="{ active: activeMenuId == data.id }" (click)="clickMenu(data)">{{data.title}}</span>
4
-  <div class="hospital" (click)="queryRangeClick()">
5
-    <ng-container *ngIf="queryType == 1">查询范围:全院查询</ng-container>
6
-    <ng-container *ngIf="queryType == 2">查询范围:{{hospital.hosName}}</ng-container>
7
-    <ng-container *ngIf="queryType == 3">查询范围:{{hospital.hosName}}{{duty.hosName}}</ng-container>
8
-    <ng-container *ngIf="queryType == 4">查询范围:垂直-{{hospital.hosName}}{{duty.hosName}}</ng-container>
9
-    <i class="icon_transport transport-jiantou_zuoyouqiehuan"></i>
10
-  </div>
11
-</div>
12 1
 <!-- content -->
13 2
 <div class="content">
14 3
   <virtual-scroller #osComponentRef1 [items]="secondMenuList" class="secondMenu">
@@ -19,6 +8,3 @@
19 8
     <router-outlet></router-outlet>
20 9
   </div>
21 10
 </div>
22
-
23
-<!-- 查询范围 -->
24
-<app-query-range [hospital]="hospital" [duty]="duty" [queryType]="queryType" (cancelQueryRange)="cancelQueryRange()" (submitQueryRange)="submitQueryRange($event)" *ngIf="queryRangeFlag"></app-query-range>

+ 0 - 35
src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.less

@@ -21,41 +21,6 @@
21 21
   ::ng-deep .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
22 22
     background: #fff;
23 23
   }
24
-  .header{
25
-    height: 48px;
26
-    background-color: #fff;
27
-    display: flex;
28
-    justify-content: center;
29
-    align-items: center;
30
-    position: relative;
31
-    .title{
32
-      margin-right: 16px;
33
-      cursor: pointer;
34
-      &:last-of-type{
35
-        margin-right: 0;
36
-      }
37
-      &.active{
38
-        color: @primary-color;
39
-      }
40
-    }
41
-    .hospital{
42
-      position: absolute;
43
-      right: 24px;
44
-      top: 50%;
45
-      transform: translateY(-50%);
46
-      color: #666666;
47
-      font-size: 16px;
48
-      display: flex;
49
-      align-items: center;
50
-      cursor: pointer;
51
-      .icon_transport{
52
-        color: #666666;
53
-        font-size: 24px;
54
-        position: relative;
55
-        top: 2px;
56
-      }
57
-    }
58
-  }
59 24
 
60 25
   .content{
61 26
     margin-top: 8px;

+ 9 - 108
src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.ts

@@ -1,5 +1,5 @@
1 1
 import { ActivatedRoute, Router } from '@angular/router';
2
-import { Component, OnInit, OnDestroy } from "@angular/core";
2
+import { Component, OnInit } from "@angular/core";
3 3
 import { ToolService } from 'src/app/services/tool.service';
4 4
 import { TabService } from '../services/tab.service';
5 5
 @Component({
@@ -7,7 +7,7 @@ import { TabService } from '../services/tab.service';
7 7
   templateUrl: "./maintenance-statistics.component.html",
8 8
   styleUrls: ["./maintenance-statistics.component.less"],
9 9
 })
10
-export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
10
+export class MaintenanceStatisticsComponent implements OnInit {
11 11
   constructor(
12 12
     public tool: ToolService,
13 13
     public route: ActivatedRoute,
@@ -20,29 +20,13 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
20 20
 
21 21
   ngOnInit() {
22 22
     this.getMenuList();
23
-    this.initHospitalAndDuty(this.tool.getCurrentHospital());
24 23
     console.log('this.menuList:', this.menuList)
25 24
   }
26 25
 
27
-  ngOnDestroy(){
28
-    // this.sessionRemove();
29
-    this.tabService.deleteAllRouteSnapshot();
30
-  }
31
-
32
-  getMenuList(){
33
-    this.menuList = this.tool.getMenuAutoType(this.route);
34
-    this.menuList.length && this.clickMenu(this.menuList[0]);
35
-  }
36
-
37
-  // 点击一级菜单
38
-  activeMenuId:number;
39
-  clickMenu(data){
40
-    this.activeMenuId = data.id;
41
-    this.secondMenuList = this.menuList.find(v => v.id == this.activeMenuId).childrens || [];
42
-    // this.tabService.deleteAllRouteSnapshot();
26
+  initSecondMenu(){
27
+    this.secondMenuList = this.menuList.find(v => v.link == this.route.parent.routeConfig.path).childrens || [];
43 28
     console.log(this.tabService.tabs)
44 29
     let activeTab = this.tabService.tabs.find(v => v.active);
45
-    // return;
46 30
     if(this.secondMenuList.length){
47 31
       if(activeTab.path === `/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.secondMenuList[0].link}`){
48 32
         this.clickSecondMenu(this.secondMenuList[0]);
@@ -52,6 +36,11 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
52 36
     }
53 37
   }
54 38
 
39
+  getMenuList(){
40
+    this.menuList = this.tool.getMenuAutoType();
41
+    this.initSecondMenu();
42
+  }
43
+
55 44
   // 点击二级菜单
56 45
   activeSecondMenuLink:string;
57 46
   clickSecondMenu(data){
@@ -63,92 +52,4 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
63 52
   selectTabEmit(link){
64 53
     this.activeSecondMenuLink = link;
65 54
   }
66
-
67
-  // 全院查询-1|院区查询-2|责任部门查询-3|部门垂直查询-4
68
-  hospital;
69
-  duty;
70
-  queryType;//查询范围
71
-  // 初始化院区、部门显示
72
-  initHospitalAndDuty(hospitalOrDuty){
73
-    let sessionData = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
74
-    console.log(sessionData);
75
-    if(sessionData){
76
-      this.hospital = sessionData.hospital;
77
-      this.duty = sessionData.duty;
78
-      this.queryType = sessionData.queryType;
79
-      return;
80
-    }
81
-    let type = 'hospital';//默认是院区
82
-    if(hospitalOrDuty.type){
83
-      // 当前是责任部门
84
-      type = 'duty';
85
-    }
86
-
87
-    if(type === 'duty'){
88
-      // 当前的所属责任部门
89
-      this.hospital = hospitalOrDuty.parent;
90
-      this.duty = hospitalOrDuty;
91
-    }else{
92
-      // 当前的所属院区
93
-      this.hospital = hospitalOrDuty;
94
-      this.duty = undefined;
95
-    }
96
-    console.log('this.hospital:', this.hospital)
97
-    console.log('this.duty:', this.duty)
98
-
99
-    // 查询范围单选框
100
-    if(this.hospital){
101
-      if(this.duty){
102
-        if(this.duty.parentDeptId){
103
-          this.queryType = 3;
104
-        }else{
105
-          this.queryType = 4;
106
-        }
107
-      }else{
108
-        this.queryType = 2;
109
-      }
110
-    }else{
111
-      this.queryType = 1;
112
-    }
113
-
114
-    this.sessionSave();
115
-  }
116
-
117
-  // 缓存数据
118
-  sessionSave(){
119
-    sessionStorage.setItem('maintenanceStatistics', JSON.stringify({queryType: this.queryType, hospitalId: this.hospital ? this.hospital.id : undefined, dutyId: this.duty ? this.duty.id : undefined, hospital: this.hospital, duty: this.duty}));
120
-  }
121
-
122
-  // 清除缓存数据
123
-  sessionRemove(){
124
-    sessionStorage.removeItem('maintenanceStatistics');
125
-  }
126
-
127
-  // 查询范围
128
-  queryRangeFlag = false;
129
-  queryRangeClick(){
130
-    this.queryRangeFlag = true;
131
-  }
132
-  submitQueryRange({queryType, hospital, duty}) {
133
-    console.log('queryType:', queryType)
134
-    console.log('hospital:', hospital)
135
-    console.log('duty:', duty)
136
-    this.queryType = queryType;
137
-    this.hospital = hospital;
138
-    this.duty = duty;
139
-    this.queryRangeFlag = false;
140
-
141
-    this.sessionSave();
142
-    // this.tabService.deleteRouteSnapshot(`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`);
143
-    // this.router.navigate([`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`], { replaceUrl: true });
144
-
145
-    this.router.navigateByUrl('/redirect', {
146
-      skipLocationChange: true
147
-    }).then(() => {
148
-      this.router.navigate([`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`], { replaceUrl: true });
149
-    });
150
-  }
151
-  cancelQueryRange() {
152
-    this.queryRangeFlag = false;
153
-  }
154 55
 }

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

@@ -1,5 +1,4 @@
1 1
 import { CustomTabsModule } from './../components/custom-tabs/custom-tabs.module';
2
-import { QueryRangeModule } from './../components/query-range/query-range.module';
3 2
 import { NgModule } from '@angular/core';
4 3
 import { CommonModule } from '@angular/common';
5 4
 
@@ -18,7 +17,6 @@ import { VirtualScrollerModule } from 'ngx-virtual-scroller';
18 17
     MaintenanceStatisticsRoutingModule,
19 18
     ShareModule,
20 19
     VirtualScrollerModule,
21
-    QueryRangeModule,
22 20
     CustomTabsModule,
23 21
   ],
24 22
 })

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/synthesize-statistics/synthesize-statistics.component.ts

@@ -331,10 +331,10 @@ export class SynthesizeStatisticsComponent implements OnInit {
331 331
   dutyId:any;
332 332
   parentDutyId:any;
333 333
   initSessionData(){
334
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
335
-    let queryType:any = maintenanceStatistics.queryType;
336
-    let hosId:any = maintenanceStatistics.hospitalId;
337
-    let dutyId:any = maintenanceStatistics.dutyId;
334
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
335
+    let queryType:any = newStatistics.queryType;
336
+    let hosId:any = newStatistics.hospitalId;
337
+    let dutyId:any = newStatistics.dutyId;
338 338
 
339 339
     queryType = queryType ? +queryType : undefined;
340 340
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.ts

@@ -71,10 +71,10 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.ts

@@ -71,10 +71,10 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

+ 4 - 4
src/app/views/new-statistics/maintenance-statistics/work-hour-statistics/work-hour-statistics.component.ts

@@ -71,10 +71,10 @@ export class WorkHourStatisticsComponent implements OnInit, AfterViewInit {
71 71
   dutyId:any;
72 72
   parentDutyId:any;
73 73
   initSessionData(){
74
-    let maintenanceStatistics = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
75
-    let queryType:any = maintenanceStatistics.queryType;
76
-    let hosId:any = maintenanceStatistics.hospitalId;
77
-    let dutyId:any = maintenanceStatistics.dutyId;
74
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
75
+    let queryType:any = newStatistics.queryType;
76
+    let hosId:any = newStatistics.hospitalId;
77
+    let dutyId:any = newStatistics.dutyId;
78 78
 
79 79
     queryType = queryType ? +queryType : undefined;
80 80
     hosId = hosId ? +hosId : undefined;

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

@@ -13,6 +13,11 @@ const routes: Routes = [
13 13
         path: 'maintenanceStatistics',
14 14
         loadChildren: () => import('./maintenance-statistics/maintenance-statistics.module').then(m => m.MaintenanceStatisticsModule),
15 15
       },
16
+      {
17
+        // 配送陪检统计
18
+        path: 'distributionInspectionStatistics',
19
+        loadChildren: () => import('./distribution-inspection-statistics/distribution-inspection-statistics.module').then(m => m.DistributionInspectionStatisticsModule),
20
+      },
16 21
     ]
17 22
   }
18 23
 ];

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

@@ -1 +1,14 @@
1
+<div class="header">
2
+  <span class="title" *ngFor="let data of menuList" [ngClass]="{ active: activeMenuId == data.id }" (click)="clickMenu(data)">{{data.title}}</span>
3
+  <div class="hospital" (click)="queryRangeClick()">
4
+    <ng-container *ngIf="queryType == 1">查询范围:全院查询</ng-container>
5
+    <ng-container *ngIf="queryType == 2">查询范围:{{hospital.hosName}}</ng-container>
6
+    <ng-container *ngIf="queryType == 3">查询范围:{{hospital.hosName}}{{duty.hosName}}</ng-container>
7
+    <ng-container *ngIf="queryType == 4">查询范围:垂直-{{hospital.hosName}}{{duty.hosName}}</ng-container>
8
+    <i class="icon_transport transport-jiantou_zuoyouqiehuan"></i>
9
+  </div>
10
+</div>
1 11
 <router-outlet></router-outlet>
12
+
13
+<!-- 查询范围 -->
14
+<app-query-range [hospital]="hospital" [duty]="duty" [queryType]="queryType" (cancelQueryRange)="cancelQueryRange()" (submitQueryRange)="submitQueryRange($event)" *ngIf="queryRangeFlag"></app-query-range>

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

@@ -3,4 +3,39 @@
3 3
 :host{
4 4
   width: 100%;
5 5
   height: 100vh;
6
+  .header{
7
+    height: 48px;
8
+    background-color: #fff;
9
+    display: flex;
10
+    justify-content: center;
11
+    align-items: center;
12
+    position: relative;
13
+    .title{
14
+      margin-right: 16px;
15
+      cursor: pointer;
16
+      &:last-of-type{
17
+        margin-right: 0;
18
+      }
19
+      &.active{
20
+        color: @primary-color;
21
+      }
22
+    }
23
+    .hospital{
24
+      position: absolute;
25
+      right: 24px;
26
+      top: 50%;
27
+      transform: translateY(-50%);
28
+      color: #666666;
29
+      font-size: 16px;
30
+      display: flex;
31
+      align-items: center;
32
+      cursor: pointer;
33
+      .icon_transport{
34
+        color: #666666;
35
+        font-size: 24px;
36
+        position: relative;
37
+        top: 2px;
38
+      }
39
+    }
40
+  }
6 41
 }

+ 121 - 4
src/app/views/new-statistics/new-statistics.component.ts

@@ -1,10 +1,127 @@
1
-import { Component, OnInit } from "@angular/core";
1
+import { Component, OnInit, OnDestroy } from "@angular/core";
2
+import { ToolService } from 'src/app/services/tool.service';
3
+import { ActivatedRoute, Router } from '@angular/router';
4
+import { TabService } from './services/tab.service';
5
+import { SimpleReuseStrategy } from 'src/app/SimpleReuseStrategy';
2 6
 @Component({
3 7
   selector: "app-new-statistics",
4 8
   templateUrl: "./new-statistics.component.html",
5 9
   styleUrls: ["./new-statistics.component.less"],
6 10
 })
7
-export class NewStatisticsComponent implements OnInit {
8
-  constructor() {}
9
-  ngOnInit() {}
11
+export class NewStatisticsComponent implements OnInit, OnDestroy {
12
+  constructor(
13
+    public tool: ToolService,
14
+    public route: ActivatedRoute,
15
+    public router: Router,
16
+    public tabService: TabService,
17
+  ) {}
18
+
19
+  menuList: any[] = [];
20
+  ngOnInit() {
21
+    this.getMenuList();
22
+    this.initHospitalAndDuty(this.tool.getCurrentHospital());
23
+    console.log('this.menuList:', this.menuList)
24
+  }
25
+
26
+  ngOnDestroy(){
27
+    this.tabService.deleteAllRouteSnapshot();
28
+  }
29
+
30
+  getMenuList(){
31
+    this.menuList = this.tool.getMenuAutoType();
32
+    this.menuList.length && this.clickMenu(this.menuList[0]);
33
+  }
34
+
35
+  // 点击一级菜单
36
+  activeMenuId:number;
37
+  clickMenu(data){
38
+    this.activeMenuId = data.id;
39
+    console.log(`/newStatistics/${data.link}/${data.childrens[0].link}`);
40
+    console.log(SimpleReuseStrategy.handlers)
41
+    this.router.navigate([`/newStatistics/${data.link}/${data.childrens[0].link}`], { replaceUrl: true });
42
+  }
43
+
44
+  // 全院查询-1|院区查询-2|责任部门查询-3|部门垂直查询-4
45
+  hospital;
46
+  duty;
47
+  queryType;//查询范围
48
+  // 初始化院区、部门显示
49
+  initHospitalAndDuty(hospitalOrDuty){
50
+    let sessionData = JSON.parse(sessionStorage.getItem('newStatistics'));
51
+    console.log(sessionData);
52
+    if(sessionData){
53
+      this.hospital = sessionData.hospital;
54
+      this.duty = sessionData.duty;
55
+      this.queryType = sessionData.queryType;
56
+      return;
57
+    }
58
+    let type = 'hospital';//默认是院区
59
+    if(hospitalOrDuty.type){
60
+      // 当前是责任部门
61
+      type = 'duty';
62
+    }
63
+
64
+    if(type === 'duty'){
65
+      // 当前的所属责任部门
66
+      this.hospital = hospitalOrDuty.parent;
67
+      this.duty = hospitalOrDuty;
68
+    }else{
69
+      // 当前的所属院区
70
+      this.hospital = hospitalOrDuty;
71
+      this.duty = undefined;
72
+    }
73
+    console.log('this.hospital:', this.hospital)
74
+    console.log('this.duty:', this.duty)
75
+
76
+    // 查询范围单选框
77
+    if(this.hospital){
78
+      if(this.duty){
79
+        if(this.duty.parentDeptId){
80
+          this.queryType = 3;
81
+        }else{
82
+          this.queryType = 4;
83
+        }
84
+      }else{
85
+        this.queryType = 2;
86
+      }
87
+    }else{
88
+      this.queryType = 1;
89
+    }
90
+
91
+    this.sessionSave();
92
+  }
93
+
94
+  // 缓存数据
95
+  sessionSave(){
96
+    sessionStorage.setItem('newStatistics', JSON.stringify({queryType: this.queryType, hospitalId: this.hospital ? this.hospital.id : undefined, dutyId: this.duty ? this.duty.id : undefined, hospital: this.hospital, duty: this.duty}));
97
+  }
98
+
99
+  // 查询范围
100
+  queryRangeFlag = false;
101
+  queryRangeClick(){
102
+    this.queryRangeFlag = true;
103
+  }
104
+  submitQueryRange({queryType, hospital, duty}) {
105
+    console.log('queryType:', queryType)
106
+    console.log('hospital:', hospital)
107
+    console.log('duty:', duty)
108
+    this.queryType = queryType;
109
+    this.hospital = hospital;
110
+    this.duty = duty;
111
+    this.queryRangeFlag = false;
112
+
113
+    this.sessionSave();
114
+
115
+    let url = location.href.split('/#')[1];
116
+    console.log(url);
117
+
118
+    this.router.navigateByUrl('/redirect', {
119
+      skipLocationChange: true
120
+    }).then(() => {
121
+      this.router.navigate([url], { replaceUrl: true });
122
+    });
123
+  }
124
+  cancelQueryRange() {
125
+    this.queryRangeFlag = false;
126
+  }
10 127
 }

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

@@ -4,6 +4,7 @@ import { CommonModule } from '@angular/common';
4 4
 import { NewStatisticsRoutingModule } from './new-statistics-routing.module';
5 5
 import { NewStatisticsComponent } from './new-statistics.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7
+import { QueryRangeModule } from './components/query-range/query-range.module';
7 8
 
8 9
 
9 10
 @NgModule({
@@ -14,6 +15,7 @@ import { ShareModule } from 'src/app/share/share.module';
14 15
     CommonModule,
15 16
     NewStatisticsRoutingModule,
16 17
     ShareModule,
18
+    QueryRangeModule,
17 19
   ],
18 20
 })
19 21
 export class NewStatisticsModule { }

+ 1 - 1
src/app/views/new-statistics/services/tab.service.ts

@@ -23,7 +23,7 @@ export class TabService {
23 23
         if(event.urlAfterRedirects.startsWith('/newStatistics/')){
24 24
           this.updateTabs(event.urlAfterRedirects);
25 25
         }else if(event.urlAfterRedirects !== '/'){
26
-          sessionStorage.removeItem('maintenanceStatistics')
26
+          sessionStorage.removeItem('newStatistics')
27 27
         }
28 28
       });
29 29
   }