seimin il y a 3 ans
Parent
commit
2bcd661328
16 fichiers modifiés avec 758 ajouts et 0 suppressions
  1. 13 0
      src/app/views/dept-order-source-statistics/dept-order-source-statistics-routing.module.ts
  2. 1 0
      src/app/views/dept-order-source-statistics/dept-order-source-statistics.component.html
  3. 0 0
      src/app/views/dept-order-source-statistics/dept-order-source-statistics.component.less
  4. 15 0
      src/app/views/dept-order-source-statistics/dept-order-source-statistics.component.ts
  5. 12 0
      src/app/views/dept-order-source-statistics/dept-order-source-statistics.module.ts
  6. 24 0
      src/app/views/main/main-routing.module.ts
  7. 13 0
      src/app/views/order-source-statistics/order-source-statistics-routing.module.ts
  8. 88 0
      src/app/views/order-source-statistics/order-source-statistics.component.html
  9. 91 0
      src/app/views/order-source-statistics/order-source-statistics.component.less
  10. 439 0
      src/app/views/order-source-statistics/order-source-statistics.component.ts
  11. 17 0
      src/app/views/order-source-statistics/order-source-statistics.module.ts
  12. 13 0
      src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics-routing.module.ts
  13. 1 0
      src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.component.html
  14. 0 0
      src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.component.less
  15. 15 0
      src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.component.ts
  16. 16 0
      src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.module.ts

+ 13 - 0
src/app/views/dept-order-source-statistics/dept-order-source-statistics-routing.module.ts

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

+ 1 - 0
src/app/views/dept-order-source-statistics/dept-order-source-statistics.component.html

@@ -0,0 +1 @@
1
+<p>dept-order-source-statistics works!</p>

+ 0 - 0
src/app/views/dept-order-source-statistics/dept-order-source-statistics.component.less


+ 15 - 0
src/app/views/dept-order-source-statistics/dept-order-source-statistics.component.ts

@@ -0,0 +1,15 @@
1
+import { Component, OnInit } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'app-dept-order-source-statistics',
5
+  templateUrl: './dept-order-source-statistics.component.html',
6
+  styleUrls: ['./dept-order-source-statistics.component.less']
7
+})
8
+export class DeptOrderSourceStatisticsComponent implements OnInit {
9
+
10
+  constructor() { }
11
+
12
+  ngOnInit() {
13
+  }
14
+
15
+}

+ 12 - 0
src/app/views/dept-order-source-statistics/dept-order-source-statistics.module.ts

@@ -0,0 +1,12 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { DeptOrderSourceStatisticsRoutingModule } from "./dept-order-source-statistics-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { DeptOrderSourceStatisticsComponent } from "./dept-order-source-statistics.component";
7
+
8
+@NgModule({
9
+  declarations: [DeptOrderSourceStatisticsComponent],
10
+  imports: [CommonModule, DeptOrderSourceStatisticsRoutingModule, ShareModule],
11
+})
12
+export class DeptOrderSourceStatisticsModule {}

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

@@ -335,6 +335,30 @@ const routes: Routes = [
335 335
             (m) => m.InspectActiveModule
336 336
           ),
337 337
       },
338
+      {
339
+        // 建单来源统计
340
+        path: "orderSourceStatistics",
341
+        loadChildren: () =>
342
+          import(
343
+            "../order-source-statistics/order-source-statistics.module"
344
+          ).then((m) => m.OrderSourceStatisticsModule),
345
+      },
346
+      {
347
+        // 科室建单来源统计
348
+        path: "deptOrderSourceStatistics",
349
+        loadChildren: () =>
350
+          import(
351
+            "../dept-order-source-statistics/dept-order-source-statistics.module"
352
+          ).then((m) => m.DeptOrderSourceStatisticsModule),
353
+      },
354
+      {
355
+        // 任务类型建单来源统计
356
+        path: "tasktypeOrderSourceStatistics",
357
+        loadChildren: () =>
358
+          import(
359
+            "../tasktype-order-source-statistics/tasktype-order-source-statistics.module"
360
+          ).then((m) => m.TasktypeOrderSourceStatisticsModule),
361
+      },
338 362
     ],
