seimin 10 ヶ月 前
コミット
b76a3587dd
共有27 個のファイルを変更した3260 個の追加11 個の削除を含む
  1. 1 1
      proxy.conf.json
  2. 20 0
      src/app/views/main/main-routing.module.ts
  3. 13 0
      src/app/views/medical-waste-department-statistics/medical-waste-department-statistics-routing.module.ts
  4. 105 0
      src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.component.html
  5. 95 0
      src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.component.less
  6. 611 0
      src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.component.ts
  7. 16 0
      src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.module.ts
  8. 13 0
      src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics-routing.module.ts
  9. 91 0
      src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.component.html
  10. 95 0
      src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.component.less
  11. 624 0
      src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.component.ts
  12. 18 0
      src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.module.ts
  13. 13 0
      src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics-routing.module.ts
  14. 97 0
      src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.component.html
  15. 95 0
      src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.component.less
  16. 520 0
      src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.component.ts
  17. 16 0
      src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.module.ts
  18. 13 0
      src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis-routing.module.ts
  19. 181 0
      src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.component.html
  20. 186 0
      src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.component.less
  21. 380 0
      src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.component.ts
  22. 18 0
      src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.module.ts
  23. 1 3
      src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.component.ts
  24. 1 3
      src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.component.ts
  25. 1 3
      src/app/views/quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.component.ts
  26. 35 0
      src/common.less
  27. 1 1
      src/main.ts

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-    "target": "http://192.168.3.108",
3
+    "target": "http://192.168.4.163",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 20 - 0
src/app/views/main/main-routing.module.ts

@@ -483,6 +483,26 @@ const routes: Routes = [
483 483
         path: "quiltWashingTrendAnalysis",
484 484
         loadChildren: () => import("../quilt-washing-trend-analysis/quilt-washing-trend-analysis.module").then((m) => m.QuiltWashingTrendAnalysisModule),
485 485
       },
486
+      // 医废统计-人员统计
487
+      {
488
+        path: "medicalWastePersonnelStatistics",
489
+        loadChildren: () => import("../medical-waste-personnel-statistics/medical-waste-personnel-statistics.module").then((m) => m.MedicalWastePersonnelStatisticsModule),
490
+      },
491
+      // 医废统计-科室统计
492
+      {
493
+        path: "medicalWasteDepartmentStatistics",
494
+        loadChildren: () => import("../medical-waste-department-statistics/medical-waste-department-statistics.module").then((m) => m.MedicalWasteDepartmentStatisticsModule),
495
+      },
496
+      // 医废统计-全院统计
497
+      {
498
+        path: "medicalWasteHospitalStatistics",
499
+        loadChildren: () => import("../medical-waste-hospital-statistics/medical-waste-hospital-statistics.module").then((m) => m.MedicalWasteHospitalStatisticsModule),
500
+      },
501
+      // 医废统计-趋势分析
502
+      {
503
+        path: "medicalWasteTrendAnalysis",
504
+        loadChildren: () => import("../medical-waste-trend-analysis/medical-waste-trend-analysis.module").then((m) => m.MedicalWasteTrendAnalysisModule),
505
+      },
486 506
     ],
487 507
   },
488 508
 ];

+ 13 - 0
src/app/views/medical-waste-department-statistics/medical-waste-department-statistics-routing.module.ts

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

+ 105 - 0
src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.component.html

