seimin 11 kuukautta sitten
vanhempi
commit
4e280fe8bf

+ 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": {

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

@@ -468,6 +468,16 @@ const routes: Routes = [
468 468
         path: "quiltWashingPersonnelStatistics",
469 469
         loadChildren: () => import("../quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.module").then((m) => m.QuiltWashingPersonnelStatisticsModule),
470 470
       },
471
+      // 绩效基础配置-科室统计
472
+      {
473
+        path: "quiltWashingDepartmentStatistics",
474
+        loadChildren: () => import("../quilt-washing-department-statistics/quilt-washing-department-statistics.module").then((m) => m.QuiltWashingDepartmentStatisticsModule),
475
+      },
476
+      // 绩效基础配置-全员统计
477
+      {
478
+        path: "quiltWashingHospitalStatistics",
479
+        loadChildren: () => import("../quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.module").then((m) => m.QuiltWashingHospitalStatisticsModule),
480
+      },
471 481
     ],
472 482
   },
473 483
 ];

+ 13 - 0
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics-routing.module.ts

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

+ 91 - 0
src/app/views/quilt-washing-department-statistics/quilt-washing-department-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__bottom">
44
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
45
+        [nzLoading]="loading1">
46
+        <thead (nzSortChange)="sort($event)" nzSingleSort>
47
+          <tr class="thead">
48
+            <th nzWidth="5%">序号</th>
49
+            <th nzWidth="5%">人员姓名</th>
50
+            <th nzShowSort nzWidth="10%" nzSortKey="totalTrip" [(nzSort)]="sortCurrent.totalTrip">总趟数</th>
51
+            <th nzShowSort nzWidth="10%" nzSortKey="totalOrder" [(nzSort)]="sortCurrent.totalOrder">总单数</th>
52
+            <th nzShowSort nzWidth="10%" nzSortKey="getTrip" [(nzSort)]="sortCurrent.getTrip">回收趟数</th>
53
+            <th nzShowSort nzWidth="10%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收工单数</th>
54
+            <th nzShowSort nzWidth="10%" nzSortKey="getClothesNum" [(nzSort)]="sortCurrent.getClothesNum">回收被服数量</th>
55
+            <th nzShowSort nzWidth="10%" nzSortKey="sendTrip" [(nzSort)]="sortCurrent.sendTrip">送回趟数</th>
56
+            <th nzShowSort nzWidth="10%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回工单数</th>
57
+            <th nzShowSort nzWidth="10%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">送回被服数量</th>
58
+            <th nzShowSort nzWidth="10%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
59
+          </tr>
60
+        </thead>
61
+        <tbody>
62
+          <tr *ngFor="let data of listOfData;let index=index;">
63
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
64
+            <td>{{ data.userName }}</td>
65
+            <td>{{ data.totalTrip }}</td>
66
+            <td>{{ data.totalOrder }}</td>
67
+            <td>{{ data.getTrip }}</td>
68
+            <td>{{ data.getOrder }}</td>
69
+            <td>{{ data.getClothesNum }}</td>
70
+            <td>{{ data.sendTrip }}</td>
71
+            <td>{{ data.sendOrder }}</td>
72
+            <td>{{ data.sendClothesNum }}</td>
73
+            <td>{{ data.price }}</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/quilt-washing-department-statistics/quilt-washing-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
+}

+ 455 - 0
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.component.ts