339 363
   },
340 364
 ];

+ 13 - 0
src/app/views/order-source-statistics/order-source-statistics-routing.module.ts

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

+ 88 - 0
src/app/views/order-source-statistics/order-source-statistics.component.html

@@ -0,0 +1,88 @@
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"
32
+            nzPlaceHolder="请选择时间" [(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>
47
+          <tr class="thead">
48
+            <th nzWidth="5%">序号</th>
49
+            <th nzWidth="15%">时间</th>
50
+            <th nzWidth="10%">工单总量</th>
51
+            <th nzWidth="10%">标本数量</th>
52
+            <th nzWidth="10%">标本轮巡数量</th>
53
+            <th nzWidth="10%">患者陪检数量</th>
54
+            <th nzWidth="10%">药品数量</th>
55
+            <th nzWidth="10%">静配数量</th>
56
+            <th nzWidth="10%">患者转运数量</th>
57
+            <th nzWidth="10%">其他数量</th>
58
+          </tr>
59
+        </thead>
60
+        <tbody>
61
+          <tr *ngFor="let data of listOfData;let index=index;">
62
+            <td>{{index+(pageIndex-1)*10+1}}</td>
63
+            <td>{{ data.date }}</td>
64
+            <td>{{ data.total||0}}</td>
65
+            <td>{{data.speCount||0}}</td>
66
+            <td>{{data.spePlanCount||0}}</td>
67
+            <td>{{data.insCount||0}}</td>
68
+            <td>{{data.drugsCount||0}}</td>
69
+            <td>{{data.jpCount||0}}</td>
70
+            <td>{{data.transCount||0}}</td>
71
+            <td>{{data.otherCount||0}}</td>
72
+          </tr>
73
+        </tbody>
74
+      </nz-table>
75
+      <div class="list-template__pagination">
76
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
77
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
78
+        </nz-pagination>
79
+      </div>
80
+    </div>
81
+  </div>
82
+</div>
83
+<!-- 操作成功/失败提示框 -->
84
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
85
+  [info]="promptInfo"></app-prompt-modal>
86
+
87
+<!-- 查看详情 -->
88
+<router-outlet></router-outlet>

+ 91 - 0
src/app/views/order-source-statistics/order-source-statistics.component.less

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

+ 439 - 0
src/app/views/order-source-statistics/order-source-statistics.component.ts

@@ -0,0 +1,439 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { differenceInCalendarDays, endOfMonth, endOfYear } 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-order-source-statistics",
12
+  templateUrl: "./order-source-statistics.component.html",
13
+  styleUrls: ["./order-source-statistics.component.less"],
14
+})
15
+export class OrderSourceStatisticsComponent 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
+    // 不是从综合报表页面跳转过来的
97
+    // setTimeout(() => {
98
+    //   if (!sub['isStopped']) {
99
+    that.changeDateRange(that.defRange);
100
+    that.search();
101
+    //   }
102
+    // }, 100);
103
+  }
104
+  // 搜索
105
+  search(num?: number) {
106
+    if (this.hospital) {
107
+      this.searchData["hosId"] = this.hospital;
108
+    }
109
+    if (this.startDate) {
110
+      this.searchData["dateRange"] = {
111
+        start: this.startDate + " " + "00:00:00",
112
+        end: this.endDate + " " + "23:59:59",
113
+      };
114
+    }
115
+    if (num !== undefined) {
116
+      this.getList(num);
117
+    } else {
118
+      this.getList();
119
+    }
120
+  }
121
+  // 导出
122
+  loading2 = false;
123
+  export() {
124
+    let that = this;
125
+    let postData = {
126
+      hosId: that.hospital,
127
+      startTime: this.startDate + " " + "00:00:00",
128
+      endTime: this.endDate + " " + "23:59:59",
129
+      type: that.dateType,
130
+    };
131
+    this.loading2 = true;
132
+    that.mainService.exportReport("workOrder", postData).subscribe(
133
+      (data) => {
134
+        this.loading2 = false;
135
+        this.showPromptModal("导出", true, "");
136
+        var file = new Blob([data], {
137
+          type: "application/vnd.ms-excel",
138
+        });
139
+        //trick to download store a file having its URL
140
+        var fileURL = URL.createObjectURL(file);
141
+        var a = document.createElement("a");
142
+        a.href = fileURL;
143
+        a.target = "_blank";
144
+        a.download = "工单统计.xls";
145
+        document.body.appendChild(a);
146
+        a.click();
147
+      },
148
+      (err) => {
149
+        this.loading2 = false;
150
+        this.showPromptModal("导出", false, "");
151
+      }
152
+    );
153
+  }
154
+  // 重置
155
+  reset() {
156
+    this.changeDateType("day");
157
+    this.changeDateRange("1");
158
+    this.search();
159
+  }
160
+  // 表格数据
161
+  loading1 = false;
162
+  getList(num?: number) {
163
+    if (num !== undefined) {
164
+      this.pageIndex = num;
165
+    }
166
+    let postData = {
167
+      idx: this.pageIndex - 1,
168
+      sum: this.pageSize,
169
+      startTime: this.searchData.dateRange.start,
170
+      endTime: this.searchData.dateRange.end,
171
+      hosId: this.searchData.hosId,
172
+      type: this.dateType,
173
+    };
174
+    this.loading1 = true;
175
+    this.mainService
176
+      .postCustom("report", "workOrder", postData)
177
+      .subscribe((result) => {
178
+        this.loading1 = false;
179
+        this.listOfData = result.list || [];
180
+        this.listLength = result.totalNum;
181
+      });
182
+  }
183
+  // 获取院区
184
+  hospital: string; //选中院区
185
+  getAllHos() {
186
+    this.hospital = this.tool.getCurrentHospital().id + "";
187
+  }
188
+
189
+  // 修改时间展示维度
190
+  changeDateType(res) {
191
+    console.log(res, this.dateType);
192
+    this.dateType = res;
193
+    this.searchData["type"] = res;
194
+    console.log(this.searchData);
195
+    switch (res) {
196
+      case "day":
197
+        this.defRanges = [
198
+          {
199
+            label: "上周",
200
+            id: 1,
201
+          },
202
+          {
203
+            label: "上月",
204
+            id: 2,
205
+          },
206
+          {
207
+            label: "上年",
208
+            id: 3,
209
+          },
210
+        ]; //时间默认区间
211
+        this.defRange = "1"; //默认上周
212
+        this.changeDateRange("1");
213
+        break;
214
+      case "month":
215
+        this.defRanges = [
216
+          {
217
+            label: "上月",
218
+            id: 2,
219
+          },
220
+          {
221
+            label: "上年",
222
+            id: 3,
223
+          },
224
+        ]; //时间默认区间
225
+        this.defRange = "2"; //上月
226
+        this.changeDateRange("2");
227
+        break;
228
+      case "year":
229
+        this.defRanges = [
230
+          {
231
+            label: "上年",
232
+            id: 3,
233
+          },
234
+        ]; //时间默认区间
235
+        this.defRange = "3"; //默认上周
236
+        this.changeDateRange("3");
237
+        break;
238
+    }
239
+  }
240
+
241
+  // 禁选日期
242
+  disabledDate = (current: Date): boolean => {
243
+    // Can not select days before today and today
244
+    return differenceInCalendarDays(current, this.today) > 0;
245
+  };
246
+
247
+  // 禁选月份开始
248
+  disabledMonthStart = (current: Date): boolean => {
249
+    // Can not select days before today and today
250
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
251
+    let staEnd = differenceInCalendarDays(current, this.monthRangeEnd) > 0;
252
+    return cur || staEnd;
253
+  };
254
+  // 禁选月份结束
255
+  disabledMonthEnd = (current: Date): boolean => {
256
+    // Can not select days before today and today
257
+    let cur = differenceInCalendarDays(current, endOfMonth(this.today)) > 0;
258
+    let staEnd = differenceInCalendarDays(this.monthRangeStart, current) > 0;
259
+    return cur || staEnd;
260
+  };
261
+
262
+  // 禁选年份开始
263
+  disabledYearStart = (current: Date): boolean => {
264
+    // Can not select days before today and today
265
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
266
+    let staEnd = differenceInCalendarDays(current, this.yearRangeEnd) > 0;
267
+    return cur || staEnd;
268
+  };
269
+
270
+  // 禁选年份结束
271
+  disabledYearEnd = (current: Date): boolean => {
272
+    // Can not select days before today and today
273
+    let cur = differenceInCalendarDays(current, endOfYear(this.today)) > 0;
274
+    let staEnd = differenceInCalendarDays(this.yearRangeStart, current) > 0;
275
+    return cur || staEnd;
276
+  };
277
+
278
+  // 日期选择 日
279
+  startDate: string; //发起时间开始
280
+  endDate: string; //发起时间结束
281
+  changeDate(result?): void {
282
+    console.log(this.dateRange);
283
+    console.log(result);
284
+    this.dateRange = result;
285
+    if (!this.quick) {
286
+      // 不是快捷选择
287
+      this.defRange = null;
288
+    }
289
+    if (!result || !result.length) {
290
+      this.startDate = this.endDate = "";
291
+      return;
292
+    }
293
+    this.startDate =
294
+      result[0].getFullYear() +
295
+      "-" +
296
+      (result[0].getMonth() + 1) +
297
+      "-" +
298
+      result[0].getDate();
299
+    this.endDate =
300
+      result[1].getFullYear() +
301
+      "-" +
302
+      (result[1].getMonth() + 1) +
303
+      "-" +
304
+      result[1].getDate();
305
+  }
306
+
307
+  // 月份选择
308
+  changeMonthStart(result?) {
309
+    console.log(result);
310
+    this.monthRangeStart = result;
311
+    if (!this.quick) {
312
+      // 不是快捷选择
313
+      this.defRange = null;
314
+    }
315
+    if (!result) {
316
+      this.startDate = this.endDate = "";
317
+      return;
318
+    }
319
+    this.startDate =
320
+      result.getFullYear() + "-" + (result.getMonth() + 1) + "-01";
321
+    // this.endDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
322
+  }
323
+  changeMonthEnd(result?) {
324
+    console.log(result);
325
+    this.monthRangeEnd = result;
326
+    if (!this.quick) {
327
+      // 不是快捷选择
328
+      this.defRange = null;
329
+    }
330
+    if (!result) {
331
+      this.startDate = this.endDate = "";
332
+      return;
333
+    }
334
+    // this.startDate = result.getFullYear() + '-' + (result.getMonth() + 1) + '-01';
335
+    this.endDate = result.getFullYear() + "-" + (result.getMonth() + 1) + "-31";
336
+  }
337
+  // 年份选择
338
+  changeYearStart(result?) {
339
+    console.log(result);
340
+    this.yearRangeStart = result;
341
+    if (!this.quick) {
342
+      // 不是快捷选择
343
+      this.defRange = null;
344
+    }
345
+    if (!result) {
346
+      this.startDate = this.endDate = "";
347
+      return;
348
+    }
349
+    this.startDate = result.getFullYear() + "-01-01";
350
+    // this.endDate = result.getFullYear() + '-01-01';
351
+  }
352
+  changeYearEnd(result?) {
353
+    console.log(result);
354
+    this.yearRangeEnd = result;
355
+    if (!this.quick) {
356
+      // 不是快捷选择
357
+      this.defRange = null;
358
+    }
359
+    if (!result) {
360
+      this.startDate = this.endDate = "";
361
+      return;
362
+    }
363
+    this.endDate = result.getFullYear() + "-12-31";
364
+  }
365
+
366
+  // 日期选择 快速修改时间区间
367
+  today = new Date();
368
+  quick: boolean = false;
369
+  changeDateRange(res) {
370
+    console.log(res);
371
+    this.quick = true;
372
+    switch (res) {
373
+      case "1":
374
+        // 上周
375
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
376
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
377
+        console.log(lastweekstartdate, lastweekenddate);
378
+        this.changeDate([lastweekstartdate, lastweekenddate]);
379
+        break;
380
+      case "2":
381
+        // 上月
382
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
383
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
384
+        console.log(lastmonthstartdate, lastmonthenddate);
385
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
386
+        this.changeMonthStart(lastmonthstartdate);
387
+        this.changeMonthEnd(lastmonthenddate);
388
+        break;
389
+      case "3":
390
+        // 上年
391
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
392
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
393
+        console.log(lastyearstartdate, lastyearenddate);
394
+        this.changeDate([lastyearstartdate, lastyearenddate]);
395
+        this.changeMonthStart(lastyearstartdate);
396
+        this.changeMonthEnd(lastyearenddate);
397
+        this.changeYearStart(lastyearstartdate);
398
+        this.changeYearEnd(lastyearenddate);
399
+        break;
400
+    }
401
+    this.quick = false;
402
+  }
403
+
404
+  // 更多
405
+  toMore(type) {
406
+    let sendData = this.searchData;
407
+    console.log(sendData);
408
+    this.myService.sendMsg(sendData);
409
+    this.router.navigateByUrl("/main/" + type);
410
+  }
411
+
412
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
413
+  showPromptModal(con, success, promptInfo?) {
414
+    this.promptModalShow = false;
415
+    this.promptContent = con;
416
+    this.ifSuccess = success;
417
+    this.promptInfo = promptInfo;
418
+    setTimeout(() => {
419
+      this.promptModalShow = true;
420
+    }, 100);
421
+  }
422
+
423
+  // 边输入边搜索节流阀
424
+  isLoading: boolean = false;
425
+  searchTimer(fun, e, those) {
426
+    let that = this;
427
+    that.isLoading = true;
428
+    fun(e, those);
429
+  }
430
+
431
+  // 截取意见内容(ie内核截取)
432
+  spliceContent(con) {
433
+    if (con.length >= 41 && navigator.userAgent.indexOf("Trident") > -1) {
434
+      return con.slice(0, 20) + "...";
435
+    } else {
436
+      return con;
437
+    }
438
+  }
439
+}