@@ -0,0 +1,105 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <nz-radio-group [(ngModel)]="dateType" (ngModelChange)="changeDateType($event)">
7
+            <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
8
+          </nz-radio-group>
9
+        </div>
10
+        <div class="list-template__searchItem">
11
+          <span class="label">发起时间</span>:
12
+          <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
13
+            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
14
+          </nz-range-picker>
15
+          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
16
+            (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">
17
+          </nz-month-picker>
18
+          <span *ngIf="dateType=='month'"> ~ </span>
19
+          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeEnd" [nzDisabledDate]="disabledMonthEnd"
20
+            (ngModelChange)="changeMonthEnd($event)" nzPlaceHolder="请选择截止月份">
21
+          </nz-month-picker>
22
+          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeStart" [nzDisabledDate]="disabledYearStart"
23
+            (ngModelChange)="changeYearStart($event)" nzPlaceHolder="请选择开始年份">
24
+          </nz-year-picker>
25
+          <span *ngIf="dateType=='year'"> ~ </span>
26
+          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeEnd" (ngModelChange)="changeYearEnd($event)"
27
+            [nzDisabledDate]="disabledYearEnd" nzPlaceHolder="请选择截止年份">
28
+          </nz-year-picker>
29
+        </div>
30
+        <div class="list-template__searchItem ml8">
31
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择时间"
32
+            [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
33
+            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
34
+          </nz-select>
35
+        </div>
36
+        <div class="list-template__searchItem">
37
+          <span class="label">科室名称</span>:
38
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
39
+            (nzOnSearch)="changeInp($event, 'getDeptList')" nzAllowClear nzPlaceHolder="请选择科室名称" [(ngModel)]="searchDto.dept">
40
+            <ng-container *ngFor="let option of deptList">
41
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
42
+            </ng-container>
43
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
44
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
45
+            </nz-option>
46
+          </nz-select>
47
+        </div>
48
+        <div class="list-template__searchItem">
49
+          <span class="label">楼栋名称</span>:
50
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
51
+            (nzOnSearch)="changeInp($event, 'getBuildingList')" nzAllowClear nzPlaceHolder="请选择楼栋名称" [(ngModel)]="searchDto.building">
52
+            <ng-container *ngFor="let option of buildingList">
53
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
54
+            </ng-container>
55
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
56
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
57
+            </nz-option>
58
+          </nz-select>
59
+        </div>
60
+      </div>
61
+      <div nz-col nzXl='6' class="list-template__btns">
62
+        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
63
+        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
64
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
65
+        <!-- <button nz-button class="btn default ml8" (click)='exportDetail()' [nzLoading]="loading3" [disabled]="!checkedDepIds.length">批量导出详细科室报表</button> -->
66
+      </div>
67
+    </div>
68
+    <div class="list-template__bottom">
69
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
70
+        [nzLoading]="loading1">
71
+        <thead (nzSortChange)="sort($event)" nzSingleSort>
72
+          <tr class="thead">
73
+            <!-- <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked"
74
+              (nzCheckedChange)="checkAll($event)"></th> -->
75
+            <th>序号</th>
76
+            <th>科室名称</th>
77
+            <th>总重量(kg)</th>
78
+            <th *ngFor="let data of heads">{{data}}(kg)</th>
79
+          </tr>
80
+        </thead>
81
+        <tbody>
82
+          <tr *ngFor="let data of listOfData;let index=index;" (click)="selectedListData(data)">
83
+            <!-- <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td> -->
84
+            <td>{{ index+(pageIndex-1) * pageSize + 1 }}</td>
85
+            <td>{{ data.dept }}</td>
86
+            <td>{{ data.totalWeight }}</td>
87
+            <td *ngFor="let weight of data.typeWeightList">{{ weight }}</td>
88
+          </tr>
89
+        </tbody>
90
+      </nz-table>
91
+      <div class="list-template__pagination">
92
+        <nz-pagination [(nzPageIndex)]="pageIndex" [nzPageSizeOptions]="[10,100]" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
93
+          (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)"
94
+          (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)">
95
+        </nz-pagination>
96
+      </div>
97
+    </div>
98
+  </div>
99
+</div>
100
+<!-- 操作成功/失败提示框 -->
101
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
102
+  [info]="promptInfo"></app-prompt-modal>
103
+
104
+<!-- 查看详情 -->
105
+<router-outlet></router-outlet>

+ 95 - 0
src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.component.less

@@ -0,0 +1,95 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host ::ng-deep .on {
4
+  color: #fff !important;
5
+}
6
+
7
+.save {
8
+  position: fixed;
9
+  left: 0;
10
+  top: 0;
11
+  width: 100%;
12
+  height: 100%;
13
+  background: rgba(0, 0, 0, 0.4);
14
+  z-index: 99;
15
+
16
+  .modalBody {
17
+    width: 1000px;
18
+    background: #fff;
19
+    border-radius: 5px;
20
+    padding: 10px 20px;
21
+    color: #333;
22
+
23
+    .title {
24
+      width: 100%;
25
+      text-align: center;
26
+      font-size: 18px;
27
+      position: relative;
28
+
29
+      i {
30
+        position: absolute;
31
+        right: 0;
32
+        top: 0;
33
+        font-size: 20px;
34
+        color: #666;
35
+        cursor: pointer;
36
+        padding: 0 5px;
37
+      }
38
+    }
39
+
40
+    .content {
41
+      width: 100%;
42
+      border: 1px solid #e5e9ed;
43
+      border-radius: 5px;
44
+      overflow: hidden;
45
+      margin-top: 12px;
46
+
47
+      .conItem {
48
+        color: #333;
49
+
50
+        .jiTit {
51
+          height: 50px;
52
+          line-height: 50px;
53
+          border-bottom: 1px solid #e5e9ed;
54
+          padding: 0 32px;
55
+        }
56
+
57
+        .defeat {
58
+          font-size: 14px;
59
+          color: #333;
60
+          padding: 15px 32px;
61
+          min-height: 125px;
62
+        }
63
+
64
+        &.noCon {
65
+          background: #f9fafb;
66
+          padding: 16px 32px 24px 32px;
67
+          border-top: 1px solid #e5e9ed;
68
+
69
+          .title {
70
+            text-align: left;
71
+            font-size: 14px;
72
+            margin-bottom: 8px;
73
+          }
74
+
75
+          textarea {
76
+            min-height: 210px;
77
+          }
78
+        }
79
+      }
80
+    }
81
+
82
+    button {
83
+      margin-top: 10px;
84
+      margin-left: 10px;
85
+    }
86
+  }
87
+
88
+  .txtL {
89
+    text-align: left !important;
90
+  }
91
+
92
+  .txtR {
93
+    text-align: right !important;
94
+  }
95
+}

+ 611 - 0
src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.component.ts

@@ -0,0 +1,611 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear, startOfDay, endOfDay } from "date-fns";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { DateService } from "../../services/date.service";
7
+import { MyServiceService } from "../../services/my-service.service";
8
+import { ToolService } from "../../services/tool.service";
9
+import { Subject } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
11
+
12
+@Component({
13
+  selector: "app-medical-waste-department-statistics",
14
+  templateUrl: "./medical-waste-department-statistics.component.html",
15
+  styleUrls: ["./medical-waste-department-statistics.component.less"],
16
+})
17
+export class MedicalWasteDepartmentStatisticsComponent implements OnInit {
18
+  constructor(
19
+    private route: ActivatedRoute,
20
+    private router: Router,
21
+    private mainService: MainService,
22
+    private dateService: DateService,
23
+    private myService: MyServiceService,
24
+    private tool: ToolService
25
+  ) {}
26
+
27
+  searchTimerSubject = new Subject();
28
+
29
+  searchDto: any = {
30
+    dept: null,
31
+    building: null,
32
+  }
33
+
34
+  ngOnInit() {
35
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
36
+      let fun = v[0];
37
+      fun.call(this, v[1]);
38
+    });
39
+    this.coopBtns = this.tool.initCoopBtns(this.route);
40
+    this.getAllHos();
41
+    this.changeDateRange(this.defRange);
42
+    // this.search();
43
+  }
44
+
45
+  dateType: string = "day"; //选中时间维度
46
+  dateTypes: any = [
47
+    {
48
+      label: "按天统计",
49
+      value: "day",
50
+    },
51
+    {
52
+      label: "按月统计",
53
+      value: "month",
54
+    },
55
+    {
56
+      label: "按年统计",
57
+      value: "year",
58
+    },
59
+  ]; //时间维度
60
+  defRange = "1"; //默认上周
61
+  defRanges = [
62
+    {
63
+      label: "上周",
64
+      id: 1,
65
+    },
66
+    {
67
+      label: "上月",
68
+      id: 2,
69
+    },
70
+    {
71
+      label: "上年",
72
+      id: 3,
73
+    },
74
+  ]; //时间默认区间
75
+
76
+  heads: any[] = []; //表头数据
77
+  listOfData: any[] = []; //表格数据
78
+  pageIndex: number = 1; //表格当前页码
79
+  pageSize: number = 10; //表格每页展示条数
80
+  listLength: number = 10; //表格总数据量
81
+
82
+  alldepart: any = []; //当前院区所属科室
83
+  dateRange: any = []; //发起时间区间 天
84
+  monthRangeStart: any; //发起时间 月 起
85
+  monthRangeEnd: any; //发起时间 月 止
86
+  yearRangeStart: any; //发起时间 年 起
87
+  yearRangeEnd: any; //发起时间 年 止
88
+
89
+  promptContent: string; //操作提示框提示信息
90
+  ifSuccess: boolean; //操作成功/失败
91
+  promptInfo: string; //操作结果提示信息
92
+  promptModalShow: boolean; //操作提示框是否展示
93
+
94
+  // 初始化增删改按钮
95
+  coopBtns: any = {};
96
+  searchData: any = {}; // 综合统计页面带过来的参数
97
+  getSearchData() {
98
+    let that = this;
99
+    let sub = that.myService.getMsg().subscribe((msg) => {
100
+      // 从综合报表跳转过来
101
+      that.searchData = msg;
102
+      console.log(that.searchData);
103
+      console.log(66);
104
+      sub.unsubscribe(); //取消订阅,否则订阅函数会累加执行
105
+      that.hospital = that.searchData["hosId"];
106
+      that.changeDate(that.searchData["range"]);
107
+      that.defRange = that.searchData["defRange"];
108
+      that.search();
109
+    });
110
+    that.changeDateRange(that.defRange);
111
+    that.search();
112
+  }
113
+  // 搜索
114
+  search(num?: number) {
115
+    if (this.hospital) {
116
+      this.searchData["hosId"] = this.hospital;
117
+    }
118
+    if (this.startDate) {
119
+      this.searchData["dateRange"] = {
120
+        start: this.startDate,
121
+        end: this.endDate,
122
+      };
123
+    }
124
+    if (num !== undefined) {
125
+      this.getList(num, this.sortCurrentKey, this.sortCurrentValue);
126
+    } else {
127
+      this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
128
+    }
129
+  }
130
+  // 导出
131
+  loading2 = false;
132
+  export() {
133
+    this.mapOfCheckedId = {};
134
+    this.checkedDepIds = [];
135
+    this.isAllDisplayDataChecked = false;
136
+    let that = this;
137
+    let postData: any = {
138
+      startTime: this.startDate,
139
+      endTime: this.endDate,
140
+      hosId: that.hospital,
141
+      type: this.dateType,
142
+      deptId: this.searchDto.dept || undefined,
143
+      buildingId: this.searchDto.building || undefined,
144
+    };
145
+    if (this.sortCurrentKey && this.sortCurrentValue) {
146
+      postData.sort =
147
+        this.sortCurrentValue === "ascend"
148
+          ? this.sortCurrentKey
149
+          : `${this.sortCurrentKey} desc`;
150
+    }
151
+    this.loading2 = true;
152
+    that.mainService.exportReport("medicalWasteDept", postData).subscribe(
153
+      (data) => {
154
+        this.loading2 = false;
155
+        this.showPromptModal("导出", true, "");
156
+        var file = new Blob([data], {
157
+          type: "application/vnd.ms-excel",
158
+        });
159
+        //trick to download store a file having its URL
160
+        var fileURL = URL.createObjectURL(file);
161
+        var a = document.createElement("a");
162
+        a.href = fileURL;
163
+        a.target = "_blank";
164
+        a.download = "科室统计.xls";
165
+        document.body.appendChild(a);
166
+        a.click();
167
+      },
168
+      (err) => {
169
+        this.loading2 = false;
170
+        this.showPromptModal("导出", false, "");
171
+      }
172
+    );
173
+  }
174
+  // 批量导出详细科室报表
175
+  loading3 = false;
176
+  exportDetail() {
177
+    let ids = this.checkedDepIds.join(",");
178
+    this.mapOfCheckedId = {};
179
+    this.checkedDepIds = [];
180
+    this.isAllDisplayDataChecked = false;
181
+    let that = this;
182
+    let postData: any = {
183
+      startTime: this.startDate,
184
+      endTime: this.endDate,
185
+      hosId: that.hospital,
186
+      type: this.dateType,
187
+      deptId: ids || undefined,
188
+      buildingId: this.searchDto.building || undefined,
189
+    };
190
+    if (this.sortCurrentKey && this.sortCurrentValue) {
191
+      postData.sort =
192
+        this.sortCurrentValue === "ascend"
193
+          ? this.sortCurrentKey
194
+          : `${this.sortCurrentKey} desc`;
195
+    }
196
+    this.loading3 = true;
197
+    that.mainService.exportReport("clothesDeptDetails", postData).subscribe(
198
+      (data) => {
199
+        this.loading3 = false;
200
+        this.showPromptModal("导出", true, "");
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 = "详细科室报表.xls";
210
+        document.body.appendChild(a);
211
+        a.click();
212
+      },
213
+      (err) => {
214
+        this.loading3 = false;
215
+        this.showPromptModal("导出", false, "");
216
+      }
217
+    );
218
+  }
219
+  // 重置
220
+  reset() {
221
+    this.sortCurrentKey = "";
222
+    this.sortCurrentValue = "";
223
+    this.sortCurrent = {
224
+      clothesTypeNum: null,
225
+      getOrder: null,
226
+      sendOrder: null,
227
+      sendClothesNum: null,
228
+      price: null,
229
+    };
230
+    this.searchDto = {
231
+      dept: null,
232
+      building: null,
233
+    }
234
+    this.changeDateType("day");
235
+  }
236
+  // 选中表格单列
237
+  mapOfCheckedId: { [key: string]: boolean } = {};
238
+  checkedDepIds = []; //已选中单列id
239
+  refreshStatus(): void {
240
+    this.isAllDisplayDataChecked = this.listOfData.every(
241
+      (item) => this.mapOfCheckedId[item.id]
242
+    );
243
+    let arr = [];
244
+    for (var k in this.mapOfCheckedId) {
245
+      if (this.mapOfCheckedId[k]) {
246
+        arr.push(Number(k));
247
+      }
248
+    }
249
+    this.checkedDepIds = arr;
250
+  }
251
+  // 整行操作
252
+  selectedListData(data) {
253
+    this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
254
+    this.refreshStatus();
255
+  }
256
+  // 全选
257
+  isAllDisplayDataChecked = false; //当前页是否全选
258
+  checkAll(value: boolean): void {
259
+    this.listOfData.forEach((item) => {
260
+      this.mapOfCheckedId[item.id] = value;
261
+    });
262
+    this.refreshStatus();
263
+  }
264
+  // 表格数据
265
+  loading1 = false;
266
+  getList(num?: number, field?: string, sort?: string) {
267
+    this.mapOfCheckedId = {};
268
+    this.checkedDepIds = [];
269
+    this.isAllDisplayDataChecked = false;
270
+    this.pageIndex = num;
271
+    let postData: any = {
272
+      idx: this.pageIndex - 1,
273
+      sum: this.pageSize,
274
+      startTime: this.searchData.dateRange.start,
275
+      endTime: this.searchData.dateRange.end,
276
+      hosId: this.searchData.hosId,
277
+      type: this.dateType,
278
+      deptId: this.searchDto.dept || undefined,
279
+      buildingId: this.searchDto.building || undefined,
280
+    };
281
+    if (field && sort) {
282
+      postData.sort = sort === "ascend" ? field : `${field} desc`;
283
+    }
284
+    this.loading1 = true;
285
+    this.mainService
286
+      .postCustom("report/medicalWaste", "dept", postData)
287
+      .subscribe((result) => {
288
+        this.loading1 = false;
289
+        this.listOfData = result.list || [];
290
+        this.heads = result.heads || [];
291
+        this.listLength = result.totalNum;
292
+      });
293
+  }
294
+  // 获取院区
295
+  hospital: string; //选中院区
296
+  getAllHos() {
297
+    this.hospital = this.tool.getCurrentHospital().id + "";
298
+    this.getDeptList();
299
+    this.getBuildingList();
300
+  }
301
+
302
+  onCalendarChangeDate(dateArr){
303
+    console.log(dateArr)
304
+    if(dateArr.length == 2){
305
+      let dateStart = new Date(dateArr[0]);
306
+      let dateEnd = new Date(dateArr[1]);
307
+      dateStart.setHours(0,0,0);
308
+      dateEnd.setHours(23,59,59);
309
+      this.dateRange = [dateStart,dateEnd];
310
+    }
311
+  }
312
+
313
+  // 边输边搜节流阀
314
+  changeInp(e, fn) {
315
+    this.searchTimer(this[fn], e);
316
+  }
317
+  // 获取科室
318
+  deptList: any = [];
319
+  getDeptList(keyword = '') {
320
+    let postData = {
321
+      department: {
322
+        searchType: 1,// 简单查询
323
+        cascadeHosId: this.hospital,
324
+        dept: keyword,
325
+      },
326
+      idx: 0,
327
+      sum: 10,
328
+    };
329
+    this.isLoading = true;
330
+    this.mainService
331
+      .getFetchDataList("data", "department", postData)
332
+      .subscribe((result) => {
333
+        this.isLoading = false;
334
+        this.deptList = result.list;
335
+      });
336
+  }
337
+
338
+  // 获取楼栋
339
+  buildingList: any = [];
340
+  getBuildingList(keyword = '') {
341
+    let postData = {
342
+      building: {
343
+        cascadeHosId: this.hospital,
344
+        buildingName: keyword
345
+      },
346
+      idx: 0,
347
+      sum: 10,
348
+    };
349
+    this.isLoading = true;
350
+    this.mainService
351
+      .getFetchDataList("data", "building", postData)
352
+      .subscribe((result) => {
353
+        this.isLoading = false;
354
+        this.buildingList = result.list;
355
+      });
356
+  }
357
+
358
+  // 修改时间展示维度
359
+  changeDateType(res) {
360
+    console.log(res, this.dateType);
361
+    this.dateType = res;
362
+    this.searchData["type"] = res;
363
+    console.log(this.searchData);
364
+    switch (res) {
365
+      case "day":
366
+        this.defRanges = [
367
+          {
368
+            label: "上周",
369
+            id: 1,
370
+          },
371
+          {
372
+            label: "上月",
373
+            id: 2,
374
+          },
375
+          {
376
+            label: "上年",
377
+            id: 3,
378
+          },
379
+        ]; //时间默认区间
380
+        this.defRange = "1"; //默认上周
381
+        this.changeDateRange("1");
382
+        break;
383
+      case "month":
384
+        this.defRanges = [
385
+          {
386
+            label: "上月",
387
+            id: 2,
388
+          },
389
+          {
390
+            label: "上年",
391
+            id: 3,
392
+          },
393
+        ]; //时间默认区间
394
+        this.defRange = "2"; //上月
395
+        this.changeDateRange("2");
396
+        break;
397
+      case "year":
398
+        this.defRanges = [
399
+          {
400
+            label: "上年",
401
+            id: 3,
402
+          },
403
+        ]; //时间默认区间
404
+        this.defRange = "3"; //默认上周
405
+        this.changeDateRange("3");
406
+        break;
407
+    }
408
+  }
409
+
410
+  // 禁选日期
411
+  disabledDate = (current: Date): boolean => {
412
+    // Can not select days before today and today
413
+    return differenceInCalendarDays(current, this.today) > 0;
414
+  };
415
+
416
+  // 禁选月份开始
417
+  disabledMonthStart = (current: Date): boolean => {
418
+    // Can not select days before today and today
419
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
420
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
421
+    return cur || staEnd;
422
+  };
423
+  // 禁选月份结束
424
+  disabledMonthEnd = (current: Date): boolean => {
425
+    // Can not select days before today and today
426
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
427
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
428
+    return cur || staEnd;
429
+  };
430
+
431
+  // 禁选年份开始
432
+  disabledYearStart = (current: Date): boolean => {
433
+    // Can not select days before today and today
434
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
435
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
436
+    return cur || staEnd;
437
+  };
438
+
439
+  // 禁选年份结束
440
+  disabledYearEnd = (current: Date): boolean => {
441
+    // Can not select days before today and today
442
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
443
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
444
+    return cur || staEnd;
445
+  };
446
+
447
+  // 日期选择 日
448
+  startDate: string; //发起时间开始
449
+  endDate: string; //发起时间结束
450
+  changeDate(result?): void {
451
+    console.log(this.dateRange);
452
+    console.log(result);
453
+    this.dateRange = result;
454
+    if (!this.quick) {
455
+      // 不是快捷选择
456
+      this.defRange = null;
457
+    }
458
+    if (!result || !result.length) {
459
+      this.startDate = this.endDate = "";
460
+      return;
461
+    }
462
+    this.startDate = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
463
+    this.endDate = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
464
+  }
465
+
466
+  // 跳转详情
467
+  toDetail(e, data){
468
+    e.stopPropagation();
469
+    console.log(data);
470
+    window.open(`${location.origin}/spreadSheet/#/quiltWashingDepartment/${data.id}/${this.dateType}/${this.startDate}/${this.endDate}`);
471
+  }
472
+
473
+  // 月份选择
474
+  changeMonthStart(result?) {
475
+    console.log(result);
476
+    this.monthRangeStart = result;
477
+    if (!this.quick) {
478
+      // 不是快捷选择
479
+      this.defRange = null;
480
+    }
481
+    if (!result) {
482
+      this.startDate = this.endDate = "";
483
+      return;
484
+    }
485
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
486
+    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
487
+  }
488
+  changeMonthEnd(result?) {
489
+    console.log(result);
490
+    this.monthRangeEnd = result;
491
+    if (!this.quick) {
492
+      // 不是快捷选择
493
+      this.defRange = null;
494
+    }
495
+    if (!result) {
496
+      this.startDate = this.endDate = "";
497
+      return;
498
+    }
499
+    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
500
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
501
+  }
502
+  // 年份选择
503
+  changeYearStart(result?) {
504
+    console.log(result);
505
+    this.yearRangeStart = result;
506
+    if (!this.quick) {
507
+      // 不是快捷选择
508
+      this.defRange = null;
509
+    }
510
+    if (!result) {
511
+      this.startDate = this.endDate = "";
512
+      return;
513
+    }
514
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
515
+    // this.endDate = result.getFullYear() + '-01-01';
516
+  }
517
+  changeYearEnd(result?) {
518
+    console.log(result);
519
+    this.yearRangeEnd = result;
520
+    if (!this.quick) {
521
+      // 不是快捷选择
522
+      this.defRange = null;
523
+    }
524
+    if (!result) {
525
+      this.startDate = this.endDate = "";
526
+      return;
527
+    }
528
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
529
+  }
530
+
531
+  // 日期选择 快速修改时间区间
532
+  today = new Date();
533
+  quick: boolean = false;
534
+  changeDateRange(res) {
535
+    console.log(res);
536
+    this.quick = true;
537
+    switch (res) {
538
+      case "1":
539
+        // 上周
540
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
541
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
542
+        console.log(lastweekstartdate, lastweekenddate);
543
+        this.changeDate([lastweekstartdate, lastweekenddate]);
544
+        break;
545
+      case "2":
546
+        // 上月
547
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
548
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
549
+        console.log(lastmonthstartdate, lastmonthenddate);
550
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
551
+        this.changeMonthStart(lastmonthstartdate);
552
+        this.changeMonthEnd(lastmonthenddate);
553
+        break;
554
+      case "3":
555
+        // 上年
556
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
557
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
558
+        console.log(lastyearstartdate, lastyearenddate);
559
+        this.changeDate([lastyearstartdate, lastyearenddate]);
560
+        this.changeMonthStart(lastyearstartdate);
561
+        this.changeMonthEnd(lastyearenddate);
562
+        this.changeYearStart(lastyearstartdate);
563
+        this.changeYearEnd(lastyearenddate);
564
+        break;
565
+    }
566
+    this.quick = false;
567
+    this.search();
568
+  }
569
+
570
+  // 更多
571
+  toMore(type) {
572
+    let sendData = this.searchData;
573
+    console.log(sendData);
574
+    this.myService.sendMsg(sendData);
575
+    this.router.navigateByUrl("/main/" + type);
576
+  }
577
+
578
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
579
+  showPromptModal(con, success, promptInfo?) {
580
+    this.promptModalShow = false;
581
+    this.promptContent = con;
582
+    this.ifSuccess = success;
583
+    this.promptInfo = promptInfo;
584
+    setTimeout(() => {
585
+      this.promptModalShow = true;
586
+    }, 100);
587
+  }
588
+
589
+  // 边输入边搜索节流阀
590
+  isLoading: boolean = false;
591
+  searchTimer(fun, e) {
592
+    this.isLoading = true;
593
+    this.searchTimerSubject.next([fun, e]);
594
+  }
595
+  // 列表排序
596
+  sortCurrent = {
597
+    clothesTypeNum: null,
598
+    getOrder: null,
599
+    sendOrder: null,
600
+    sendClothesNum: null,
601
+    price: null,
602
+  };
603
+  sortCurrentKey: string = "";
604
+  sortCurrentValue: string | null = "";
605
+  sort(e) {
606
+    const { key, value } = e;
607
+    this.sortCurrentKey = key;
608
+    this.sortCurrentValue = value;
609
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
610
+  }
611
+}

