seimin 3 gadi atpakaļ
vecāks
revīzija
cec0acaec6

+ 25 - 0
src/app/views/inspect-active/inspect-active-routing.module.ts

@@ -0,0 +1,25 @@
1
+import { NgModule } from "@angular/core";
2
+import { Routes, RouterModule } from "@angular/router";
3
+import { InspectActiveComponent } from './inspect-active.component';
4
+
5
+const routes: Routes = [
6
+  {
7
+    path: "",
8
+    component: InspectActiveComponent,
9
+    children: [
10
+      {
11
+        path: "workerStatisticsDetail/:workerId/:startTime/:endTime/:groupId", //id是workid,startTime是开始时间,endTime是结束时间,groupId是组ID
12
+        loadChildren: () =>
13
+          import(
14
+            "../worker-statistics-detail/worker-statistics-detail.module"
15
+          ).then((m) => m.WorkerStatisticsDetailModule),
16
+      },
17
+    ],
18
+  },
19
+];
20
+
21
+@NgModule({
22
+  imports: [RouterModule.forChild(routes)],
23
+  exports: [RouterModule],
24
+})
25
+export class InspectActiveRoutingModule {}

+ 93 - 0
src/app/views/inspect-active/inspect-active.component.html

@@ -0,0 +1,93 @@
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
+          <span class="label">发起时间</span>:
7
+          <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]='false' (ngModelChange)="changeDate($event)">
8
+          </nz-range-picker>
9
+          <br />
10
+        </div>
11
+        <div class="list-template__searchItem ml8">
12
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
13
+            nzPlaceHolder="请选择时间" [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
14
+            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
15
+          </nz-select>
16
+        </div>
17
+        <!-- <div class="list-template__searchItem">
18
+          <span class="label">支助人员</span>:
19
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
20
+            nzPlaceHolder="请选择支助人员" [ngModel]="group" (ngModelChange)="searchGroup($event)">
21
+            <nz-option nzLabel="全部" nzValue="0"></nz-option>
22
+            <nz-option nzLabel="{{data.groupName}}" nzValue="{{data.id}}" *ngFor="let data of workerList"></nz-option>
23
+          </nz-select>
24
+        </div> -->
25
+        <div class="list-template__searchItem">
26
+          <span class="label">支助人员</span>:
27
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
28
+            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择支助人员" [(ngModel)]="worker">
29
+            <ng-container *ngFor="let option of allWorker">
30
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
31
+            </ng-container>
32
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
33
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
34
+            </nz-option>
35
+          </nz-select>
36
+        </div>
37
+      </div>
38
+      <div nz-col nzXl='6' class="list-template__btns">
39
+        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
40
+        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
41
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
42
+      </div>
43
+    </div>
44
+    <div class="list-template__bottom">
45
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
46
+        [nzLoading]="loading1">
47
+        <thead>
48
+          <tr class="thead">
49
+            <th nzWidth="5%">序号</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="15%">按时完成达标率</th>
56
+            <th nzWidth="10%">平均到达时间</th>
57
+            <th nzWidth="10%">平均完成时间</th>
58
+            <th nzWidth="10%">操作</th>
59
+          </tr>
60
+        </thead>
61
+        <tbody>
62
+          <tr *ngFor="let data of listOfData;let index=index;">
63
+            <td>{{index+(pageIndex-1)*10+1}}</td>
64
+            <td>{{ data.name }}</td>
65
+            <td>{{ data.total||0}}</td>
66
+            <td>{{data.order||0}}</td>
67
+            <td>{{data.num||0}}</td>
68
+            <td>{{data.specialCloseNum}}</td>
69
+            <td>{{data.avePer+'%'}}</td>
70
+            <td>{{data.arriveTime}}</td>
71
+            <td>{{data.completeTime}}</td>
72
+            <td>
73
+              <div class="coop">
74
+                <span *ngIf="coopBtns.look" (click)="personDetail(data.workerId)">查看</span>
75
+              </div>
76
+            </td>
77
+          </tr>
78
+        </tbody>
79
+      </nz-table>
80
+      <div class="list-template__pagination">
81
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
82
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
83
+        </nz-pagination>
84
+      </div>
85
+    </div>
86
+  </div>
87
+</div>
88
+<!-- 操作成功/失败提示框 -->
89
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
90
+  [info]="promptInfo"></app-prompt-modal>
91
+
92
+<!-- 查看详情 -->
93
+<router-outlet></router-outlet>

+ 91 - 0
src/app/views/inspect-active/inspect-active.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
+}