+ 17 - 0
src/app/views/order-source-statistics/order-source-statistics.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { OrderSourceStatisticsRoutingModule } from './order-source-statistics-routing.module';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+import { OrderSourceStatisticsComponent } from './order-source-statistics.component';
7
+
8
+
9
+@NgModule({
10
+  declarations: [OrderSourceStatisticsComponent],
11
+  imports: [
12
+    CommonModule,
13
+    OrderSourceStatisticsRoutingModule,
14
+    ShareModule
15
+  ]
16
+})
17
+export class OrderSourceStatisticsModule { }

+ 13 - 0
src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics-routing.module.ts

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

+ 1 - 0
src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.component.html

@@ -0,0 +1 @@
1
+<p>tasktype-order-source-statistics works!</p>

+ 0 - 0
src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.component.less


+ 15 - 0
src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.component.ts

@@ -0,0 +1,15 @@
1
+import { Component, OnInit } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'app-tasktype-order-source-statistics',
5
+  templateUrl: './tasktype-order-source-statistics.component.html',
6
+  styleUrls: ['./tasktype-order-source-statistics.component.less']
7
+})
8
+export class TasktypeOrderSourceStatisticsComponent implements OnInit {
9
+
10
+  constructor() { }
11
+
12
+  ngOnInit() {
13
+  }
14
+
15
+}

+ 16 - 0
src/app/views/tasktype-order-source-statistics/tasktype-order-source-statistics.module.ts

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