@@ -0,0 +1,455 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear } 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-quilt-washing-department-statistics",
12
+  templateUrl: "./quilt-washing-department-statistics.component.html",
13
+  styleUrls: ["./quilt-washing-department-statistics.component.less"],
14
+})
15
+export class QuiltWashingDepartmentStatisticsComponent 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.changeDateRange(this.defRange);
29
+    this.search();
30
+  }
31
+
32
+  dateType: string = "day"; //选中时间维度
33
+  dateTypes: any = [
34
+    {
35
+      label: "按天统计",
36
+      value: "day",
37
+    },
38
+    {
39
+      label: "按月统计",
40
+      value: "month",
41
+    },
42
+    {
43
+      label: "按年统计",
44
+      value: "year",
45
+    },
46
+  ]; //时间维度
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
+
75
+  promptContent: string; //操作提示框提示信息
76
+  ifSuccess: boolean; //操作成功/失败
77
+  promptInfo: string; //操作结果提示信息
78
+  promptModalShow: boolean; //操作提示框是否展示
79
+
80
+  // 初始化增删改按钮
81
+  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();
98
+  }
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);
114
+    }
115
+  }
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`;
131
+    }
132
+    this.loading2 = true;
133
+    that.mainService.exportReport("clothesDept", postData).subscribe(
134
+      (data) => {
135
+        this.loading2 = false;
136
+        this.showPromptModal("导出", true, "");
137
+        var file = new Blob([data], {
138
+          type: "application/vnd.ms-excel",
139
+        });
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();
148
+      },
149
+      (err) => {
150
+        this.loading2 = false;
151
+        this.showPromptModal("导出", false, "");
152
+      }
153
+    );
154
+  }
155
+  // 重置
156
+  reset() {
157
+    this.changeDateType("day");
158
+    this.changeDateRange("1");
159
+    this.sortCurrentKey = "";
160
+    this.sortCurrentValue = "";
161
+    this.sortCurrent = {
162
+      source1: null,
163
+      source2: null,
164
+      source3: null,
165
+      source4: null,
166
+    };
167
+    this.search();
168
+  }
169
+  // 表格数据
170
+  loading1 = false;
171
+  getList(num?: number, field?: string, sort?: string) {
172
+    this.pageIndex = num;
173
+    let postData: any = {
174
+      idx: this.pageIndex - 1,
175
+      sum: this.pageSize,
176
+      startTime: this.searchData.dateRange.start,
177
+      endTime: this.searchData.dateRange.end,
178
+      hosId: this.searchData.hosId,
179
+      type: this.dateType,
180
+    };
181
+    if (field && sort) {
182
+      postData.sort = sort === "ascend" ? field : `${field} desc`;
183
+    }
184
+    this.loading1 = true;
185
+    this.mainService
186
+      .postCustom("report/clothes", "dept", postData)
187
+      .subscribe((result) => {
188
+        this.loading1 = false;
189
+        this.listOfData = result.list || [];
190
+        this.listLength = result.totalNum;
191
+      });
192
+  }
193
+  // 获取院区
194
+  hospital: string; //选中院区
195
+  getAllHos() {
196
+    this.hospital = this.tool.getCurrentHospital().id + "";
197
+  }
198
+
199
+  // 修改时间展示维度
200
+  changeDateType(res) {
201
+    console.log(res, this.dateType);
202
+    this.dateType = res;
203
+    this.searchData["type"] = res;
204
+    console.log(this.searchData);
205
+    switch (res) {
206
+      case "day":
207
+        this.defRanges = [
208
+          {
209
+            label: "上周",
210
+            id: 1,
211
+          },
212
+          {
213
+            label: "上月",
214
+            id: 2,
215
+          },
216
+          {
217
+            label: "上年",
218
+            id: 3,
219
+          },
220
+        ]; //时间默认区间
221
+        this.defRange = "1"; //默认上周
222
+        this.changeDateRange("1");
223
+        break;
224
+      case "month":
225
+        this.defRanges = [
226
+          {
227
+            label: "上月",
228
+            id: 2,
229
+          },
230
+          {
231
+            label: "上年",
232
+            id: 3,
233
+          },
234
+        ]; //时间默认区间
235
+        this.defRange = "2"; //上月
236
+        this.changeDateRange("2");
237
+        break;
238
+      case "year":
239
+        this.defRanges = [
240
+          {
241
+            label: "上年",
242
+            id: 3,
243
+          },
244
+        ]; //时间默认区间
245
+        this.defRange = "3"; //默认上周
246
+        this.changeDateRange("3");
247
+        break;
248
+    }
249
+  }
250
+
251
+  // 禁选日期
252
+  disabledDate = (current: Date): boolean => {
253
+    // Can not select days before today and today
254
+    return differenceInCalendarDays(current, this.today) > 0;
255
+  };
256
+
257
+  // 禁选月份开始
258
+  disabledMonthStart = (current: Date): boolean => {
259
+    // Can not select days before today and today
260
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
261
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
262
+    return cur || staEnd;
263
+  };
264
+  // 禁选月份结束
265
+  disabledMonthEnd = (current: Date): boolean => {
266
+    // Can not select days before today and today
267
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
268
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
269
+    return cur || staEnd;
270
+  };
271
+
272
+  // 禁选年份开始
273
+  disabledYearStart = (current: Date): boolean => {
274
+    // Can not select days before today and today
275
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
276
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
277
+    return cur || staEnd;
278
+  };
279
+
280
+  // 禁选年份结束
281
+  disabledYearEnd = (current: Date): boolean => {
282
+    // Can not select days before today and today
283
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
284
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
285
+    return cur || staEnd;
286
+  };
287
+
288
+  // 日期选择 日
289
+  startDate: string; //发起时间开始
290
+  endDate: string; //发起时间结束
291
+  changeDate(result?): void {
292
+    console.log(this.dateRange);
293
+    console.log(result);
294
+    this.dateRange = result;
295
+    if (!this.quick) {
296
+      // 不是快捷选择
297
+      this.defRange = null;
298
+    }
299
+    if (!result || !result.length) {
300
+      this.startDate = this.endDate = "";
301
+      return;
302
+    }
303
+    this.startDate =
304
+      result[0].getFullYear() +
305
+      "-" +
306
+      (result[0].getMonth() + 1) +
307
+      "-" +
308
+      result[0].getDate();
309
+    this.endDate =
310
+      result[1].getFullYear() +
311
+      "-" +
312
+      (result[1].getMonth() + 1) +
313
+      "-" +
314
+      result[1].getDate();
315
+  }
316
+
317
+  // 月份选择
318
+  changeMonthStart(result?) {
319
+    console.log(result);
320
+    this.monthRangeStart = result;
321
+    if (!this.quick) {
322
+      // 不是快捷选择
323
+      this.defRange = null;
324
+    }
325
+    if (!result) {
326
+      this.startDate = this.endDate = "";
327
+      return;
328
+    }
329
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd');
330
+    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
331
+  }
332
+  changeMonthEnd(result?) {
333
+    console.log(result);
334
+    this.monthRangeEnd = result;
335
+    if (!this.quick) {
336
+      // 不是快捷选择
337
+      this.defRange = null;
338
+    }
339
+    if (!result) {
340
+      this.startDate = this.endDate = "";
341
+      return;
342
+    }
343
+    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
344
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd');
345
+  }
346
+  // 年份选择
347
+  changeYearStart(result?) {
348
+    console.log(result);
349
+    this.yearRangeStart = result;
350
+    if (!this.quick) {
351
+      // 不是快捷选择
352
+      this.defRange = null;
353
+    }
354
+    if (!result) {
355
+      this.startDate = this.endDate = "";
356
+      return;
357
+    }
358
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd');
359
+    // this.endDate = result.getFullYear() + '-01-01';
360
+  }
361
+  changeYearEnd(result?) {
362
+    console.log(result);
363
+    this.yearRangeEnd = result;
364
+    if (!this.quick) {
365
+      // 不是快捷选择
366
+      this.defRange = null;
367
+    }
368
+    if (!result) {
369
+      this.startDate = this.endDate = "";
370
+      return;
371
+    }
372
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd');
373
+  }
374
+
375
+  // 日期选择 快速修改时间区间
376
+  today = new Date();
377
+  quick: boolean = false;
378
+  changeDateRange(res) {
379
+    console.log(res);
380
+    this.quick = true;
381
+    switch (res) {
382
+      case "1":
383
+        // 上周
384
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
385
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
386
+        console.log(lastweekstartdate, lastweekenddate);
387
+        this.changeDate([lastweekstartdate, lastweekenddate]);
388
+        break;
389
+      case "2":
390
+        // 上月
391
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
392
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
393
+        console.log(lastmonthstartdate, lastmonthenddate);
394
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
395
+        this.changeMonthStart(lastmonthstartdate);
396
+        this.changeMonthEnd(lastmonthenddate);
397
+        break;
398
+      case "3":
399
+        // 上年
400
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
401
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
402
+        console.log(lastyearstartdate, lastyearenddate);
403
+        this.changeDate([lastyearstartdate, lastyearenddate]);
404
+        this.changeMonthStart(lastyearstartdate);
405
+        this.changeMonthEnd(lastyearenddate);
406
+        this.changeYearStart(lastyearstartdate);
407
+        this.changeYearEnd(lastyearenddate);
408
+        break;
409
+    }
410
+    this.quick = false;
411
+    this.search();
412
+  }
413
+
414
+  // 更多
415
+  toMore(type) {
416
+    let sendData = this.searchData;
417
+    console.log(sendData);
418
+    this.myService.sendMsg(sendData);
419
+    this.router.navigateByUrl("/main/" + type);
420
+  }
421
+
422
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
423
+  showPromptModal(con, success, promptInfo?) {
424
+    this.promptModalShow = false;
425
+    this.promptContent = con;
426
+    this.ifSuccess = success;
427
+    this.promptInfo = promptInfo;
428
+    setTimeout(() => {
429
+      this.promptModalShow = true;
430
+    }, 100);
431
+  }
432
+
433
+  // 边输入边搜索节流阀
434
+  isLoading: boolean = false;
435
+  searchTimer(fun, e, those) {
436
+    let that = this;
437
+    that.isLoading = true;
438
+    fun(e, those);
439
+  }
440
+  // 列表排序
441
+  sortCurrent = {
442
+    source1: null,
443
+    source2: null,
444
+    source3: null,
445
+    source4: null,
446
+  };
447
+  sortCurrentKey: string = "";
448
+  sortCurrentValue: string | null = "";
449
+  sort(e) {
450
+    const { key, value } = e;
451
+    this.sortCurrentKey = key;
452
+    this.sortCurrentValue = value;
453
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
454
+  }
455
+}

+ 16 - 0
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.module.ts

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

+ 13 - 0
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics-routing.module.ts

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

+ 91 - 0
src/app/views/quilt-washing-hospital-statistics/quilt-washing-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__bottom">
44
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
45
+        [nzLoading]="loading1">
46
+        <thead (nzSortChange)="sort($event)" nzSingleSort>
47
+          <tr class="thead">
48
+            <th nzWidth="5%">序号</th>
49
+            <th nzWidth="5%">人员姓名</th>
50
+            <th nzShowSort nzWidth="10%" nzSortKey="totalTrip" [(nzSort)]="sortCurrent.totalTrip">总趟数</th>
51
+            <th nzShowSort nzWidth="10%" nzSortKey="totalOrder" [(nzSort)]="sortCurrent.totalOrder">总单数</th>
52
+            <th nzShowSort nzWidth="10%" nzSortKey="getTrip" [(nzSort)]="sortCurrent.getTrip">回收趟数</th>
53
+            <th nzShowSort nzWidth="10%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收工单数</th>
54
+            <th nzShowSort nzWidth="10%" nzSortKey="getClothesNum" [(nzSort)]="sortCurrent.getClothesNum">回收被服数量</th>
55
+            <th nzShowSort nzWidth="10%" nzSortKey="sendTrip" [(nzSort)]="sortCurrent.sendTrip">送回趟数</th>
56
+            <th nzShowSort nzWidth="10%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回工单数</th>
57
+            <th nzShowSort nzWidth="10%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">送回被服数量</th>
58
+            <th nzShowSort nzWidth="10%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
59
+          </tr>
60
+        </thead>
61
+        <tbody>
62
+          <tr *ngFor="let data of listOfData;let index=index;">
63
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
64
+            <td>{{ data.userName }}</td>
65
+            <td>{{ data.totalTrip }}</td>
66
+            <td>{{ data.totalOrder }}</td>
67
+            <td>{{ data.getTrip }}</td>
68
+            <td>{{ data.getOrder }}</td>
69
+            <td>{{ data.getClothesNum }}</td>
70
+            <td>{{ data.sendTrip }}</td>
71
+            <td>{{ data.sendOrder }}</td>
72
+            <td>{{ data.sendClothesNum }}</td>
73
+            <td>{{ data.price }}</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/quilt-washing-hospital-statistics/quilt-washing-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
+}

+ 455 - 0
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.component.ts

@@ -0,0 +1,455 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear, format, startOfMonth, startOfYear } 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-quilt-washing-hospital-statistics",
12
+  templateUrl: "./quilt-washing-hospital-statistics.component.html",
13
+  styleUrls: ["./quilt-washing-hospital-statistics.component.less"],
14
+})
15
+export class QuiltWashingHospitalStatisticsComponent 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.changeDateRange(this.defRange);
29
+    this.search();
30
+  }
31
+
32
+  dateType: string = "day"; //选中时间维度
33
+  dateTypes: any = [
34
+    {
35
+      label: "按天统计",
36
+      value: "day",
37
+    },
38
+    {
39
+      label: "按月统计",
40
+      value: "month",
41
+    },
42
+    {
43
+      label: "按年统计",
44
+      value: "year",
45
+    },
46
+  ]; //时间维度
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
+
75
+  promptContent: string; //操作提示框提示信息
76
+  ifSuccess: boolean; //操作成功/失败
77
+  promptInfo: string; //操作结果提示信息
78
+  promptModalShow: boolean; //操作提示框是否展示
79
+
80
+  // 初始化增删改按钮
81
+  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();
98
+  }
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);
114
+    }
115
+  }
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`;
131
+    }
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",
139
+        });
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();
148
+      },
149
+      (err) => {
150
+        this.loading2 = false;
151
+        this.showPromptModal("导出", false, "");
152
+      }
153
+    );
154
+  }
155
+  // 重置
156
+  reset() {
157
+    this.changeDateType("day");
158
+    this.changeDateRange("1");
159
+    this.sortCurrentKey = "";
160
+    this.sortCurrentValue = "";
161
+    this.sortCurrent = {
162
+      source1: null,
163
+      source2: null,
164
+      source3: null,
165
+      source4: null,
166
+    };
167
+    this.search();
168
+  }
169
+  // 表格数据
170
+  loading1 = false;
171
+  getList(num?: number, field?: string, sort?: string) {
172
+    this.pageIndex = num;
173
+    let postData: any = {
174
+      idx: this.pageIndex - 1,
175
+      sum: this.pageSize,
176
+      startTime: this.searchData.dateRange.start,
177
+      endTime: this.searchData.dateRange.end,
178
+      hosId: this.searchData.hosId,
179
+      type: this.dateType,
180
+    };
181
+    if (field && sort) {
182
+      postData.sort = sort === "ascend" ? field : `${field} desc`;
183
+    }
184
+    this.loading1 = true;
185
+    this.mainService
186
+      .postCustom("report/clothes", "hospital", postData)
187
+      .subscribe((result) => {
188
+        this.loading1 = false;
189
+        this.listOfData = result.list || [];
190
+        this.listLength = result.totalNum;
191
+      });
192
+  }
193
+  // 获取院区
194
+  hospital: string; //选中院区
195
+  getAllHos() {
196
+    this.hospital = this.tool.getCurrentHospital().id + "";
197
+  }
198
+
199
+  // 修改时间展示维度
200
+  changeDateType(res) {
201
+    console.log(res, this.dateType);
202
+    this.dateType = res;
203
+    this.searchData["type"] = res;
204
+    console.log(this.searchData);
205
+    switch (res) {
206
+      case "day":
207
+        this.defRanges = [
208
+          {
209
+            label: "上周",
210
+            id: 1,
211
+          },
212
+          {
213
+            label: "上月",
214
+            id: 2,
215
+          },
216
+          {
217
+            label: "上年",
218
+            id: 3,
219
+          },
220
+        ]; //时间默认区间
221
+        this.defRange = "1"; //默认上周
222
+        this.changeDateRange("1");
223
+        break;
224
+      case "month":
225
+        this.defRanges = [
226
+          {
227
+            label: "上月",
228
+            id: 2,
229
+          },
230
+          {
231
+            label: "上年",
232
+            id: 3,
233
+          },
234
+        ]; //时间默认区间
235
+        this.defRange = "2"; //上月
236
+        this.changeDateRange("2");
237
+        break;
238
+      case "year":
239
+        this.defRanges = [
240
+          {
241
+            label: "上年",
242
+            id: 3,
243
+          },
244
+        ]; //时间默认区间
245
+        this.defRange = "3"; //默认上周
246
+        this.changeDateRange("3");
247
+        break;
248
+    }
249
+  }
250
+
251
+  // 禁选日期
252
+  disabledDate = (current: Date): boolean => {
253
+    // Can not select days before today and today
254
+    return differenceInCalendarDays(current, this.today) > 0;
255
+  };
256
+
257
+  // 禁选月份开始
258
+  disabledMonthStart = (current: Date): boolean => {
259
+    // Can not select days before today and today
260
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
261
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
262
+    return cur || staEnd;
263
+  };
264
+  // 禁选月份结束
265
+  disabledMonthEnd = (current: Date): boolean => {
266
+    // Can not select days before today and today
267
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
268
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
269
+    return cur || staEnd;
270
+  };
271
+
272
+  // 禁选年份开始
273
+  disabledYearStart = (current: Date): boolean => {
274
+    // Can not select days before today and today
275
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
276
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
277
+    return cur || staEnd;
278
+  };
279
+
280
+  // 禁选年份结束
281
+  disabledYearEnd = (current: Date): boolean => {
282
+    // Can not select days before today and today
283
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
284
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
285
+    return cur || staEnd;
286
+  };
287
+
288
+  // 日期选择 日
289
+  startDate: string; //发起时间开始
290
+  endDate: string; //发起时间结束
291
+  changeDate(result?): void {
292
+    console.log(this.dateRange);
293
+    console.log(result);
294
+    this.dateRange = result;
295
+    if (!this.quick) {
296
+      // 不是快捷选择
297
+      this.defRange = null;
298
+    }
299
+    if (!result || !result.length) {
300
+      this.startDate = this.endDate = "";
301
+      return;
302
+    }
303
+    this.startDate =
304
+      result[0].getFullYear() +
305
+      "-" +
306
+      (result[0].getMonth() + 1) +
307
+      "-" +
308
+      result[0].getDate();
309
+    this.endDate =
310
+      result[1].getFullYear() +
311
+      "-" +
312
+      (result[1].getMonth() + 1) +
313
+      "-" +
314
+      result[1].getDate();
315
+  }
316
+
317
+  // 月份选择
318
+  changeMonthStart(result?) {
319
+    console.log(result);
320
+    this.monthRangeStart = result;
321
+    if (!this.quick) {
322
+      // 不是快捷选择
323
+      this.defRange = null;
324
+    }
325
+    if (!result) {
326
+      this.startDate = this.endDate = "";
327
+      return;
328
+    }
329
+    this.startDate = format(startOfMonth(result), 'yyyy-MM-dd');
330
+    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
331
+  }
332
+  changeMonthEnd(result?) {
333
+    console.log(result);
334
+    this.monthRangeEnd = result;
335
+    if (!this.quick) {
336
+      // 不是快捷选择
337
+      this.defRange = null;
338
+    }
339
+    if (!result) {
340
+      this.startDate = this.endDate = "";
341
+      return;
342
+    }
343
+    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
344
+    this.endDate = format(endOfMonth(result), 'yyyy-MM-dd');
345
+  }
346
+  // 年份选择
347
+  changeYearStart(result?) {
348
+    console.log(result);
349
+    this.yearRangeStart = result;
350
+    if (!this.quick) {
351
+      // 不是快捷选择
352
+      this.defRange = null;
353
+    }
354
+    if (!result) {
355
+      this.startDate = this.endDate = "";
356
+      return;
357
+    }
358
+    this.startDate = format(startOfYear(result), 'yyyy-MM-dd');
359
+    // this.endDate = result.getFullYear() + '-01-01';
360
+  }
361
+  changeYearEnd(result?) {
362
+    console.log(result);
363
+    this.yearRangeEnd = result;
364
+    if (!this.quick) {
365
+      // 不是快捷选择
366
+      this.defRange = null;
367
+    }
368
+    if (!result) {
369
+      this.startDate = this.endDate = "";
370
+      return;
371
+    }
372
+    this.endDate = format(endOfYear(result), 'yyyy-MM-dd');
373
+  }
374
+
375
+  // 日期选择 快速修改时间区间
376
+  today = new Date();
377
+  quick: boolean = false;
378
+  changeDateRange(res) {
379
+    console.log(res);
380
+    this.quick = true;
381
+    switch (res) {
382
+      case "1":
383
+        // 上周
384
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
385
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
386
+        console.log(lastweekstartdate, lastweekenddate);
387
+        this.changeDate([lastweekstartdate, lastweekenddate]);
388
+        break;
389
+      case "2":
390
+        // 上月
391
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
392
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
393
+        console.log(lastmonthstartdate, lastmonthenddate);
394
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
395
+        this.changeMonthStart(lastmonthstartdate);
396
+        this.changeMonthEnd(lastmonthenddate);
397
+        break;
398
+      case "3":
399
+        // 上年
400
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
401
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
402
+        console.log(lastyearstartdate, lastyearenddate);
403
+        this.changeDate([lastyearstartdate, lastyearenddate]);
404
+        this.changeMonthStart(lastyearstartdate);
405
+        this.changeMonthEnd(lastyearenddate);
406
+        this.changeYearStart(lastyearstartdate);
407
+        this.changeYearEnd(lastyearenddate);
408
+        break;
409
+    }
410
+    this.quick = false;
411
+    this.search();
412
+  }
413
+
414
+  // 更多
415
+  toMore(type) {
416
+    let sendData = this.searchData;
417
+    console.log(sendData);
418
+    this.myService.sendMsg(sendData);
419
+    this.router.navigateByUrl("/main/" + type);
420
+  }
421
+
422
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
423
+  showPromptModal(con, success, promptInfo?) {
424
+    this.promptModalShow = false;
425
+    this.promptContent = con;
426
+    this.ifSuccess = success;
427
+    this.promptInfo = promptInfo;
428
+    setTimeout(() => {
429
+      this.promptModalShow = true;
430
+    }, 100);
431
+  }
432
+
433
+  // 边输入边搜索节流阀
434
+  isLoading: boolean = false;
435
+  searchTimer(fun, e, those) {
436
+    let that = this;
437
+    that.isLoading = true;
438
+    fun(e, those);
439
+  }
440
+  // 列表排序
441
+  sortCurrent = {
442
+    source1: null,
443
+    source2: null,
444
+    source3: null,
445
+    source4: null,
446
+  };
447
+  sortCurrentKey: string = "";
448
+  sortCurrentValue: string | null = "";
449
+  sort(e) {
450
+    const { key, value } = e;
451
+    this.sortCurrentKey = key;
452
+    this.sortCurrentValue = value;
453
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
454
+  }
455
+}

