Selaa lähdekoodia

被服统计开发

seimin 10 kuukautta sitten
vanhempi
commit
af83650099

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

@@ -10,7 +10,7 @@
10 10
         <div class="list-template__searchItem">
11 11
           <span class="label">发起时间</span>:
12 12
           <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
13
-            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
13
+            [nzDisabledDate]="disabledDate" nzShowTime  (nzOnCalendarChange)="onCalendarChangeDate($event)" (ngModelChange)="changeDate($event)">
14 14
           </nz-range-picker>
15 15
           <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
16 16
             (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">

+ 23 - 22
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.component.ts

@@ -116,8 +116,8 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
116 116
     }
117 117
     if (this.startDate) {
118 118
       this.searchData["dateRange"] = {
119
-        start: this.startDate + " " + "00:00:00",
120
-        end: this.endDate + " " + "23:59:59",
119
+        start: this.startDate,
120
+        end: this.endDate,
121 121
       };
122 122
     }
123 123
     if (num !== undefined) {
@@ -134,8 +134,8 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
134 134
     this.isAllDisplayDataChecked = false;
135 135
     let that = this;
136 136
     let postData: any = {
137
-      startTime: this.startDate + " " + "00:00:00",
138
-      endTime: this.endDate + " " + "23:59:59",
137
+      startTime: this.startDate,
138
+      endTime: this.endDate,
139 139
       hosId: that.hospital,
140 140
       type: this.dateType,
141 141
       deptId: this.searchDto.dept || undefined,
@@ -179,8 +179,8 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
179 179
     this.isAllDisplayDataChecked = false;
180 180
     let that = this;
181 181
     let postData: any = {
182
-      startTime: this.startDate + " " + "00:00:00",
183
-      endTime: this.endDate + " " + "23:59:59",
182
+      startTime: this.startDate,
183
+      endTime: this.endDate,
184 184
       hosId: that.hospital,
185 185
       type: this.dateType,
186 186
       deptId: ids || undefined,
@@ -299,6 +299,17 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
299 299
     this.getBuildingList();
300 300
   }
301 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
+
302 313
   // 边输边搜节流阀
303 314
   changeInp(e, fn) {
304 315
     this.searchTimer(this[fn], e);
@@ -448,18 +459,8 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
448 459
       this.startDate = this.endDate = "";
449 460
       return;
450 461
     }
451
-    this.startDate =
452
-      result[0].getFullYear() +
453
-      "-" +
454
-      (result[0].getMonth() + 1) +
455
-      "-" +
456
-      result[0].getDate();
457
-    this.endDate =
458
-      result[1].getFullYear() +
459
-      "-" +
460
-      (result[1].getMonth() + 1) +
461
-      "-" +
462
-      result[1].getDate();
462
+    this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
463
+    this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
463 464
   }
464 465
 
465 466
   // 月份选择
@@ -474,7 +475,7 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
474 475
       this.startDate = this.endDate = "";
475 476
       return;
476 477
     }
477
-    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd');
478
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
478 479
     // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
479 480
   }
480 481
   changeMonthEnd(result?) {
@@ -489,7 +490,7 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
489 490
       return;
490 491
     }
491 492
     // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
492
-    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd');
493
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
493 494
   }
494 495
   // 年份选择
495 496
   changeYearStart(result?) {
@@ -503,7 +504,7 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
503 504
       this.startDate = this.endDate = "";
504 505
       return;
505 506
     }
506
-    this.startDate = format(startOfYear(result), 'yyyy-MM-dd');
507
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
507 508
     // this.endDate = result.getFullYear() + '-01-01';
508 509
   }
509 510
   changeYearEnd(result?) {
@@ -517,7 +518,7 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
517 518
       this.startDate = this.endDate = "";
518 519
       return;
519 520
     }
520
-    this.endDate = format(endOfYear(result), 'yyyy-MM-dd');
521
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
521 522
   }
522 523
 
523 524
   // 日期选择 快速修改时间区间

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

@@ -10,7 +10,7 @@
10 10
         <div class="list-template__searchItem">
11 11
           <span class="label">发起时间</span>:
12 12
           <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
13
-            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
13
+            [nzDisabledDate]="disabledDate" nzShowTime  (nzOnCalendarChange)="onCalendarChangeDate($event)" (ngModelChange)="changeDate($event)">
14 14
           </nz-range-picker>
15 15
           <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
16 16
             (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">

+ 21 - 20
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.component.ts

@@ -103,8 +103,8 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
103 103
     }
104 104
     if (this.startDate) {
105 105
       this.searchData["dateRange"] = {
106
-        start: this.startDate + " " + "00:00:00",
107
-        end: this.endDate + " " + "23:59:59",
106
+        start: this.startDate,
107
+        end: this.endDate,
108 108
       };
109 109
     }