+ 16 - 0
src/app/views/medical-waste-department-statistics/medical-waste-department-statistics.module.ts

@@ -0,0 +1,16 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { MedicalWasteDepartmentStatisticsRoutingModule } from "./medical-waste-department-statistics-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { MedicalWasteDepartmentStatisticsComponent } from "./medical-waste-department-statistics.component";
7
+
8
+@NgModule({
9
+  declarations: [MedicalWasteDepartmentStatisticsComponent],
10
+  imports: [
11
+    CommonModule,
12
+    MedicalWasteDepartmentStatisticsRoutingModule,
13
+    ShareModule,
14
+  ],
15
+})
16
+export class MedicalWasteDepartmentStatisticsModule {}

+ 13 - 0
src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics-routing.module.ts

@@ -0,0 +1,13 @@
1
+import { NgModule } from "@angular/core";
2
+import { Routes, RouterModule } from "@angular/router";
3
+import { MedicalWasteHospitalStatisticsComponent } from "./medical-waste-hospital-statistics.component";
4
+
5
+const routes: Routes = [
6
+  { path: "", component: MedicalWasteHospitalStatisticsComponent },
7
+];
8
+
9
+@NgModule({
10
+  imports: [RouterModule.forChild(routes)],
11
+  exports: [RouterModule],
12
+})
13
+export class MedicalWasteHospitalStatisticsRoutingModule {}

+ 91 - 0
src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.component.html