+ 16 - 0
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.module.ts

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

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

@@ -46,21 +46,31 @@
46 46
         <thead (nzSortChange)="sort($event)" nzSingleSort>
47 47
           <tr class="thead">
48 48
             <th nzWidth="5%">序号</th>
49
-            <th nzWidth="15%">任务类型</th>
50
-            <th nzShowSort nzWidth="20%" nzSortKey="source1" [(nzSort)]="sortCurrent.source1">服务台建单数量</th>
51
-            <th nzShowSort nzWidth="20%" nzSortKey="source2" [(nzSort)]="sortCurrent.source2">护士端建单数量</th>
52
-            <th nzShowSort nzWidth="20%" nzSortKey="source3" [(nzSort)]="sortCurrent.source3">系统自动建单数量</th>
53
-            <th nzShowSort nzWidth="20%" nzSortKey="source4" [(nzSort)]="sortCurrent.source4">微信端建单数量</th>
49
+            <th nzWidth="5%">人员姓名</th>
50
+            <th nzShowSort nzWidth="10%" nzSortKey="totalTrip" [(nzSort)]="sortCurrent.totalTrip">总趟数</th>
51
+            <th nzShowSort nzWidth="10%" nzSortKey="totalOrder" [(nzSort)]="sortCurrent.totalOrder">总单数</th>
52
+            <th nzShowSort nzWidth="10%" nzSortKey="getTrip" [(nzSort)]="sortCurrent.getTrip">回收趟数</th>
53
+            <th nzShowSort nzWidth="10%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收工单数</th>
54
+            <th nzShowSort nzWidth="10%" nzSortKey="getClothesNum" [(nzSort)]="sortCurrent.getClothesNum">回收被服数量</th>
55
+            <th nzShowSort nzWidth="10%" nzSortKey="sendTrip" [(nzSort)]="sortCurrent.sendTrip">送回趟数</th>
56
+            <th nzShowSort nzWidth="10%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回工单数</th>
57
+            <th nzShowSort nzWidth="10%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">送回被服数量</th>
58
+            <th nzShowSort nzWidth="10%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
54 59
           </tr>