110 110
     if (num !== undefined) {
@@ -118,8 +118,8 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
118 118
   export() {
119 119
     let that = this;
120 120
     let postData: any = {
121
-      startTime: this.startDate + " " + "00:00:00",
122
-      endTime: this.endDate + " " + "23:59:59",
121
+      startTime: this.startDate,
122
+      endTime: this.endDate,
123 123
       hosId: that.hospital,
124 124
       type: this.dateType,
125 125
     };
@@ -198,6 +198,17 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
198 198
     this.hospital = this.tool.getCurrentHospital().id + "";
199 199
   }
200 200
 
201
+  onCalendarChangeDate(dateArr){
202
+    console.log(dateArr)
203
+    if(dateArr.length == 2){
204
+      let dateStart = new Date(dateArr[0]);
205
+      let dateEnd = new Date(dateArr[1]);
206
+      dateStart.setHours(0,0,0);
207
+      dateEnd.setHours(23,59,59);
208
+      this.dateRange = [dateStart,dateEnd];
209
+    }
210
+  }
211
+
201 212
   // 修改时间展示维度
202 213
   changeDateType(res) {
203 214
     console.log(res, this.dateType);
@@ -302,18 +313,8 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
302 313
       this.startDate = this.endDate = "";
303 314
       return;
304 315
     }
305
-    this.startDate =
306
-      result[0].getFullYear() +
307
-      "-" +
308
-      (result[0].getMonth() + 1) +
309
-      "-" +
310
-      result[0].getDate();
311
-    this.endDate =
312
-      result[1].getFullYear() +
313
-      "-" +
314
-      (result[1].getMonth() + 1) +
315
-      "-" +
316
-      result[1].getDate();
316
+    this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
317
+    this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
317 318
   }
318 319
 
319 320
   // 月份选择
@@ -328,7 +329,7 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
328 329
       this.startDate = this.endDate = "";
329 330
       return;
330 331
     }
331
-    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd');
332
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
332 333
     // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
333 334
   }
334 335
   changeMonthEnd(result?) {
@@ -343,7 +344,7 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
343 344
       return;
344 345
     }
345 346
     // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
346
-    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd');
347
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
347 348
   }
348 349
   // 年份选择
349 350
   changeYearStart(result?) {
@@ -357,7 +358,7 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
357 358
       this.startDate = this.endDate = "";
358 359
       return;
359 360
     }
360
-    this.startDate = format(startOfYear(result), 'yyyy-MM-dd');
361
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
361 362
     // this.endDate = result.getFullYear() + '-01-01';
362 363
   }
363 364
   changeYearEnd(result?) {
@@ -371,7 +372,7 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
371 372
       this.startDate = this.endDate = "";
372 373
       return;
373 374
     }
374
-    this.endDate = format(endOfYear(result), 'yyyy-MM-dd');
375
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
375 376
   }
376 377
 
377 378
   // 日期选择 快速修改时间区间

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

@@ -10,7 +10,7 @@
10 10
         <div class="list-template__searchItem">
11 11
           <span class="label">发起时间</span>:
12 12
           <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
13
-            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
13
+            [nzDisabledDate]="disabledDate" nzShowTime  (nzOnCalendarChange)="onCalendarChangeDate($event)" (ngModelChange)="changeDate($event)">
14 14
           </nz-range-picker>
15 15
           <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
16 16
             (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">

+ 21 - 20
src/app/views/quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.component.ts

@@ -156,8 +156,8 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
156 156
     }
157 157
     if (this.startDate) {
158 158
       this.searchData["dateRange"] = {
159
-        start: this.startDate + " " + "00:00:00",
160
-        end: this.endDate + " " + "23:59:59",
159
+        start: this.startDate,
160
+        end: this.endDate,
161 161
       };
162 162
     }
