Bläddra i källkod

调度台回访优化

seimin 3 månader sedan
förälder
incheckning
9f239f2a12

+ 115 - 22
src/app/components/incidentManagement/incident-ser-visit/incident-ser-visit.component.html

@@ -1,33 +1,126 @@
1 1
 <div class="modal display_flex align-items_center">
2 2
   <div class="modalBody">
3 3
     <div class="title">待回访<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
-    <overlay-scrollbars #osComponentRef1 class="content">
5
-      <nz-spin nzSimple [nzSpinning]="loading" class="mt8 text_align_center"></nz-spin>
6
-      <ng-container *ngIf="!loading">
7
-        <div class="items" *ngFor="let item of visitList">
8
-          <div class="row">
9
-            <div class="col"><span [ngClass]="priorityColor(item.priorityId)">{{item.priorityDTO?.name}}</span> {{item.incidentsign}}</div>
10
-            <div class="col">{{item.hosName}} <ng-container *ngIf="item.repairIncidentType.value === 'public'">{{ item.repairIncidentType.name }}</ng-container><ng-container *ngIf="item.repairIncidentType.value === 'dept'">{{ item.department?.dept }}</ng-container></div>
11
-          </div>
12
-          <div class="row">
13
-            <div class="col">故障描述:{{item.description}}</div>
14
-          </div>
15
-          <div class="row">
16
-            <div class="col">详细地址:{{ item.place ? item.place.building.buildingName : '' }}{{ item.place ? item.place.floorName + '层' : '' }}{{ item.houseNumber }} <span [innerHTML]="item.overtimeRemark"></span></div>
17
-          </div>
18
-          <div class="row">
19
-            <div class="col">申请时间:{{ item.startDate | date: 'yyyy-MM-dd HH:mm'}}</div>
20
-            <div class="col">处理人:{{computedHandlerUser(item)}}</div>
21
-            <div class="col btns">
22
-              <input type="button" class="mid_bot mr8" value="回访" (click)="visit(item)" />
23
-              <input type="button" class="btm_bot" value="查看" (click)="openItsmDetails(item)" />
4
+    <div class="content">
5
+      <div class="tabs">
6
+        <div class="tab" [ngClass]="{'active': queryTask == item.key}" (click)="changeTab(item.key)" *ngFor="let item of tabs">{{item.value}}<span [ngClass]="{ red: item.isRed && item.num > 0}">({{item.num}})</span></div>
7
+      </div>
8
+      <div class="list-template w100" style="padding: 16px;">
9
+        <div class="list-template__content">
10
+          <div class="list-template__top" nz-row style="padding: 0;">
11
+            <div nz-col nzXl='20' class="list-template__searchBox">
12
+              <div class="list-template__searchItem" *ngIf="coopBtns.strideLook && queryTask!='todo' && queryTask!='doing' && queryTask!='storage'">
13
+                <span class="label">维修科室</span>:
14
+                <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch
15
+                   (ngModelChange)="deptChange($event)" nzAllowClear nzPlaceHolder="请选择维修科室" [(ngModel)]="searchDTO.maintainDepartment">
16
+                  <ng-container *ngFor="let option of maintainDept">
17
+                    <nz-option [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
18
+                  </ng-container>
19
+                </nz-select>
20
+              </div>
21
+              <div class="list-template__searchItem">
22
+                <span class="label">登记时间</span>:
23
+                <nz-range-picker style="width: 373px;" nzShowTime [(ngModel)]="searchDTO.dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)"></nz-range-picker>
24
+              </div>
25
+              <div class="list-template__searchItem">
26
+                <span class="label">事件单号</span>:
27
+                <input nz-input class="formItem" placeholder="请输入事件单号" [(ngModel)]="searchDTO.incidentsign" />
28
+              </div>
29
+              <div class="list-template__searchItem">
30
+                <span class="label">报修科室</span>:
31
+                <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
32
+                  (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="searchDTO.department">
33
+                  <ng-container *ngFor="let option of alldepart">
34
+                    <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
35
+                  </ng-container>
36
+                  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
37
+                    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
38
+                  </nz-option>
39
+                </nz-select>
40
+              </div>
41
+              <div class="list-template__searchItem">
42
+                <span class="label">状态</span>:
43
+                <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
44
+                  nzPlaceHolder="请选择状态" [(ngModel)]="searchDTO.statusId">
45
+                  <nz-option [nzLabel]="data.name" [nzValue]="data.id" *ngFor="let data of gdStates"></nz-option>
46
+                </nz-select>
47
+              </div>
48
+            </div>
49
+            <div nz-col nzXl='4' class="list-template__btns">
50
+              <button nz-button class="btn default ml8 mt0" (click)='search()'>搜索</button>
51
+              <button nz-button class="btn default ml8 mt0" (click)='reset()'>重置</button>
24 52
             </div>
25 53
           </div>
26 54
         </div>
27
-      </ng-container>
28
-    </overlay-scrollbars>
55
+      </div>
56
+      <div class="tableWrap">
57
+        <nz-table class="hospitalTable" [nzData]="listOfData" nzSize="small" [nzShowPagination]="false" [nzLoading]="loading1">
58
+          <thead>
59
+            <tr class="thead">
60
+              <th nzWidth="5%">序号</th>
61
+              <th nzWidth="27%">故障信息</th>
62
+              <th nzWidth="14%">详细地址</th>
63
+              <th nzWidth="12%">联系信息</th>
64
+              <th nzWidth="12%">受理人|处理人/组</th>
65
+              <th nzWidth="10%">延期记录</th>
66
+              <th nzWidth="8%">状态</th>
67
+              <th nzWidth="12%">操作</th>
68
+            </tr>
69
+          </thead>
70
+          <tbody>
71
+            <tr *ngFor="let data of listOfData;let index=index;" (click)="detail($event,data)">
72
+              <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
73
+              <td class="text_align_left">
74
+                <span [ngClass]="priorityColor(data.priorityId)">{{ data.priorityDTO?.name }}</span>
75
+                {{ data.incidentsign }} {{ data.acceptDate | date: 'yyyy-MM-dd HH:mm' }}<br>{{ data.description }}
76
+                <i class="icon_transport transport-a-11111 ml8" *ngIf="data.reqAttachment"></i>
77
+                <i class="icon_transport transport-luyin ml8" *ngIf="data.reqRecord"></i>
78
+              </td>
79
+              <td class="text_align_left">
80
+                {{ data.hosName || '无' }}<br>
81
+                <ng-container *ngIf="data.repairIncidentType.value === 'public'">
82
+                  {{ data.repairIncidentType.name }}<br>
83
+                </ng-container>
84
+                <ng-container *ngIf="data.repairIncidentType.value === 'dept'">
85
+                  {{ data.department?.dept || '无' }}<br>
86
+                </ng-container>
87
+                {{ data.place ? data.place.building.buildingName : '' }}{{ data.place ? data.place.floorName + '层' : '' }}{{ data.houseNumber }}
88
+              </td>
89
+              <td class="text_align_left">
90
+                {{ data.requester?.name || '无' }}<br>
91
+                联电:{{ data.contactsInformation || '无' }}<br>
92
+                来电:{{ data.incomingPhone || '无' }}
93
+                <i class="icon_transport transport-luyin ml8" *ngIf="data.callID"></i>
94
+              </td>
95
+              <td>
96
+                {{ data.acceptUser?.name || '无' }}<br>
97
+                {{ transferSynergetic(data) }}<br>
98
+                <ng-container *ngIf="(data.state.value === 'pending' || data.state.value === 'reassign') && data.overdueResponseDate"><span [ngStyle]="{ color: data.acceptColourInfo ? data.acceptColourInfo.value : '' }">{{ data.overdueResponseDate | date: 'MM-dd HH:mm' }}</span>前接单</ng-container>
99
+                <ng-container *ngIf="data.state.value === 'handler' && data.overdueTime"><span [ngStyle]="{ color: data.handleColourInfo ? data.handleColourInfo.value : '' }">{{ data.overdueTime | date: 'MM-dd HH:mm' }}</span>前处理</ng-container>
100
+              </td>
101
+              <td [innerHTML]="data.overtimeRemark"></td>
102
+              <td>{{ data.state?.name }}</td>
103
+              <td>
104
+                <div class="coop">
105
+                  <span *ngIf="data.computedVisitFlag" (click)="visit($event,data)">回访</span>
106
+                </div>
107
+              </td>
108
+            </tr>
109
+          </tbody>
110
+        </nz-table>
111
+        <div class="pagination">
112
+          <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
113
+          <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength"
114
+            [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList()"
115
+            (nzPageSizeChange)="getList()" [nzShowTotal]="totalTemplate">
116
+          </nz-pagination>
117
+        </div>
118
+      </div>
119
+    </div>
29 120
   </div>
30 121
 </div>
122
+<!-- 操作成功/失败提示框 -->
123
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow" [info]="promptInfo"></app-prompt-modal>
31 124
 
32 125
 <!-- 详情 -->
33 126
 <app-incident-detail [id]="coopData.id" *ngIf="detailModalShow" (closeModelHs)="closeDetailModelOrder($event)" (confirmModelHs)="confirmDetailModelOrder($event)"></app-incident-detail>

+ 163 - 75
src/app/components/incidentManagement/incident-ser-visit/incident-ser-visit.component.less

@@ -1,4 +1,56 @@
1 1
 @import "../../../../theme.less";
2
+.icon_transport{
3
+  color: @primary-color;;
4
+}
5
+.coop {
6
+  button{
7
+    color: #333;
8
+  }
9
+  span,button {
10
+    display: inline-block;
11
+    padding: 0 8px;
12
+    cursor: pointer;
13
+    position: relative;
14
+
15
+    &::after {
16
+      content: "|";
17
+      position: absolute;
18
+      top: 0;
19
+      right: 0;
20
+    }
21
+
22
+    &:hover,
23
+    &:active {
24
+      color: @primary-color;
25
+    }
26
+
27
+    &:nth-last-child(1) {
28
+      &::after {
29
+        content: "";
30
+      }
31
+    }
32
+  }
33
+}
34
+.tabs{
35
+  width: 100%;
36
+  height: 56px;
37
+  border-bottom: 1px solid #D9D9D9;
38
+  display: flex;
39
+  align-items: center;
40
+  .tab{
41
+    width: 148px;
42
+    display: flex;
43
+    height: 100%;
44
+    justify-content: center;
45
+    align-items: center;
46
+    font-size: #333;
47
+    cursor: pointer;
48
+    &.active{
49
+      color: @primary-color;
50
+      border-bottom: 2px solid @primary-color;
51
+    }
52
+  }
53
+}
2 54
 .modal {
3 55
   position: fixed;
4 56
   left: 0;
@@ -7,17 +59,29 @@
7 59
   height: 100%;
8 60
   background: rgba(0, 0, 0, 0.4);
9 61
   z-index: 999;
62
+  .tableWrap{
63
+    margin: 0 16px 16px!important;
64
+    background: #F9FAFB;
65
+    border-radius: 8px;
66
+    border: 1px solid #D9D9D9;
67
+    width: calc(100% - 32px);
68
+    min-height: 501px;
69
+    padding: 16px 16px 0;
70
+    ::ng-deep .ant-table-body{
71
+      margin: 0!important;
72
+    }
73
+  }
10 74
   .hospitalTable {
11 75
     width: 100%;
12 76
     td {
13
-      text-align: center !important;
77
+      text-align: center;
14 78
       position: relative;
15 79
       word-break: break-all;
16 80
     }
17 81
     .thead {
18 82
       background-image: linear-gradient(to right, @bg-start, @bg-end);
19 83
       th {
20
-        text-align: center !important;
84
+        text-align: center;
21 85
         color: #fff;
22 86
         background: transparent;
23 87
       }
@@ -37,34 +101,11 @@
37 101
     }
38 102
   }
39 103
 
40
-  .tab {
41
-    width: 100%;
42
-    height: 60px;
43
-    border-bottom: 1px solid #e5e9ed;
44
-    background-color: #fff;
45
-
46
-    .item {
47
-      text-align: center;
48
-      line-height: 60px;
49
-      height: 100%;
50
-      border-right: 1px solid #e5e9ed;
51
-
52
-      &:nth-last-child(1) {
53
-        border: none;
54
-      }
55
-
56
-      &.checked {
57
-        background: #f0f6ed;
58
-      }
59
-    }
60
-  }
61
-
62 104
   .modalBody {
63
-    width: 742px;
64
-    height: 707px;
105
+    width: 1315px;
65 106
     background: #fff;
66 107
     border-radius: 5px;
67
-    padding-bottom: 30px;
108
+    padding: 10px 20px;
68 109
     color: #333;
69 110
     &.modalBody-search {
70 111
       width: 480px;
@@ -73,73 +114,80 @@
73 114
 
74 115
     .title {
75 116
       width: 100%;
76
-      height: 40px;
77
-      line-height: 40px;
78 117
       text-align: center;
79
-      font-size: 16px;
118
+      font-size: 18px;
80 119
       position: relative;
81 120
 
82 121
       i {
83 122
         position: absolute;
84 123
         right: 0;
85 124
         top: 0;
86
-        font-size: 16px;
125
+        font-size: 20px;
87 126
         color: #666;
88 127
         cursor: pointer;
89
-        padding: 0 16px;
128
+        padding: 0 5px;
90 129
       }
91 130
     }
92 131
 
93 132
     .content {
94
-      height: calc(100% - 40px);
95
-      border-top: 1px solid #D9D9D9;
96
-      border-bottom: 1px solid #D9D9D9;
97
-      .items{
98
-        border-bottom: 1px solid #D9D9D9;
99
-        padding: 16px 48px;
100
-        font-size: 14px;
101
-        &:last-of-type{
102
-          border-bottom: none;
103
-        }
104
-        .row{
105
-          position: relative;
133
+      min-height: 117px;
134
+      // background: #f9fafb;
135
+      border: 1px solid #e5e9ed;
136
+      border-radius: 5px;
137
+      overflow: hidden;
138
+      margin-top: 12px;
139
+      display: flex;
140
+      flex-direction: column;
141
+      justify-content: center;
142
+      align-items: center;
143
+      &.content-search {
144
+        min-height: 147px;
145
+        justify-content: start;
146
+        .defeat-search {
147
+          width: 100%;
148
+          height: 52px;
106 149
           display: flex;
107
-          margin-top: 12px;
108
-          &:first-of-type{
109
-            margin-top: 0;
150
+          justify-content: center;
151
+          align-items: center;
152
+          border-bottom: solid 1px #e5e9ed;
153
+          em {
154
+            color: #666;
155
+            font-style: normal;
110 156
           }
111
-          .col{
112
-            margin-right: 48px;
113
-            &:last-of-type{
114
-              margin-right: 0;
115
-            }
116
-            &.btns{
117
-              position: absolute;
118
-              bottom: 0;
119
-              right: 0;
120
-            }
157
+        }
158
+        .form {
159
+          width: 100%;
160
+          padding: 0 16px;
161
+          .ant-form-item-label,
162
+          .ant-form-explain {
163
+            text-align: left !important;
121 164
           }
122 165
         }
123
-        /* 中按钮 */
124
-        .mid_bot {
125
-          width: 65px;
126
-          border-radius: 4px;
127
-          color: white;
128
-          background-color: @primary-color;
129
-          border: 1px @primary-color solid;
130
-          cursor: pointer;
131
-          height: 27px;
166
+      }
167
+
168
+      div {
169
+        text-align: center;
170
+        margin: 0;
171
+
172
+        &.defeat {
173
+          color: #333;
174
+          font-size: 28px;
175
+        }
176
+        &.countDown {
177
+          font-size: 14px;
178
+          color: 666;
179
+          em {
180
+            font-style: normal;
181
+            color: @primary-color;
182
+          }
132 183
         }
133 184
 
134
-        /* 下按钮 */
135
-        .btm_bot {
136
-          width: 65px;
137
-          border-radius: 4px;
138
-          color: #78797a;
139
-          background-color: #FFF;
140
-          border: 1px #e5e9ed solid;
141
-          cursor: pointer;
142
-          height: 27px;
185
+        &.pagination {
186
+          font-size: 14px;
187
+          color: #666;
188
+          padding-top: 16px;
189
+          padding-bottom: 16px;
190
+          text-align: right;
143 191
         }
144 192
       }
145 193
     }
@@ -152,4 +200,44 @@
152 200
       }
153 201
     }
154 202
   }
203
+
204
+  // 新增
205
+  &.add {
206
+    .modalBody {
207
+      width: 480px;
208
+      height: auto;
209
+
210
+      .content {
211
+        width: 100%;
212
+        height: auto;
213
+        padding: 18px 14px 0 14px;
214
+
215
+        .addForm {
216
+          .ant-form-item {
217
+            margin-bottom: 15px;
218
+
219
+            .ant-form-item-label {
220
+              line-height: 0;
221
+            }
222
+          }
223
+        }
224
+
225
+        .editForm {
226
+          .ant-form-item {
227
+            margin-bottom: 15px;
228
+
229
+            .ant-form-item-label {
230
+              line-height: 0;
231
+            }
232
+          }
233
+        }
234
+      }
235
+
236
+      button {
237
+        &:nth-child(1) {
238
+          margin-right: 20px;
239
+        }
240
+      }
241
+    }
242
+  }
155 243
 }

+ 348 - 84
src/app/components/incidentManagement/incident-ser-visit/incident-ser-visit.component.ts

@@ -1,38 +1,168 @@
1
-import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
2
-import { ToolService } from 'src/app/services/tool.service';
3
-import { MainService } from 'src/app/services/main.service';
4
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
1
+import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+
4
+import { Subject } from "rxjs";
5
+import { debounceTime } from "rxjs/operators";
6
+import { format, addDays, addHours } from 'date-fns';
7
+import { FormGroup, FormBuilder } from '@angular/forms';
5 8
 import cloneDeep from 'lodash-es/cloneDeep'
6
-import { format, addHours, addDays } from 'date-fns';
9
+import { MainService } from 'src/app/services/main.service';
10
+import { ToolService } from 'src/app/services/tool.service';
7 11
 @Component({
8 12
   selector: 'app-incident-ser-visit',
9 13
   templateUrl: './incident-ser-visit.component.html',
10 14
   styleUrls: ['./incident-ser-visit.component.less']
11 15
 })
12 16
 export class IncidentSerVisitComponent implements OnInit {
13
-  @ViewChild("osComponentRef1", {
14
-    read: OverlayScrollbarsComponent,
15
-    static: false,
16
-  })
17
-  osComponentRef1: OverlayScrollbarsComponent;
18
-  // 切换科室,切换弹窗
19
-  loading = false;
20
-  visitList: any = [];// 列表
21
-  pageIndex: number = 1;//表格当前页码
22
-  pageSize: number = 10;//表格每页展示条数
23
-  total: number = 0;//表格总数据量
24
-
25 17
   @Input() itsmData:any;
26 18
   @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
27 19
 
28
-  constructor(private mainService: MainService, private tool: ToolService) { }
20
+  constructor(
21
+    public route: ActivatedRoute,
22
+    private mainService: MainService,
23
+    private tool: ToolService,
24
+    private fb: FormBuilder,
25
+  ) {}
26
+
27
+  loginUser: any = localStorage.getItem("user")
28
+    ? JSON.parse(localStorage.getItem("user")).user
29
+    : null; //登录人信息
30
+  listOfData: any[] = []; //表格数据
31
+  coopId: string; //表格中执行操作的id
32
+  hospital: string; //选中院区
33
+  alldepart: any = []; //当前院区所属科室
34
+  worker: number; //选择执行配送人员
35
+  gdState: number; //选择工单状态
36
+  gdStates: any; //工单状态列表
37
+  overdueStates: any; //逾期查询列表
38
+  pageIndex: number = 1; //页码
39
+  listLength: number = 0; //总条数
40
+  pageSize: number = 5; //每页条数
41
+
42
+  promptContent: string; //操作提示框提示信息
43
+  ifSuccess: boolean; //操作成功/失败
44
+  promptInfo: string; //操作结果提示信息
45
+  promptModalShow: boolean; //操作提示框是否展示
46
+
47
+  btnLoading: boolean = false; //提交按钮loading状态
48
+
49
+  tabs:any[] = [
50
+    {key: 'all', value: '全部故障', num: 0, isRed: false},
51
+    {key: 'callback', value: '待我回访', num: 0, isRed: false},
52
+    {key: 'owns', value: '与我关联', num: 0, isRed: false},
53
+  ]
54
+
55
+  searchDTO: any = {};
56
+
57
+  searchTimerSubject = new Subject();
58
+  debounceSubject = new Subject(); //防抖
59
+	maintainDept:any = []; //维修科室
60
+	hosIds:any; //当前院区
61
+  // 初始化增删改按钮
62
+  coopBtns: any = {};
63
+  // 选择tab
64
+  queryTask:string = 'callback';//默认待我回访
65
+  changeTab(key){
66
+    this.queryTask = key;
67
+		this.getDeparts();
68
+    this.loading1 = true;
69
+    this.debounceSubject.next(true);
70
+  }
29 71
 
30 72
   ngOnInit() {
31
-    this.getVisitList();
73
+		this.hosIds = this.tool.getCurrentHospital().id
74
+    console.log(this.itsmData)
75
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
76
+      let fun = v[0];
77
+      fun.call(this, v[1], v[2]);
78
+    });
79
+    this.debounceSubject.pipe(debounceTime(500)).subscribe((v:boolean) => {
80
+      this.getList(v);
81
+    });
82
+    this.coopBtns = this.tool.initCoopBtns(this.route);
83
+    if(this.itsmData.allDuty == 1){
84
+      this.getMaintainDeptList();
85
+    }else{
86
+      this.maintainDept = this.itsmData.checkedHos || [];
87
+      // if(this.coopBtns.strideLook){
88
+      //   this.defaDept()
89
+      // }
90
+    }
91
+    this.getGdStates();
92
+    this.getHospitalType();
93
+    this.getOverdueStates();
94
+    this.loading1 = true;
95
+    this.debounceSubject.next(true);
32 96
   }
33
-  // 关闭弹窗
34
-  hideModal() {
35
-    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
97
+
98
+  // 获取院区类型
99
+  hospitalTypes:any[] = [];
100
+  getHospitalType() {
101
+    this.mainService.getDictionary("list", "hospital_type").subscribe((result) => {
102
+      this.hospitalTypes = result || [];
103
+    });
104
+  }
105
+
106
+  // 获取所有的责任部门
107
+  getMaintainDeptList(){
108
+    let type = this.hospitalTypes.find(v => v.value == 6);
109
+    let postData: any = {
110
+      idx: 0,
111
+      sum: 99999,
112
+      hospital: {
113
+        type: type || undefined,
114
+      },
115
+    };
116
+    this.mainService.getFetchDataList("data", "hospital", postData).subscribe(result => {
117
+      if(result.status == 200){
118
+        this.maintainDept = result.list || [];
119
+        // if(this.coopBtns.strideLook){
120
+        //   this.defaDept()
121
+        // }
122
+      }else{
123
+        this.maintainDept = [];
124
+      }
125
+    });
126
+  }
127
+
128
+	defaDept(){
129
+		let itemDept = this.maintainDept.find(i=>i.id == this.hosIds)
130
+		if(itemDept){
131
+			this.searchDTO.maintainDepartment = itemDept.id
132
+		}
133
+		this.getDeparts();
134
+	}
135
+
136
+	// 选择维修科室
137
+	deptChange(e){
138
+		this.searchDTO.department = null;
139
+		this.getDeparts();
140
+	}
141
+
142
+  // 搜索
143
+  search() {
144
+    this.loading1 = true;
145
+    this.debounceSubject.next(true);
146
+  }
147
+  // 重置
148
+  reset() {
149
+    this.searchDTO = {};
150
+		if(this.coopBtns.strideLook){
151
+			this.defaDept()
152
+		}
153
+    this.loading1 = true;
154
+    this.debounceSubject.next(true);
155
+  }
156
+
157
+  onCalendarChangeDate(dateArr){
158
+    console.log(dateArr)
159
+    if(dateArr.length == 2){
160
+      let dateStart = new Date(dateArr[0]);
161
+      let dateEnd = new Date(dateArr[1]);
162
+      dateStart.setHours(0,0,0);
163
+      dateEnd.setHours(23,59,59);
164
+      this.searchDTO.dateRange = [dateStart,dateEnd];
165
+    }
36 166
   }
37 167
 
38 168
   // 优先级颜色
@@ -46,98 +176,232 @@ export class IncidentSerVisitComponent implements OnInit {
46 176
       return 'red';
47 177
     }
48 178
   }
49
-
50
-  // 处理人
51
-  computedHandlerUser(item){
52
-    if(item.state.value == 'pending' && item.currentLog){
53
-      return item.currentLog.workerName;
54
-    }
55
-    if(item.state.value != 'pending' && item.handlingPersonnelUser){
56
-      return item.handlingPersonnelUser.name;
179
+  // 处理人+协同人
180
+  transferSynergetic(incidentData){
181
+    let str = incidentData.groupORHandlerUser || "";
182
+    if(incidentData.synergetic && incidentData.synergetic.length){
183
+        str += ',' + incidentData.synergetic.map(v => v.name).join(',');
57 184
     }
58
-  }
59
-
60
-  // 查看ITSM工单详情
61
-  detailModalShow = false; //弹窗开关
62
-  coopData:any = {};
63
-  openItsmDetails(data) {
64
-    this.coopData = data;
65
-    this.detailModalShow = true;
66
-  }
67
-  // 关闭弹窗
68
-  closeDetailModelOrder(e) {
69
-    this.detailModalShow = JSON.parse(e).show;
70
-  }
71
-  // 弹窗确定
72
-  confirmDetailModelOrder(e){
73
-    console.log(e);
74
-    this.detailModalShow = false;
75
-  }
76
-
77
-  // 回访-弹窗
78
-  visitModalShow = false; //弹窗开关
79
-  visit(data) {
80
-    this.coopData = data;
81
-    this.visitModalShow = true;
82
-  }
83
-  // 关闭弹窗
84
-  closeVisitModelOrder(e) {
85
-    this.visitModalShow = JSON.parse(e).show;
86
-  }
87
-  // 弹窗确定
88
-  confirmVisitModelOrder(e){
89
-    console.log(e);
90
-    this.visitModalShow = false;
91
-    this.getList();
92
-  }
93
-
94
-  // 分页获取数据
95
-  getList(){
96
-    this.getVisitList();
185
+    return str;
97 186
   }
98 187
 
99 188
   // 延期记录
100 189
   transferHandlerLog = function (currentLog) {
101 190
     if(!currentLog){
102
-        return '';
191
+        return '无';
103 192
     }
104 193
     currentLog = cloneDeep(currentLog);
105 194
     if(currentLog.extra1DTO && currentLog.extra2 && currentLog.startTime){
106 195
         if(currentLog.extra2==0.5){
107 196
           currentLog.extra2 = 4;
108
-          return currentLog.extra1DTO.name+" "+ format(addHours(currentLog.startTime, +currentLog.extra2), "MM月dd日") + format(addHours(currentLog.startTime, +currentLog.extra2), "HH时mm分前完成");
197
+          return currentLog.extra1DTO.name+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "MM月dd日")+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "HH时mm分前完成");
109 198
         }else{
110
-          return currentLog.extra1DTO.name+" "+ format(addDays(currentLog.startTime, +currentLog.extra2), "MM月dd日前完成");
199
+          return currentLog.extra1DTO.name+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "MM月dd日前完成");
111 200
         }
112 201
     }else{
113
-        return '';
202
+        return '无';
114 203
     }
115 204
   }
116 205
 
117
-  // 获取回访列表
118
-  getVisitList(){
119
-    this.loading = true;
206
+  // 是否显示回访按钮
207
+  computedVisit(data){
208
+    return this.coopBtns.visit && data.state.value == 'close' && data.deleteFlag !== 1;
209
+  }
210
+
211
+  // 表格数据
212
+  loading1 = false;
213
+  getList(isInit = false) {
120 214
     let postData: any = {
121
-      idx: 0,
122
-      sum: 9999,
215
+      idx: isInit ? 0 : (this.pageIndex - 1),
216
+      sum: this.pageSize,
123 217
       incident: {
124
-        // "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
218
+        assignee: this.tool.getCurrentUserId(),
219
+        acceptDate: (this.searchDTO.dateRange && this.searchDTO.dateRange[0]) ? format(this.searchDTO.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
220
+        acceptDateEnd: (this.searchDTO.dateRange && this.searchDTO.dateRange[1]) ? format(this.searchDTO.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
221
+        incidentsign: this.searchDTO.incidentsign,
222
+        department: this.searchDTO.department ? { id: this.searchDTO.department } : undefined,
223
+        statusId: this.searchDTO.statusId || undefined,
224
+        todoingUser: this.searchDTO.todoingUser ? { id: this.searchDTO.todoingUser } : undefined,
225
+        deleteFlag: 0,
125 226
         "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
126 227
         "urgentType": +this.itsmData.orderScopeRadio + 1,
127
-        "queryTask": "callback",
128
-        "assignee": this.tool.getCurrentUserId(),
129
-        "deleteFlag": 0,
130 228
       },
131 229
     };
132 230
 
231
+		if(this.queryTask!='todo' && this.queryTask!='doing' && this.queryTask!='storage'){
232
+			if(this.searchDTO.maintainDepartment){
233
+				let itemDept = this.maintainDept.find(i=>i.id == this.searchDTO.maintainDepartment)
234
+				postData.incident.duty = itemDept;
235
+				delete postData.incident.dutyIds;
236
+			}
237
+		}
238
+
239
+    postData.incident.queryTask = this.queryTask;
240
+
241
+    if(this.queryTask === 'todo' || this.queryTask === 'owns'){
242
+      postData.incident.candidateGroups = this.tool.getCurrentGroupList().map(v => v.id).toString();
243
+    }else{
244
+      delete postData.incident.candidateGroups;
245
+    }
246
+
247
+    this.loading1 = true;
133 248
     this.mainService
134 249
       .getFetchDataList("simple/data", "incident", postData)
135 250
       .subscribe((result) => {
136
-        this.loading = false;
137
-        this.visitList = result.list.map(v => ({...v, endDeptsName: v.endDepts ? v.endDepts.map(v => v.dept).toString() : ''}));
251
+        this.loading1 = false;
252
+        let list = result.list || [];
253
+        list.forEach((item) => {
254
+          item.endDeptsName = item.endDepts ? item.endDepts.map(v => v.dept).toString() : '';
255
+          item.computedVisitFlag = this.computedVisit(item);
256
+        });
257
+        this.listOfData = list;
258
+        this.listLength = result.totalNum;
138 259
       });
260
+
261
+    // 获取数量
262
+    this.getCount(postData.incident);
139 263
   }
264
+
265
+  // 调用接口-查数量
266
+  getCount = function (incident = {}){
267
+    let postData = {
268
+        incidentList: [],
269
+    }
270
+    this.tabs.forEach(v => {
271
+        postData.incidentList.push({...incident, ...{queryTask: v.key}});
272
+    })
273
+    postData.incidentList.forEach(incident => {
274
+        // 请求参数调整
275
+        if(!incident){
276
+            incident = {
277
+              "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
278
+              "urgentType": +this.itsmData.orderScopeRadio + 1,
279
+            };
280
+        }
281
+
282
+				if(incident.queryTask!='todo' && incident.queryTask!='doing' && incident.queryTask!='storage'){
283
+					if(this.searchDTO.maintainDepartment){
284
+						let itemDept = this.maintainDept.find(i=>i.id == this.searchDTO.maintainDepartment)
285
+						incident.duty = itemDept;
286
+						delete incident.dutyIds;
287
+					}
288
+				}
289
+
290
+        incident.assignee = this.tool.getCurrentUserId();
291
+
292
+        if(incident.queryTask === 'todo' || incident.queryTask === 'owns'){
293
+          incident.candidateGroups = this.tool.getCurrentGroupList().map(v => v.id).toString();
294
+        }else{
295
+          delete incident.candidateGroups;
296
+        }
297
+    })
298
+    this.mainService
299
+      .getCount(postData)
300
+      .subscribe((result) => {
301
+        let myData = result.data || {};
302
+        this.tabs.forEach(v => {
303
+            v.num = myData[v.key];
304
+        })
305
+      });
140 306
 }
141 307
 
308
+  // 获取所有科室
309
+  getDeparts(dept?) {
310
+    let data = {
311
+      department: {
312
+        searchType: 1,// 简单查询
313
+        cascadeHosId: this.searchDTO.maintainDepartment?this.searchDTO.maintainDepartment:this.tool.getCurrentHospital().id,
314
+        dept: dept,
315
+      },
316
+      idx: 0,
317
+      sum: 20,
318
+    };
319
+    this.isLoading = true;
320
+    this.mainService
321
+      .getFetchDataList("data", "department", data)
322
+      .subscribe((data) => {
323
+        this.alldepart = data.list;
324
+        this.isLoading = false;
325
+      });
326
+  }
142 327
 
328
+  // 获取工单状态
329
+  getGdStates() {
330
+    this.mainService.getDictionary("list", "incident_status").subscribe((data) => {
331
+      this.gdStates = data || [];
332
+    });
333
+  }
143 334
 
335
+  // 获取逾期查询
336
+  getOverdueStates() {
337
+    this.mainService.getDictionary("list", "overdue_state").subscribe((data) => {
338
+      this.overdueStates = data || [];
339
+    });
340
+  }
341
+
342
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
343
+  showPromptModal(con, success, promptInfo?) {
344
+    this.promptModalShow = false;
345
+    this.promptContent = con;
346
+    this.ifSuccess = success;
347
+    this.promptInfo = promptInfo;
348
+    setTimeout(() => {
349
+      this.promptModalShow = true;
350
+    }, 100);
351
+    this.loading1 = true;
352
+    this.debounceSubject.next(false);
353
+  }
354
+
355
+  // 回访-弹窗
356
+  visitModalShow = false; //弹窗开关
357
+  visit(e, data) {
358
+    e.stopPropagation();
359
+    this.coopData = data;
360
+    this.visitModalShow = true;
361
+  }
362
+  // 关闭弹窗
363
+  closeVisitModelOrder(e) {
364
+    this.visitModalShow = JSON.parse(e).show;
365
+  }
366
+  // 弹窗确定
367
+  confirmVisitModelOrder(e){
368
+    console.log(e);
369
+    this.visitModalShow = false;
370
+    this.getList(true);
371
+  }
372
+
373
+  // 详情-弹窗
374
+  detailModalShow = false; //弹窗开关
375
+  detail(e, data) {
376
+    e.stopPropagation();
377
+    this.coopData = data;
378
+    this.detailModalShow = true;
379
+  }
380
+  // 关闭弹窗
381
+  closeDetailModelOrder(e) {
382
+    this.detailModalShow = JSON.parse(e).show;
383
+  }
384
+  // 弹窗确定
385
+  confirmDetailModelOrder(e){
386
+    console.log(e);
387
+    this.detailModalShow = false;
388
+    this.getList(true);
389
+  }
390
+
391
+  // 科室边输边搜节流阀
392
+  isLoading = false;
393
+  changeInp(e) {
394
+    this.searchTimer(this.getDeparts, e);
395
+  }
396
+
397
+  // 边输入边搜索节流阀
398
+  searchTimer(fun, e, type?) {
399
+    this.isLoading = true;
400
+    this.searchTimerSubject.next([fun, e, type]);
401
+  }
402
+
403
+  // 关闭弹窗
404
+  hideModal() {
405
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
406
+  }
407
+}

+ 7 - 4
src/app/views/hospital-management/hospital-management.component.ts

@@ -48,6 +48,7 @@ export class HospitalManagementComponent implements OnInit {
48 48
     this.getList();
49 49
     this.initForm();
50 50
     this.initFormCopy();
51
+    this.getHospitalType();
51 52
   }
52 53
 
53 54
   currentUserAccount: any = JSON.parse(localStorage.getItem("user")).user.account; //当前登录人账号
@@ -124,13 +125,15 @@ export class HospitalManagementComponent implements OnInit {
124 125
       });
125 126
     }
126 127
   }
128
+  // 获取院区类型
129
+  getHospitalType() {
130
+    this.mainService.getDictionary("list", "hospital_type").subscribe((result) => {
131
+      this.hospitalTypes = result || [];
132
+    });
133
+  }
127 134
   //获取所有的父级院区列表
128 135
   getAllParentHospital(keyWord = "", isParentDept = false) {
129 136
     if(isParentDept){
130
-      this.mainService.getDictionary("list", "hospital_type").subscribe((result) => {
131
-        this.hospitalTypes = result || [];
132
-      });
133
-
134 137
       let postData: any = {
135 138
         idx: 0,
136 139
         sum: 10,

+ 3 - 2
src/app/views/incident-management/incident-management.component.ts

@@ -172,7 +172,8 @@ export class IncidentManagementComponent implements OnInit, OnDestroy {
172 172
 		}else{
173 173
 			this.maintainGroup = this.tool.getUserInfoPermission().dutyGroupList
174 174
 		}
175
-		this.searchDTO.maintainDepartment = e
175
+		this.searchDTO.department = null
176
+		this.searchDTO.todoingUser = null
176 177
 		this.getDeparts();
177 178
 		this.getUsers('', 'handle');
178 179
 	}
@@ -688,7 +689,7 @@ export class IncidentManagementComponent implements OnInit, OnDestroy {
688 689
         acceptUser: this.validateSearchForm.value.acceptUser ? { id: this.validateSearchForm.value.acceptUser } : undefined,
689 690
         selectType: this.validateSearchForm.value.selectType || undefined,
690 691
         deleteFlag: this.validateSearchForm.value.deleteFlag,
691
-				candidateGroupId: null
692
+				candidateGroupId: undefined
692 693
       },
693 694
     };
694 695