+ 309 - 0
src/app/views/inspect-active/inspect-active.component.ts

@@ -0,0 +1,309 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+
4
+import { MainService } from "../../services/main.service";
5
+import { DateService } from "../../services/date.service";
6
+import { MyServiceService } from "../../services/my-service.service";
7
+import { ToolService } from "../../services/tool.service";
8
+import { Subject } from "rxjs";
9
+import { debounceTime } from "rxjs/operators";
10
+
11
+@Component({
12
+  selector: "app-inspect-active",
13
+  templateUrl: "./inspect-active.component.html",
14
+  styleUrls: ["./inspect-active.component.less"],
15
+})
16
+export class InspectActiveComponent implements OnInit {
17
+  constructor(
18
+    private route: ActivatedRoute,
19
+    private router: Router,
20
+    private mainService: MainService,
21
+    private dateService: DateService,
22
+    private myService: MyServiceService,
23
+    private tool: ToolService
24
+  ) {}
25
+  searchTimerSubject = new Subject();
26
+  ngOnInit() {
27
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
28
+      this.getAllWorker(v);
29
+    });
30
+    this.getSearchData();
31
+    this.coopBtns = this.tool.initCoopBtns(this.route);
32
+    this.getAllHos();
33
+  }
34
+
35
+  defRange = "1"; //默认上周
36
+  defRanges = [
37
+    {
38
+      label: "上周",
39
+      id: 1,
40
+    },
41
+    {
42
+      label: "上月",
43
+      id: 2,
44
+    },
45
+    {
46
+      label: "上年",
47
+      id: 3,
48
+    },
49
+  ]; //时间默认区间
50
+
51
+  listOfData: any[] = []; //表格数据
52
+  pageIndex: number = 1; //表格当前页码
53
+  pageSize: number = 10; //表格每页展示条数
54
+  listLength: number = 10; //表格总数据量
55
+
56
+  dateRange: any = []; //发起时间区间 天
57
+
58
+  promptContent: string; //操作提示框提示信息
59
+  ifSuccess: boolean; //操作成功/失败
60
+  promptInfo: string; //操作结果提示信息
61
+  promptModalShow: boolean; //操作提示框是否展示
62
+
63
+  // 初始化增删改按钮
64
+  coopBtns: any = {};
65
+  searchData: any = {}; // 综合统计页面带过来的参数
66
+  getSearchData() {
67
+    let that = this;
68
+    let sub = that.myService.getMsg().subscribe((msg) => {
69
+      // 从综合报表跳转过来
70
+      that.searchData = msg;
71
+      console.log(that.searchData);
72
+      console.log(66);
73
+      sub.unsubscribe(); //取消订阅,否则订阅函数会累加执行
74
+      that.hospital = that.searchData["hosId"];
75
+      that.changeDate(that.searchData["range"]);
76
+      that.defRange = that.searchData["defRange"];
77
+      that.search();
78
+    });
79
+    // 不是从综合报表页面跳转过来的
80
+    setTimeout(() => {
81
+      if (!sub["isStopped"]) {
82
+        that.changeDateRange(that.defRange);
83
+        that.search();
84
+      }
85
+    }, 100);
86
+  }
87
+  // 搜索
88
+  search(num?: number) {
89
+    if (this.hospital) {
90
+      this.searchData["hosId"] = this.hospital;
91
+    }
92
+    if (this.startDate) {
93
+      this.searchData["dateRange"] = {
94
+        start: this.startDate + " " + "00:00:00",
95
+        end: this.endDate + " " + "23:59:59",
96
+      };
97
+    }
98
+    if (num !== undefined) {
99
+      this.getList(num);
100
+    } else {
101
+      this.getList();
102
+    }
103
+  }
104
+  // 导出
105
+  loading2 = false;
106
+  export() {
107
+    let that = this;
108
+    let postData = {
109
+      hosId: that.hospital,
110
+      startTime: this.startDate + " " + "00:00:00",
111
+      endTime: this.endDate + " " + "23:59:59",
112
+      groupId: that.group || "",
113
+    };
114
+    this.loading2 = true;
115
+    that.mainService.exportReport("user", postData).subscribe(
116
+      (data) => {
117
+        this.loading2 = false;
118
+        this.showPromptModal("导出", true, "");
119
+        var file = new Blob([data], {
120
+          type: "application/vnd.ms-excel",
121
+        });
122
+        //trick to download store a file having its URL
123
+        var fileURL = URL.createObjectURL(file);
124
+        var a = document.createElement("a");
125
+        a.href = fileURL;
126
+        a.target = "_blank";
127
+        a.download = "支助人员统计.xls";
128
+        document.body.appendChild(a);
129
+        a.click();
130
+      },
131
+      (err) => {
132
+        this.loading2 = false;
133
+        this.showPromptModal("导出", false, "");
134
+      }
135
+    );
136
+  }
137
+  // 重置
138
+  reset() {
139
+    this.changeDateRange("1");
140
+    this.group = null;
141
+    this.search();
142
+  }
143
+  // 表格数据
144
+  loading1 = false;
145
+  getList(num?: number) {
146
+    if (num !== undefined) {
147
+      this.pageIndex = num;
148
+    }
149
+    let postData = {
150
+      idx: this.pageIndex - 1,
151
+      sum: this.pageSize,
152
+      startTime: this.searchData.dateRange.start,
153
+      endTime: this.searchData.dateRange.end,
154
+      hosId: this.searchData.hosId,
155
+      groupId: this.group || "",
156
+    };
157
+    this.loading1 = true;
158
+    this.mainService
159
+      .postCustom("report", "user", postData)
160
+      .subscribe((result) => {
161
+        this.loading1 = false;
162
+        this.listOfData = result.list || [];
163
+        this.listLength = result.totalNum;
164
+      });
165
+  }
166
+  // 获取院区/分组
167
+  hospital: string; //选中院区
168
+  group: string; //选中组
169
+  allWorker: any = []; //支助人员列表
170
+  getAllHos() {
171
+    this.hospital = this.tool.getCurrentHospital().id + "";
172
+    this.getAllWorker();
173
+  }
174
+  // 用户输入搜索支助人员
175
+  changeUser(e = "") {
176
+    this.isLoading = true;
177
+    this.searchTimerSubject.next(e);
178
+  }
179
+  // 获取支助人员列表
180
+  worker: number; //选中的支助人员
181
+  isLoading = false;
182
+  getAllWorker(e: any = "") {
183
+    let postData = {
184
+      user: {
185
+        name: e || "",
186
+        hospital: { id: this.hospital },
187
+        usertype: { id: 106 }, //支助人员
188
+      },
189
+      idx: 0,
190
+      sum: 10,
191
+    };
192
+    this.isLoading = true;
193
+    this.mainService
194
+      .getFetchDataList("data", "user", postData)
195
+      .subscribe((data) => {
196
+        this.allWorker = data.list;
197
+        this.isLoading = false;
198
+      });
199
+  }
200
+
201
+  // 日期选择 日
202
+  startDate: string; //发起时间开始
203
+  endDate: string; //发起时间结束
204
+  changeDate(result?): void {
205
+    console.log(this.dateRange);
206
+    console.log(result);
207
+    this.dateRange = result;
208
+    if (!this.quick) {
209
+      // 不是快捷选择
210
+      this.defRange = null;
211
+    }
212
+    if (!result || !result.length) {
213
+      this.startDate = this.endDate = "";
214
+      return;
215
+    }
216
+    this.startDate =
217
+      result[0].getFullYear() +
218
+      "-" +
219
+      (result[0].getMonth() + 1) +
220
+      "-" +
221
+      result[0].getDate();
222
+    this.endDate =
223
+      result[1].getFullYear() +
224
+      "-" +
225
+      (result[1].getMonth() + 1) +
226
+      "-" +
227
+      result[1].getDate();
228
+    this.search();
229
+  }
230
+  // 修改搜素条件工作组
231
+  searchGroup(e) {
232
+    this.group = e;
233
+    this.search();
234
+  }
235
+  // 日期选择 快速修改时间区间
236
+  nowdate = new Date();
237
+  quick: boolean = false;
238
+  changeDateRange(res) {
239
+    this.defRange = res;
240
+    console.log(res);
241
+    this.quick = true;
242
+    switch (res) {
243
+      case "1":
244
+        // 上周
245
+        let lastweekstartdate = this.dateService.date().lastWeekStartDate;
246
+        let lastweekenddate = this.dateService.date().lastWeekEndDate;
247
+        console.log(lastweekstartdate, lastweekenddate);
248
+        this.changeDate([lastweekstartdate, lastweekenddate]);
249
+        break;
250
+      case "2":
251
+        // 上月
252
+        let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
253
+        let lastmonthenddate = this.dateService.date().lastMonthEndDate;
254
+        console.log(lastmonthstartdate, lastmonthenddate);
255
+        this.changeDate([lastmonthstartdate, lastmonthenddate]);
256
+        break;
257
+      case "3":
258
+        // 上年
259
+        let lastyearstartdate = this.dateService.date().lastYearStartDate;
260
+        let lastyearenddate = this.dateService.date().lastYearEndDate;
261
+        console.log(lastyearstartdate, lastyearenddate);
262
+        this.changeDate([lastyearstartdate, lastyearenddate]);
263
+        break;
264
+    }
265
+    this.quick = false;
266
+  }
267
+
268
+  // 更多
269
+  toMore(type) {
270
+    let sendData = this.searchData;
271
+    console.log(sendData);
272
+    this.myService.sendMsg(sendData);
273
+    this.router.navigateByUrl("/main/" + type);
274
+  }
275
+
276
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
277
+  showPromptModal(con, success, promptInfo?) {
278
+    this.promptModalShow = false;
279
+    this.promptContent = con;
280
+    this.ifSuccess = success;
281
+    this.promptInfo = promptInfo;
282
+    setTimeout(() => {
283
+      this.promptModalShow = true;
284
+    }, 100);
285
+  }
286
+
287
+  // 边输入边搜索节流阀
288
+  searchTimer(fun, e, those) {
289
+    fun(e, those);
290
+  }
291
+
292
+  // 截取意见内容(ie内核截取)
293
+  spliceContent(con) {
294
+    if (con.length >= 41 && navigator.userAgent.indexOf("Trident") > -1) {
295
+      return con.slice(0, 20) + "...";
296
+    } else {
297
+      return con;
298
+    }
299
+  }
300
+  //获取支助人员工单详情列表
301
+  personDetail(workerId) {
302
+    let startDate = this.startDate + " " + "00:00:00";
303
+    let endDate = this.endDate + " " + "23:59:59";
304
+    let group = this.group || "null";
305
+    this.router.navigateByUrl(
306
+      `/main/workerStatistics/workerStatisticsDetail/${workerId}/${startDate}/${endDate}/${group}`
307
+    );
308
+  }
309
+}

+ 12 - 0
src/app/views/inspect-active/inspect-active.module.ts

@@ -0,0 +1,12 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { InspectActiveRoutingModule } from "./inspect-active-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { InspectActiveComponent } from "./inspect-active.component";
7
+
8
+@NgModule({
9
+  declarations: [InspectActiveComponent],
10
+  imports: [CommonModule, InspectActiveRoutingModule, ShareModule],
11
+})
12
+export class InspectActiveModule {}

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

@@ -303,6 +303,14 @@ const routes: Routes = [
303 303
             (m) => m.InspectAutoModule
304 304
           ),
305 305
       },
306
+      {
307
+        // 人员检查主动服务统计
308
+        path: "inspectActive",
309
+        loadChildren: () =>
310
+          import("../inspect-active/inspect-active.module").then(
311
+            (m) => m.InspectActiveModule
312
+          ),
313
+      },
306 314
     ],
307 315
   },
308 316
 ];