163 163
     if (num !== undefined) {
@@ -171,8 +171,8 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
171 171
   export() {
172 172
     let that = this;
173 173
     let postData: any = {
174
-      startTime: this.startDate + " " + "00:00:00",
175
-      endTime: this.endDate + " " + "23:59:59",
174
+      startTime: this.startDate,
175
+      endTime: this.endDate,
176 176
       hosId: that.hospital,
177 177
       type: this.dateType,
178 178
       userId: this.searchDto.user || undefined,
@@ -264,6 +264,17 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
264 264
     this.getUserList();
265 265
   }
266 266
 
267
+  onCalendarChangeDate(dateArr){
268
+    console.log(dateArr)
269
+    if(dateArr.length == 2){
270
+      let dateStart = new Date(dateArr[0]);
271
+      let dateEnd = new Date(dateArr[1]);
272
+      dateStart.setHours(0,0,0);
273
+      dateEnd.setHours(23,59,59);
274
+      this.dateRange = [dateStart,dateEnd];
275
+    }
276
+  }
277
+
267 278
   // 修改时间展示维度
268 279
   changeDateType(res) {
269 280
     console.log(res, this.dateType);
@@ -368,18 +379,8 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
368 379
       this.startDate = this.endDate = "";
369 380
       return;
370 381
     }
371
-    this.startDate =
372
-      result[0].getFullYear() +
373
-      "-" +
374
-      (result[0].getMonth() + 1) +
375
-      "-" +
376
-      result[0].getDate();
377
-    this.endDate =
378
-      result[1].getFullYear() +
379
-      "-" +
380
-      (result[1].getMonth() + 1) +
381
-      "-" +
382
-      result[1].getDate();
382
+    this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
383
+    this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
383 384
   }
384 385
 
385 386
   // 月份选择
@@ -394,7 +395,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
394 395
       this.startDate = this.endDate = "";
395 396
       return;
396 397
     }
397
-    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd');
398
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
398 399
     // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
399 400
   }
400 401
   changeMonthEnd(result?) {
@@ -409,7 +410,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
409 410
       return;
410 411
     }
411 412
     // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
412
-    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd');
413
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd HH:mm:ss');
413 414
   }
414 415
   // 年份选择
415 416
   changeYearStart(result?) {
@@ -423,7 +424,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
423 424
       this.startDate = this.endDate = "";
424 425
       return;
425 426
     }
426
-    this.startDate = format(startOfYear(result), 'yyyy-MM-dd');
427
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd HH:mm:ss');
427 428
     // this.endDate = result.getFullYear() + '-01-01';
428 429
   }
429 430
   changeYearEnd(result?) {
@@ -437,7 +438,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
437 438
       this.startDate = this.endDate = "";
438 439
       return;
439 440
     }
440
-    this.endDate = format(endOfYear(result), 'yyyy-MM-dd');
441
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd HH:mm:ss');
441 442
   }
442 443
 
443 444
   // 日期选择 快速修改时间区间

+ 178 - 3
src/app/views/quilt-washing-trend-analysis/quilt-washing-trend-analysis.component.html

@@ -1,6 +1,181 @@
1 1
 <div class="quiltWashingTrendAnalysis">
2 2
   <div class="main">
3
-    <div class="head"></div>
4
-    <div class="body"></div>
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.totalPrice}}</span>
51
+            <span class="value">总费用(元)</span>
52
+          </div>
53
+          <div class="total_item">
54
+            <span class="name">{{headerData.compareTotalPrice}}</span>
55
+            <span class="value">对比期总费用</span>
56
+          </div>
57
+          <div class="total_item green">
58
+            <span class="name">{{headerData.priceRate}}%</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.totalCount}}</span>
65
+            <span class="value">总数量</span>
66
+          </div>
67
+          <div class="total_item">
68
+            <span class="name">{{headerData.compareTotalCount}}</span>
69
+            <span class="value">对比期总数量</span>
70
+          </div>
71
+          <div class="total_item green">
72
+            <span class="name">{{headerData.countRate}}%</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]="priceDeptListTop10" 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%">本期费用(元)</th>
87
+                <th nzWidth="30%">占比(%)</th>
88
+              </tr>
89
+            </thead>
90
+            <tbody>
91
+              <tr *ngFor="let data of priceDeptListTop10;let i = index;">
92
+                <td>{{i + 1}}</td>
93
+                <td>{{data.deptName}}</td>
94
+                <td>{{data.totalPrice}}</td>
95
+                <td>{{data.priceRate}}%</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]="priceCompareDeptListTop10" 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%">对比期费用(元)</th>
109
+                <th nzWidth="30%">占比(%)</th>
110
+              </tr>
111
+            </thead>
112
+            <tbody>
113
+              <tr *ngFor="let data of priceCompareDeptListTop10;let i = index;">
114
+                <td>{{i + 1}}</td>
115
+                <td>{{data.deptName}}</td>
116
+                <td>{{data.totalPrice}}</td>
117
+                <td>{{data.priceRate}}%</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]='deptPriceOption'></div>
127
+      </div>
128
+
129
+      <div class="boxwrap">
130
+        <div class="box">
131
+          <div class="box-head">本期数量科室TOP10</div>
132
+          <nz-table class="table" [nzData]="countDeptListTop10" 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%">本期数量</th>
138
+                <th nzWidth="30%">占比(%)</th>
139
+              </tr>
140
+            </thead>
141
+            <tbody>
142
+              <tr *ngFor="let data of countDeptListTop10;let i = index;">
143
+                <td>{{i + 1}}</td>
144
+                <td>{{data.deptName}}</td>
145
+                <td>{{data.sendBackNum}}</td>
146
+                <td>{{data.countRate}}%</td>
147
+              </tr>
148
+            </tbody>
149
+          </nz-table>
150
+        </div>
151
+
152
+        <div class="box">
153
+          <div class="box-head">对比期数量科室TOP10</div>
154
+          <nz-table class="table" [nzData]="countCompareDeptListTop10" 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%">对比期数量</th>
160
+                <th nzWidth="30%">占比(%)</th>
161
+              </tr>
162
+            </thead>
163
+            <tbody>
164
+              <tr *ngFor="let data of countCompareDeptListTop10;let i = index;">
165
+                <td>{{i + 1}}</td>
166
+                <td>{{data.deptName}}</td>
167
+                <td>{{data.sendBackNum}}</td>
168
+                <td>{{data.countRate}}%</td>
169
+              </tr>
170
+            </tbody>
171
+          </nz-table>
172
+        </div>
173
+      </div>
174
+
175
+      <div class="echarts">
176
+        <div class="echart-head">科室数量差异率TOP10</div>
177
+        <div echarts class="echart" [options]='deptCountOption'></div>
178
+      </div>
179
+    </div>
5 180
   </div>