@@ -0,0 +1,91 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <nz-radio-group [(ngModel)]="dateType" (ngModelChange)="changeDateType($event)">
7
+            <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
8
+          </nz-radio-group>
9
+        </div>
10
+        <div class="list-template__searchItem">
11
+          <span class="label">发起时间</span>:
12
+          <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
13
+            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
14
+          </nz-range-picker>
15
+          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
16
+            (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">
17
+          </nz-month-picker>
18
+          <span *ngIf="dateType=='month'"> ~ </span>
19
+          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeEnd" [nzDisabledDate]="disabledMonthEnd"
20
+            (ngModelChange)="changeMonthEnd($event)" nzPlaceHolder="请选择截止月份">
21
+          </nz-month-picker>
22
+          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeStart" [nzDisabledDate]="disabledYearStart"
23
+            (ngModelChange)="changeYearStart($event)" nzPlaceHolder="请选择开始年份">
24
+          </nz-year-picker>
25
+          <span *ngIf="dateType=='year'"> ~ </span>
26
+          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeEnd" (ngModelChange)="changeYearEnd($event)"
27
+            [nzDisabledDate]="disabledYearEnd" nzPlaceHolder="请选择截止年份">
28
+          </nz-year-picker>
29
+        </div>
30
+        <div class="list-template__searchItem ml8">
31
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择时间"
32
+            [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
33
+            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
34
+          </nz-select>
35
+        </div>
36
+      </div>
37
+      <div nz-col nzXl='6' class="list-template__btns">
38
+        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
39
+        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
40
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
41
+      </div>
42
+    </div>
43
+    <div class="list-template__checkBoxes">
44
+      <nz-radio-group [(ngModel)]="dataType" (ngModelChange)="getList(true)">
45
+        <label nz-radio [nzValue]="item.value" *ngFor="let item of checkOptionsOne">{{item.label}}</label>
46
+      </nz-radio-group>
47
+    </div>
48
+    <div class="list-template__chart">
49
+      <div class="echarts">
50
+        <div class="echart-head">医废类型</div>
51
+        <div echarts class="echart" [options]='pieChartOption'></div>
52
+      </div>
53
+      <div class="echarts">
54
+        <div class="echart-head">回收及出库重量</div>
55
+        <div echarts class="echart" [options]='barChartOption'></div>
56
+      </div>
57
+    </div>
58
+    <div class="list-template__bottom">
59
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
60
+        [nzLoading]="loading1">
61
+        <!-- <thead (nzSortChange)="sort($event)" nzSingleSort> -->
62
+        <thead>
63
+          <tr class="thead">
64
+            <th>序号</th>
65
+            <th>日期</th>
66
+            <th *ngFor="let data of heads">{{data}}(kg)</th>
67
+          </tr>
68
+        </thead>
69
+        <tbody>
70
+          <tr *ngFor="let data of listOfData;let index=index;">
71
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
72
+            <td>{{ data.date }}</td>
73
+            <td *ngFor="let weight of data.typeWeightList">{{ weight }}</td>
74
+          </tr>
75
+        </tbody>
76
+      </nz-table>
77
+      <div class="list-template__pagination">
78
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
79
+          (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)"
80
+          (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)">
81
+        </nz-pagination>
82
+      </div>
83
+    </div>
84
+  </div>
85
+</div>
86
+<!-- 操作成功/失败提示框 -->
87
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
88
+  [info]="promptInfo"></app-prompt-modal>
89
+
90
+<!-- 查看详情 -->
91
+<router-outlet></router-outlet>

+ 95 - 0
src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.component.less

@@ -0,0 +1,95 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host ::ng-deep .on {
4
+  color: #fff !important;
5
+}
6
+
7
+.save {
8
+  position: fixed;
9
+  left: 0;
10
+  top: 0;
11
+  width: 100%;
12
+  height: 100%;
13
+  background: rgba(0, 0, 0, 0.4);
14
+  z-index: 99;
15
+
16
+  .modalBody {
17
+    width: 1000px;
18
+    background: #fff;
19
+    border-radius: 5px;
20
+    padding: 10px 20px;
21
+    color: #333;
22
+
23
+    .title {
24
+      width: 100%;
25
+      text-align: center;
26
+      font-size: 18px;
27
+      position: relative;
28
+
29
+      i {
30
+        position: absolute;
31
+        right: 0;
32
+        top: 0;
33
+        font-size: 20px;
34
+        color: #666;
35
+        cursor: pointer;
36
+        padding: 0 5px;
37
+      }
38
+    }
39
+
40
+    .content {
41
+      width: 100%;
42
+      border: 1px solid #e5e9ed;
43
+      border-radius: 5px;
44
+      overflow: hidden;
45
+      margin-top: 12px;
46
+
47
+      .conItem {
48
+        color: #333;
49
+
50
+        .jiTit {
51
+          height: 50px;
52
+          line-height: 50px;
53
+          border-bottom: 1px solid #e5e9ed;
54
+          padding: 0 32px;
55
+        }
56
+
57
+        .defeat {
58
+          font-size: 14px;
59
+          color: #333;
60
+          padding: 15px 32px;
61
+          min-height: 125px;
62
+        }
63
+
64
+        &.noCon {
65
+          background: #f9fafb;
66
+          padding: 16px 32px 24px 32px;
67
+          border-top: 1px solid #e5e9ed;
68
+
69
+          .title {
70
+            text-align: left;
71
+            font-size: 14px;
72
+            margin-bottom: 8px;
73
+          }
74
+
75
+          textarea {
76
+            min-height: 210px;
77
+          }
78
+        }
79
+      }
80
+    }
81
+
82
+    button {
83
+      margin-top: 10px;
84
+      margin-left: 10px;
85
+    }
86
+  }
87
+
88
+  .txtL {
89
+    text-align: left !important;
90
+  }
91
+
92
+  .txtR {
93
+    text-align: right !important;
94
+  }
95
+}

+ 624 - 0
src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.component.ts

@@ -0,0 +1,624 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear, startOfDay, endOfDay } from "date-fns";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { DateService } from "../../services/date.service";
7
+import { MyServiceService } from "../../services/my-service.service";
8
+import { ToolService } from "../../services/tool.service";
9
+import { NzMessageService } from 'ng-zorro-antd';
10
+
11
+@Component({
12
+  selector: "app-medical-waste-hospital-statistics",
13
+  templateUrl: "./medical-waste-hospital-statistics.component.html",
14
+  styleUrls: ["./medical-waste-hospital-statistics.component.less"],
15
+})
16
+export class MedicalWasteHospitalStatisticsComponent implements OnInit {
17
+  constructor(
18
+    private route: ActivatedRoute,
19
+    private router: Router,
20
+    private mainService: MainService,
21
+    private dateService: DateService,
22
+    private myService: MyServiceService,
23
+    private message: NzMessageService,
24
+    private tool: ToolService
25
+  ) {}
26
+
27
+  ngOnInit() {
28
+    this.coopBtns = this.tool.initCoopBtns(this.route);
29
+    this.getAllHos();
30
+    this.changeDateRange(this.defRange);
31
+    // this.search();
32
+  }
33
+
34
+  dataType:string = 'outbound';
35
+
36
+  checkOptionsOne: Array<any> = [
37
+    { label: "回收重量", value: "recovery", checked: true },
38
+    { label: "出库总重量", value: "outbound", checked: false },
39
+  ];
40
+
41
+  dateType: string = "day"; //选中时间维度
42
+  dateTypes: any = [
43
+    {
44
+      label: "按天统计",
45
+      value: "day",
46
+    },
47
+    {
48
+      label: "按月统计",
49
+      value: "month",
50
+    },
51
+    {
52
+      label: "按年统计",
53
+      value: "year",
54
+    },
55
+  ]; //时间维度
56
+  defRange = "1"; //默认上周
57
+  defRanges = [
58
+    {
59
+      label: "上周",
60
+      id: 1,
61
+    },
62
+    {
63
+      label: "上月",
64
+      id: 2,
65
+    },
66
+    {
67
+      label: "上年",
68
+      id: 3,
69
+    },
70
+  ]; //时间默认区间
71
+
72
+  heads: any[] = []; //表头数据
73
+  listOfData: any[] = []; //表格数据
74
+  pageIndex: number = 1; //表格当前页码
75
+  pageSize: number = 10; //表格每页展示条数
76
+  listLength: number = 10; //表格总数据量
77
+
78
+  alldepart: any = []; //当前院区所属科室
79
+  dateRange: any = []; //发起时间区间 天
80
+  monthRangeStart: any; //发起时间 月 起
81
+  monthRangeEnd: any; //发起时间 月 止
82
+  yearRangeStart: any; //发起时间 年 起
83
+  yearRangeEnd: any; //发起时间 年 止
84
+
85
+  promptContent: string; //操作提示框提示信息
86
+  ifSuccess: boolean; //操作成功/失败
87
+  promptInfo: string; //操作结果提示信息
88
+  promptModalShow: boolean; //操作提示框是否展示
89
+
90
+  // 初始化增删改按钮
91
+  coopBtns: any = {};
92
+  searchData: any = {}; // 综合统计页面带过来的参数
93
+  getSearchData() {
94
+    let that = this;
95
+    let sub = that.myService.getMsg().subscribe((msg) => {
96
+      // 从综合报表跳转过来
97
+      that.searchData = msg;
98
+      console.log(that.searchData);
99
+      console.log(66);
100
+      sub.unsubscribe(); //取消订阅,否则订阅函数会累加执行
101
+      that.hospital = that.searchData["hosId"];
102
+      that.changeDate(that.searchData["range"]);
103
+      that.defRange = that.searchData["defRange"];
104
+      that.search();
105
+    });
106
+    that.changeDateRange(that.defRange);
107
+    that.search();
108
+  }
109
+  // 搜索
110
+  search(num?: number) {
111
+    if (this.hospital) {
112
+      this.searchData["hosId"] = this.hospital;
113
+    }
114
+    if (this.startDate) {
115
+      this.searchData["dateRange"] = {
116
+        start: this.startDate,
117
+        end: this.endDate,
118
+      };
119
+    }
120
+    if (num !== undefined) {
121
+      this.getList(num, this.sortCurrentKey, this.sortCurrentValue);
122
+    } else {
123
+      this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
124
+    }
125
+  }
126
+  // 导出
127
+  loading2 = false;
128
+  export() {
129
+    let that = this;
130
+    let postData: any = {
131
+      startTime: this.startDate,
132
+      endTime: this.endDate,
133
+      hosId: that.hospital,
134
+      type: this.dateType,
135
+      dataType: this.dataType || undefined,
136
+    };
137
+    if (this.sortCurrentKey && this.sortCurrentValue) {
138
+      postData.sort =
139
+        this.sortCurrentValue === "ascend"
140
+          ? this.sortCurrentKey
141
+          : `${this.sortCurrentKey} desc`;
142
+    }
143
+    this.loading2 = true;
144
+    that.mainService.exportReport("medicalWasteHospital", postData).subscribe(
145
+      (data) => {
146
+        this.loading2 = false;
147
+        this.showPromptModal("导出", true, "");
148
+        var file = new Blob([data], {
149
+          type: "application/vnd.ms-excel",
150
+        });
151
+        //trick to download store a file having its URL
152
+        var fileURL = URL.createObjectURL(file);
153
+        var a = document.createElement("a");
154
+        a.href = fileURL;
155
+        a.target = "_blank";
156
+        a.download = "全院统计.xls";
157
+        document.body.appendChild(a);
158
+        a.click();
159
+      },
160
+      (err) => {
161
+        this.loading2 = false;
162
+        this.showPromptModal("导出", false, "");
163
+      }
164
+    );
165
+  }
166
+  // 重置
167
+  reset() {
168
+    this.dataType = 'outbound';
169
+    this.sortCurrentKey = "";
170
+    this.sortCurrentValue = "";
171
+    this.sortCurrent = {
172
+      deptNum: null,
173
+      clothesTypeNum: null,
174
+      getOrder: null,
175
+      sendOrder: null,
176
+      sendClothesNum: null,
177
+      price: null,
178
+    };
179
+    this.changeDateType("day");
180
+  }
181
+  // 医废类型-图表
182
+  pieChartOption;
183
+  pieChartHandler(datas) {
184
+    console.log(datas)
185
+    let labels = [];
186
+    let nums = [];
187
+    if (datas.length) {
188
+      datas.forEach((e) => {
189
+        labels.push(e[0]);
190
+        nums.push({
191
+          name: e[0],
192
+          value: e[1],
193
+          label: {
194
+            position: e[1] >= 0 ? 'bottom' : 'top',
195
+          }
196
+        });
197
+      });
198
+    }
199
+    this.pieChartOption = {
200
+      color: ["#6c63f0", "#b750be", "#3aacff", "#ed589d", "#fb466c", "#00d6f6"],
201
+      tooltip: {
202
+        trigger: "item",
203
+        axisPointer: {
204
+          // 坐标轴指示器,坐标轴触发有效
205
+          type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
206
+        },
207
+        formatter: '{b}: {c}kg'
208
+      },
209
+      legend: {
210
+        orient: 'vertical',
211
+        right: 20,
212
+        top: 'center'
213
+      },
214
+      grid: {
215
+        left: "9px",
216
+        right: "9px",
217
+        bottom: "20px",
218
+        top: "20px",
219
+        containLabel: true,
220
+      },
221
+      series: [
222
+        {
223
+          type: 'pie',
224
+          radius: '50%',
225
+          data: nums,
226
+          emphasis: {
227
+            itemStyle: {
228
+              shadowBlur: 10,
229
+              shadowOffsetX: 0,
230
+              shadowColor: 'rgba(0, 0, 0, 0.5)'
231
+            }
232
+          },
233
+          label: {
234
+            show: true,
235
+            formatter: "{b} {d}%"
236
+          },
237
+        },
238
+      ],
239
+    };
240
+  }
241
+
242
+  // 回收及出库重量-图表
243
+  barChartOption;
244
+  barChartHandler(datas) {
245
+    console.log(datas)
246
+    let labels = [];
247
+    let nums = [];
248
+    if (datas.length) {
249
+      datas.forEach((e) => {
250
+        labels.push(e[0]);
251
+        nums.push({
252
+          name: e[0],
253
+          value: e[1],
254
+          label: {
255
+            position: 'top',
256
+          },
257
+          itemStyle: {
258
+            color: e[0] === '回收' ? '#3588fa' : '#00d6f6'
259
+          }
260
+        });
261
+      });
262
+    }
263
+    this.barChartOption = {
264
+      tooltip: {
265
+        trigger: "axis",
266
+        axisPointer: {
267
+          // 坐标轴指示器,坐标轴触发有效
268
+          type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
269
+        },
270
+        formatter: '{b}: {c}kg'
271
+      },
272
+      grid: {
273
+        left: "9px",
274
+        right: "9px",
275
+        bottom: "20px",
276
+        top: "20px",
277
+        containLabel: true,
278
+      },
279
+      xAxis: [
280
+        {
281
+          type: "category",
282
+          data: labels,
283
+          axisTick: {
284
+            alignWithLabel: true,
285
+          },
286
+        },
287
+      ],
288
+      yAxis: [
289
+        {
290
+          type: "value",
291
+          axisLabel: {
292
+            formatter: "{value}kg",
293
+          },
294
+          nameTextStyle: {
295
+            align: "left",
296
+          },
297
+        },
298
+      ],
299
+      series: [
300
+        {
301
+          name: "",
302
+          type: "bar",
303
+          barWidth: "35",
304
+          data: nums,
305
+          label: {
306
+            show: true,
307
+            color: '#000',
308
+            formatter: '{c}kg'
309
+          },
310
+        },
311
+      ],
312
+    };
313
+  }
314
+  // 表格数据
315
+  loading1 = false;
316
+  pieChart: any = [];
317
+  barChart: any = [];
318
+  getList(num?: number, field?: string, sort?: string) {
319
+    let maskFlag = this.message.loading("正在加载中..", {
320
+      nzDuration: 0,
321
+    }).messageId;
322
+    this.pageIndex = num;
323
+    let postData: any = {
324
+      idx: this.pageIndex - 1,
325
+      sum: this.pageSize,
326
+      startTime: this.searchData.dateRange.start,
327
+      endTime: this.searchData.dateRange.end,
328
+      hosId: this.searchData.hosId,
329
+      type: this.dateType,
330
+      dataType: this.dataType || undefined,
331
+    };
332
+    if (field && sort) {
333
+      postData.sort = sort === "ascend" ? field : `${field} desc`;
334
+    }
335
+    this.loading1 = true;
336
+    this.mainService
337
+      .postCustom("report/medicalWaste", "hospital", postData)
338
+      .subscribe((result) => {
339
+        this.message.remove(maskFlag);
340
+        this.loading1 = false;
341
+        this.heads = result.heads || [];
342
+        this.listOfData = result.list || [];
343
+        this.listLength = result.totalNum;
344
+
345
+        this.pieChart = result.pieChart || [];
346
+        this.pieChartHandler(this.pieChart);
347
+
348
+        this.barChart = result.barChart || [];
349
+        this.barChartHandler(this.barChart);
350
+      });
351
+  }
352
+  // 获取院区
353
+  hospital: string; //选中院区
354
+  getAllHos() {
355
+    this.hospital = this.tool.getCurrentHospital().id + "";
356
+  }
357
+
358
+  onCalendarChangeDate(dateArr){
359
+    console.log(dateArr)
360
+    if(dateArr.length == 2){
361
+      let dateStart = new Date(dateArr[0]);
362
+      let dateEnd = new Date(dateArr[1]);
363
+      dateStart.setHours(0,0,0);
364
+      dateEnd.setHours(23,59,59);
365
+      this.dateRange = [dateStart,dateEnd];
366
+    }
367
+  }
368
+
369
+  // 修改时间展示维度
370
+  changeDateType(res) {
371
+    console.log(res, this.dateType);
372
+    this.dateType = res;
373
+    this.searchData["type"] = res;
374
+    console.log(this.searchData);
375
+    switch (res) {
376
+      case "day":
377
+        this.defRanges = [
378
+          {
379
+            label: "上周",
380
+            id: 1,
381
+          },
382
+          {
383
+            label: "上月",
384
+            id: 2,
385
+          },
386
+          {
387
+            label: "上年",
388
+            id: 3,
389
+          },
390
+        ]; //时间默认区间
391
+        this.defRange = "1"; //默认上周
392
+        this.changeDateRange("1");
393
+        break;
394
+      case "month":
395
+        this.defRanges = [
396
+          {
397
+            label: "上月",
398
+            id: 2,
399
+          },
400
+          {
401
+            label: "上年",
402
+            id: 3,
403
+          },
404
+        ]; //时间默认区间
405
+        this.defRange = "2"; //上月
406
+        this.changeDateRange("2");
407
+        break;
408
+      case "year":
409
+        this.defRanges = [
410
+          {
411
+            label: "上年",
412
+            id: 3,
413
+          },
414
+        ]; //时间默认区间
415
+        this.defRange = "3"; //默认上周
416
+        this.changeDateRange("3");
417
+        break;
418
+    }
419
+  }
420
+
421
+  // 禁选日期
422
+  disabledDate = (current: Date): boolean => {
423
+    // Can not select days before today and today
424
+    return differenceInCalendarDays(current, this.today) > 0;
425
+  };
426
+
427
+  // 禁选月份开始
428
+  disabledMonthStart = (current: Date): boolean => {
429
+    // Can not select days before today and today
430
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
431
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
432
+    return cur || staEnd;
433
+  };
434
+  // 禁选月份结束
435
+  disabledMonthEnd = (current: Date): boolean => {
436
+    // Can not select days before today and today
437
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
438
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
439
+    return cur || staEnd;
440
+  };
441
+
442
+  // 禁选年份开始
443
+  disabledYearStart = (current: Date): boolean => {
444
+    // Can not select days before today and today
445
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
446
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
447
+    return cur || staEnd;
448
+  };
449
+
450
+  // 禁选年份结束
451
+  disabledYearEnd = (current: Date): boolean => {
452
+    // Can not select days before today and today
453
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
454
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
455
+    return cur || staEnd;
456
+  };
457
+
458
+  // 日期选择 日
459
+  startDate: string; //发起时间开始
460
+  endDate: string; //发起时间结束
461
+  changeDate(result?): void {
462
+    console.log(this.dateRange);
463
+    console.log(result);
464
+    this.dateRange = result;
465
+    if (!this.quick) {
466
+      // 不是快捷选择
467
+      this.defRange = null;
468
+    }
469
+    if (!result || !result.length) {
470
+      this.startDate = this.endDate = "";
471
+      return;
472
+    }
473
+    this.startDate = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
474
+    this.endDate = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
475
+  }
476
+
477
+  // 月份选择
478
+  changeMonthStart(result?) {
479
+    console.log(result);
480
+    this.monthRangeStart = result;
481
+    if (!this.quick) {
482
+      // 不是快捷选择
483
+      this.defRange = null;
484
+    }
485
+    if (!result) {
486
+      this.startDate = this.endDate = "";
487
+      return;
488
+    }
489
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
490
+    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
491
+  }
492
+  changeMonthEnd(result?) {
493
+    console.log(result);
494
+    this.monthRangeEnd = result;
495
+    if (!this.quick) {
496
+      // 不是快捷选择
497
+      this.defRange = null;
498
+    }
499
+    if (!result) {
500
+      this.startDate = this.endDate = "";
501
+      return;
502
+    }
503
+    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
504
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
505
+  }
506
+  // 年份选择
507
+  changeYearStart(result?) {
508
+    console.log(result);
509
+    this.yearRangeStart = result;
510
+    if (!this.quick) {
511
+      // 不是快捷选择
512
+      this.defRange = null;
513
+    }
514
+    if (!result) {
515
+      this.startDate = this.endDate = "";
516
+      return;
517
+    }
518
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
519
+    // this.endDate = result.getFullYear() + '-01-01';
520
+  }
521
+  changeYearEnd(result?) {
522
+    console.log(result);
523
+    this.yearRangeEnd = result;
524
+    if (!this.quick) {
525
+      // 不是快捷选择
526
+      this.defRange = null;
527
+    }
528
+    if (!result) {
529
+      this.startDate = this.endDate = "";
530
+      return;
531
+    }
532
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
533
+  }
534
+
535
+  // 日期选择 快速修改时间区间
536
+  today = new Date();
537
+  quick: boolean = false;
538
+  changeDateRange(res) {
539
+    console.log(res);
540
+    this.quick = true;
541
+    switch (res) {
542
+      case "1":
543
+        // 上周
544
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
545
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
546
+        console.log(lastweekstartdate, lastweekenddate);
547
+        this.changeDate([lastweekstartdate, lastweekenddate]);
548
+        break;
549
+      case "2":
550
+        // 上月
551
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
552
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
553
+        console.log(lastmonthstartdate, lastmonthenddate);
554
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
555
+        this.changeMonthStart(lastmonthstartdate);
556
+        this.changeMonthEnd(lastmonthenddate);
557
+        break;
558
+      case "3":
559
+        // 上年
560
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
561
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
562
+        console.log(lastyearstartdate, lastyearenddate);
563
+        this.changeDate([lastyearstartdate, lastyearenddate]);
564
+        this.changeMonthStart(lastyearstartdate);
565
+        this.changeMonthEnd(lastyearenddate);
566
+        this.changeYearStart(lastyearstartdate);
567
+        this.changeYearEnd(lastyearenddate);
568
+        break;
569
+    }
570
+    this.quick = false;
571
+    this.search();
572
+  }
573
+
574
+  // 更多
575
+  toMore(type) {
576
+    let sendData = this.searchData;
577
+    console.log(sendData);
578
+    this.myService.sendMsg(sendData);
579
+    this.router.navigateByUrl("/main/" + type);
580
+  }
581
+
582
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
583
+  showPromptModal(con, success, promptInfo?) {
584
+    this.promptModalShow = false;
585
+    this.promptContent = con;
586
+    this.ifSuccess = success;
587
+    this.promptInfo = promptInfo;
588
+    setTimeout(() => {
589
+      this.promptModalShow = true;
590
+    }, 100);
591
+  }
592
+
593
+  // 跳转详情
594
+  toDetail(e, data){
595
+    e.stopPropagation();
596
+    console.log(data);
597
+    window.open(`${location.origin}/spreadSheet/#/quiltWashingHospital/${data.date}/${this.dateType}`);
598
+  }
599
+
600
+  // 边输入边搜索节流阀
601
+  isLoading: boolean = false;
602
+  searchTimer(fun, e, those) {
603
+    let that = this;
604
+    that.isLoading = true;
605
+    fun(e, those);
606
+  }
607
+  // 列表排序
608
+  sortCurrent = {
609
+    deptNum: null,
610
+    clothesTypeNum: null,
611
+    getOrder: null,
612
+    sendOrder: null,
613
+    sendClothesNum: null,
614
+    price: null,
615
+  };
616
+  sortCurrentKey: string = "";
617
+  sortCurrentValue: string | null = "";
618
+  sort(e) {
619
+    const { key, value } = e;
620
+    this.sortCurrentKey = key;
621
+    this.sortCurrentValue = value;
622
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
623
+  }
624
+}

+ 18 - 0
src/app/views/medical-waste-hospital-statistics/medical-waste-hospital-statistics.module.ts

@@ -0,0 +1,18 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { MedicalWasteHospitalStatisticsRoutingModule } from "./medical-waste-hospital-statistics-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { MedicalWasteHospitalStatisticsComponent } from "./medical-waste-hospital-statistics.component";
7
+import { NgxEchartsModule } from 'ngx-echarts';
8
+
9
+@NgModule({
10
+  declarations: [MedicalWasteHospitalStatisticsComponent],
11
+  imports: [
12
+    CommonModule,
13
+    MedicalWasteHospitalStatisticsRoutingModule,
14
+    NgxEchartsModule,
15
+    ShareModule,
16
+  ],
17
+})
18
+export class MedicalWasteHospitalStatisticsModule {}

+ 13 - 0
src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics-routing.module.ts

@@ -0,0 +1,13 @@
1
+import { NgModule } from "@angular/core";
2
+import { Routes, RouterModule } from "@angular/router";
3
+import { MedicalWastePersonnelStatisticsComponent } from "./medical-waste-personnel-statistics.component";
4
+
5
+const routes: Routes = [
6
+  { path: "", component: MedicalWastePersonnelStatisticsComponent },
7
+];
8
+
9
+@NgModule({
10
+  imports: [RouterModule.forChild(routes)],
11
+  exports: [RouterModule],
12
+})
13
+export class MedicalWastePersonnelStatisticsRoutingModule {}

+ 97 - 0
src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.component.html

@@ -0,0 +1,97 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <nz-radio-group [(ngModel)]="dateType" (ngModelChange)="changeDateType($event)">
7
+            <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
8
+          </nz-radio-group>
9
+        </div>
10
+        <div class="list-template__searchItem">
11
+          <span class="label">发起时间</span>:
12
+          <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
13
+            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
14
+          </nz-range-picker>
15
+          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
16
+            (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">
17
+          </nz-month-picker>
18
+          <span *ngIf="dateType=='month'"> ~ </span>
19
+          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeEnd" [nzDisabledDate]="disabledMonthEnd"
20
+            (ngModelChange)="changeMonthEnd($event)" nzPlaceHolder="请选择截止月份">
21
+          </nz-month-picker>
22
+          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeStart" [nzDisabledDate]="disabledYearStart"
23
+            (ngModelChange)="changeYearStart($event)" nzPlaceHolder="请选择开始年份">
24
+          </nz-year-picker>
25
+          <span *ngIf="dateType=='year'"> ~ </span>
26
+          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeEnd" (ngModelChange)="changeYearEnd($event)"
27
+            [nzDisabledDate]="disabledYearEnd" nzPlaceHolder="请选择截止年份">
28
+          </nz-year-picker>
29
+        </div>
30
+        <div class="list-template__searchItem ml8">
31
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择时间"
32
+            [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
33
+            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
34
+          </nz-select>
35
+        </div>
36
+        <div class="list-template__searchItem">
37
+          <span class="label">人员名称</span>:
38
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
39
+            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择人员名称" [(ngModel)]="searchDto.user">
40
+            <ng-container *ngFor="let option of userList">
41
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
42
+            </ng-container>
43
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
44
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
45
+            </nz-option>
46
+          </nz-select>
47
+        </div>
48
+        <div class="list-template__searchItem">
49
+          <span class="label">人员分组</span>:
50
+          <nz-select class="formItem" nzAllowClear [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择人员分组" [(ngModel)]="searchDto.group">
51
+            <nz-option [nzLabel]="data.groupName" [nzValue]="data.id" *ngFor="let data of groupList"></nz-option>
52
+          </nz-select>
53
+        </div>
54
+      </div>
55
+      <div nz-col nzXl='6' class="list-template__btns">
56
+        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
57
+        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
58
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
59
+      </div>
60
+    </div>
61
+    <div class="list-template__bottom">
62
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
63
+        [nzLoading]="loading1">
64
+        <thead (nzSortChange)="sort($event)" nzSingleSort>
65
+          <tr class="thead">
66
+            <th nzWidth="5%">序号</th>
67
+            <th nzWidth="5%">人员姓名</th>
68
+            <th nzWidth="30%">总趟数</th>
69
+            <th nzWidth="30%">总单数</th>
70
+            <th nzWidth="30%">总重量(KG)</th>
71
+          </tr>
72
+        </thead>
73
+        <tbody>
74
+          <tr *ngFor="let data of listOfData;let index=index;">
75
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
76
+            <td>{{ data.userName }}</td>
77
+            <td>{{ data.totalTrip }}</td>
78
+            <td>{{ data.totalOrder }}</td>
79
+            <td>{{ data.totalWeight }}</td>
80
+          </tr>
81
+        </tbody>
82
+      </nz-table>
83
+      <div class="list-template__pagination">
84
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
85
+          (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)"
86
+          (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)">
87
+        </nz-pagination>
88
+      </div>
89
+    </div>
90
+  </div>
91
+</div>
92
+<!-- 操作成功/失败提示框 -->
93
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
94
+  [info]="promptInfo"></app-prompt-modal>
95
+
96
+<!-- 查看详情 -->
97
+<router-outlet></router-outlet>

+ 95 - 0
src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.component.less

@@ -0,0 +1,95 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host ::ng-deep .on {
4
+  color: #fff !important;
5
+}
6
+
7
+.save {
8
+  position: fixed;
9
+  left: 0;
10
+  top: 0;
11
+  width: 100%;
12
+  height: 100%;
13
+  background: rgba(0, 0, 0, 0.4);
14
+  z-index: 99;
15
+
16
+  .modalBody {
17
+    width: 1000px;
18
+    background: #fff;
19
+    border-radius: 5px;
20
+    padding: 10px 20px;
21
+    color: #333;
22
+
23
+    .title {
24
+      width: 100%;
25
+      text-align: center;
26
+      font-size: 18px;
27
+      position: relative;
28
+
29
+      i {
30
+        position: absolute;
31
+        right: 0;
32
+        top: 0;
33
+        font-size: 20px;
34
+        color: #666;
35
+        cursor: pointer;
36
+        padding: 0 5px;
37
+      }
38
+    }
39
+
40
+    .content {
41
+      width: 100%;
42
+      border: 1px solid #e5e9ed;
43
+      border-radius: 5px;
44
+      overflow: hidden;
45
+      margin-top: 12px;
46
+
47
+      .conItem {
48
+        color: #333;
49
+
50
+        .jiTit {
51
+          height: 50px;
52
+          line-height: 50px;
53
+          border-bottom: 1px solid #e5e9ed;
54
+          padding: 0 32px;
55
+        }
56
+
57
+        .defeat {
58
+          font-size: 14px;
59
+          color: #333;
60
+          padding: 15px 32px;
61
+          min-height: 125px;
62
+        }
63
+
64
+        &.noCon {
65
+          background: #f9fafb;
66
+          padding: 16px 32px 24px 32px;
67
+          border-top: 1px solid #e5e9ed;
68
+
69
+          .title {
70
+            text-align: left;
71
+            font-size: 14px;
72
+            margin-bottom: 8px;
73
+          }
74
+
75
+          textarea {
76
+            min-height: 210px;
77
+          }
78
+        }
79
+      }
80
+    }
81
+
82
+    button {
83
+      margin-top: 10px;
84
+      margin-left: 10px;
85
+    }
86
+  }
87
+
88
+  .txtL {
89
+    text-align: left !important;
90
+  }
91
+
92
+  .txtR {
93
+    text-align: right !important;
94
+  }
95
+}

+ 520 - 0
src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.component.ts

@@ -0,0 +1,520 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear, endOfDay, startOfDay } from "date-fns";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { DateService } from "../../services/date.service";
7
+import { MyServiceService } from "../../services/my-service.service";
8
+import { ToolService } from "../../services/tool.service";
9
+import { Subject } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
11
+
12
+@Component({
13
+  selector: "app-medical-waste-personnel-statistics",
14
+  templateUrl: "./medical-waste-personnel-statistics.component.html",
15
+  styleUrls: ["./medical-waste-personnel-statistics.component.less"],
16
+})
17
+export class MedicalWastePersonnelStatisticsComponent implements OnInit {
18
+  constructor(
19
+    private route: ActivatedRoute,
20
+    private router: Router,
21
+    private mainService: MainService,
22
+    private dateService: DateService,
23
+    private myService: MyServiceService,
24
+    private tool: ToolService
25
+  ) {}
26
+
27
+  searchTimerSubject = new Subject();
28
+
29
+  ngOnInit() {
30
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
31
+      let fun = v[0];
32
+      fun.call(this, v[1]);
33
+    });
34
+    this.coopBtns = this.tool.initCoopBtns(this.route);
35
+    this.getAllHos();
36
+    this.changeDateRange(this.defRange);
37
+    // this.search();
38
+  }
39
+
40
+  dateType: string = "day"; //选中时间维度
41
+  dateTypes: any = [
42
+    {
43
+      label: "按天统计",
44
+      value: "day",
45
+    },
46
+    {
47
+      label: "按月统计",
48
+      value: "month",
49
+    },
50
+    {
51
+      label: "按年统计",
52
+      value: "year",
53
+    },
54
+  ]; //时间维度
55
+  defRange = "1"; //默认上周
56
+  defRanges = [
57
+    {
58
+      label: "上周",
59
+      id: 1,
60
+    },
61
+    {
62
+      label: "上月",
63
+      id: 2,
64
+    },
65
+    {
66
+      label: "上年",
67
+      id: 3,
68
+    },
69
+  ]; //时间默认区间
70
+
71
+  listOfData: any[] = []; //表格数据
72
+  pageIndex: number = 1; //表格当前页码
73
+  pageSize: number = 10; //表格每页展示条数
74
+  listLength: number = 10; //表格总数据量
75
+
76
+  alldepart: any = []; //当前院区所属科室
77
+  dateRange: any = []; //发起时间区间 天
78
+  monthRangeStart: any; //发起时间 月 起
79
+  monthRangeEnd: any; //发起时间 月 止
80
+  yearRangeStart: any; //发起时间 年 起
81
+  yearRangeEnd: any; //发起时间 年 止
82
+
83
+  promptContent: string; //操作提示框提示信息
84
+  ifSuccess: boolean; //操作成功/失败
85
+  promptInfo: string; //操作结果提示信息
86
+  promptModalShow: boolean; //操作提示框是否展示
87
+
88
+  searchDto: any = {
89
+    group: null,
90
+    user: null,
91
+  }
92
+
93
+  // 初始化增删改按钮
94
+  coopBtns: any = {};
95
+  searchData: any = {}; // 综合统计页面带过来的参数
96
+  getSearchData() {
97
+    let that = this;
98
+    let sub = that.myService.getMsg().subscribe((msg) => {
99
+      // 从综合报表跳转过来
100
+      that.searchData = msg;
101
+      console.log(that.searchData);
102
+      console.log(66);
103
+      sub.unsubscribe(); //取消订阅,否则订阅函数会累加执行
104
+      that.hospital = that.searchData["hosId"];
105
+      that.changeDate(that.searchData["range"]);
106
+      that.defRange = that.searchData["defRange"];
107
+      that.search();
108
+    });
109
+    that.changeDateRange(that.defRange);
110
+    that.search();
111
+  }
112
+  // 获取分组
113
+  groupList: any = []; //分组
114
+  getGroupList(id) {
115
+    let groupData = {
116
+      group2: {
117
+        hospitals: id,
118
+        type:1
119
+      },
120
+      idx: 0,
121
+      sum: 9999,
122
+    };
123
+    this.mainService
124
+      .getFetchDataList("data", "group2", groupData)
125
+      .subscribe((result) => {
126
+        this.groupList = result.list;
127
+      });
128
+  }
129
+  // 边输边搜节流阀
130
+  changeInp(e) {
131
+    this.searchTimer(this.getUserList, e);
132
+  }
133
+  // 获取人员
134
+  userList: any = []; //人员
135
+  getUserList(keyword = '') {
136
+    let postData = {
137
+      user: {
138
+        hospital: { id: this.hospital },
139
+        name: keyword
140
+      },
141
+      idx: 0,
142
+      sum: 10,
143
+    };
144
+    this.isLoading = true;
145
+    this.mainService
146
+      .getFetchDataList("data", "user", postData)
147
+      .subscribe((result) => {
148
+        this.isLoading = false;
149
+        this.userList = result.list;
150
+      });
151
+  }
152
+  // 搜索
153
+  search(num?: number) {
154
+    if (this.hospital) {
155
+      this.searchData["hosId"] = this.hospital;
156
+    }
157
+    if (this.startDate) {
158
+      this.searchData["dateRange"] = {
159
+        start: this.startDate,
160
+        end: this.endDate,
161
+      };
162
+    }
163
+    if (num !== undefined) {
164
+      this.getList(num, this.sortCurrentKey, this.sortCurrentValue);
165
+    } else {
166
+      this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
167
+    }
168
+  }
169
+  // 导出
170
+  loading2 = false;
171
+  export() {
172
+    let that = this;
173
+    let postData: any = {
174
+      startTime: this.startDate,
175
+      endTime: this.endDate,
176
+      hosId: that.hospital,
177
+      type: this.dateType,
178
+      userId: this.searchDto.user || undefined,
179
+      groupId: this.searchDto.group || undefined,
180
+    };
181
+    if (this.sortCurrentKey && this.sortCurrentValue) {
182
+      postData.sort =
183
+        this.sortCurrentValue === "ascend"
184
+          ? this.sortCurrentKey
185
+          : `${this.sortCurrentKey} desc`;
186
+    }
187
+    this.loading2 = true;
188
+    that.mainService.exportReport("medicalWastePersonal", postData).subscribe(
189
+      (data) => {
190
+        this.loading2 = false;
191
+        this.showPromptModal("导出", true, "");
192
+        var file = new Blob([data], {
193
+          type: "application/vnd.ms-excel",
194
+        });
195
+        //trick to download store a file having its URL
196
+        var fileURL = URL.createObjectURL(file);
197
+        var a = document.createElement("a");
198
+        a.href = fileURL;
199
+        a.target = "_blank";
200
+        a.download = "人员统计.xls";
201
+        document.body.appendChild(a);
202
+        a.click();
203
+      },
204
+      (err) => {
205
+        this.loading2 = false;
206
+        this.showPromptModal("导出", false, "");
207
+      }
208
+    );
209
+  }
210
+  // 重置
211
+  reset() {
212
+    this.sortCurrentKey = "";
213
+    this.sortCurrentValue = "";
214
+    this.sortCurrent = {
215
+      totalTrip: null,
216
+      totalOrder: null,
217
+      getTrip: null,
218
+      getOrder: null,
219
+      sendTrip: null,
220
+      sendOrder: null,
221
+    };
222
+    this.searchDto = {
223
+      group: null,
224
+      user: null,
225
+    }
226
+    this.changeDateType("day");
227
+  }
228
+  // 表格数据
229
+  loading1 = false;
230
+  getList(num?: number, field?: string, sort?: string) {
231
+    this.pageIndex = num;
232
+    let postData: any = {
233
+      idx: this.pageIndex - 1,
234
+      sum: this.pageSize,
235
+      startTime: this.searchData.dateRange.start,
236
+      endTime: this.searchData.dateRange.end,
237
+      hosId: this.searchData.hosId,
238
+      type: this.dateType,
239
+      userId: this.searchDto.user || undefined,
240
+      groupId: this.searchDto.group || undefined,
241
+    };
242
+    if (field && sort) {
243
+      postData.sort = sort === "ascend" ? field : `${field} desc`;
244
+    }
245
+    this.loading1 = true;
246
+    this.mainService
247
+      .postCustom("report/medicalWaste", "personal", postData)
248
+      .subscribe((result) => {
249
+        this.loading1 = false;
250
+        this.listOfData = result.list || [];
251
+        this.listLength = result.totalNum;
252
+      });
253
+  }
254
+  // 获取院区
255
+  hospital: string; //选中院区
256
+  getAllHos() {
257
+    this.hospital = this.tool.getCurrentHospital().id + "";
258
+    this.getGroupList(this.hospital);
259
+    this.getUserList();
260
+  }
261
+
262
+  onCalendarChangeDate(dateArr){
263
+    console.log(dateArr)
264
+    if(dateArr.length == 2){
265
+      let dateStart = new Date(dateArr[0]);
266
+      let dateEnd = new Date(dateArr[1]);
267
+      dateStart.setHours(0,0,0);
268
+      dateEnd.setHours(23,59,59);
269
+      this.dateRange = [dateStart,dateEnd];
270
+    }
271
+  }
272
+
273
+  // 修改时间展示维度
274
+  changeDateType(res) {
275
+    console.log(res, this.dateType);
276
+    this.dateType = res;
277
+    this.searchData["type"] = res;
278
+    console.log(this.searchData);
279
+    switch (res) {
280
+      case "day":
281
+        this.defRanges = [
282
+          {
283
+            label: "上周",
284
+            id: 1,
285
+          },
286
+          {
287
+            label: "上月",
288
+            id: 2,
289
+          },
290
+          {
291
+            label: "上年",
292
+            id: 3,
293
+          },
294
+        ]; //时间默认区间
295
+        this.defRange = "1"; //默认上周
296
+        this.changeDateRange("1");
297
+        break;
298
+      case "month":
299
+        this.defRanges = [
300
+          {
301
+            label: "上月",
302
+            id: 2,
303
+          },
304
+          {
305
+            label: "上年",
306
+            id: 3,
307
+          },
308
+        ]; //时间默认区间
309
+        this.defRange = "2"; //上月
310
+        this.changeDateRange("2");
311
+        break;
312
+      case "year":
313
+        this.defRanges = [
314
+          {
315
+            label: "上年",
316
+            id: 3,
317
+          },
318
+        ]; //时间默认区间
319
+        this.defRange = "3"; //默认上周
320
+        this.changeDateRange("3");
321
+        break;
322
+    }
323
+  }
324
+
325
+  // 禁选日期
326
+  disabledDate = (current: Date): boolean => {
327
+    // Can not select days before today and today
328
+    return differenceInCalendarDays(current, this.today) > 0;
329
+  };
330
+
331
+  // 禁选月份开始
332
+  disabledMonthStart = (current: Date): boolean => {
333
+    // Can not select days before today and today
334
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
335
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
336
+    return cur || staEnd;
337
+  };
338
+  // 禁选月份结束
339
+  disabledMonthEnd = (current: Date): boolean => {
340
+    // Can not select days before today and today
341
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
342
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
343
+    return cur || staEnd;
344
+  };
345
+
346
+  // 禁选年份开始
347
+  disabledYearStart = (current: Date): boolean => {
348
+    // Can not select days before today and today
349
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
350
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
351
+    return cur || staEnd;
352
+  };
353
+
354
+  // 禁选年份结束
355
+  disabledYearEnd = (current: Date): boolean => {
356
+    // Can not select days before today and today
357
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
358
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
359
+    return cur || staEnd;
360
+  };
361
+
362
+  // 日期选择 日
363
+  startDate: string; //发起时间开始
364
+  endDate: string; //发起时间结束
365
+  changeDate(result?): void {
366
+    console.log(this.dateRange);
367
+    console.log(result);
368
+    this.dateRange = result;
369
+    if (!this.quick) {
370
+      // 不是快捷选择
371
+      this.defRange = null;
372
+    }
373
+    if (!result || !result.length) {
374
+      this.startDate = this.endDate = "";
375
+      return;
376
+    }
377
+    this.startDate = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
378
+    this.endDate = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
379
+  }
380
+
381
+  // 月份选择
382
+  changeMonthStart(result?) {
383
+    console.log(result);
384
+    this.monthRangeStart = result;
385
+    if (!this.quick) {
386
+      // 不是快捷选择
387
+      this.defRange = null;
388
+    }
389
+    if (!result) {
390
+      this.startDate = this.endDate = "";
391
+      return;
392
+    }
393
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
394
+    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
395
+  }
396
+  changeMonthEnd(result?) {
397
+    console.log(result);
398
+    this.monthRangeEnd = result;
399
+    if (!this.quick) {
400
+      // 不是快捷选择
401
+      this.defRange = null;
402
+    }
403
+    if (!result) {
404
+      this.startDate = this.endDate = "";
405
+      return;
406
+    }
407
+    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
408
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
409
+  }
410
+  // 年份选择
411
+  changeYearStart(result?) {
412
+    console.log(result);
413
+    this.yearRangeStart = result;
414
+    if (!this.quick) {
415
+      // 不是快捷选择
416
+      this.defRange = null;
417
+    }
418
+    if (!result) {
419
+      this.startDate = this.endDate = "";
420
+      return;
421
+    }
422
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
423
+    // this.endDate = result.getFullYear() + '-01-01';
424
+  }
425
+  changeYearEnd(result?) {
426
+    console.log(result);
427
+    this.yearRangeEnd = result;
428
+    if (!this.quick) {
429
+      // 不是快捷选择
430
+      this.defRange = null;
431
+    }
432
+    if (!result) {
433
+      this.startDate = this.endDate = "";
434
+      return;
435
+    }
436
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
437
+  }
438
+
439
+  // 日期选择 快速修改时间区间
440
+  today = new Date();
441
+  quick: boolean = false;
442
+  changeDateRange(res) {
443
+    console.log(res);
444
+    this.quick = true;
445
+    switch (res) {
446
+      case "1":
447
+        // 上周
448
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
449
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
450
+        console.log(lastweekstartdate, lastweekenddate);
451
+        this.changeDate([lastweekstartdate, lastweekenddate]);
452
+        break;
453
+      case "2":
454
+        // 上月
455
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
456
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
457
+        console.log(lastmonthstartdate, lastmonthenddate);
458
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
459
+        this.changeMonthStart(lastmonthstartdate);
460
+        this.changeMonthEnd(lastmonthenddate);
461
+        break;
462
+      case "3":
463
+        // 上年
464
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
465
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
466
+        console.log(lastyearstartdate, lastyearenddate);
467
+        this.changeDate([lastyearstartdate, lastyearenddate]);
468
+        this.changeMonthStart(lastyearstartdate);
469
+        this.changeMonthEnd(lastyearenddate);
470
+        this.changeYearStart(lastyearstartdate);
471
+        this.changeYearEnd(lastyearenddate);
472
+        break;
473
+    }
474
+    this.quick = false;
475
+    this.search();
476
+  }
477
+
478
+  // 更多
479
+  toMore(type) {
480
+    let sendData = this.searchData;
481
+    console.log(sendData);
482
+    this.myService.sendMsg(sendData);
483
+    this.router.navigateByUrl("/main/" + type);
484
+  }
485
+
486
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
487
+  showPromptModal(con, success, promptInfo?) {
488
+    this.promptModalShow = false;
489
+    this.promptContent = con;
490
+    this.ifSuccess = success;
491
+    this.promptInfo = promptInfo;
492
+    setTimeout(() => {
493
+      this.promptModalShow = true;
494
+    }, 100);
495
+  }
496
+
497
+  // 边输入边搜索节流阀
498
+  isLoading: boolean = false;
499
+  searchTimer(fun, e) {
500
+    this.isLoading = true;
501
+    this.searchTimerSubject.next([fun, e]);
502
+  }
503
+  // 列表排序
504
+  sortCurrent = {
505
+    totalTrip: null,
506
+    totalOrder: null,
507
+    getTrip: null,
508
+    getOrder: null,
509
+    sendTrip: null,
510
+    sendOrder: null,
511
+  };
512
+  sortCurrentKey: string = "";
513
+  sortCurrentValue: string | null = "";
514
+  sort(e) {
515
+    const { key, value } = e;
516
+    this.sortCurrentKey = key;
517
+    this.sortCurrentValue = value;
518
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
519
+  }
520
+}

+ 16 - 0
src/app/views/medical-waste-personnel-statistics/medical-waste-personnel-statistics.module.ts

@@ -0,0 +1,16 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { MedicalWastePersonnelStatisticsRoutingModule } from "./medical-waste-personnel-statistics-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { MedicalWastePersonnelStatisticsComponent } from "./medical-waste-personnel-statistics.component";
7
+
8
+@NgModule({
9
+  declarations: [MedicalWastePersonnelStatisticsComponent],
10
+  imports: [
11
+    CommonModule,
12
+    MedicalWastePersonnelStatisticsRoutingModule,
13
+    ShareModule,
14
+  ],
15
+})
16
+export class MedicalWastePersonnelStatisticsModule {}

+ 13 - 0
src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis-routing.module.ts

@@ -0,0 +1,13 @@
1
+import { NgModule } from "@angular/core";
2
+import { Routes, RouterModule } from "@angular/router";
3
+import { MedicalWasteTrendAnalysisComponent } from "./medical-waste-trend-analysis.component";
4
+
5
+const routes: Routes = [
6
+  { path: "", component: MedicalWasteTrendAnalysisComponent },
7
+];
8
+
9
+@NgModule({
10
+  imports: [RouterModule.forChild(routes)],
11
+  exports: [RouterModule],
12
+})
13
+export class MedicalWasteTrendAnalysisRoutingModule {}

+ 181 - 0
src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.component.html

@@ -0,0 +1,181 @@
1
+<div class="quiltWashingTrendAnalysis">
2
+  <div class="main">
3
+    <div class="head">
4
+      <div class="search">
5
+        <div class="searchItem">
6
+          <nz-radio-group [(ngModel)]="searchDto.dateType" (ngModelChange)="changeDateType($event)">
7
+            <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
8
+          </nz-radio-group>
9
+        </div>
10
+        <div class="searchItem" *ngIf="searchDto.dateType=='day'">
11
+          <span class="label">发起时间:</span>
12
+          <nz-date-picker [nzAllowClear]="false" [(ngModel)]="searchDto.dateStr"></nz-date-picker>
13
+        </div>
14
+        <div class="searchItem" *ngIf="searchDto.dateType=='month'">
15
+          <span class="label">发起时间:</span>
16
+          <nz-month-picker [nzAllowClear]="false" [(ngModel)]="searchDto.dateStr"></nz-month-picker>
17
+        </div>
18
+        <div class="searchItem" *ngIf="searchDto.dateType=='year'">
19
+          <span class="label">发起时间:</span>
20
+          <nz-year-picker [nzAllowClear]="false" [(ngModel)]="searchDto.dateStr"></nz-year-picker>
21
+        </div>
22
+        <div class="searchItem" *ngIf="searchDto.dateType=='quarter'">
23
+          <span class="label">发起时间:</span>
24
+          <nz-select [(ngModel)]="searchDto.year">
25
+            <nz-option [nzLabel]="item.name" [nzValue]="item.value" *ngFor="let item of yearList"></nz-option>
26
+          </nz-select>
27
+          <nz-select class="ml8" [(ngModel)]="searchDto.quarter">
28
+            <nz-option [nzLabel]="item.name" [nzValue]="item.value" *ngFor="let item of quarterList"></nz-option>
29
+          </nz-select>
30
+        </div>
31
+      </div>
32
+      <div class="btns">
33
+        <button nz-button nzType="primary" (click)='search()'>搜索</button>
34
+        <button nz-button class="ml8" (click)='reset()'>重置</button>
35
+      </div>
36
+    </div>
37
+    <div class="body">
38
+      <div class="body_tabs_wrap">
39
+        <div class="body_tabs">
40
+          <ng-container *ngFor="let tabType of tabTypes">
41
+            <div class="tab" [ngClass]="{active: searchDto.tabType == tabType.value}" *ngIf="!(searchDto.dateType == 'year' && tabType.value == 'MoM')" (click)="changeTabType(tabType.value)">{{tabType.name}}</div>
42
+          </ng-container>
43
+        </div>
44
+        <div class="compareDate">对比期:{{headerDate.compareDate}}</div>
45
+      </div>
46
+
47
+      <div class="total">
48
+        <div class="total_list">
49
+          <div class="total_item">
50
+            <span class="name">{{headerData.totalIntoWeight}}</span>
51
+            <span class="value">产生医废重量(kg)</span>
52
+          </div>
53
+          <div class="total_item">
54
+            <span class="name">{{headerData.compareTotalIntoWeight}}</span>
55
+            <span class="value">对比期重量(kg)</span>
56
+          </div>
57
+          <div class="total_item" [ngClass]="{green: headerData.intoWeightRate >= 0, red: headerData.intoWeightRate < 0}">
58
+            <span class="name">{{headerData.intoWeightRate}}%</span>
59
+            <span class="value">差异率</span>
60
+          </div>
61
+        </div>
62
+        <div class="total_list">
63
+          <div class="total_item">
64
+            <span class="name">{{headerData.totalOutWeight}}</span>
65
+            <span class="value">出库总重量(kg)</span>
66
+          </div>
67
+          <div class="total_item">
68
+            <span class="name">{{headerData.compareTotalOutWeight}}</span>
69
+            <span class="value">对比期总重量(kg)</span>
70
+          </div>
71
+          <div class="total_item" [ngClass]="{green: headerData.outWeightRate >= 0, red: headerData.outWeightRate < 0}">
72
+            <span class="name">{{headerData.outWeightRate}}%</span>
73
+            <span class="value">差异率</span>
74
+          </div>
75
+        </div>
76
+      </div>
77
+
78
+      <div class="boxwrap">
79
+        <div class="box">
80
+          <div class="box-head">本期科室重量TOP10</div>
81
+          <nz-table class="table" [nzData]="deptListTop10" nzSize="small" [nzShowPagination]="false" [nzLoading]="loading">
82
+            <thead>
83
+              <tr class="thead">
84
+                <th nzWidth="10%">排名</th>
85
+                <th nzWidth="30%">科室名称</th>
86
+                <th nzWidth="30%">本期重量(kg)</th>
87
+                <th nzWidth="30%">占比(%)</th>
88
+              </tr>
89
+            </thead>
90
+            <tbody>
91
+              <tr *ngFor="let data of deptListTop10;let i = index;">
92
+                <td>{{i + 1}}</td>
93
+                <td>{{data.deptName}}</td>
94
+                <td>{{data.weight}}</td>
95
+                <td>{{data.weightRate}}%</td>
96
+              </tr>
97
+            </tbody>
98
+          </nz-table>
99
+        </div>
100
+
101
+        <div class="box">
102
+          <div class="box-head">对比期科室重量TOP10</div>
103
+          <nz-table class="table" [nzData]="deptCompareListTop10" nzSize="small" [nzShowPagination]="false" [nzLoading]="loading">
104
+            <thead>
105
+              <tr class="thead">
106
+                <th nzWidth="10%">排名</th>
107
+                <th nzWidth="30%">科室名称</th>
108
+                <th nzWidth="30%">对比期重量(kg)</th>
109
+                <th nzWidth="30%">占比(%)</th>
110
+              </tr>
111
+            </thead>
112
+            <tbody>
113
+              <tr *ngFor="let data of deptCompareListTop10;let i = index;">
114
+                <td>{{i + 1}}</td>
115
+                <td>{{data.deptName}}</td>
116
+                <td>{{data.weight}}</td>
117
+                <td>{{data.weightRate}}%</td>
118
+              </tr>
119
+            </tbody>
120
+          </nz-table>
121
+        </div>
122
+      </div>
123
+
124
+      <div class="echarts">
125
+        <div class="echart-head">科室重量差异率TOP10</div>
126
+        <div echarts class="echart" [options]='deptWeightOption'></div>
127
+      </div>
128
+
129
+      <div class="boxwrap">
130
+        <div class="box">
131
+          <div class="box-head">本期医废类型产生重量排名</div>
132
+          <nz-table class="table" [nzData]="wasteTypeListTop10" nzSize="small" [nzShowPagination]="false" [nzLoading]="loading">
133
+            <thead>
134
+              <tr class="thead">
135
+                <th nzWidth="10%">排名</th>
136
+                <th nzWidth="30%">医废类型</th>
137
+                <th nzWidth="30%">本期重量(kg)</th>
138
+                <th nzWidth="30%">占比(%)</th>
139
+              </tr>
140
+            </thead>
141
+            <tbody>
142
+              <tr *ngFor="let data of wasteTypeListTop10;let i = index;">
143
+                <td>{{i + 1}}</td>
144
+                <td>{{data.clinicalWasteTypeName}}</td>
145
+                <td>{{data.weight}}</td>
146
+                <td>{{data.weightRate}}%</td>
147
+              </tr>
148
+            </tbody>
149
+          </nz-table>
150
+        </div>
151
+
152
+        <div class="box">
153
+          <div class="box-head">对比期医废类型产生重量排名</div>
154
+          <nz-table class="table" [nzData]="wasteTypeCompareListTop10" nzSize="small" [nzShowPagination]="false" [nzLoading]="loading">
155
+            <thead>
156
+              <tr class="thead">
157
+                <th nzWidth="10%">排名</th>
158
+                <th nzWidth="30%">医废类型</th>
159
+                <th nzWidth="30%">对比期重量(kg)</th>
160
+                <th nzWidth="30%">占比(%)</th>
161
+              </tr>
162
+            </thead>
163
+            <tbody>
164
+              <tr *ngFor="let data of wasteTypeCompareListTop10;let i = index;">
165
+                <td>{{i + 1}}</td>
166
+                <td>{{data.clinicalWasteTypeName}}</td>
167
+                <td>{{data.weight}}</td>
168
+                <td>{{data.weightRate}}%</td>
169
+              </tr>
170
+            </tbody>
171
+          </nz-table>
172
+        </div>
173
+      </div>
174
+
175
+      <div class="echarts">
176
+        <div class="echart-head">医废类型重量差异率排名</div>
177
+        <div echarts class="echart" [options]='typeWeightOption'></div>
178
+      </div>
179
+    </div>
180
+  </div>
181
+</div>

+ 186 - 0
src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.component.less

@@ -0,0 +1,186 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host {
4
+  .quiltWashingTrendAnalysis ::ng-deep .ant-table-small > .ant-table-content > .ant-table-body{
5
+    margin: 0;
6
+  }
7
+  .quiltWashingTrendAnalysis ::ng-deep thead{
8
+    background-color: #F9F9FB;
9
+    border-bottom: none;
10
+  }
11
+  .quiltWashingTrendAnalysis{
12
+    min-height: 100%;
13
+    background-color: #F1F2F2;
14
+    .main{
15
+      margin-left: 10px;
16
+      .head{
17
+        margin-top: 8px;
18
+        height: 60px;
19
+        background-color: #fff;
20
+        display: flex;
21
+        align-items: center;
22
+        justify-content: space-between;
23
+        padding: 0 16px;
24
+        .search{
25
+          display: flex;
26
+          .searchItem{
27
+            margin-left: 16px;
28
+            &:first-of-type{
29
+              margin-left: 0;
30
+            }
31
+          }
32
+        }
33
+        .btns{
34
+          display: flex;
35
+        }
36
+      }
37
+      .body{
38
+        margin-top: 8px;
39
+        background-color: #fff;
40
+        padding-bottom: 30px;
41
+        .body_tabs_wrap{
42
+          display: flex;
43
+          justify-content: space-between;
44
+          align-items: center;
45
+          .body_tabs{
46
+            display: flex;
47
+            .tab{
48
+              width: 106px;
49
+              height: 50px;
50
+              display: flex;
51
+              justify-content: center;
52
+              align-items: center;
53
+              background-color: #F9FAFB;
54
+              color: #6E6E6E;
55
+              font-size: 22px;
56
+              font-weight: bold;
57
+              cursor: pointer;
58
+              &.active{
59
+                background-color: @primary-color;
60
+                color: #fff;
61
+              }
62
+            }
63
+          }
64
+          .compareDate{
65
+            font-size: 22px;
66
+            font-weight: bold;
67
+            margin-right: 24px;
68
+          }
69
+        }
70
+
71
+        .total{
72
+          height: 105px;
73
+          padding: 0 16px;
74
+          border-bottom: 1px solid #CECECE;
75
+          display: flex;
76
+          justify-content: space-between;
77
+          align-items:center;
78
+          .total_list{
79
+            flex: 1;
80
+            display: flex;
81
+            justify-content: space-between;
82
+            align-items:center;
83
+            padding-right: 30px;
84
+            position: relative;
85
+            &:after{
86
+              content: '';
87
+              position:absolute;
88
+              right: -1px;
89
+              top: 50%;
90
+              transform: translateY(-50%);
91
+              width: 2px;
92
+              height: 42px;
93
+              background-color: #D9D9D9;
94
+            }
95
+            &:last-of-type{
96
+              padding-left: 30px;
97
+              &:after{
98
+                display: none;
99
+              }
100
+            }
101
+            .total_item{
102
+              display: flex;
103
+              flex-direction: column;
104
+              align-items: center;
105
+              .name{
106
+                font-size: 32px;
107
+                font-weight: bold;
108
+                &.green{
109
+                  color: @primary-color;
110
+                }
111
+                &.red{
112
+                  color: red;
113
+                }
114
+              }
115
+              .value{
116
+                font-size: 16px;
117
+                color: #8F8F8F;
118
+              }
119
+            }
120
+          }
121
+        }
122
+
123
+        .boxwrap{
124
+          display: flex;
125
+          .box{
126
+            flex: 1;
127
+            margin: 0 8px;
128
+            .box-head{
129
+              height: 46px;
130
+              padding: 0 24px;
131
+              display: flex;
132
+              align-items: center;
133
+              font-size: 16px;
134
+              font-weight: bold;
135
+              position: relative;
136
+              &:before{
137
+                content: '';
138
+                width: 10px;
139
+                height: 10px;
140
+                border-radius: 50%;
141
+                background-color: @primary-color;
142
+                position: absolute;
143
+                top: 50%;
144
+                left: 8px;
145
+                transform: translateY(-50%);
146
+              }
147
+            }
148
+            .table{
149
+              th,td{
150
+                text-align: center;
151
+              }
152
+            }
153
+          }
154
+        }
155
+
156
+        .echarts{
157
+          flex: 1;
158
+          margin: 0 8px;
159
+          .echart-head{
160
+            height: 46px;
161
+            padding: 0 24px;
162
+            display: flex;
163
+            align-items: center;
164
+            font-size: 16px;
165
+            font-weight: bold;
166
+            position: relative;
167
+            &:before{
168
+              content: '';
169
+              width: 10px;
170
+              height: 10px;
171
+              border-radius: 50%;
172
+              background-color: @primary-color;
173
+              position: absolute;
174
+              top: 50%;
175
+              left: 8px;
176
+              transform: translateY(-50%);
177
+            }
178
+          }
179
+          .echart{
180
+
181
+          }
182
+        }
183
+      }
184
+    }
185
+  }
186
+}

+ 380 - 0
src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.component.ts

@@ -0,0 +1,380 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear, getQuarter } from "date-fns";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { DateService } from "../../services/date.service";
7
+import { MyServiceService } from "../../services/my-service.service";
8
+import { ToolService } from "../../services/tool.service";
9
+
10
+@Component({
11
+  selector: "app-medical-waste-trend-analysis",
12
+  templateUrl: "./medical-waste-trend-analysis.component.html",
13
+  styleUrls: ["./medical-waste-trend-analysis.component.less"],
14
+})
15
+export class MedicalWasteTrendAnalysisComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private router: Router,
19
+    private mainService: MainService,
20
+    private dateService: DateService,
21
+    private myService: MyServiceService,
22
+    private tool: ToolService
23
+  ) {}
24
+
25
+  ngOnInit() {
26
+    this.coopBtns = this.tool.initCoopBtns(this.route);
27
+    this.getAllHos();
28
+    this.changeDateType();
29
+  }
30
+
31
+  searchDto = {
32
+    dateType: "day", //选中日期维度
33
+    dateStr: new Date(), //选中日期--天、月、年
34
+    year: +format(new Date(), "yyyy"),//季度-年
35
+    quarter: getQuarter(new Date()),//季度
36
+    tabType: 'YoY',//YoY/同比,MoM/环比
37
+  }
38
+
39
+  tabTypes = [
40
+    {
41
+      name: "同比",
42
+      value: "YoY",
43
+    },
44
+    {
45
+      name: "环比",
46
+      value: "MoM",
47
+    },
48
+  ]
49
+
50
+  quarterList = [
51
+    { name: '第一季度', value: 1, },
52
+    { name: '第二季度', value: 2, },
53
+    { name: '第三季度', value: 3, },
54
+    { name: '第四季度', value: 4, },
55
+  ]
56
+
57
+  yearList = this.generaterYears();
58
+
59
+  dateTypes: any = [
60
+    {
61
+      label: "按天统计",
62
+      value: "day",
63
+    },
64
+    {
65
+      label: "按月统计",
66
+      value: "month",
67
+    },
68
+    {
69
+      label: "按季度统计",
70
+      value: "quarter",
71
+    },
72
+    {
73
+      label: "按年统计",
74
+      value: "year",
75
+    },
76
+  ]; //时间维度
77
+
78
+  promptContent: string; //操作提示框提示信息
79
+  ifSuccess: boolean; //操作成功/失败
80
+  promptInfo: string; //操作结果提示信息
81
+  promptModalShow: boolean; //操作提示框是否展示
82
+
83
+  // 初始化增删改按钮
84
+  coopBtns: any = {};
85
+
86
+  // 切换同比/环比
87
+  changeTabType(value){
88
+    this.searchDto.tabType = value;
89
+    this.search();
90
+  }
91
+
92
+  // 生成前5年的年份
93
+  generaterYears(){
94
+    const currentYear = new Date().getFullYear();
95
+    const years = [];
96
+
97
+    for (let i = currentYear - 4; i <= currentYear; i++) {
98
+      years.push(i);
99
+    }
100
+
101
+    return years.map(v => ({
102
+      name: v + '年',
103
+      value: v,
104
+    }));
105
+  }
106
+  // 科室重量差异率TOP10
107
+  deptWeightOption;
108
+  deptWeightChart(datas) {
109
+    console.log(datas)
110
+    let labels = [];
111
+    let nums = [];
112
+    if (datas.length) {
113
+      datas.forEach((e) => {
114
+        labels.push(e.deptName);
115
+        nums.push({
116
+          name: e.deptName,
117
+          value: e.weightRate,
118
+          label: {
119
+            position: e.weightRate >= 0 ? 'bottom' : 'top',
120
+          }
121
+        });
122
+      });
123
+    }
124
+    this.deptWeightOption = {
125
+      color: ["#3398DB"],
126
+      tooltip: {
127
+        trigger: "axis",
128
+        axisPointer: {
129
+          // 坐标轴指示器,坐标轴触发有效
130
+          type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
131
+        },
132
+        formatter: '{b}: {c}%'
133
+      },
134
+      grid: {
135
+        left: "9px",
136
+        right: "9px",
137
+        bottom: "20px",
138
+        top: "20px",
139
+        containLabel: true,
140
+      },
141
+      xAxis: [
142
+        {
143
+          type: "category",
144
+          data: labels,
145
+          // axisLine: {
146
+          //   show: true,
147
+          //   onZero: false,
148
+          // },
149
+          axisTick: {
150
+            alignWithLabel: true,
151
+          },
152
+        },
153
+      ],
154
+      yAxis: [
155
+        {
156
+          type: "value",
157
+          interval: 20,
158
+          max: 100,
159
+          min: -100,
160
+          splitLine: {
161
+            // show: false,
162
+          },
163
+          axisLabel: {
164
+            formatter: "{value}%",
165
+          },
166
+          nameTextStyle: {
167
+            align: "left",
168
+          },
169
+        },
170
+      ],
171
+      series: [
172
+        {
173
+          name: "差异率",
174
+          type: "bar",
175
+          barWidth: "35",
176
+          data: nums,
177
+          label: {
178
+            show: true,
179
+            color: '#000',
180
+            formatter: '{c}%'
181
+          },
182
+          itemStyle: {
183
+            normal: {
184
+              //每根柱子颜色设置
185
+              color: function (params) {
186
+                if (params.value > 0) {
187
+                  return '#92DCE9';  // 正数颜色
188
+                } else {
189
+                  return '#7E8CEB';    // 负数颜色
190
+                }
191
+              },
192
+            },
193
+          },
194
+        },
195
+      ],
196
+    };
197
+  }
198
+  // 医废类型重量差异率排名
199
+  typeWeightOption;
200
+  typeWeightChart(datas) {
201
+    console.log(datas)
202
+    let labels = [];
203
+    let nums = [];
204
+    if (datas.length) {
205
+      datas.forEach((e) => {
206
+        labels.push(e.clinicalWasteTypeName);
207
+        nums.push({
208
+          name: e.clinicalWasteTypeName,
209
+          value: e.weightRate,
210
+          label: {
211
+            position: e.weightRate >= 0 ? 'bottom' : 'top',
212
+          }
213
+        });
214
+      });
215
+    }
216
+    this.typeWeightOption = {
217
+      color: ["#3398DB"],
218
+      tooltip: {
219
+        trigger: "axis",
220
+        axisPointer: {
221
+          // 坐标轴指示器,坐标轴触发有效
222
+          type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
223
+        },
224
+        formatter: '{b}: {c}%'
225
+      },
226
+      grid: {
227
+        left: "9px",
228
+        right: "9px",
229
+        bottom: "20px",
230
+        top: "20px",
231
+        containLabel: true,
232
+      },
233
+      xAxis: [
234
+        {
235
+          type: "category",
236
+          data: labels,
237
+          // axisLine: {
238
+          //   show: true,
239
+          //   onZero: false,
240
+          // },
241
+          axisTick: {
242
+            alignWithLabel: true,
243
+          },
244
+        },
245
+      ],
246
+      yAxis: [
247
+        {
248
+          type: "value",
249
+          interval: 20,
250
+          max: 100,
251
+          min: -100,
252
+          splitLine: {
253
+            // show: false,
254
+          },
255
+          axisLabel: {
256
+            formatter: "{value}%",
257
+          },
258
+          nameTextStyle: {
259
+            align: "left",
260
+          },
261
+        },
262
+      ],
263
+      series: [
264
+        {
265
+          name: "差异率",
266
+          type: "bar",
267
+          barWidth: "35",
268
+          data: nums,
269
+          label: {
270
+            show: true,
271
+            color: '#000',
272
+            formatter: '{c}%'
273
+          },
274
+          itemStyle: {
275
+            normal: {
276
+              //每根柱子颜色设置
277
+              color: function (params) {
278
+                if (params.value > 0) {
279
+                  return '#89C9BD';  // 正数颜色
280
+                } else {
281
+                  return '#0694B6';    // 负数颜色
282
+                }
283
+              },
284
+            },
285
+          },
286
+        },
287
+      ],
288
+    };
289
+  }
290
+  // 搜索
291
+  search() {
292
+    this.getData();
293
+  }
294
+  // 重置
295
+  reset() {
296
+    this.searchDto = {
297
+      dateType: "day", //选中日期维度
298
+      dateStr: new Date(), //选中日期--天、月、年
299
+      year: +format(new Date(), "yyyy"),//季度-年
300
+      quarter: getQuarter(new Date()),//季度
301
+      tabType: 'YoY',//YoY/同比,MoM/环比
302
+    }
303
+    this.search();
304
+  }
305
+  // 数据
306
+  loading = false;
307
+  headerDate: any = {};
308
+  headerData: any = {};
309
+  deptListTop10: any = [];
310
+  deptCompareListTop10: any = [];
311
+  wasteTypeListTop10: any = [];
312
+  wasteTypeCompareListTop10: any = [];
313
+  deptBarTop10: any = [];
314
+  wasteTypeBarTop10: any = [];
315
+  getData() {
316
+    let postData: any = {
317
+      tabType: this.searchDto.tabType,
318
+      hosId: this.hospital,
319
+      type: this.searchDto.dateType,
320
+    };
321
+    switch (postData.type) {
322
+      case "day":
323
+        postData.dateStr = this.searchDto.dateStr ? format(this.searchDto.dateStr, "yyyy-MM-dd") : format(new Date(), "yyyy-MM-dd");
324
+        break;
325
+      case "month":
326
+        postData.dateStr = this.searchDto.dateStr ? format(this.searchDto.dateStr, "yyyy-MM") : format(new Date(), "yyyy-MM");
327
+        break;
328
+      case "quarter":
329
+        postData.year = this.searchDto.year || +format(new Date(), "yyyy");
330
+        postData.quarter = this.searchDto.quarter || getQuarter(new Date());
331
+        break;
332
+      case "year":
333
+        postData.dateStr = format(this.searchDto.dateStr, "yyyy");
334
+        break;
335
+    }
336
+    this.loading = true;
337
+    this.mainService
338
+      .postCustom("report/trend/analysis", "medicalWaste", postData)
339
+      .subscribe((result) => {
340
+        this.loading = false;
341
+        if(result.status == 200){
342
+          this.headerDate = result.list[0] || {};
343
+          this.headerData = result.list[1] || {};
344
+          let bodyData = result.list[2] || {};
345
+          this.deptListTop10 = bodyData.deptListTop10 || [];
346
+          this.deptCompareListTop10 = bodyData.deptCompareListTop10 || [];
347
+          this.wasteTypeListTop10 = bodyData.wasteTypeListTop10 || [];
348
+          this.wasteTypeCompareListTop10 = bodyData.wasteTypeCompareListTop10 || [];
349
+          this.deptBarTop10 = bodyData.deptBarTop10 || [];
350
+          this.deptWeightChart(this.deptBarTop10);
351
+          this.wasteTypeBarTop10 = bodyData.wasteTypeBarTop10 || [];
352
+          this.typeWeightChart(this.wasteTypeBarTop10);
353
+        }
354
+      });
355
+  }
356
+  // 获取院区
357
+  hospital: string; //选中院区
358
+  getAllHos() {
359
+    this.hospital = this.tool.getCurrentHospital().id;
360
+  }
361
+
362
+  // 修改时间展示维度
363
+  changeDateType(e?) {
364
+    if(this.searchDto.dateType == 'year' && this.searchDto.tabType == 'MoM'){
365
+      this.searchDto.tabType = 'YoY';
366
+    }
367
+    this.getData();
368
+  }
369
+
370
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
371
+  showPromptModal(con, success, promptInfo?) {
372
+    this.promptModalShow = false;
373
+    this.promptContent = con;
374
+    this.ifSuccess = success;
375
+    this.promptInfo = promptInfo;
376
+    setTimeout(() => {
377
+      this.promptModalShow = true;
378
+    }, 100);
379
+  }
380
+}

