瀏覽代碼

支助人员统计导出修改

seimin 3 年之前
父節點
當前提交
e19762646f

+ 42 - 0
src/app/share/excel-export/excel-export.component.html

@@ -0,0 +1,42 @@
1
+<div
2
+  class="save add display_flex align-items_center justify-content_flex-center"
3
+  *ngIf="isShow"
4
+>
5
+  <div class="modalBody">
6
+    <div class="title">
7
+      选择导出方式<i
8
+        class="icon_transport transport-guanbi"
9
+        (click)="hideModal()"
10
+      ></i>
11
+    </div>
12
+    <div class="content">
13
+      <div>
14
+        <label nz-checkbox [(ngModel)]="isGroup">是否按组导出</label>
15
+      </div>
16
+      <div class="isNumOrIntegral">
17
+        <nz-radio-group [(ngModel)]="isNumOrIntegral">
18
+          <label nz-radio nzValue="A">按工单数量排序</label>
19
+          <label nz-radio nzValue="B">按积分排序</label>
20
+        </nz-radio-group>
21
+      </div>
22
+    </div>
23
+    <div class="display_flex justify-content_flex-center">
24
+      <button
25
+        nzType="primary"
26
+        nz-button
27
+        (click)="submitForm()"
28
+        [nzLoading]="loading"
29
+      >
30
+        确认导出
31
+      </button>
32
+      <button
33
+        class="btn cancel"
34
+        nz-button
35
+        nzType="default"
36
+        (click)="hideModal()"
37
+      >
38
+        取消
39
+      </button>
40
+    </div>
41
+  </div>
42
+</div>

+ 74 - 0
src/app/share/excel-export/excel-export.component.less

@@ -0,0 +1,74 @@
1
+.save {
2
+  position: fixed;
3
+  left: 0;
4
+  top: 0;
5
+  width: 100%;
6
+  height: 100%;
7
+  background: rgba(0, 0, 0, 0.4);
8
+  z-index: 999;
9
+  .modalBody {
10
+    width: 350px;
11
+    background: #fff;
12
+    border-radius: 5px;
13
+    padding: 10px 20px;
14
+    color: #333;
15
+
16
+    .title {
17
+      width: 100%;
18
+      text-align: center;
19
+      font-size: 18px;
20
+      position: relative;
21
+
22
+      i {
23
+        position: absolute;
24
+        right: 0;
25
+        top: 0;
26
+        font-size: 20px;
27
+        color: #666;
28
+        cursor: pointer;
29
+        padding: 0 5px;
30
+      }
31
+    }
32
+
33
+    .content {
34
+      width: 100%;
35
+      height: 117px;
36
+      background: #f9fafb;
37
+      border: 1px solid #e5e9ed;
38
+      border-radius: 5px;
39
+      overflow: hidden;
40
+      margin-top: 12px;
41
+    }
42
+
43
+    button {
44
+      margin-top: 10px;
45
+
46
+      &.btn {
47
+        margin-left: 8px;
48
+      }
49
+    }
50
+  }
51
+
52
+  // 新增
53
+  &.add {
54
+    .modalBody {
55
+      width: 330px;
56
+      height: auto;
57
+
58
+      .content {
59
+        width: 100%;
60
+        height: auto;
61
+        padding: 19px 14px 0 14px;
62
+        max-height: 500px;
63
+        overflow-y: auto;
64
+        .isNumOrIntegral {
65
+          margin: 24px 0;
66
+        }
67
+      }
68
+
69
+      button:nth-child(1) {
70
+        margin-right: 20px;
71
+      }
72
+    }
73
+  }
74
+}

+ 29 - 0
src/app/share/excel-export/excel-export.component.ts

@@ -0,0 +1,29 @@
1
+import { Component, OnInit, Output, Input } from "@angular/core";
2
+import { EventEmitter } from "@angular/core";
3
+
4
+@Component({
5
+  selector: "app-excel-export",
6
+  templateUrl: "./excel-export.component.html",
7
+  styleUrls: ["./excel-export.component.less"],
8
+})
9
+export class ExcelExportComponent implements OnInit {
10
+  @Output() submitFormHand = new EventEmitter();
11
+  @Output() hideFormHand = new EventEmitter();
12
+  @Input() isShow: boolean = false; //模态框
13
+  @Input() loading: boolean = false; //确定按钮的loading
14
+  deptList = []; //护理单元科室列表
15
+  isGroup = false; //是否按组导出
16
+  isNumOrIntegral = "A";
17
+  constructor() {}
18
+
19
+  ngOnInit() {}
20
+  // 隐藏模态框
21
+  hideModal() {
22
+    this.hideFormHand.emit();
23
+  }
24
+  // 表单提交
25
+  submitForm(): void {
26
+    this.submitFormHand.emit({isGroup:this.isGroup,isNumOrIntegral:this.isNumOrIntegral});
27
+    this.hideModal();
28
+  }
29
+}