6
-</div>
181
+</div>

+ 172 - 1
src/app/views/quilt-washing-trend-analysis/quilt-washing-trend-analysis.component.less

@@ -1,12 +1,183 @@
1 1
 @import "../../../../src/theme.less";
2 2
 
3 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
+  }
4 11
   .quiltWashingTrendAnalysis{
5 12
     min-height: 100%;
6 13
     background-color: #F1F2F2;
7 14
     .main{
8 15
       margin-left: 10px;
9
-      background: #000;
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
+              }
112
+              .value{
113
+                font-size: 16px;
114
+                color: #8F8F8F;
115
+              }
116
+            }
117
+          }
118
+        }
119
+
120
+        .boxwrap{
121
+          display: flex;
122
+          .box{
123
+            flex: 1;
124
+            margin: 0 8px;
125
+            .box-head{
126
+              height: 46px;
127
+              padding: 0 24px;
128
+              display: flex;
129
+              align-items: center;
130
+              font-size: 16px;
131
+              font-weight: bold;
132
+              position: relative;
133
+              &:before{
134
+                content: '';
135
+                width: 10px;
136
+                height: 10px;
137
+                border-radius: 50%;
138
+                background-color: @primary-color;
139
+                position: absolute;
140
+                top: 50%;
141
+                left: 8px;
142
+                transform: translateY(-50%);
143
+              }
144
+            }
145
+            .table{
146
+              th,td{
147
+                text-align: center;
148
+              }
149
+            }
150
+          }
151
+        }
152
+
153
+        .echarts{
154
+          flex: 1;
155
+          margin: 0 8px;
156
+          .echart-head{
157
+            height: 46px;
158
+            padding: 0 24px;
159
+            display: flex;
160
+            align-items: center;
161
+            font-size: 16px;
162
+            font-weight: bold;
163
+            position: relative;
164
+            &:before{
165
+              content: '';
166
+              width: 10px;
167
+              height: 10px;
168
+              border-radius: 50%;
169
+              background-color: @primary-color;
170
+              position: absolute;
171
+              top: 50%;
172
+              left: 8px;
173
+              transform: translateY(-50%);
174
+            }
175
+          }
176
+          .echart{
177
+
178
+          }
179
+        }
180
+      }
10 181
     }
11 182
   }
12 183
 }

+ 292 - 371
src/app/views/quilt-washing-trend-analysis/quilt-washing-trend-analysis.component.ts

@@ -1,6 +1,6 @@
1 1
 import { Component, OnInit } from "@angular/core";
2 2
 import { ActivatedRoute, Router } from "@angular/router";
3
-import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear } from "date-fns";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear, getQuarter } from "date-fns";
4 4
 
5 5
 import { MainService } from "../../services/main.service";
6 6
 import { DateService } from "../../services/date.service";