+ 18 - 0
src/app/views/medical-waste-trend-analysis/medical-waste-trend-analysis.module.ts

@@ -0,0 +1,18 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { MedicalWasteTrendAnalysisRoutingModule } from "./medical-waste-trend-analysis-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { MedicalWasteTrendAnalysisComponent } from "./medical-waste-trend-analysis.component";
7
+import { NgxEchartsModule } from 'ngx-echarts';
8
+
9
+@NgModule({
10
+  declarations: [MedicalWasteTrendAnalysisComponent],
11
+  imports: [
12
+    CommonModule,
13
+    MedicalWasteTrendAnalysisRoutingModule,
14
+    NgxEchartsModule,
15
+    ShareModule,
16
+  ],
17
+})
18
+export class MedicalWasteTrendAnalysisModule {}

+ 1 - 3
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.component.ts

@@ -217,8 +217,6 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
217 217
   }
218 218
   // 重置
219 219
   reset() {
220
-    this.changeDateType("day");
221
-    this.changeDateRange("1");
222 220
     this.sortCurrentKey = "";
223 221
     this.sortCurrentValue = "";
224 222
     this.sortCurrent = {
@@ -232,7 +230,7 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
232 230
       dept: null,
233 231
       building: null,
234 232
     }
235
-    this.search();
233
+    this.changeDateType("day");
236 234
   }