+ 3 - 0
src/app/share/share.module.ts

@@ -28,6 +28,7 @@ import { CollapseComponent } from './collapse/collapse.component';
28 28
 import { CollapsePanelComponent } from './collapse-panel/collapse-panel.component';
29 29
 import { HtmlTransformPipe } from '../pipes/html-transform.pipe';
30 30
 import { BxPromptModalComponent } from './bx-prompt-modal/bx-prompt-modal.component';
31
+import { ExcelExportComponent } from './excel-export/excel-export.component';
31 32
 
32 33
 @NgModule({
33 34
   declarations: [
@@ -54,6 +55,7 @@ import { BxPromptModalComponent } from './bx-prompt-modal/bx-prompt-modal.compon
54 55
     CollapseComponent,
55 56
     CollapsePanelComponent,
56 57
     HtmlTransformPipe,
58
+    ExcelExportComponent,
57 59
   ],
58 60
   imports: [
59 61
     CommonModule,
@@ -95,6 +97,7 @@ import { BxPromptModalComponent } from './bx-prompt-modal/bx-prompt-modal.compon
95 97
     CollapseComponent,
96 98
     CollapsePanelComponent,
97 99
     HtmlTransformPipe,
100
+    ExcelExportComponent,
98 101
   ]
99 102
 })
100 103
 export class ShareModule { }

+ 4 - 1
src/app/views/worker-statistics-detail/worker-statistics-detail.component.html

@@ -1,6 +1,9 @@
1 1
 <div class="detail">
2 2
   <div class="title">
3
-    工单详情
3
+    <div>
4
+      工单详情
5
+      <label class="isFiveOrder" nz-checkbox [ngModel]="isFiveOrder" (ngModelChange)="changeIsFiveOrder($event)">执行时长五分钟以内工单</label>
6
+    </div>
4 7
     <i class="icon_transport transport-guanbi" (click)="close()"></i>
5 8
   </div>
6 9
   <div class="box">

+ 4 - 0
src/app/views/worker-statistics-detail/worker-statistics-detail.component.less

@@ -24,6 +24,10 @@
24 24
   position: relative;
25 25
   padding-bottom: 70px;
26 26
 