@@ -25,11 +25,37 @@ export class QuiltWashingTrendAnalysisComponent implements OnInit {
25 25
   ngOnInit() {
26 26
     this.coopBtns = this.tool.initCoopBtns(this.route);
27 27
     this.getAllHos();
28
-    this.changeDateRange(this.defRange);
29
-    // this.search();
28
+    this.changeDateType();
30 29
   }
31 30
 
32
-  dateType: string = "day"; //选中时间维度
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
+
33 59
   dateTypes: any = [
34 60
     {
35 61
       label: "按天统计",
@@ -40,37 +66,14 @@ export class QuiltWashingTrendAnalysisComponent implements OnInit {
40 66
       value: "month",
41 67
     },
42 68
     {
69
+      label: "按季度统计",
70
+      value: "quarter",
71
+    },
72
+    {
43 73
       label: "按年统计",
44 74
       value: "year",
45 75
     },
46 76
   ]; //时间维度
47
-  defRange = "1"; //默认上周
48
-  defRanges = [
49
-    {
50
-      label: "上周",
51
-      id: 1,
52
-    },
53
-    {
54
-      label: "上月",
55
-      id: 2,
56
-    },
57
-    {
58
-      label: "上年",
59
-      id: 3,
60
-    },
61
-  ]; //时间默认区间
62
-
63
-  listOfData: any[] = []; //表格数据
64
-  pageIndex: number = 1; //表格当前页码
65
-  pageSize: number = 10; //表格每页展示条数
66
-  listLength: number = 10; //表格总数据量
67
-
68
-  alldepart: any = []; //当前院区所属科室
69
-  dateRange: any = []; //发起时间区间 天
70
-  monthRangeStart: any; //发起时间 月 起
71
-  monthRangeEnd: any; //发起时间 月 止
72
-  yearRangeStart: any; //发起时间 年 起
73
-  yearRangeEnd: any; //发起时间 年 止
74 77
 
75 78
   promptContent: string; //操作提示框提示信息
76 79
   ifSuccess: boolean; //操作成功/失败
@@ -79,346 +82,289 @@ export class QuiltWashingTrendAnalysisComponent implements OnInit {
79 82
 
80 83
   // 初始化增删改按钮
81 84
   coopBtns: any = {};
82
-  searchData: any = {}; // 综合统计页面带过来的参数
83
-  getSearchData() {
84
-    let that = this;
85
-    let sub = that.myService.getMsg().subscribe((msg) => {
86
-      // 从综合报表跳转过来
87
-      that.searchData = msg;
88
-      console.log(that.searchData);
89
-      console.log(66);
90
-      sub.unsubscribe(); //取消订阅,否则订阅函数会累加执行
91
-      that.hospital = that.searchData["hosId"];
92
-      that.changeDate(that.searchData["range"]);
93
-      that.defRange = that.searchData["defRange"];
94
-      that.search();
95
-    });
96
-    that.changeDateRange(that.defRange);
97
-    that.search();
85
+
86
+  // 切换同比/环比
87
+  changeTabType(value){
88
+    this.searchDto.tabType = value;
89
+    this.search();
98 90
   }
99
-  // 搜索
100
-  search(num?: number) {
101
-    if (this.hospital) {
102
-      this.searchData["hosId"] = this.hospital;
103
-    }
104
-    if (this.startDate) {
105
-      this.searchData["dateRange"] = {
106
-        start: this.startDate + " " + "00:00:00",
107
-        end: this.endDate + " " + "23:59:59",
108
-      };
109
-    }
110
-    if (num !== undefined) {
111
-      this.getList(num, this.sortCurrentKey, this.sortCurrentValue);
112
-    } else {
113
-      this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
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);
114 99
     }
100
+
101
+    return years.map(v => ({
102
+      name: v + '年',
103
+      value: v,
104
+    }));
115 105
   }
116
-  // 导出
117
-  loading2 = false;
118
-  export() {
119
-    let that = this;
120
-    let postData: any = {
121
-      startTime: this.startDate + " " + "00:00:00",
122
-      endTime: this.endDate + " " + "23:59:59",
123
-      hosId: that.hospital,
124
-      type: this.dateType,
125
-    };
126
-    if (this.sortCurrentKey && this.sortCurrentValue) {
127
-      postData.sort =
128
-        this.sortCurrentValue === "ascend"
129
-          ? this.sortCurrentKey
130
-          : `${this.sortCurrentKey} desc`;
106
+  // 科室费用差异率TOP10
107
+  deptPriceOption;
108
+  deptPriceChart(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.priceRate,
118
+          label: {
119
+            position: e.priceRate >= 0 ? 'top' : 'bottom',
120
+          }
121
+        });
122
+      });
131 123
     }
132
-    this.loading2 = true;
133
-    that.mainService.exportReport("clothesHos", postData).subscribe(
134
-      (data) => {
135
-        this.loading2 = false;
136
-        this.showPromptModal("导出", true, "");
137
-        var file = new Blob([data], {
138
-          type: "application/vnd.ms-excel",
124
+    this.deptPriceOption = {
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
+  // 科室数量差异率TOP10
199
+  deptCountOption;
200
+  deptCountChart(datas) {
201
+    console.log(datas)
202
+    let labels = [];
203
+    let nums = [];
204
+    if (datas.length) {
205
+      datas.forEach((e) => {
206
+        labels.push(e.deptName);
207
+        nums.push({
208
+          name: e.deptName,
209
+          value: e.countRate,
210
+          label: {
211
+            position: e.countRate >= 0 ? 'top' : 'bottom',
212
+          }
139 213
         });
140
-        //trick to download store a file having its URL
141
-        var fileURL = URL.createObjectURL(file);
142
-        var a = document.createElement("a");
143
-        a.href = fileURL;
144
-        a.target = "_blank";
145
-        a.download = "全员统计.xls";
146
-        document.body.appendChild(a);
147
-        a.click();
214
+      });
215
+    }
216
+    this.deptCountOption = {
217
+      color: ["#3398DB"],
218
+      tooltip: {
219
+        trigger: "axis",
220
+        axisPointer: {
221
+          // 坐标轴指示器,坐标轴触发有效
222
+          type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
223
+        },
224
+        formatter: '{b}: {c}%'
148 225
       },
149
-      (err) => {
150
-        this.loading2 = false;
151
-        this.showPromptModal("导出", false, "");
152
-      }
153
-    );
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();
154 293
   }
155 294
   // 重置
156 295
   reset() {
157
-    this.changeDateType("day");
158
-    this.changeDateRange("1");
159
-    this.sortCurrentKey = "";
160
-    this.sortCurrentValue = "";
161
-    this.sortCurrent = {
162
-      deptNum: null,
163
-      clothesTypeNum: null,
164
-      getOrder: null,
165
-      sendOrder: null,
166
-      sendClothesNum: null,
167
-      price: null,
168
-    };
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
+    }
169 303
     this.search();
170 304
   }
171
-  // 表格数据
172
-  loading1 = false;
173
-  getList(num?: number, field?: string, sort?: string) {
174
-    this.pageIndex = num;
305
+  // 数据
306
+  loading = false;
307
+  headerDate: any = {};
308
+  headerData: any = {};
309
+  priceDeptListTop10: any = [];
310
+  priceCompareDeptListTop10: any = [];
311
+  countDeptListTop10: any = [];
312
+  countCompareDeptListTop10: any = [];
313
+  priceBarTop10: any = [];
314
+  countBarTop10: any = [];
315
+  getData() {
175 316
     let postData: any = {
176
-      idx: this.pageIndex - 1,
177
-      sum: this.pageSize,
178
-      startTime: this.searchData.dateRange.start,
179
-      endTime: this.searchData.dateRange.end,
180
-      hosId: this.searchData.hosId,
181
-      type: this.dateType,
317
+      tabType: this.searchDto.tabType,
318
+      hosId: this.hospital,
319
+      type: this.searchDto.dateType,
182 320
     };
183
-    if (field && sort) {
184
-      postData.sort = sort === "ascend" ? field : `${field} desc`;
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;
185 335
     }
186
-    this.loading1 = true;
336
+    this.loading = true;
187 337
     this.mainService
188
-      .postCustom("report/clothes", "hospital", postData)
338
+      .postCustom("report/trend/analysis", "clothes", postData)
189 339
       .subscribe((result) => {
190
-        this.loading1 = false;
191
-        this.listOfData = result.list || [];
192
-        this.listLength = result.totalNum;
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.priceDeptListTop10 = bodyData.priceDeptListTop10 || [];
346
+          this.priceCompareDeptListTop10 = bodyData.priceCompareDeptListTop10 || [];
347
+          this.countDeptListTop10 = bodyData.countDeptListTop10 || [];
348
+          this.countCompareDeptListTop10 = bodyData.countCompareDeptListTop10 || [];
349
+          this.priceBarTop10 = bodyData.priceBarTop10 || [];
350
+          this.deptPriceChart(this.priceBarTop10);
351
+          this.countBarTop10 = bodyData.countBarTop10 || [];
352
+          this.deptCountChart(this.countBarTop10);
353
+        }
193 354
       });
194 355
   }
195 356
   // 获取院区
196 357
   hospital: string; //选中院区
197 358
   getAllHos() {
198
-    this.hospital = this.tool.getCurrentHospital().id + "";
359
+    this.hospital = this.tool.getCurrentHospital().id;
199 360
   }
200 361
 
201 362
   // 修改时间展示维度
202
-  changeDateType(res) {
203
-    console.log(res, this.dateType);
204
-    this.dateType = res;
205
-    this.searchData["type"] = res;
206
-    console.log(this.searchData);
207
-    switch (res) {
208
-      case "day":
209
-        this.defRanges = [
210
-          {
211
-            label: "上周",
212
-            id: 1,
213
-          },
214
-          {
215
-            label: "上月",
216
-            id: 2,
217
-          },
218
-          {
219
-            label: "上年",
220
-            id: 3,
221
-          },
222
-        ]; //时间默认区间
223
-        this.defRange = "1"; //默认上周
224
-        this.changeDateRange("1");
225
-        break;
226
-      case "month":
227
-        this.defRanges = [
228
-          {
229
-            label: "上月",
230
-            id: 2,
231
-          },
232
-          {
233
-            label: "上年",
234
-            id: 3,
235
-          },
236
-        ]; //时间默认区间
237
-        this.defRange = "2"; //上月
238
-        this.changeDateRange("2");
239
-        break;
240
-      case "year":
241
-        this.defRanges = [
242
-          {
243
-            label: "上年",
244
-            id: 3,
245
-          },
246
-        ]; //时间默认区间
247
-        this.defRange = "3"; //默认上周
248
-        this.changeDateRange("3");
249
-        break;
363
+  changeDateType(e?) {
364
+    if(this.searchDto.dateType == 'year' && this.searchDto.tabType == 'MoM'){
365
+      this.searchDto.tabType = 'YoY';
250 366
     }
251
-  }
252
-
253
-  // 禁选日期
254
-  disabledDate = (current: Date): boolean => {
255
-    // Can not select days before today and today
256
-    return differenceInCalendarDays(current, this.today) > 0;
257
-  };
258
-
259
-  // 禁选月份开始
260
-  disabledMonthStart = (current: Date): boolean => {
261
-    // Can not select days before today and today
262
-    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
263
-    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
264
-    return cur || staEnd;
265
-  };
266
-  // 禁选月份结束
267
-  disabledMonthEnd = (current: Date): boolean => {
268
-    // Can not select days before today and today
269
-    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
270
-    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
271
-    return cur || staEnd;
272
-  };
273
-
274
-  // 禁选年份开始
275
-  disabledYearStart = (current: Date): boolean => {
276
-    // Can not select days before today and today
277
-    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
278
-    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
279
-    return cur || staEnd;
280
-  };
281
-
282
-  // 禁选年份结束
283
-  disabledYearEnd = (current: Date): boolean => {
284
-    // Can not select days before today and today
285
-    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
286
-    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
287
-    return cur || staEnd;
288
-  };
289
-
290
-  // 日期选择 日
291
-  startDate: string; //发起时间开始
292
-  endDate: string; //发起时间结束
293
-  changeDate(result?): void {
294
-    console.log(this.dateRange);
295
-    console.log(result);
296
-    this.dateRange = result;
297
-    if (!this.quick) {
298
-      // 不是快捷选择
299
-      this.defRange = null;
300
-    }
301
-    if (!result || !result.length) {
302
-      this.startDate = this.endDate = "";
303
-      return;
304
-    }
305
-    this.startDate =
306
-      result[0].getFullYear() +
307
-      "-" +
308
-      (result[0].getMonth() + 1) +
309
-      "-" +
310
-      result[0].getDate();
311
-    this.endDate =
312
-      result[1].getFullYear() +
313
-      "-" +
314
-      (result[1].getMonth() + 1) +
315
-      "-" +
316
-      result[1].getDate();
317
-  }
318
-
319
-  // 月份选择
320
-  changeMonthStart(result?) {
321
-    console.log(result);
322
-    this.monthRangeStart = result;
323
-    if (!this.quick) {
324
-      // 不是快捷选择
325
-      this.defRange = null;
326
-    }
327
-    if (!result) {
328
-      this.startDate = this.endDate = "";
329
-      return;
330
-    }
331
-    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd');
332
-    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
333
-  }
334
-  changeMonthEnd(result?) {
335
-    console.log(result);
336
-    this.monthRangeEnd = result;
337
-    if (!this.quick) {
338
-      // 不是快捷选择
339
-      this.defRange = null;
340
-    }
341
-    if (!result) {
342
-      this.startDate = this.endDate = "";
343
-      return;
344
-    }
345
-    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
346
-    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd');
347
-  }
348
-  // 年份选择
349
-  changeYearStart(result?) {
350
-    console.log(result);
351
-    this.yearRangeStart = result;
352
-    if (!this.quick) {
353
-      // 不是快捷选择
354
-      this.defRange = null;
355
-    }
356
-    if (!result) {
357
-      this.startDate = this.endDate = "";
358
-      return;
359
-    }
360
-    this.startDate = format(startOfYear(result), 'yyyy-MM-dd');
361
-    // this.endDate = result.getFullYear() + '-01-01';
362
-  }
363
-  changeYearEnd(result?) {
364
-    console.log(result);
365
-    this.yearRangeEnd = result;
366
-    if (!this.quick) {
367
-      // 不是快捷选择
368
-      this.defRange = null;
369
-    }
370
-    if (!result) {
371
-      this.startDate = this.endDate = "";
372
-      return;
373
-    }
374
-    this.endDate = format(endOfYear(result), 'yyyy-MM-dd');
375
-  }
376
-
377
-  // 日期选择 快速修改时间区间
378
-  today = new Date();
379
-  quick: boolean = false;
380
-  changeDateRange(res) {
381
-    console.log(res);
382
-    this.quick = true;
383
-    switch (res) {
384
-      case "1":
385
-        // 上周
386
-        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
387
-        let lastweekenddate = this.dateService.date().lastWeekEndDate;
388
-        console.log(lastweekstartdate, lastweekenddate);
389
-        this.changeDate([lastweekstartdate, lastweekenddate]);
390
-        break;
391
-      case "2":
392
-        // 上月
393
-        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
394
-        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
395
-        console.log(lastmonthstartdate, lastmonthenddate);
396
-        this.changeDate([lastmonthstartdate, lastmonthenddate]);
397
-        this.changeMonthStart(lastmonthstartdate);
398
-        this.changeMonthEnd(lastmonthenddate);
399
-        break;
400
-      case "3":
401
-        // 上年
402
-        let lastyearstartdate = this.dateService.date().lastYearStartDate;
403
-        let lastyearenddate = this.dateService.date().lastYearEndDate;
404
-        console.log(lastyearstartdate, lastyearenddate);
405
-        this.changeDate([lastyearstartdate, lastyearenddate]);
406
-        this.changeMonthStart(lastyearstartdate);
407
-        this.changeMonthEnd(lastyearenddate);
408
-        this.changeYearStart(lastyearstartdate);
409
-        this.changeYearEnd(lastyearenddate);
410
-        break;
411
-    }
412
-    this.quick = false;
413
-    this.search();
414
-  }
415
-
416
-  // 更多
417
-  toMore(type) {
418
-    let sendData = this.searchData;
419
-    console.log(sendData);
420
-    this.myService.sendMsg(sendData);
421
-    this.router.navigateByUrl("/main/" + type);
367
+    this.getData();
422 368
   }
423 369
 
424 370
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
@@ -431,29 +377,4 @@ export class QuiltWashingTrendAnalysisComponent implements OnInit {
431 377
       this.promptModalShow = true;
432 378
     }, 100);
433 379
   }
434
-
435
-  // 边输入边搜索节流阀
436
-  isLoading: boolean = false;
437
-  searchTimer(fun, e, those) {
438
-    let that = this;
439
-    that.isLoading = true;
440
-    fun(e, those);
441
-  }
442
-  // 列表排序
443
-  sortCurrent = {
444
-    deptNum: null,
445
-    clothesTypeNum: null,
446
-    getOrder: null,
447
-    sendOrder: null,
448
-    sendClothesNum: null,
449
-    price: null,
450
-  };
451
-  sortCurrentKey: string = "";
452
-  sortCurrentValue: string | null = "";
453
-  sort(e) {
454
-    const { key, value } = e;
455
-    this.sortCurrentKey = key;
456
-    this.sortCurrentValue = value;
457
-    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
458
-  }
459 380
 }

+ 2 - 0
src/app/views/quilt-washing-trend-analysis/quilt-washing-trend-analysis.module.ts

@@ -4,12 +4,14 @@ import { CommonModule } from "@angular/common";
4 4
 import { QuiltWashingTrendAnalysisRoutingModule } from "./quilt-washing-trend-analysis-routing.module";
5 5
 import { ShareModule } from "src/app/share/share.module";
6 6
 import { QuiltWashingTrendAnalysisComponent } from "./quilt-washing-trend-analysis.component";
7
+import { NgxEchartsModule } from 'ngx-echarts';
7 8
 
8 9
 @NgModule({
9 10
   declarations: [QuiltWashingTrendAnalysisComponent],
10 11
   imports: [
11 12
     CommonModule,
12 13
     QuiltWashingTrendAnalysisRoutingModule,
14
+    NgxEchartsModule,
13 15
     ShareModule,
14 16
   ],
15 17
 })

+ 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('v2.4.60');
11
+    console.info('v2.4.61');
12 12
   }
13 13
 }
14 14
 platformBrowserDynamic().bootstrapModule(AppModule)