237 235
   // 选中表格单列
238 236
   mapOfCheckedId: { [key: string]: boolean } = {};

+ 1 - 3
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.component.ts

@@ -154,8 +154,6 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
154 154
   }
155 155
   // 重置
156 156
   reset() {
157
-    this.changeDateType("day");
158
-    this.changeDateRange("1");
159 157
     this.sortCurrentKey = "";
160 158
     this.sortCurrentValue = "";
161 159
     this.sortCurrent = {
@@ -166,7 +164,7 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
166 164
       sendClothesNum: null,
167 165
       price: null,
168 166
     };
169
-    this.search();
167
+    this.changeDateType("day");
170 168
   }
171 169
   // 表格数据
172 170
   loading1 = false;

+ 1 - 3
src/app/views/quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.component.ts

@@ -209,8 +209,6 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
209 209
   }
210 210
   // 重置
211 211
   reset() {
212
-    this.changeDateType("day");
213
-    this.changeDateRange("1");
214 212
     this.sortCurrentKey = "";
215 213
     this.sortCurrentValue = "";
216 214
     this.sortCurrent = {
@@ -225,7 +223,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
225 223
       group: null,
226 224
       user: null,
227 225
     }
228
-    this.search();
226
+    this.changeDateType("day");
229 227
   }