27
+  .isFiveOrder{
28
+    margin-left: 24px;
29
+  }
30
+
27 31
   .title {
28 32
     font-size: 18px;
29 33
     text-align: center;

+ 62 - 35
src/app/views/worker-statistics-detail/worker-statistics-detail.component.ts

@@ -1,26 +1,33 @@
1
-import { Component, OnInit } from '@angular/core';
2
-import { ActivatedRoute, Router } from '@angular/router';
3
-import { NzMessageService } from 'ng-zorro-antd';
4
-import { MainService } from 'src/app/services/main.service';
5
-import { ToolService } from 'src/app/services/tool.service';
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { NzMessageService } from "ng-zorro-antd";
4
+import { MainService } from "src/app/services/main.service";
5
+import { ToolService } from "src/app/services/tool.service";
6 6
 
7 7
 @Component({
8
-  selector: 'app-worker-statistics-detail',
9
-  templateUrl: './worker-statistics-detail.component.html',
10
-  styleUrls: ['./worker-statistics-detail.component.less'],
8
+  selector: "app-worker-statistics-detail",
9
+  templateUrl: "./worker-statistics-detail.component.html",
10
+  styleUrls: ["./worker-statistics-detail.component.less"],
11 11
 })
12 12
 export class WorkerStatisticsDetailComponent implements OnInit {
13
-  loading1 = false;//获取选中支助人员的工单列表loading
14
-  hosId;//当前院区id
15
-  currentPersonId;//当前支助人员id
16
-  startTime;//当前开始时间
17
-  endTime;//当前结束时间
18
-  groupId;//当前组ID
19
-  listOfData = [];//获取选中支助人员的工单列表
20
-  pageIndex: number = 1;//页码
21
-  listLength: number = 0;//总数据条目数
22
-  pageSize: number = 10;//每页条数
23
-  constructor(private mainService: MainService, private tool: ToolService, private message: NzMessageService, private route: ActivatedRoute, private router: Router) { }
13
+  loading1 = false; //获取选中支助人员的工单列表loading
14
+  hosId; //当前院区id
15
+  currentPersonId; //当前支助人员id
16
+  startTime; //当前开始时间
17
+  endTime; //当前结束时间
18
+  groupId; //当前组ID
19
+  listOfData = []; //获取选中支助人员的工单列表
20
+  pageIndex: number = 1; //页码
21
+  listLength: number = 0; //总数据条目数
22
+  pageSize: number = 10; //每页条数
23
+  isFiveOrder: boolean = false; //是否执行时长五分钟以内工单
24
+  constructor(
25
+    private mainService: MainService,
26
+    private tool: ToolService,
27
+    private message: NzMessageService,
28
+    private route: ActivatedRoute,
29
+    private router: Router
30
+  ) {}
24 31
 
25 32
   ngOnInit() {
26 33
     this.hosId = this.tool.getCurrentHospital().id;
@@ -30,37 +37,57 @@ export class WorkerStatisticsDetailComponent implements OnInit {
30 37
     this.groupId = this.route.snapshot.params.groupId;
31 38
     this.getOrdersByPerson(this.hosId, this.currentPersonId);
32 39
   }
40
+  // 是否剖执行时长五分钟以内工单
41
+  changeIsFiveOrder(e: boolean) {
42
+    if (e) {
43
+      this.getOrdersByPerson(this.hosId, this.currentPersonId, e);
44
+    } else {
45
+      this.getOrdersByPerson(this.hosId, this.currentPersonId);
46
+    }
47
+  }
33 48
   //获取选中支助人员的工单列表
34
-  getOrdersByPerson(hosId: number, currentPersonId: number) {
49
+  getOrdersByPerson(
50
+    hosId: number,
51
+    currentPersonId: number,
52
+    isFiveOrder: boolean = false
53
+  ) {
35 54
     this.loading1 = true;
36
-    let postData = {
55
+    let postData:any = {
37 56
       idx: this.pageIndex - 1,
38 57
       sum: this.pageSize,
39 58
       startTime: this.startTime,
40 59
       endTime: this.endTime,
41 60
       hosId,
42
-      groupId: this.groupId == 'null' ? '' : this.groupId,
61
+      groupId: this.groupId == "null" ? "" : this.groupId,
43 62
       worker: currentPersonId,
63
+    };
64
+    if(isFiveOrder){
65
+      postData.difLong = true;
44 66
     }
45
-    this.mainService.postCustom('report', 'userDetails', postData).subscribe(result => {
46
-      this.loading1 = false;
47
-      if (result.status == 200) {
48
-        this.listOfData = result.list;
49
-        this.listLength = result.totalNum;
50
-      } else {
51
-        this.message.error('获取数据失败');
67
+    this.mainService.postCustom("report", "userDetails", postData).subscribe(
68
+      (result) => {
69
+        this.loading1 = false;
70
+        if (result.status == 200) {
71
+          this.listOfData = result.list;
72
+          this.listLength = result.totalNum;
73
+        } else {
74
+          this.message.error("获取数据失败");
75
+        }
76
+      },
77
+      (err) => {
78
+        this.loading1 = false;
79
+        this.message.error("获取数据失败");
52 80
       }
53
-    }, err => {
54
-      this.loading1 = false;
55
-      this.message.error('获取数据失败');
56
-    })
81
+    );
57 82
   }
58 83
   //查看积分详情
59 84
   integralDetail(obj) {
60
-    this.router.navigateByUrl(`/main/workerStatistics/workerStatisticsDetail/${this.currentPersonId}/${this.startTime}/${this.endTime}/${this.groupId}/orderDetail/${obj.id}/3`);
85
+    this.router.navigateByUrl(
86
+      `/main/workerStatistics/workerStatisticsDetail/${this.currentPersonId}/${this.startTime}/${this.endTime}/${this.groupId}/orderDetail/${obj.id}/3`
87
+    );
61 88
   }
62 89
   //关闭
63 90
   close() {
64
-    this.router.navigateByUrl('/main/workerStatistics');
91
+    this.router.navigateByUrl("/main/workerStatistics");
65 92
   }
66 93
 }

+ 90 - 35
src/app/views/worker-statistics/worker-statistics.component.html

@@ -1,81 +1,136 @@
1 1
 <div class="list-template">
2 2
   <div class="list-template__content">
3 3
     <div class="list-template__top" nz-row>
4
-      <div nz-col nzXl='18' class="list-template__searchBox">
4
+      <div nz-col nzXl="18" class="list-template__searchBox">
5 5
         <div class="list-template__searchItem">
6 6
           <span class="label">发起时间</span>:
7
-          <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]='false' (ngModelChange)="changeDate($event)">
7
+          <nz-range-picker
8
+            [(ngModel)]="dateRange"
9
+            [nzAllowClear]="false"
10
+            (ngModelChange)="changeDate($event)"
11
+          >
8 12
           </nz-range-picker>
9 13
           <br />
10 14
         </div>
11 15
         <div class="list-template__searchItem ml8">
12
-          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择时间"
13
-            [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
14
-            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
16
+          <nz-select
17
+            class="formItem"
18
+            [nzDropdownMatchSelectWidth]="false"
19
+            [nzShowSearch]="false"
20
+            nzPlaceHolder="请选择时间"
21
+            [(ngModel)]="defRange"
22
+            (ngModelChange)="changeDateRange($event)"
23
+          >
24
+            <nz-option
25
+              nzLabel="{{ data.label }}"
26
+              nzValue="{{ data.id }}"
27
+              *ngFor="let data of defRanges"
28
+            ></nz-option>
15 29
           </nz-select>
16 30
         </div>
17 31
         <div class="list-template__searchItem">
18 32
           <span class="label">分组</span>:
19
-          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择分组"
20
-            [ngModel]="group" (ngModelChange)="searchGroup($event)">
33
+          <nz-select
34
+            class="formItem"
35
+            [nzDropdownMatchSelectWidth]="false"
36
+            [nzShowSearch]="false"
37
+            nzPlaceHolder="请选择分组"
38
+            [ngModel]="group"
39
+            (ngModelChange)="searchGroup($event)"
40
+          >
21 41
             <nz-option nzLabel="全部" [nzValue]="0"></nz-option>
22
-            <nz-option nzLabel="{{data.groupName}}" nzValue="{{data.id}}" *ngFor="let data of groupList"></nz-option>
42
+            <nz-option
43
+              nzLabel="{{ data.groupName }}"
44
+              nzValue="{{ data.id }}"
45
+              *ngFor="let data of groupList"
46
+            ></nz-option>
23 47
           </nz-select>
24 48
         </div>
25 49
       </div>
26
-      <div nz-col nzXl='6' class="list-template__btns">
27
-        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
28
-        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
29
-        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
50
+      <div nz-col nzXl="6" class="list-template__btns">
51
+        <button nz-button class="btn default" (click)="search(1)">搜索</button>
52
+        <button nz-button class="btn default ml8" (click)="excelExport()">
53
+          导出
54
+        </button>
55
+        <button nz-button class="btn default ml8" (click)="reset()">
56
+          重置
57
+        </button>
30 58
       </div>
31 59
     </div>
32 60
     <div class="list-template__bottom">
33
-      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
34
-        [nzLoading]="loading1">
61
+      <nz-table
62
+        class="list-template__nzTable"
63
+        [nzData]="listOfData"
64
+        nzSize="middle"
65
+        [nzShowPagination]="false"
66
+        [nzLoading]="loading1"
67
+      >
35 68
         <thead>
36 69
           <tr class="thead">
37 70
             <th nzWidth="5%">序号</th>
38
-            <th nzWidth="10%">支助人员名称</th>
39
-            <th nzWidth="10%">工单总量</th>
40
-            <th nzWidth="10%">积分</th>
41
-            <th nzWidth="10%">好评数量</th>
42
-            <th nzWidth="10%">特殊关闭数量</th>
71
+            <th nzWidth="10%">姓名</th>
72
+            <th nzWidth="10%">工单总数</th>
73
+            <th nzWidth="10%">五分钟内工单</th>
74
+            <th nzWidth="10%">特殊关闭数</th>
75
+            <th nzWidth="10%">平均到达时长</th>
76
+            <th nzWidth="10%">平均完成时长</th>
43 77
             <th nzWidth="15%">按时完成达标率</th>
44
-            <th nzWidth="10%">平均到达时间</th>
45
-            <th nzWidth="10%">平均完成时间</th>
78
+            <th nzWidth="10%">总积分</th>
46 79
             <th nzWidth="10%">操作</th>
47 80
           </tr>
48 81
         </thead>
49 82
         <tbody>
50
-          <tr *ngFor="let data of listOfData;let index=index;">
51
-            <td>{{index+(pageIndex-1)*10+1}}</td>
83
+          <tr *ngFor="let data of listOfData; let index = index">
84
+            <td>{{ index + (pageIndex - 1) * 10 + 1 }}</td>
52 85
             <td>{{ data.name }}</td>
53
-            <td>{{ data.total||0}}</td>
54
-            <td>{{data.order||0}}</td>
55
-            <td>{{data.num||0}}</td>
56
-            <td>{{data.specialCloseNum}}</td>
57
-            <td>{{data.avePer+'%'}}</td>
58
-            <td>{{data.arriveTime}}</td>
59
-            <td>{{data.completeTime}}</td>
86
+            <td>{{ data.total || 0 }}</td>
87
+            <td>{{ data.fiveTimeNum || 0 }}</td>
88
+            <td>{{ data.specialCloseNum }}</td>
89
+            <td>{{ data.arriveTime }}</td>
90
+            <td>{{ data.completeTime }}</td>
91
+            <td>{{ data.avePer + "%" }}</td>
92
+            <td>{{ data.order || 0 }}</td>
60 93
             <td>
61 94
               <div class="coop">
62
-                <span *ngIf="coopBtns.look" (click)="personDetail(data.workerId)">查看</span>
95
+                <span
96
+                  *ngIf="coopBtns.look"
97
+                  (click)="personDetail(data.workerId)"
98
+                  >查看</span
99
+                >
63 100
               </div>
64 101
             </td>
65 102
           </tr>
66 103
         </tbody>
67 104
       </nz-table>
68 105
       <div class="list-template__pagination">
69
-        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
70
-          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
106
+        <nz-pagination
107
+          [(nzPageIndex)]="pageIndex"
108
+          [(nzTotal)]="listLength"
109
+          nzShowSizeChanger
110
+          [(nzPageSize)]="pageSize"
111
+          (nzPageIndexChange)="getList()"
112
+          (nzPageSizeChange)="getList()"
113
+        >
71 114
         </nz-pagination>
72 115
       </div>
73 116
     </div>
74 117
   </div>
75 118
 </div>
76 119
 <!-- 操作成功/失败提示框 -->
77
-<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
78
-  [info]="promptInfo"></app-prompt-modal>
120
+<app-prompt-modal
121
+  *ngIf="promptModalShow"
122
+  [content]="promptContent"
123
+  [success]="ifSuccess"
124
+  [show]="promptModalShow"
125
+  [info]="promptInfo"
126
+></app-prompt-modal>
127
+<app-excel-export
128
+  [loading]="loading2"
129
+  [isShow]="isShow"
130
+  (submitFormHand)="submitExcelExport($event)"
131
+  (hideFormHand)="hideExcelExport($event)"
132
+  *ngIf="isShow"
133
+></app-excel-export>
79 134
 
80 135
 <!-- 查看详情 -->
81 136
 <router-outlet></router-outlet>

+ 22 - 6
src/app/views/worker-statistics/worker-statistics.component.ts

@@ -96,18 +96,34 @@ export class WorkerStatisticsComponent implements OnInit {
96 96
       this.getList();
97 97
     }
98 98
   }
99
+  // 导出-model-确定
100
+  submitExcelExport(e) {
101
+    console.log(e);
102
+    this.export(e);
103
+  }
104
+  // 导出-model-取消
105
+  hideExcelExport() {
106
+    this.isShow = false;
107
+  }
108
+  // 导出-触发
109
+  excelExport() {
110
+    this.isShow = true;
111
+  }
99 112
   // 导出
100 113
   loading2 = false;
101
-  export() {
102
-    let that = this;
103
-    let postData = {
104
-      hosId: that.hospital,
114
+  isShow = false;
115
+  export(obj) {
116
+    let postData: any = {
117
+      hosId: this.hospital,
105 118
       startTime: this.startDate + " " + "00:00:00",
106 119
       endTime: this.endDate + " " + "23:59:59",
107
-      groupId: that.group || "",
120
+      groupId: this.group || "",
108 121
     };
122
+    if (obj.isGroup) {
123
+      postData.byGroup = true;
124
+    }
109 125
     this.loading2 = true;
110
-    that.mainService.exportReport("user", postData).subscribe(
126
+    this.mainService.exportReport("user", postData).subscribe(
111 127
       (data) => {
112 128
         this.loading2 = false;
113 129
         this.showPromptModal("导出", true, "");