55 60
         </thead>
56 61
         <tbody>
57 62
           <tr *ngFor="let data of listOfData;let index=index;">
58 63
             <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
59
-            <td>{{ data.taskName }}</td>
60
-            <td>{{ data.source1||0}}</td>
61
-            <td>{{data.source2||0}}</td>
62
-            <td>{{data.source3||0}}</td>
63
-            <td>{{data.source4||0}}</td>
64
+            <td>{{ data.userName }}</td>
65
+            <td>{{ data.totalTrip }}</td>
66
+            <td>{{ data.totalOrder }}</td>
67
+            <td>{{ data.getTrip }}</td>
68
+            <td>{{ data.getOrder }}</td>
69
+            <td>{{ data.getClothesNum }}</td>
70
+            <td>{{ data.sendTrip }}</td>
71
+            <td>{{ data.sendOrder }}</td>
72
+            <td>{{ data.sendClothesNum }}</td>
73
+            <td>{{ data.price }}</td>
64 74
           </tr>
65 75
         </tbody>
66 76
       </nz-table>

+ 4 - 5
src/app/views/quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.component.ts

@@ -122,7 +122,6 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
122 122
       endTime: this.endDate + " " + "23:59:59",
123 123
       hosId: that.hospital,
124 124
       type: this.dateType,