230 228
   // 表格数据
231 229
   loading1 = false;

+ 35 - 0
src/common.less

@@ -269,6 +269,41 @@
269 269
       display: flex;
270 270
       align-items: center;
271 271
     }
272
+    .list-template__chart {
273
+      display: flex;
274
+      .echarts{
275
+        flex: 1;
276
+        margin-right: 8px;
277
+        border: 1px solid #e8e8e8;
278
+        margin-bottom: 8px;
279
+        &:last-of-type{
280
+          margin-right: 0;
281
+        }
282
+        .echart-head{
283
+          height: 46px;
284
+          padding: 0 24px;
285
+          display: flex;
286
+          align-items: center;
287
+          font-size: 16px;
288
+          font-weight: bold;
289
+          position: relative;
290
+          &:before{
291
+            content: '';
292
+            width: 10px;
293
+            height: 10px;
294
+            border-radius: 50%;
295
+            background-color: @primary-color;
296
+            position: absolute;
297
+            top: 50%;
298
+            left: 8px;
299
+            transform: translateY(-50%);
300
+          }
301
+        }
302
+        .echart{
303
+          height: 250px;
304
+        }
305
+      }
306
+    }
272 307
     .list-template__bottom {
273 308
       background: #f9fafb;
274 309
       border: 1px solid #e5e9ed;

+ 1 - 1
src/main.ts

@@ -8,7 +8,7 @@ if (environment.production) {
8 8
   enableProdMode();
9 9
   if (window) {
10 10
     window.console.log = function () { };
11
-    console.info(`%c%c v2.4.61 %c 武汉大势恒通科技有限责任公司 `,
11
+    console.info(`%c%c v2.4.62 %c 武汉大势恒通科技有限责任公司 `,
12 12
       'color: #3eaf7c; font-size: 16px;line-height:30px;',
13 13
       'background: #35495e; padding: 4px; border-radius: 3px 0 0 3px; color: #fff',
14 14
       'background: #41b883; padding: 4px; border-radius: 0 3px 3px 0; color: #fff',