125
-      sourceType: "taskType",
126 125
     };
127 126
     if (this.sortCurrentKey && this.sortCurrentValue) {
128 127
       postData.sort =
@@ -131,7 +130,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
131 130
           : `${this.sortCurrentKey} desc`;
132 131
     }
133 132
     this.loading2 = true;
134
-    that.mainService.exportReport("workOrderSource", postData).subscribe(
133
+    that.mainService.exportReport("clothesPersonal", postData).subscribe(
135 134
       (data) => {
136 135
         this.loading2 = false;
137 136
         this.showPromptModal("导出", true, "");
@@ -143,7 +142,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
143 142
         var a = document.createElement("a");
144 143
         a.href = fileURL;
145 144
         a.target = "_blank";
146
-        a.download = "任务类型建单来源统计.xls";
145
+        a.download = "人员统计.xls";
147 146
         document.body.appendChild(a);
148 147
         a.click();
149 148
       },
@@ -178,14 +177,13 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
178 177
       endTime: this.searchData.dateRange.end,
179 178
       hosId: this.searchData.hosId,
180 179
       type: this.dateType,
181
-      sourceType: "taskType",
182 180
     };
183 181
     if (field && sort) {
184 182
       postData.sort = sort === "ascend" ? field : `${field} desc`;
185 183
     }
186 184
     this.loading1 = true;
187 185
     this.mainService
188
-      .postCustom("report", "workOrderSourceReport", postData)
186
+      .postCustom("report/clothes", "personal", postData)
189 187
       .subscribe((result) => {
190 188
         this.loading1 = false;
191 189
         this.listOfData = result.list || [];
@@ -410,6 +408,7 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
410 408
         break;
411 409
     }
412 410
     this.quick = false;
411
+    this.search();
413 412
   }
414 413
 
415 414
   // 更多