瀏覽代碼

Merge branch 'master' into develop

seimin 1 月之前
父節點
當前提交
b77d96536c
共有 45 個文件被更改,包括 5599 次插入219 次删除
  1. 143 0
      src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component.html
  2. 386 0
      src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component.less
  3. 331 0
      src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component.ts
  4. 107 4
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html
  5. 188 0
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.less
  6. 292 36
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts
  7. 139 0
      src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.html
  8. 386 0
      src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.less
  9. 321 0
      src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.ts
  10. 19 1
      src/app/components/order-scope/order-scope.component.html
  11. 34 11
      src/app/components/order-scope/order-scope.component.ts
  12. 8 1
      src/app/services/main.service.ts
  13. 35 2
      src/app/services/tool.service.ts
  14. 25 0
      src/app/views/common-info/common-info-routing.module.ts
  15. 99 0
      src/app/views/common-info/common-info.component.html
  16. 176 0
      src/app/views/common-info/common-info.component.less
  17. 230 0
      src/app/views/common-info/common-info.component.ts
  18. 19 0
      src/app/views/common-info/common-info.module.ts
  19. 22 0
      src/app/views/emergency-info/emergency-info-routing.module.ts
  20. 225 0
      src/app/views/emergency-info/emergency-info.component.html
  21. 214 0
      src/app/views/emergency-info/emergency-info.component.less
  22. 496 0
      src/app/views/emergency-info/emergency-info.component.ts
  23. 20 0
      src/app/views/emergency-info/emergency-info.module.ts
  24. 110 0
      src/app/views/emergency-info/emergency-info.service.ts
  25. 80 6
      src/app/views/fuwutai/fuwutai.component.html
  26. 1 1
      src/app/views/fuwutai/fuwutai.component.less
  27. 325 30
      src/app/views/fuwutai/fuwutai.component.ts
  28. 4 0
      src/app/views/incident-config/incident-config.component.html
  29. 5 1
      src/app/views/incident-config/incident-config.component.ts
  30. 3 2
      src/app/views/incident-config/incident-config.module.ts
  31. 10 1
      src/app/views/main/main-routing.module.ts
  32. 1 1
      src/app/views/main/main.component.html
  33. 84 17
      src/app/views/main/main.component.ts
  34. 5 1
      src/app/views/nurse-config/nurse-config.component.html
  35. 7 1
      src/app/views/nurse-config/nurse-config.component.ts
  36. 3 1
      src/app/views/nurse-config/nurse-config.module.ts
  37. 320 10
      src/app/views/operation-search/operation-search.component.html
  38. 113 15
      src/app/views/operation-search/operation-search.component.less
  39. 408 30
      src/app/views/operation-search/operation-search.component.ts
  40. 1 0
      src/app/views/questionnaire-answer/questionnaire-answer.component.html
  41. 1 0
      src/app/views/questionnaire-answer/questionnaire-answer.component.ts
  42. 4 4
      src/app/views/shortcut-build-orders/shortcut-build-orders.component.html
  43. 127 32
      src/app/views/shortcut-build-orders/shortcut-build-orders.component.ts
  44. 13 2
      src/app/views/task-type-management/task-type-management.component.html
  45. 59 9
      src/app/views/task-type-management/task-type-management.component.ts

+ 143 - 0
src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component.html

@@ -0,0 +1,143 @@
1
+<div class="content" id="dictionary">
2
+  <div class="contentInner">
3
+    <div class="address">
4
+      <overlay-scrollbars #osComponentRef1 class="contentBody">
5
+        <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of customBusinessList">{{ item.name }}</div>
6
+      </overlay-scrollbars>
7
+    </div>
8
+    <div class="addressAssign" *ngIf="activeDictionaryKey.key=='one_connect'">
9
+			<div class="list-template" id="priorityTable">
10
+			  <div class="list-template__content">
11
+			    <div class="list-template__bottom">
12
+			     <div class="list-template__top" nz-row>
13
+			        <div nz-col nzLg="24" class="list-template__btns">
14
+			          <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
15
+			        </div>
16
+			      </div>
17
+			      <nz-table class="list-template__nzTable" [nzData]="commonFaultsList" nzSize="middle" [nzShowPagination]="false"
18
+			        [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
19
+			        <thead>
20
+			          <tr class="thead">
21
+			            <th nzWidth="20%">排序号</th>
22
+			            <th nzWidth="20%">交接名称</th>
23
+			            <th nzWidth="20%">关联科室</th>
24
+									<th nzWidth="20%">关联类型</th>
25
+									<th nzWidth="15%">任务类型</th>
26
+									<th nzWidth="120px">操作</th>
27
+			          </tr>
28
+			        </thead>
29
+			        <tbody>
30
+			          <tr *ngFor="let data of commonFaultsList;let i = index">
31
+			            <td>{{data.orders}}</td>
32
+									<td>{{data.handoverName}}</td>
33
+									<td>{{data.associationDeptDTO?.dept}}</td>
34
+			            <td>
35
+										{{data.handoverType?.name}}
36
+									</td>
37
+									<td>{{data.taskTypeDTO?.taskName}}</td>
38
+			            <td>
39
+			              <div class="coop">
40
+			                <span (click)="showDelModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
41
+			                <span (click)="editPriority(data)">编辑</span>
42
+			              </div>
43
+			            </td>
44
+			          </tr>
45
+			        </tbody>
46
+			      </nz-table>
47
+			    </div>
48
+			  </div>
49
+			</div>
50
+    </div>
51
+  </div>
52
+</div>
53
+
54
+<!-- 操作成功/失败提示框 -->
55
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
56
+  [info]="promptInfo">
57
+</app-prompt-modal>
58
+
59
+<!-- 删除模态框 -->
60
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
61
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
62
+
63
+<!-- 新增/编辑模态框 -->
64
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
65
+  <div class="modalBody">
66
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
67
+    <div class="content">
68
+      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
69
+       <nz-form-item>
70
+         <nz-form-label nzFor="hosId" nzRequired [nzSpan]="6">院区</nz-form-label>
71
+         <nz-form-control [nzSpan]="18" nzErrorTip="请选择院区!">
72
+       		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择院区" formControlName="hosId" (ngModelChange)="changeHos()">
73
+       		  <ng-container *ngFor="let option of hospitalList">
74
+       		    <nz-option [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
75
+       		  </ng-container>
76
+       		</nz-select>
77
+         </nz-form-control>
78
+       </nz-form-item>
79
+       
80
+       <nz-form-item>
81
+         <nz-form-label [nzSpan]="6" nzFor="orders" nzRequired>排序号</nz-form-label>
82
+         <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
83
+           <nz-input-group>
84
+             <input formControlName="orders" nz-input placeholder="请输入排序号">
85
+           </nz-input-group>
86
+         </nz-form-control>
87
+       </nz-form-item>
88
+       
89
+       <nz-form-item>
90
+         <nz-form-label [nzSpan]="6" nzFor="handoverName" nzRequired>交接名称</nz-form-label>
91
+         <nz-form-control [nzSpan]="18" nzErrorTip="请输入交接名称!">
92
+           <nz-input-group>
93
+             <input formControlName="handoverName" nz-input placeholder="请输入交接名称">
94
+           </nz-input-group>
95
+         </nz-form-control>
96
+       </nz-form-item>
97
+       
98
+			 <nz-form-item>
99
+			   <nz-form-label nzFor="associationDept" nzRequired [nzSpan]="6">关联科室</nz-form-label>
100
+			   <nz-form-control [nzSpan]="18" nzErrorTip="请选择关联科室!">
101
+			 		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择关联科室" formControlName="associationDept" (nzOnSearch)="changeCommonInp($event)">
102
+			 		  <ng-container *ngFor="let option of deptData">
103
+			 		    <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
104
+			 		  </ng-container>
105
+			 		  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
106
+			 		    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
107
+			 		  </nz-option>
108
+			 		</nz-select>
109
+			   </nz-form-control>
110
+			 </nz-form-item>
111
+			 
112
+			 <nz-form-item>
113
+			   <nz-form-label nzFor="handoverType" nzRequired [nzSpan]="6">交接类型</nz-form-label>
114
+			   <nz-form-control [nzSpan]="18" nzErrorTip="请选择交接类型!">
115
+			 		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择交接类型" formControlName="handoverType">
116
+			 		  <ng-container *ngFor="let option of connectList">
117
+			 		    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
118
+			 		  </ng-container>
119
+			 		</nz-select>
120
+			   </nz-form-control>
121
+			 </nz-form-item>
122
+			 
123
+       <nz-form-item>
124
+         <nz-form-label nzFor="taskType" nzRequired [nzSpan]="6">关联任务类型</nz-form-label>
125
+         <nz-form-control [nzSpan]="18" nzErrorTip="请选择关联任务类型!">
126
+       		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择关联任务类型" formControlName="taskType">
127
+       		  <ng-container *ngFor="let option of taskTypeList">
128
+       		    <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
129
+       		  </ng-container>
130
+       		  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
131
+       		    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
132
+       		  </nz-option>
133
+       		</nz-select>
134
+         </nz-form-control>
135
+       </nz-form-item>
136
+      </form>
137
+    </div>
138
+    <div class=" display_flex justify-content_flex-center">
139
+      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
140
+      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
141
+    </div>
142
+  </div>
143
+</div>

+ 386 - 0
src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component.less

@@ -0,0 +1,386 @@
1
+@import "../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+	.w220px{
9
+		width: 220px;
10
+	}
11
+	.w100px{
12
+			width: 100px !important;
13
+		}
14
+  .list-template__nzTable,
15
+  .list-template__bottom{
16
+    padding: 0!important;
17
+    border: none!important;
18
+    background: #fff!important;
19
+  }
20
+  .list-template{
21
+    width: 100%!important;
22
+    height: 100%!important;
23
+  }
24
+	
25
+	#dictionary{
26
+	  margin: 24px 16px;
27
+	  .addressAssign{
28
+	    flex: 7;
29
+			.hos-title{
30
+				margin-top: 10px;
31
+				text-align: center;
32
+			}
33
+	  }
34
+	  .contentItem{
35
+	    margin: 0 16px;
36
+	    padding: 8px;
37
+	    text-align: center;
38
+	    &.active{
39
+	      background-color: @primary-color;
40
+	      color: #fff;
41
+	      border-radius: 4px;
42
+	    }
43
+	  }
44
+	  .contentBody{
45
+	    padding: 16px;
46
+	    min-height: 0;
47
+	    display: flex;
48
+	    flex-direction: column;
49
+	  }
50
+	  .contentBody2{
51
+	    flex: 1;
52
+	  }
53
+	  ::ng-deep .ant-form-item{
54
+	    margin-bottom: 0;
55
+	  }
56
+	  .dictionaryRow{
57
+	    display: flex;
58
+	    align-items: center;
59
+	    justify-content: center;
60
+	    gap: 16px;
61
+	    .orders{
62
+	      flex: 1;
63
+	      display: flex;
64
+	      justify-content: flex-end;
65
+	      align-items: center;
66
+	    }
67
+	    .name{
68
+	      width: 100px;
69
+	      display: flex;
70
+	      justify-content: flex-end;
71
+	      align-items: center;
72
+	    }
73
+	    .value{
74
+	      flex: 3;
75
+	      display: flex;
76
+	      align-items: center;
77
+	      .valueInput{
78
+	        width: 600px;
79
+	      }
80
+	      .icon_transport{
81
+	        font-size: 20px;
82
+	        color: #8a8a8a;
83
+	        cursor: pointer;
84
+	      }
85
+	    }
86
+	
87
+	  }
88
+	}
89
+	
90
+	.content{
91
+	  flex: 1;
92
+	  min-height: 0;
93
+	  display: flex;
94
+	  flex-direction: column;
95
+	  justify-content: space-between;
96
+	  border: 1px solid #EEF3F9;
97
+	  &.priority{
98
+	    margin: 24px 118px 0;
99
+	    background-color: #fff;
100
+	    .contentInner{
101
+	      padding: 48px 206px;
102
+	      border: 1px solid #E8EBEF;
103
+	    }
104
+	  }
105
+	  .contentItem{
106
+	    padding: 4px 16px;
107
+	    cursor: pointer;
108
+	    overflow: hidden;
109
+	    text-overflow: ellipsis;
110
+	    white-space: nowrap;
111
+	    &.active{
112
+	      color: @primary-color;
113
+	      background-color: #F0F6ED;
114
+	      border-radius: 4px;
115
+	    }
116
+	  }
117
+	  .contentInner{
118
+	    flex: 1;
119
+	    display: flex;
120
+	    justify-content: space-between;
121
+	    align-items: center;
122
+	    padding: 0 16px;
123
+	    gap: 16px;
124
+			.hos-title{
125
+				font-weight: 600;
126
+				font-size: 16px;
127
+			}
128
+
129
+			.hospital{
130
+			  width: 100%;
131
+			  text-align: left;
132
+			}
133
+			.classList{
134
+				// padding: 5px 0;
135
+				.mar-10{
136
+					margin: 8px 0;
137
+				}
138
+			  .select{
139
+			    width: 313px;
140
+			  }
141
+			  span{
142
+			    display: inline-block;
143
+			    width: 11em;
144
+			  }
145
+			}
146
+			
147
+	    .contentHead{
148
+	      height: 45px;
149
+	      display: flex;
150
+	      justify-content: space-between;
151
+	      align-items: center;
152
+	      gap: 16px;
153
+	      padding: 0 16px;
154
+	      font-size: 16px;
155
+	      font-weight: bold;
156
+	      border-bottom: 1px solid #D9D9D9;
157
+	      .title{
158
+	        overflow: hidden;
159
+	        text-overflow: ellipsis;
160
+	        white-space: nowrap;
161
+	      }
162
+	      .btns{
163
+	        flex-shrink: 0;
164
+	      }
165
+	    }
166
+	    .contentBody{
167
+	      padding: 0 8px;
168
+	      margin: 4px 0;
169
+	      flex: 1;
170
+	    }
171
+	    .address{
172
+	      flex: 1;
173
+	      height: 100%;
174
+	      background: #FFFFFF;
175
+	      border: 1px solid #E8EBEF;
176
+	      display: flex;
177
+	      flex-direction: column;
178
+	      width: 0;
179
+	    }
180
+	    .addressAssign{
181
+	      flex: 3;
182
+	      height: 100%;
183
+	      background: #FFFFFF;
184
+	      border: 1px solid #E8EBEF;
185
+	      display: flex;
186
+	      flex-direction: column;
187
+	      width: 0;
188
+	    }
189
+	    .list-template__searchItem {
190
+	      margin-bottom: 16px;
191
+	      .label {
192
+	        color: #333;
193
+	        display: inline-block;
194
+	        width: 70px;
195
+	        text-align-last: justify;
196
+	        text-align: justify;
197
+	        &.label--big {
198
+	          width: 100px;
199
+	        }
200
+	      }
201
+	      .formItem {
202
+	        width: 135px;
203
+	      }
204
+	    }
205
+	  }
206
+	  .contentBtns{
207
+	    padding-bottom: 16px;
208
+	    display: flex;
209
+	    justify-content: center;
210
+	    align-items: center;
211
+	  }
212
+	}
213
+	
214
+	.save {
215
+	  position: fixed;
216
+	  left: 0;
217
+	  top: 0;
218
+	  width: 100%;
219
+	  height: 100%;
220
+	  background: rgba(0, 0, 0, 0.4);
221
+	  z-index: 99;
222
+	
223
+	  .tips{
224
+	    margin-bottom: 16px!important;
225
+	  }
226
+	
227
+	  .modalBody {
228
+	    width: 350px;
229
+	    background: #fff;
230
+	    border-radius: 5px;
231
+	    padding: 10px 20px;
232
+	    color: #333;
233
+	
234
+	    .title {
235
+	      width: 100%;
236
+	      text-align: center;
237
+	      font-size: 18px;
238
+	      position: relative;
239
+	
240
+	      i {
241
+	        position: absolute;
242
+	        right: 0;
243
+	        top: 0;
244
+	        font-size: 20px;
245
+	        color: #666;
246
+	        cursor: pointer;
247
+	        padding: 0 5px;
248
+	      }
249
+	    }
250
+	
251
+	    .content {
252
+	      width: 310px;
253
+	      background: #f9fafb;
254
+	      border: 1px solid #e5e9ed;
255
+	      border-radius: 5px;
256
+	      overflow: hidden;
257
+	      margin-top: 12px;
258
+	      padding: 16px 0;
259
+	
260
+	      .busyList{
261
+	        display: flex;
262
+	        margin-bottom: 8px;
263
+	        .busyContent{
264
+	          margin-right: 8px;
265
+	          flex: 1;
266
+	        }
267
+	      }
268
+	
269
+	      & > div {
270
+	        text-align: center;
271
+	        margin: 0;
272
+	
273
+	        &.icon {
274
+	          // margin-top: 17px;
275
+	
276
+	          i {
277
+	            color: #34b349;
278
+	            font-size: 30px !important;
279
+	
280
+	            &.transport-wenhao {
281
+	              color: #f5a523;
282
+	            }
283
+	
284
+	            &.transport-shibai {
285
+	              color: #ff3a52;
286
+	            }
287
+	          }
288
+	        }
289
+	
290
+	        &.defeat {
291
+	          color: #333;
292
+	          font-size: 14px;
293
+	        }
294
+	
295
+	        &:nth-child(3) {
296
+	          font-size: 14px;
297
+	          color: #666;
298
+	        }
299
+	      }
300
+	      .workAssignmentTips {
301
+	        font-size: 12px;
302
+	      }
303
+	    }
304
+	
305
+	    button {
306
+	      margin-top: 10px;
307
+	
308
+	      &.btn {
309
+	        margin-left: 8px;
310
+	      }
311
+	    }
312
+	  }
313
+	
314
+	  // 新增
315
+	  &.add {
316
+	    .modalBody {
317
+	      width: 480px;
318
+	      height: auto;
319
+	
320
+	      .content {
321
+	        width: 100%;
322
+	        height: auto;
323
+	        padding: 16px;
324
+	        max-height: 497px;
325
+	        overflow-y: auto;
326
+	
327
+	        .addForm {
328
+	          .ant-form-item {
329
+	            margin-bottom: 0;
330
+							.ant-select{
331
+								width: 100% !important;
332
+							}
333
+	            .ant-form-item-label {
334
+	              text-align: left;
335
+	            }
336
+	
337
+	            .desc {
338
+	              margin-top: 5px;
339
+	            }
340
+	          }
341
+	
342
+	          .datesControl {
343
+	            margin-top: -16px;
344
+	
345
+	            .ant-form-item-label {
346
+	              line-height: 40px;
347
+	            }
348
+	          }
349
+	
350
+	          .timer {
351
+	            .ant-form-item-label {
352
+	              width: 100%;
353
+	              text-align: left;
354
+	            }
355
+	
356
+	            .numInp {
357
+	              margin-right: 5px;
358
+	            }
359
+	
360
+	            .line {
361
+	              margin-right: 5px;
362
+	            }
363
+	          }
364
+	
365
+	          .timer2 {
366
+	            .ant-form-item-label {
367
+	              line-height: 20px;
368
+	            }
369
+	          }
370
+	        }
371
+	
372
+	        .editForm {
373
+	          .ant-form-item {
374
+	            margin-bottom: 15px;
375
+	
376
+	            .ant-form-item-label {
377
+	              line-height: 14px;
378
+	              text-align: left;
379
+	            }
380
+	          }
381
+	        }
382
+	      }
383
+	    }
384
+	  }
385
+	}
386
+}

+ 331 - 0
src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component.ts

@@ -0,0 +1,331 @@
1
+import { Component, OnInit, Input } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from "../../../services/main.service";
6
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
7
+import { ToolService } from 'src/app/services/tool.service';
8
+import { NzMessageService } from 'ng-zorro-antd';
9
+
10
+@Component({
11
+  selector: "app-configuration-custom-business",
12
+  templateUrl: "./configuration-custom-business.component.html",
13
+  styleUrls: ["./configuration-custom-business.component.less"],
14
+})
15
+export class ConfigurationCustomBusinessComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private mainService: MainService,
19
+    private fb: FormBuilder,
20
+    private tool: ToolService,
21
+    private message: NzMessageService,
22
+  ) {}
23
+	@Input() customBusinessList: any[] = [];
24
+  coopData: any = {}; //当前操作列
25
+	hosId:any;
26
+	hospitals:any = [];
27
+	isDeptLoading: boolean = false;
28
+
29
+	currentHospital:any;
30
+	malfunctionData:any = [];
31
+	allUserGroup:any = [];
32
+	userData:any = [];
33
+
34
+  changeCommonInpSubject = new Subject();
35
+	
36
+  ngOnInit() {
37
+		this.activeDictionaryKey = this.customBusinessList[0];
38
+		this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
39
+      this.getDept('add', {}, v);
40
+    });
41
+
42
+    // 优先级
43
+    setTimeout(() => {
44
+      this.tablePriorityHeight = document.querySelector('#priorityTable').clientHeight - document.querySelector('#priorityTable .list-template__top').clientHeight - 8 - document.querySelector('#priorityTable .thead').clientHeight;
45
+    }, 100)
46
+		this.hosId = this.tool.getCurrentHospital().id;
47
+		this.currentHospital = this.tool.getCurrentHospital();
48
+    this.getCommonFaultsList();
49
+		this.getHosList();
50
+  }
51
+	
52
+	activeDictionaryKey:any;
53
+	clickDictionaryKey(item){
54
+		this.activeDictionaryKey = item;
55
+		if(item.key=='one_connect'){
56
+			this.getCommonFaultsList();
57
+		}
58
+	}
59
+	
60
+	// 获取院区
61
+	hospitalList:any = [];
62
+	connectList:any = [];
63
+	getHosList() {
64
+	  let data = {
65
+			idx: 0,
66
+			sum: 99999,
67
+		};
68
+		this.mainService
69
+			.getFetchDataList("data", "hospital", data)
70
+			.subscribe((data) => {
71
+				this.hospitalList = data.list || [];
72
+			});
73
+			
74
+		this.mainService.getDictionary("list", "business_handover_type").subscribe((data) => {
75
+		  this.connectList = data || [];
76
+		});
77
+	}
78
+	
79
+	// 选择院区
80
+	taskTypeList:any = [];
81
+	changeHos(type, data?){
82
+		this.validatePriorityForm.controls.associationDept.setValue(null);
83
+		this.validatePriorityForm.controls.taskType.setValue(null);
84
+		this.getDept(type, data, '');
85
+		this.getTsakTypeList(type, data);
86
+	}
87
+	
88
+	// 获取任务类型
89
+	userList:any = [];
90
+	getTsakTypeList(type, obj?) {
91
+	  let query = {
92
+	  	idx: 0,
93
+	  	sum: 99999,
94
+			taskType:{
95
+				simpleQuery:true,
96
+				hosIds: this.validatePriorityForm.value.hosId
97
+			}
98
+	  };
99
+	  this.mainService
100
+	  	.getFetchDataList("configuration", "taskType", query)
101
+	  	.subscribe((data) => {
102
+	  		this.taskTypeList = data.list.filter(i=>i.associationType.value == 'other');
103
+				if(type=='edit'){
104
+					this.validatePriorityForm.controls.taskType.setValue(obj.taskType);
105
+				}
106
+	  	});
107
+	}
108
+	
109
+	// 获取科室
110
+	deptData:any = [];
111
+	getDept(type, obj:any = {}, dept?) {
112
+		if(!this.validatePriorityForm.value.hosId){
113
+			return
114
+		}
115
+	  let query = {
116
+	  	idx: 0,
117
+	  	sum: 20,
118
+	  	department:{
119
+	  		hospital: {
120
+					id: this.validatePriorityForm.value.hosId
121
+				},
122
+				dept: dept
123
+	  	}
124
+	  };
125
+	  this.mainService
126
+	  	.getFetchDataList("data", "department", query)
127
+	  	.subscribe((data) => {
128
+				this.isLoading = false;
129
+	  		this.deptData = data.list || [];
130
+				if(type == 'edit'){
131
+					let item = this.deptData.find(i=>i.id == obj.associationDeptDTO.id)
132
+					if(!item){
133
+						this.deptData.push({
134
+							dept: obj.associationDeptDTO.dept,
135
+							id: obj.associationDeptDTO.id
136
+						})
137
+					}
138
+					this.validatePriorityForm.controls.associationDept.setValue(obj.associationDeptDTO.id);
139
+				}
140
+	  	});
141
+	}
142
+	
143
+  // 新增优先级弹框
144
+  modelName = ""; //模态框名称
145
+  modalPriority: boolean = false; //新增/编辑模态框
146
+  add: boolean; //true:新增;false:编辑
147
+  addPriorityModal() {
148
+    this.modelName = "新增";
149
+    this.add = true; //新增
150
+    this.modalPriority = true;
151
+    this.initForm();
152
+  }
153
+  //关闭新增/编辑弹框
154
+  hidePriorityModal() {
155
+    this.modalPriority = false;
156
+  }
157
+
158
+	isLoading:boolean = false;
159
+	// 搜索科室
160
+  changeCommonInp( e) {
161
+		this.isLoading = true
162
+    this.changeCommonInpSubject.next(e);
163
+  }
164
+
165
+  // 编辑
166
+  editPriority(data) {
167
+    console.log(data);
168
+    this.modelName = "编辑";
169
+    this.add = false;
170
+    this.modalPriority = true;
171
+    this.initForm();
172
+    this.coopData = data;
173
+    this.validatePriorityForm.controls.hosId.setValue(data.hosId);
174
+    this.validatePriorityForm.controls.orders.setValue(data.orders);
175
+    this.validatePriorityForm.controls.handoverName.setValue(data.handoverName);
176
+		this.validatePriorityForm.controls.handoverType.setValue(data.handoverType.id);
177
+		this.changeHos('edit', data)
178
+	}
179
+
180
+  // 新增/编辑表单提交
181
+  btnLoading: boolean = false; //提交按钮loading状态
182
+  submitPriorityForm(): void {
183
+    for (const i in this.validatePriorityForm.controls) {
184
+      this.validatePriorityForm.controls[i].markAsDirty();
185
+      this.validatePriorityForm.controls[i].updateValueAndValidity();
186
+    }
187
+    if (this.validatePriorityForm.invalid) {
188
+      return;
189
+    }
190
+    console.log(this.validatePriorityForm.value);
191
+    this.btnLoading = true;
192
+    let postData:any = {};
193
+    if (this.add) {
194
+      //增加
195
+      postData = {
196
+				businessHandoverConfig:{
197
+					hosId: this.validatePriorityForm.value.hosId,
198
+					orders: this.validatePriorityForm.value.orders || undefined,
199
+					handoverName: this.validatePriorityForm.value.handoverName,
200
+					associationDept: this.validatePriorityForm.value.associationDept || undefined,
201
+					handoverType: {
202
+						id: this.validatePriorityForm.value.handoverType
203
+					},
204
+					taskType: this.validatePriorityForm.value.taskType,
205
+				}
206
+      };
207
+    } else {
208
+      //编辑
209
+      postData = {
210
+				businessHandoverConfig:{
211
+					...this.coopData,
212
+					hosId: this.validatePriorityForm.value.hosId,
213
+					orders: this.validatePriorityForm.value.orders || undefined,
214
+					handoverName: this.validatePriorityForm.value.handoverName,
215
+					associationDept: this.validatePriorityForm.value.associationDept || undefined,
216
+					handoverType: {
217
+						id: this.validatePriorityForm.value.handoverType
218
+					},
219
+					taskType: this.validatePriorityForm.value.taskType,
220
+				}
221
+      };
222
+    }
223
+    this.mainService
224
+      .dataPost(this.add ? "addData": "updData", "businessHandoverConfig", postData)
225
+      .subscribe((result) => {
226
+        this.btnLoading = false;
227
+        this.hidePriorityModal();
228
+        let msg = "";
229
+        if (this.add) {
230
+          msg = "新增";
231
+        } else {
232
+          msg = "修改";
233
+        }
234
+        if (result.status == 200) {
235
+          this.showPromptModal(msg, true, '');
236
+        } else {
237
+          this.showPromptModal(msg, false, result.msg);
238
+        }
239
+      });
240
+  }
241
+
242
+  // 初始化新增form表单
243
+  validatePriorityForm: FormGroup; //新增/编辑表单
244
+  initForm() {
245
+    this.validatePriorityForm = this.fb.group({
246
+      hosId: [null, [Validators.required]],
247
+      orders: [null, [Validators.required]],
248
+      handoverName: [null, [Validators.required]],
249
+			associationDept: [null, [Validators.required]],
250
+			handoverType: [null, [Validators.required]],
251
+			taskType: [null, [Validators.required]],
252
+    });
253
+		this.deptData = [];
254
+		this.taskTypeList = [];
255
+    console.log(this.validatePriorityForm.controls)
256
+  }
257
+
258
+  // 获取列表
259
+  loading1:boolean = false;
260
+  commonFaultsList: any[] = []; //表格数据
261
+  tablePriorityHeight:number = 0;
262
+  getCommonFaultsList() {
263
+    let data = {
264
+			idx: 0,
265
+			sum: 99999,
266
+			// businessHandoverConfig: {
267
+			// 	hosId: this.hosId
268
+			// },
269
+		};
270
+		this.loading1 = true;
271
+		this.mainService
272
+			.getFetchDataList("simple/data", "businessHandoverConfig", data)
273
+			.subscribe((data) => {
274
+				this.loading1 = false;
275
+				this.commonFaultsList = data.list || [];
276
+			});
277
+  }
278
+
279
+  delModal: boolean = false; //删除模态框
280
+  tipsMsg1: string; //提示框信息
281
+  tipsMsg2: string; //操作后信息
282
+  confirmDelType: string; //确认的类型(启用/停用,删除)
283
+  showDelModal(
284
+    data,
285
+    tipsMsg1: string,
286
+    tipsMsg2: string,
287
+    type: string,
288
+  ) {
289
+    this.confirmDelType = type;
290
+    this.delModal = true;
291
+    this.coopData = data;
292
+    console.log(this.coopData);
293
+    this.tipsMsg1 = tipsMsg1;
294
+    this.tipsMsg2 = tipsMsg2;
295
+  }
296
+  // 隐藏删除框
297
+  hideDelModal() {
298
+    this.delModal = false;
299
+  }
300
+  // 确认删除
301
+  confirmDel() {
302
+    this.btnLoading = true;
303
+		this.mainService
304
+			.simplePost("rmvData", "businessHandoverConfig", [this.coopData.id])
305
+			.subscribe((data) => {
306
+				this.btnLoading = false;
307
+				this.delModal = false;
308
+				if (data.status == 200) {
309
+					this.showPromptModal(this.tipsMsg2, true, "");
310
+				} else {
311
+					this.showPromptModal(this.tipsMsg2, false, data.msg);
312
+				}
313
+			});
314
+  }
315
+
316
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
317
+  promptContent: string; //操作提示框提示信息
318
+  ifSuccess: boolean; //操作成功/失败
319
+  promptInfo: string; //操作结果提示信息
320
+  promptModalShow: boolean; //操作提示框是否展示
321
+  showPromptModal(con, success, promptInfo?) {
322
+    this.promptModalShow = false;
323
+    this.promptContent = con;
324
+    this.ifSuccess = success;
325
+    this.promptInfo = promptInfo;
326
+    setTimeout(() => {
327
+      this.promptModalShow = true;
328
+    }, 100);
329
+    this.getCommonFaultsList();
330
+  }
331
+}

+ 107 - 4
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html

@@ -5,15 +5,15 @@
5 5
         <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of dictionaryKeyList">{{ item.name }}</div>
6 6
       </overlay-scrollbars>
7 7
     </div>
8
-    <div class="addressAssign">
8
+    <div class="addressAssign" *ngIf="activeDictionaryKey.key != 'business_type'">
9 9
       <div class="contentBody">
10 10
         <div class="dictionaryRow">
11 11
           <div class="orders">排序号</div>
12 12
           <div class="name">键</div>
13 13
           <div [ngClass]="{value_2: activeDictionaryKey.key == 'alarm_urgency', value: activeDictionaryKey.key != 'alarm_urgency'}">值</div>
14
-					<!-- <div class="value_2" *ngIf="activeDictionaryKey.key == 'alarm_urgency'">关键字</div> -->
14
+					<div class="value_2" *ngIf="activeDictionaryKey.key == 'alarm_urgency'">关键字</div>
15 15
         </div>
16
-        <overlay-scrollbars #osComponentRef2 class="contentBody2">
16
+        <overlay-scrollbars #osComponentRef2 class="contentBody2" *ngIf="initTyepe">
17 17
           <form nz-form [formGroup]="validateDictionaryForm" class="w100">
18 18
             <div class="dictionaryRow" *ngFor="let data of dictionaryList;let i = index;">
19 19
               <div class="orders">
@@ -61,9 +61,51 @@
61 61
         </overlay-scrollbars>
62 62
       </div>
63 63
       <div class="contentBtns">
64
-        <button nz-button nzType="primary" class="ml8" (click)="saveDictionary()">保存</button>
64
+        <button nz-button nzType="primary" class="ml8" (click)="saveDictionary()" [nzLoading]="btnLoading">保存</button>
65 65
       </div>
66 66
     </div>
67
+		<div class="addressAssign" *ngIf="activeDictionaryKey.key == 'business_type'">
68
+			<div class="list-template" id="priorityTable">
69
+			  <div class="list-template__content">
70
+			    <div class="list-template__bottom">
71
+			     <div class="list-template__top" nz-row>
72
+			        <div nz-col nzLg="24" class="list-template__btns">
73
+			          <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
74
+			        </div>
75
+			      </div>
76
+			      <nz-table class="list-template__nzTable" [nzData]="commonFaultsList" nzSize="middle" [nzShowPagination]="false"
77
+			        [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
78
+			        <thead>
79
+			          <tr class="thead">
80
+			            <th nzWidth="25%">院区</th>
81
+			            <th nzWidth="25%">业务名称</th>
82
+			            <th nzWidth="25%">业务code</th>
83
+									<th nzWidth="25%">关联任务类型</th>
84
+									<th nzWidth="120px">操作</th>
85
+			          </tr>
86
+			        </thead>
87
+			        <tbody>
88
+			          <tr *ngFor="let data of commonFaultsList;let i = index">
89
+			            <td>{{data.hospitalDTO?.hosName}}</td>
90
+									<td>{{data.businessName || ''}}</td>
91
+									<td>{{data.businessCode}}</td>
92
+									<td>{{data.taskTypeName}}</td>
93
+			            <td>
94
+			              <div class="coop">
95
+			                <span (click)="showBusinessModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
96
+			                <span (click)="edit(data)">编辑</span>
97
+			              </div>
98
+			            </td>
99
+			          </tr>
100
+			        </tbody>
101
+			      </nz-table>
102
+			    </div>
103
+			  </div>
104
+			</div>
105
+		</div>
106
+		<div class="mask-style" *ngIf="!initTyepe">
107
+			<nz-spin nzSimple class="spin-style"></nz-spin>
108
+		</div>
67 109
   </div>
68 110
 </div>
69 111
 
@@ -78,3 +120,64 @@
78 120
 
79 121
 <!-- 遮罩 -->
80 122
 <app-mask *ngIf="maskFlag"></app-mask>
123
+
124
+<!-- 删除业务类型模态框 -->
125
+<app-dialog-delete [delModal]="delBusinessModal" (hideDelModalEvent)="hideBusinessModal()" [btnLoading]="btnLoading"
126
+(confirmDelEvent)="confirmBusiness()" content="您确认要删除吗?"></app-dialog-delete>
127
+
128
+<!-- 新增/编辑模态框 -->
129
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
130
+  <div class="modalBody">
131
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
132
+    <div class="content">
133
+      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
134
+				<nz-form-item>
135
+				  <nz-form-label nzFor="hosId" nzRequired [nzSpan]="6">院区</nz-form-label>
136
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择院区!">
137
+						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择院区" formControlName="hosId" (ngModelChange)="changeHos($event)">
138
+						  <ng-container *ngFor="let option of hospitalList">
139
+						    <nz-option [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
140
+						  </ng-container>
141
+						</nz-select>
142
+				  </nz-form-control>
143
+				</nz-form-item>
144
+				
145
+				<nz-form-item>
146
+				  <nz-form-label [nzSpan]="6" nzFor="businessName" nzRequired>业务名称</nz-form-label>
147
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请输入业务名称!">
148
+				    <nz-input-group>
149
+				      <input formControlName="businessName" nz-input placeholder="请输入业务名称">
150
+				    </nz-input-group>
151
+				  </nz-form-control>
152
+				</nz-form-item>
153
+				
154
+				<nz-form-item>
155
+				  <nz-form-label [nzSpan]="6" nzFor="businessCode" nzRequired>业务code</nz-form-label>
156
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请输入业务code!">
157
+				    <nz-input-group>
158
+				      <input formControlName="businessCode" nz-input placeholder="请输入业务code">
159
+				    </nz-input-group>
160
+				  </nz-form-control>
161
+				</nz-form-item>
162
+
163
+        <nz-form-item>
164
+          <nz-form-label nzFor="taskTypeIds" nzRequired [nzSpan]="6">关联任务类型</nz-form-label>
165
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择关联任务类型!">
166
+						<nz-select class="formItem" nzMode="multiple" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择关联任务类型" formControlName="taskTypeIds">
167
+						  <ng-container *ngFor="let option of taskTypeList">
168
+						    <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
169
+						  </ng-container>
170
+						  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
171
+						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
172
+						  </nz-option>
173
+						</nz-select>
174
+          </nz-form-control>
175
+        </nz-form-item>
176
+      </form>
177
+    </div>
178
+    <div class=" display_flex justify-content_flex-center">
179
+      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
180
+      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
181
+    </div>
182
+  </div>
183
+</div>

+ 188 - 0
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.less

@@ -15,6 +15,21 @@
15 15
     width: 100%!important;
16 16
     height: 100%!important;
17 17
   }
18
+	.mask-style{
19
+		width: 100%;
20
+		height: 100%;
21
+		position: fixed;
22
+		top: 0;
23
+		left: 0;
24
+		z-index: 999;
25
+		display: flex;
26
+		background: rgba(0,0,0,0.2);
27
+		align-items: center;
28
+		justify-content: center;
29
+	}
30
+	.spin-style{
31
+		z-index:9999;
32
+	}
18 33
   #dictionary{
19 34
     margin: 24px 16px;
20 35
     .addressAssign{
@@ -188,4 +203,177 @@
188 203
       align-items: center;
189 204
     }
190 205
   }
206
+	
207
+	.save {
208
+	  position: fixed;
209
+	  left: 0;
210
+	  top: 0;
211
+	  width: 100%;
212
+	  height: 100%;
213
+	  background: rgba(0, 0, 0, 0.4);
214
+	  z-index: 99;
215
+	
216
+	  .tips{
217
+	    margin-bottom: 16px!important;
218
+	  }
219
+	
220
+	  .modalBody {
221
+	    width: 350px;
222
+	    background: #fff;
223
+	    border-radius: 5px;
224
+	    padding: 10px 20px;
225
+	    color: #333;
226
+	
227
+	    .title {
228
+	      width: 100%;
229
+	      text-align: center;
230
+	      font-size: 18px;
231
+	      position: relative;
232
+	
233
+	      i {
234
+	        position: absolute;
235
+	        right: 0;
236
+	        top: 0;
237
+	        font-size: 20px;
238
+	        color: #666;
239
+	        cursor: pointer;
240
+	        padding: 0 5px;
241
+	      }
242
+	    }
243
+	
244
+	    .content {
245
+	      width: 310px;
246
+	      background: #f9fafb;
247
+	      border: 1px solid #e5e9ed;
248
+	      border-radius: 5px;
249
+	      overflow: hidden;
250
+	      margin-top: 12px;
251
+	      padding: 16px 0;
252
+	
253
+	      .busyList{
254
+	        display: flex;
255
+	        margin-bottom: 8px;
256
+	        .busyContent{
257
+	          margin-right: 8px;
258
+	          flex: 1;
259
+	        }
260
+	      }
261
+	
262
+	      & > div {
263
+	        text-align: center;
264
+	        margin: 0;
265
+	
266
+	        &.icon {
267
+	          // margin-top: 17px;
268
+	
269
+	          i {
270
+	            color: #34b349;
271
+	            font-size: 30px !important;
272
+	
273
+	            &.transport-wenhao {
274
+	              color: #f5a523;
275
+	            }
276
+	
277
+	            &.transport-shibai {
278
+	              color: #ff3a52;
279
+	            }
280
+	          }
281
+	        }
282
+	
283
+	        &.defeat {
284
+	          color: #333;
285
+	          font-size: 14px;
286
+	        }
287
+	
288
+	        &:nth-child(3) {
289
+	          font-size: 14px;
290
+	          color: #666;
291
+	        }
292
+	      }
293
+	      .workAssignmentTips {
294
+	        font-size: 12px;
295
+	      }
296
+	    }
297
+	
298
+	    button {
299
+	      margin-top: 10px;
300
+	
301
+	      &.btn {
302
+	        margin-left: 8px;
303
+	      }
304
+	    }
305
+	  }
306
+	
307
+	  // 新增
308
+	  &.add {
309
+	    .modalBody {
310
+	      width: 480px;
311
+	      height: auto;
312
+	
313
+	      .content {
314
+	        width: 100%;
315
+	        height: auto;
316
+	        padding: 16px;
317
+	        max-height: 497px;
318
+	        overflow-y: auto;
319
+	
320
+	        .addForm {
321
+	          .ant-form-item {
322
+	            margin-bottom: 0;
323
+							.ant-select{
324
+								width: 100% !important;
325
+							}
326
+	            .ant-form-item-label {
327
+	              text-align: left;
328
+	            }
329
+	
330
+	            .desc {
331
+	              margin-top: 5px;
332
+	            }
333
+	          }
334
+	
335
+	          .datesControl {
336
+	            margin-top: -16px;
337
+	
338
+	            .ant-form-item-label {
339
+	              line-height: 40px;
340
+	            }
341
+	          }
342
+	
343
+	          .timer {
344
+	            .ant-form-item-label {
345
+	              width: 100%;
346
+	              text-align: left;
347
+	            }
348
+	
349
+	            .numInp {
350
+	              margin-right: 5px;
351
+	            }
352
+	
353
+	            .line {
354
+	              margin-right: 5px;
355
+	            }
356
+	          }
357
+	
358
+	          .timer2 {
359
+	            .ant-form-item-label {
360
+	              line-height: 20px;
361
+	            }
362
+	          }
363
+	        }
364
+	
365
+	        .editForm {
366
+	          .ant-form-item {
367
+	            margin-bottom: 15px;
368
+	
369
+	            .ant-form-item-label {
370
+	              line-height: 14px;
371
+	              text-align: left;
372
+	            }
373
+	          }
374
+	        }
375
+	      }
376
+	    }
377
+	  }
378
+	}
191 379
 }

+ 292 - 36
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts

@@ -6,6 +6,8 @@ import { ToolService } from 'src/app/services/tool.service';
6 6
 import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
7 7
 import { NzMessageService } from 'ng-zorro-antd';
8 8
 import { v4 as uuidv4, validate as uuidValidate } from 'uuid';
9
+import { Subject } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
9 11
 
10 12
 @Component({
11 13
   selector: "app-configuration-dictionary",
@@ -31,11 +33,15 @@ export class ConfigurationDictionaryComponent implements OnInit {
31 33
     static: false,
32 34
   })
33 35
   osComponentRef2: OverlayScrollbarsComponent;
34
-
36
+	changeCommonInpSubject = new Subject();
37
+	hosId:any;
38
+	
35 39
   ngOnInit() {
36 40
     this.activeDictionaryKey = this.dictionaryKeyList[0];
41
+		this.hosId = this.tool.getCurrentHospital().id;
37 42
     this.getDictionaryList();
38 43
     this.initDictionaryForm();
44
+		this.getHosList();
39 45
   }
40 46
 
41 47
   // 数据字典key列表
@@ -45,7 +51,14 @@ export class ConfigurationDictionaryComponent implements OnInit {
45 51
   activeDictionaryKey:any;
46 52
   clickDictionaryKey(item){
47 53
     this.activeDictionaryKey = item;
48
-    this.getDictionaryList();
54
+		if(item.key=='business_type'){
55
+			setTimeout(() => {
56
+			  this.tablePriorityHeight = document.querySelector('#priorityTable').clientHeight - document.querySelector('#priorityTable .list-template__top').clientHeight - 8 - document.querySelector('#priorityTable .thead').clientHeight;
57
+			}, 100)
58
+			this.getCommonFaultsList();
59
+		}else{
60
+			this.getDictionaryList();
61
+		}
49 62
   }
50 63
 
51 64
   btnLoading: boolean = false; //提交按钮loading状态
@@ -64,7 +77,11 @@ export class ConfigurationDictionaryComponent implements OnInit {
64 77
     setTimeout(() => {
65 78
       this.promptModalShow = true;
66 79
     }, 100);
67
-    this.getDictionaryList();
80
+		if(this.activeDictionaryKey.key=='business_type'){
81
+			this.getCommonFaultsList();
82
+		}else{
83
+			this.getDictionaryList();
84
+		}
68 85
   }
69 86
 
70 87
   coopData: any = {}; //当前操作列
@@ -123,7 +140,9 @@ export class ConfigurationDictionaryComponent implements OnInit {
123 140
 
124 141
   // 获取数据字典数据
125 142
   maskFlag: any = false;
143
+	initTyepe:boolean = false;
126 144
   getDictionaryList() {
145
+		this.initTyepe = false
127 146
     let postData = {
128 147
       idx: 0,
129 148
       sum: 9999,
@@ -139,59 +158,105 @@ export class ConfigurationDictionaryComponent implements OnInit {
139 158
       this.maskFlag = false;
140 159
       let list = data.list || [];
141 160
       if(list.length){
142
-        this.dictionaryList = list.map(v => {
143
-          return {
144
-            id: v.id,
145
-            name: v.name || null,
146
-            value: v.value || null,
147
-            orders: v.orders || null,
148
-            system: v.system || false,
149
-          }
150
-        });
161
+				if(this.activeDictionaryKey.key == 'alarm_urgency'){
162
+					this.dictionaryList = list.map(v => {
163
+					  return {
164
+					    id: v.id,
165
+					    name: v.name || null,
166
+					    value: v.value || null,
167
+					    orders: v.orders || null,
168
+					    system: v.system || false,
169
+							extra1: v.extra1 || null,
170
+					  }
171
+					});
172
+				}else{
173
+					this.dictionaryList = list.map(v => {
174
+					  return {
175
+					    id: v.id,
176
+					    name: v.name || null,
177
+					    value: v.value || null,
178
+					    orders: v.orders || null,
179
+					    system: v.system || false,
180
+					  }
181
+					});
182
+				}
151 183
       }else{
152
-        this.dictionaryList = [
153
-          {
154
-            id: uuidv4(),
155
-            name: null,
156
-            value: null,
157
-            orders: null,
158
-            system: false,
159
-          }
160
-        ];
184
+				if(this.activeDictionaryKey.key == 'alarm_urgency'){
185
+					this.dictionaryList = [
186
+					  {
187
+					    id: uuidv4(),
188
+					    name: null,
189
+					    value: null,
190
+					    orders: null,
191
+					    system: false,
192
+							extra1: null,
193
+					  }
194
+					];
195
+				}else{
196
+					this.dictionaryList = [
197
+					  {
198
+					    id: uuidv4(),
199
+					    name: null,
200
+					    value: null,
201
+					    orders: null,
202
+					    system: false,
203
+					  }
204
+					];
205
+				}
161 206
       }
162 207
 
163
-      console.log(this.dictionaryList);
164 208
       // 动态添加表单
165 209
       this.dictionaryList.forEach((obj, i) => {
166 210
         for (const key in obj) {
167 211
           if(key !== 'id' && key !== 'system'){
168 212
             if(this.activeDictionaryKey.key === 'incident_status' || this.activeDictionaryKey.key === 'incident_degree'){
169 213
               this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: true}, [Validators.required]))
214
+            }else if(this.activeDictionaryKey.key === 'alarm_urgency'){
215
+              this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, []))
170 216
             }else{
171
-              this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, [Validators.required]))
172
-            }
217
+							this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, [Validators.required]))
218
+						}
173 219
           }
174 220
         }
175 221
       })
176
-      console.log(this.validateDictionaryForm.controls)
222
+			setTimeout(_=>{
223
+				this.initTyepe = true
224
+			},1000)
177 225
     })
178 226
   }
179 227
 
180 228
   // 添加数据字典
181 229
   addField(i:number): void{
182
-    let obj = {
183
-      id: uuidv4(),
184
-      name: null,
185
-      value: null,
186
-      orders: null,
187
-      system: false,
188
-    };
230
+		let obj:any = {}
231
+		if(this.activeDictionaryKey.key == 'alarm_urgency'){
232
+			obj = {
233
+			  id: uuidv4(),
234
+			  name: null,
235
+			  value: null,
236
+			  orders: null,
237
+			  system: false,
238
+				extra1:null,
239
+			};
240
+		}else{
241
+			obj = {
242
+			  id: uuidv4(),
243
+			  name: null,
244
+			  value: null,
245
+			  orders: null,
246
+			  system: false,
247
+			};
248
+		}
249
+
189 250
 
190 251
     // 动态添加表单
191 252
     for (const key in obj) {
192 253
       console.log(key + '_' + obj.id)
193 254
       if(key !== 'id' && key !== 'system'){
194
-        this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, [Validators.required]))
255
+				if(key !== 'extra1'){
256
+					this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, [Validators.required]))
257
+				}else{
258
+					this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, []))
259
+				}
195 260
       }
196 261
     }
197 262
 
@@ -214,7 +279,6 @@ export class ConfigurationDictionaryComponent implements OnInit {
214 279
 
215 280
   // 保存数据字典
216 281
   saveDictionary(): void {
217
-    console.log(this.coopData)
218 282
     for (const i in this.validateDictionaryForm.controls) {
219 283
       this.validateDictionaryForm.controls[i].markAsDirty();
220 284
       this.validateDictionaryForm.controls[i].updateValueAndValidity();
@@ -234,12 +298,12 @@ export class ConfigurationDictionaryComponent implements OnInit {
234 298
         name: rawValueObj['name_' + this.dictionaryList[i].id],
235 299
         value: rawValueObj['value_' + this.dictionaryList[i].id],
236 300
         orders: rawValueObj['orders_' + this.dictionaryList[i].id],
237
-				// extra1: this.activeDictionaryKey.key == 'alarm_urgency' ? rawValueObj['extra1_' + this.dictionaryList[i].id]: undefined,
301
+				extra1: this.activeDictionaryKey.key == 'alarm_urgency' ? rawValueObj['extra1_' + this.dictionaryList[i].id]: undefined,
238 302
         system: uuidValidate(this.dictionaryList[i].id) ? false : this.dictionaryList[i].system,
239 303
         key: this.activeDictionaryKey.key,
240 304
       })
241 305
     }
242
-    console.log(postData);
306
+
243 307
     this.btnLoading = true;
244 308
     this.mainService
245 309
       .simplePost("addListData", "dictionary", postData)
@@ -253,4 +317,196 @@ export class ConfigurationDictionaryComponent implements OnInit {
253 317
         }
254 318
       });
255 319
   }
320
+	
321
+	// 获取院区
322
+	hospitalList:any = [];
323
+	getHosList() {
324
+	  let data = {
325
+			idx: 0,
326
+			sum: 99999,
327
+		};
328
+		this.mainService
329
+			.getFetchDataList("data", "hospital", data)
330
+			.subscribe((data) => {
331
+				this.hospitalList = data.list || [];
332
+			});
333
+	}
334
+	
335
+	// 选择院区
336
+	taskTypeList:any = [];
337
+	changeHos(e){
338
+		this.validatePriorityForm.controls.taskTypeIds.setValue(null);
339
+		this.getTsakTypeList('add');
340
+	}
341
+	
342
+	// 获取任务类型
343
+	userList:any = [];
344
+	getTsakTypeList(type, obj?) {
345
+	  let data = {
346
+	  	idx: 0,
347
+	  	sum: 99999,
348
+			taskType:{
349
+				simpleQuery:true,
350
+				hosIds: this.validatePriorityForm.value.hosId
351
+			}
352
+	  };
353
+	  this.mainService
354
+	  	.getFetchDataList("configuration", "taskType", data)
355
+	  	.subscribe((data) => {
356
+	  		this.taskTypeList = data.list || [];
357
+				if(type=='edit'){
358
+					this.validatePriorityForm.controls.taskTypeIds.setValue(obj);
359
+				}
360
+	  	});
361
+	}
362
+	
363
+	// 新增优先级弹框
364
+	modelName = ""; //模态框名称
365
+	modalPriority: boolean = false; //新增/编辑模态框
366
+	add: boolean; //true:新增;false:编辑
367
+	addPriorityModal() {
368
+	  this.modelName = "新增";
369
+	  this.add = true; //新增
370
+	  this.modalPriority = true;
371
+	  this.initForm();
372
+	}
373
+	//关闭新增/编辑弹框
374
+	hidePriorityModal() {
375
+	  this.modalPriority = false;
376
+	}
377
+	
378
+	isLoading:boolean = false;
379
+	// 编辑
380
+	edit(data) {
381
+	  this.modelName = "编辑";
382
+	  this.add = false;
383
+	  this.modalPriority = true;
384
+	  this.initForm();
385
+	  this.coopData = data;
386
+	  this.validatePriorityForm.controls.hosId.setValue(data.hospitalDTO.id);
387
+	  this.validatePriorityForm.controls.businessName.setValue(data.businessName?data.businessName:null);
388
+	  this.validatePriorityForm.controls.businessCode.setValue(data.businessCode);
389
+		let taskType = data.taskTypeIds.split(',')
390
+		taskType = taskType.map(i=>{
391
+			return parseInt(i)
392
+		})
393
+		this.getTsakTypeList('edit', taskType);
394
+	}
395
+	
396
+	// 新增/编辑表单提交
397
+	submitPriorityForm(): void {
398
+	  for (const i in this.validatePriorityForm.controls) {
399
+	    this.validatePriorityForm.controls[i].markAsDirty();
400
+	    this.validatePriorityForm.controls[i].updateValueAndValidity();
401
+	  }
402
+	  if (this.validatePriorityForm.invalid) {
403
+	    return;
404
+	  }
405
+	  console.log(this.validatePriorityForm.value);
406
+	  this.btnLoading = true;
407
+	  let postData:any = {};
408
+	  if (this.add) {
409
+	    //增加
410
+	    postData = {
411
+				businessTaskType:{
412
+					hosId: this.validatePriorityForm.value.hosId,
413
+					businessName: this.validatePriorityForm.value.businessName || undefined,
414
+					businessCode: this.validatePriorityForm.value.businessCode,
415
+					taskTypeIds: this.validatePriorityForm.value.taskTypeIds.toString(),
416
+				}
417
+	    };
418
+	  } else {
419
+	    //编辑
420
+	    postData = {
421
+				businessTaskType:{
422
+					...this.coopData,
423
+					hosId: this.validatePriorityForm.value.hosId,
424
+					businessName: this.validatePriorityForm.value.businessName || undefined,
425
+					businessCode: this.validatePriorityForm.value.businessCode,
426
+					taskTypeIds: this.validatePriorityForm.value.taskTypeIds.toString(),
427
+				}
428
+	    };
429
+	  }
430
+	  this.mainService
431
+	    .dataPost(this.add ? "addData": "updData", "businessTaskType", postData)
432
+	    .subscribe((result) => {
433
+	      this.btnLoading = false;
434
+	      this.hidePriorityModal();
435
+	      let msg = "";
436
+	      if (this.add) {
437
+	        msg = "新增";
438
+	      } else {
439
+	        msg = "修改";
440
+	      }
441
+	      if (result.status == 200) {
442
+	        this.showPromptModal(msg, true, '');
443
+	      } else {
444
+	        this.showPromptModal(msg, false, result.msg);
445
+	      }
446
+	    });
447
+	}
448
+	
449
+	// 初始化新增form表单
450
+	validatePriorityForm: FormGroup; //新增/编辑表单
451
+	initForm() {
452
+	  this.validatePriorityForm = this.fb.group({
453
+	    hosId: [null, [Validators.required]],
454
+	    businessName: [null, [Validators.required]],
455
+	    businessCode: [null, [Validators.required]],
456
+			taskTypeIds: [null, [Validators.required]],
457
+	  });
458
+	}
459
+	
460
+	// 获取列表
461
+	loading1:boolean = false;
462
+	commonFaultsList: any[] = []; //表格数据
463
+	tablePriorityHeight:number = 0;
464
+	getCommonFaultsList() {
465
+	  let data = {
466
+			idx: 0,
467
+			sum: 99999,
468
+			// businessTaskType: {
469
+			// 	hosId: this.hosId
470
+			// },
471
+		};
472
+		this.loading1 = true;
473
+		this.mainService
474
+			.getFetchDataList("simple/data", "businessTaskType", data)
475
+			.subscribe((data) => {
476
+				this.loading1 = false;
477
+				data.list.forEach(i=>{
478
+					i.taskTypeName = i.taskTypeDTOS.map(i=>{
479
+						return i.taskName
480
+					}).toString()
481
+				})
482
+				this.commonFaultsList = data.list || [];
483
+			});
484
+	}
485
+	
486
+	// 删除业务类型
487
+	showBusinessModal(data){
488
+		this.coopData = data
489
+		this.delBusinessModal = true;
490
+	}
491
+	
492
+	// 隐藏删除框
493
+	delBusinessModal:boolean = false;
494
+	hideBusinessModal() {
495
+	  this.delBusinessModal = false;
496
+	}
497
+	// 确认删除
498
+	confirmBusiness() {
499
+	  this.btnLoading = true;
500
+		this.mainService
501
+			.simplePost("rmvData", "businessTaskType", [this.coopData.id])
502
+			.subscribe((data) => {
503
+				this.btnLoading = false;
504
+				this.delBusinessModal = false;
505
+				if (data.status == 200) {
506
+					this.showPromptModal(this.tipsMsg2, true, "");
507
+				} else {
508
+					this.showPromptModal(this.tipsMsg2, false, data.msg);
509
+				}
510
+			});
511
+	}
256 512
 }

+ 139 - 0
src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.html

@@ -0,0 +1,139 @@
1
+<div class="content" id="dictionary">
2
+  <div class="contentInner">
3
+    <div class="address">
4
+      <overlay-scrollbars #osComponentRef1 class="contentBody">
5
+        <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of voluntarilyTabList">{{ item.name }}</div>
6
+      </overlay-scrollbars>
7
+    </div>
8
+    <div class="addressAssign" *ngIf="activeDictionaryKey.key=='alarmConfig'">
9
+			<div class="list-template" id="priorityTable">
10
+			  <div class="list-template__content">
11
+			    <div class="list-template__bottom">
12
+			     <div class="list-template__top" nz-row>
13
+			        <div nz-col nzLg="24" class="list-template__btns">
14
+			          <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
15
+			        </div>
16
+			      </div>
17
+			      <nz-table class="list-template__nzTable" [nzData]="commonFaultsList" nzSize="middle" [nzShowPagination]="false"
18
+			        [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
19
+			        <thead>
20
+			          <tr class="thead">
21
+			            <th nzWidth="20%">告警优先级</th>
22
+			            <th nzWidth="20%">关键字</th>
23
+			            <th nzWidth="20%">关联故障现象</th>
24
+									<th nzWidth="20%">处理人|组</th>
25
+									<th nzWidth="15%">是否启用</th>
26
+									<th nzWidth="120px">操作</th>
27
+			          </tr>
28
+			        </thead>
29
+			        <tbody>
30
+			          <tr *ngFor="let data of commonFaultsList;let i = index">
31
+			            <td>{{data.alarmUrgency && data.alarmUrgency.name}}</td>
32
+									<td>{{data.keywords || ''}}</td>
33
+									<td>{{data.categoryDTO?.mutiCategory}}</td>
34
+			            <td>
35
+										<div>{{data.userDTO?.name}}</div>
36
+										<div>{{data.groupDTO?.groupName}}</div>
37
+									</td>
38
+									<td>{{data.flag?'是':'否'}}</td>
39
+			            <td>
40
+			              <div class="coop">
41
+			                <span (click)="showDelModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
42
+			                <span (click)="editPriority(data)">编辑</span>
43
+			              </div>
44
+			            </td>
45
+			          </tr>
46
+			        </tbody>
47
+			      </nz-table>
48
+			    </div>
49
+			  </div>
50
+			</div>
51
+    </div>
52
+  </div>
53
+</div>
54
+
55
+<!-- 操作成功/失败提示框 -->
56
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
57
+  [info]="promptInfo">
58
+</app-prompt-modal>
59
+
60
+<!-- 删除模态框 -->
61
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
62
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
63
+
64
+<!-- 新增/编辑模态框 -->
65
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
66
+  <div class="modalBody">
67
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
68
+    <div class="content">
69
+      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
70
+        <nz-form-item>
71
+          <nz-form-label nzFor="alarmUrgency" nzRequired [nzSpan]="6">告警优先级</nz-form-label>
72
+          <nz-form-control [nzSpan]="18">
73
+        		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择告警优先级" formControlName="alarmUrgency">
74
+        		  <ng-container *ngFor="let option of emergencyData">
75
+        		    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
76
+        		  </ng-container>
77
+        		</nz-select>
78
+          </nz-form-control>
79
+        </nz-form-item>
80
+				<nz-form-item>
81
+				  <nz-form-label [nzSpan]="6" nzFor="keywords">关键字</nz-form-label>
82
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请输入关键字!">
83
+				    <nz-input-group>
84
+				      <input formControlName="keywords" nz-input placeholder="请输入关键字">
85
+				    </nz-input-group>
86
+				  </nz-form-control>
87
+				</nz-form-item>
88
+        <nz-form-item>
89
+          <nz-form-label nzFor="categoryId" nzRequired [nzSpan]="6">故障现象</nz-form-label>
90
+          <nz-form-control [nzSpan]="18">
91
+						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择故障现象" formControlName="categoryId" (nzOnSearch)="changeCommonInp('category', $event)">
92
+						  <ng-container *ngFor="let option of malfunctionData">
93
+						    <nz-option *ngIf="!isLoading" [nzLabel]="option.mutiCategory" [nzValue]="option.id"></nz-option>
94
+						  </ng-container>
95
+						  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
96
+						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
97
+						  </nz-option>
98
+						</nz-select>
99
+          </nz-form-control>
100
+        </nz-form-item>
101
+				<nz-form-item>
102
+				  <nz-form-label nzFor="groupId" nzRequired [nzSpan]="6">处理组</nz-form-label>
103
+				  <nz-form-control [nzSpan]="18">
104
+						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理组" formControlName="groupId" (ngModelChange)="changeGroup($event)">
105
+						  <ng-container *ngFor="let option of groupList">
106
+						    <nz-option [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
107
+						  </ng-container>
108
+						</nz-select>
109
+				  </nz-form-control>
110
+				</nz-form-item>
111
+				
112
+				<nz-form-item>
113
+				  <nz-form-label nzFor="userId" [nzSpan]="6">处理人</nz-form-label>
114
+				  <nz-form-control [nzSpan]="18">
115
+						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理人" formControlName="userId">
116
+						  <ng-container *ngFor="let option of userList">
117
+						    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
118
+						  </ng-container>
119
+						</nz-select>
120
+				  </nz-form-control>
121
+				</nz-form-item>
122
+				
123
+				<nz-form-item>
124
+				  <nz-form-label nzFor="flag" nzRequired [nzSpan]="6">是否启用</nz-form-label>
125
+				  <nz-form-control [nzSpan]="18">
126
+						<nz-radio-group class="formItem" formControlName="flag">
127
+						  <label nz-radio [nzValue]="0">否</label>
128
+						  <label nz-radio [nzValue]="1">是</label>
129
+						</nz-radio-group>
130
+				  </nz-form-control>
131
+				</nz-form-item>
132
+      </form>
133
+    </div>
134
+    <div class=" display_flex justify-content_flex-center">
135
+      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
136
+      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
137
+    </div>
138
+  </div>
139
+</div>

+ 386 - 0
src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.less

@@ -0,0 +1,386 @@
1
+@import "../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+	.w220px{
9
+		width: 220px;
10
+	}
11
+	.w100px{
12
+			width: 100px !important;
13
+		}
14
+  .list-template__nzTable,
15
+  .list-template__bottom{
16
+    padding: 0!important;
17
+    border: none!important;
18
+    background: #fff!important;
19
+  }
20
+  .list-template{
21
+    width: 100%!important;
22
+    height: 100%!important;
23
+  }
24
+	
25
+	#dictionary{
26
+	  margin: 24px 16px;
27
+	  .addressAssign{
28
+	    flex: 7;
29
+			.hos-title{
30
+				margin-top: 10px;
31
+				text-align: center;
32
+			}
33
+	  }
34
+	  .contentItem{
35
+	    margin: 0 16px;
36
+	    padding: 8px;
37
+	    text-align: center;
38
+	    &.active{
39
+	      background-color: @primary-color;
40
+	      color: #fff;
41
+	      border-radius: 4px;
42
+	    }
43
+	  }
44
+	  .contentBody{
45
+	    padding: 16px;
46
+	    min-height: 0;
47
+	    display: flex;
48
+	    flex-direction: column;
49
+	  }
50
+	  .contentBody2{
51
+	    flex: 1;
52
+	  }
53
+	  ::ng-deep .ant-form-item{
54
+	    margin-bottom: 0;
55
+	  }
56
+	  .dictionaryRow{
57
+	    display: flex;
58
+	    align-items: center;
59
+	    justify-content: center;
60
+	    gap: 16px;
61
+	    .orders{
62
+	      flex: 1;
63
+	      display: flex;
64
+	      justify-content: flex-end;
65
+	      align-items: center;
66
+	    }
67
+	    .name{
68
+	      width: 100px;
69
+	      display: flex;
70
+	      justify-content: flex-end;
71
+	      align-items: center;
72
+	    }
73
+	    .value{
74
+	      flex: 3;
75
+	      display: flex;
76
+	      align-items: center;
77
+	      .valueInput{
78
+	        width: 600px;
79
+	      }
80
+	      .icon_transport{
81
+	        font-size: 20px;
82
+	        color: #8a8a8a;
83
+	        cursor: pointer;
84
+	      }
85
+	    }
86
+	
87
+	  }
88
+	}
89
+	
90
+	.content{
91
+	  flex: 1;
92
+	  min-height: 0;
93
+	  display: flex;
94
+	  flex-direction: column;
95
+	  justify-content: space-between;
96
+	  border: 1px solid #EEF3F9;
97
+	  &.priority{
98
+	    margin: 24px 118px 0;
99
+	    background-color: #fff;
100
+	    .contentInner{
101
+	      padding: 48px 206px;
102
+	      border: 1px solid #E8EBEF;
103
+	    }
104
+	  }
105
+	  .contentItem{
106
+	    padding: 4px 16px;
107
+	    cursor: pointer;
108
+	    overflow: hidden;
109
+	    text-overflow: ellipsis;
110
+	    white-space: nowrap;
111
+	    &.active{
112
+	      color: @primary-color;
113
+	      background-color: #F0F6ED;
114
+	      border-radius: 4px;
115
+	    }
116
+	  }
117
+	  .contentInner{
118
+	    flex: 1;
119
+	    display: flex;
120
+	    justify-content: space-between;
121
+	    align-items: center;
122
+	    padding: 0 16px;
123
+	    gap: 16px;
124
+			.hos-title{
125
+				font-weight: 600;
126
+				font-size: 16px;
127
+			}
128
+
129
+			.hospital{
130
+			  width: 100%;
131
+			  text-align: left;
132
+			}
133
+			.classList{
134
+				// padding: 5px 0;
135
+				.mar-10{
136
+					margin: 8px 0;
137
+				}
138
+			  .select{
139
+			    width: 313px;
140
+			  }
141
+			  span{
142
+			    display: inline-block;
143
+			    width: 11em;
144
+			  }
145
+			}
146
+			
147
+	    .contentHead{
148
+	      height: 45px;
149
+	      display: flex;
150
+	      justify-content: space-between;
151
+	      align-items: center;
152
+	      gap: 16px;
153
+	      padding: 0 16px;
154
+	      font-size: 16px;
155
+	      font-weight: bold;
156
+	      border-bottom: 1px solid #D9D9D9;
157
+	      .title{
158
+	        overflow: hidden;
159
+	        text-overflow: ellipsis;
160
+	        white-space: nowrap;
161
+	      }
162
+	      .btns{
163
+	        flex-shrink: 0;
164
+	      }
165
+	    }
166
+	    .contentBody{
167
+	      padding: 0 8px;
168
+	      margin: 4px 0;
169
+	      flex: 1;
170
+	    }
171
+	    .address{
172
+	      flex: 1;
173
+	      height: 100%;
174
+	      background: #FFFFFF;
175
+	      border: 1px solid #E8EBEF;
176
+	      display: flex;
177
+	      flex-direction: column;
178
+	      width: 0;
179
+	    }
180
+	    .addressAssign{
181
+	      flex: 3;
182
+	      height: 100%;
183
+	      background: #FFFFFF;
184
+	      border: 1px solid #E8EBEF;
185
+	      display: flex;
186
+	      flex-direction: column;
187
+	      width: 0;
188
+	    }
189
+	    .list-template__searchItem {
190
+	      margin-bottom: 16px;
191
+	      .label {
192
+	        color: #333;
193
+	        display: inline-block;
194
+	        width: 70px;
195
+	        text-align-last: justify;
196
+	        text-align: justify;
197
+	        &.label--big {
198
+	          width: 100px;
199
+	        }
200
+	      }
201
+	      .formItem {
202
+	        width: 135px;
203
+	      }
204
+	    }
205
+	  }
206
+	  .contentBtns{
207
+	    padding-bottom: 16px;
208
+	    display: flex;
209
+	    justify-content: center;
210
+	    align-items: center;
211
+	  }
212
+	}
213
+	
214
+	.save {
215
+	  position: fixed;
216
+	  left: 0;
217
+	  top: 0;
218
+	  width: 100%;
219
+	  height: 100%;
220
+	  background: rgba(0, 0, 0, 0.4);
221
+	  z-index: 99;
222
+	
223
+	  .tips{
224
+	    margin-bottom: 16px!important;
225
+	  }
226
+	
227
+	  .modalBody {
228
+	    width: 350px;
229
+	    background: #fff;
230
+	    border-radius: 5px;
231
+	    padding: 10px 20px;
232
+	    color: #333;
233
+	
234
+	    .title {
235
+	      width: 100%;
236
+	      text-align: center;
237
+	      font-size: 18px;
238
+	      position: relative;
239
+	
240
+	      i {
241
+	        position: absolute;
242
+	        right: 0;
243
+	        top: 0;
244
+	        font-size: 20px;
245
+	        color: #666;
246
+	        cursor: pointer;
247
+	        padding: 0 5px;
248
+	      }
249
+	    }
250
+	
251
+	    .content {
252
+	      width: 310px;
253
+	      background: #f9fafb;
254
+	      border: 1px solid #e5e9ed;
255
+	      border-radius: 5px;
256
+	      overflow: hidden;
257
+	      margin-top: 12px;
258
+	      padding: 16px 0;
259
+	
260
+	      .busyList{
261
+	        display: flex;
262
+	        margin-bottom: 8px;
263
+	        .busyContent{
264
+	          margin-right: 8px;
265
+	          flex: 1;
266
+	        }
267
+	      }
268
+	
269
+	      & > div {
270
+	        text-align: center;
271
+	        margin: 0;
272
+	
273
+	        &.icon {
274
+	          // margin-top: 17px;
275
+	
276
+	          i {
277
+	            color: #34b349;
278
+	            font-size: 30px !important;
279
+	
280
+	            &.transport-wenhao {
281
+	              color: #f5a523;
282
+	            }
283
+	
284
+	            &.transport-shibai {
285
+	              color: #ff3a52;
286
+	            }
287
+	          }
288
+	        }
289
+	
290
+	        &.defeat {
291
+	          color: #333;
292
+	          font-size: 14px;
293
+	        }
294
+	
295
+	        &:nth-child(3) {
296
+	          font-size: 14px;
297
+	          color: #666;
298
+	        }
299
+	      }
300
+	      .workAssignmentTips {
301
+	        font-size: 12px;
302
+	      }
303
+	    }
304
+	
305
+	    button {
306
+	      margin-top: 10px;
307
+	
308
+	      &.btn {
309
+	        margin-left: 8px;
310
+	      }
311
+	    }
312
+	  }
313
+	
314
+	  // 新增
315
+	  &.add {
316
+	    .modalBody {
317
+	      width: 480px;
318
+	      height: auto;
319
+	
320
+	      .content {
321
+	        width: 100%;
322
+	        height: auto;
323
+	        padding: 16px;
324
+	        max-height: 497px;
325
+	        overflow-y: auto;
326
+	
327
+	        .addForm {
328
+	          .ant-form-item {
329
+	            margin-bottom: 0;
330
+							.ant-select{
331
+								width: 100% !important;
332
+							}
333
+	            .ant-form-item-label {
334
+	              text-align: left;
335
+	            }
336
+	
337
+	            .desc {
338
+	              margin-top: 5px;
339
+	            }
340
+	          }
341
+	
342
+	          .datesControl {
343
+	            margin-top: -16px;
344
+	
345
+	            .ant-form-item-label {
346
+	              line-height: 40px;
347
+	            }
348
+	          }
349
+	
350
+	          .timer {
351
+	            .ant-form-item-label {
352
+	              width: 100%;
353
+	              text-align: left;
354
+	            }
355
+	
356
+	            .numInp {
357
+	              margin-right: 5px;
358
+	            }
359
+	
360
+	            .line {
361
+	              margin-right: 5px;
362
+	            }
363
+	          }
364
+	
365
+	          .timer2 {
366
+	            .ant-form-item-label {
367
+	              line-height: 20px;
368
+	            }
369
+	          }
370
+	        }
371
+	
372
+	        .editForm {
373
+	          .ant-form-item {
374
+	            margin-bottom: 15px;
375
+	
376
+	            .ant-form-item-label {
377
+	              line-height: 14px;
378
+	              text-align: left;
379
+	            }
380
+	          }
381
+	        }
382
+	      }
383
+	    }
384
+	  }
385
+	}
386
+}

+ 321 - 0
src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.ts

@@ -0,0 +1,321 @@
1
+import { Component, OnInit, Input } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from "../../../services/main.service";
6
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
7
+import { ToolService } from 'src/app/services/tool.service';
8
+import { NzMessageService } from 'ng-zorro-antd';
9
+
10
+@Component({
11
+  selector: "app-configuration-voluntarilyBuild",
12
+  templateUrl: "./configuration-voluntarilyBuild.component.html",
13
+  styleUrls: ["./configuration-voluntarilyBuild.component.less"],
14
+})
15
+export class ConfigurationVoluntarilyBuildComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private mainService: MainService,
19
+    private fb: FormBuilder,
20
+    private tool: ToolService,
21
+    private message: NzMessageService,
22
+  ) {}
23
+	@Input() voluntarilyTabList: any[] = [];
24
+  coopData: any = {}; //当前操作列
25
+	hosId:any;
26
+	hospitals:any = [];
27
+	isDeptLoading: boolean = false;
28
+
29
+	currentHospital:any;
30
+	malfunctionData:any = [];
31
+	allUserGroup:any = [];
32
+	userData:any = [];
33
+
34
+  changeCommonInpSubject = new Subject();
35
+	
36
+  ngOnInit() {
37
+		this.activeDictionaryKey = this.voluntarilyTabList[0];
38
+		this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
39
+      if(v[0] === 'category'){
40
+        this.searchApplicationCategory(v[1]);
41
+      }
42
+    });
43
+
44
+    // 优先级
45
+    setTimeout(() => {
46
+      this.tablePriorityHeight = document.querySelector('#priorityTable').clientHeight - document.querySelector('#priorityTable .list-template__top').clientHeight - 8 - document.querySelector('#priorityTable .thead').clientHeight;
47
+    }, 100)
48
+		this.hosId = this.tool.getCurrentHospital().id;
49
+		this.currentHospital = this.tool.getCurrentHospital();
50
+    this.getCommonFaultsList();
51
+		this.searchApplicationCategory()
52
+		this.getEmergencyDic();
53
+		this.getGroupList();
54
+  }
55
+	
56
+	activeDictionaryKey:any;
57
+	clickDictionaryKey(item){
58
+		this.activeDictionaryKey = item;
59
+		if(item.key=='alarmConfig'){
60
+			this.getCommonFaultsList();
61
+		}
62
+	}
63
+	
64
+	// 获取处理组
65
+	groupList:any = [];
66
+	getGroupList() {
67
+	  let data = {
68
+			idx: 0,
69
+			sum: 99999,
70
+			group2: {
71
+				statisticalHosId: this.hosId,
72
+				type:'3'
73
+			}
74
+		};
75
+		this.mainService
76
+			.getFetchDataList("simple/data", "group2", data)
77
+			.subscribe((data) => {
78
+				this.groupList = data.list || [];
79
+			});
80
+	}
81
+	
82
+	// 选择处理组
83
+	changeGroup(e){
84
+		this.validatePriorityForm.controls.userId.setValue(null);
85
+		this.getUserList();
86
+	}
87
+	
88
+	// 获取处理人
89
+	userList:any = [];
90
+	getUserList() {
91
+	  let data = {
92
+			idx: 0,
93
+			sum: 99999,
94
+			user: {
95
+				groupdata: {
96
+					id: this.validatePriorityForm.value.groupId
97
+				}
98
+			}
99
+		};
100
+		this.mainService
101
+			.getFetchDataList("data", "user", data)
102
+			.subscribe((data) => {
103
+				this.userList = data.list || [];
104
+			});
105
+	}
106
+	
107
+	// 获取告警优先级
108
+	emergencyData:any = [];
109
+	getEmergencyDic() {
110
+	  this.mainService.getDictionary("list", "alarm_urgency").subscribe((data) => {
111
+	    this.emergencyData = data || [];
112
+	  });
113
+	}
114
+	
115
+  // 新增优先级弹框
116
+  modelName = ""; //模态框名称
117
+  modalPriority: boolean = false; //新增/编辑模态框
118
+  add: boolean; //true:新增;false:编辑
119
+  addPriorityModal() {
120
+    this.modelName = "新增";
121
+    this.add = true; //新增
122
+    this.modalPriority = true;
123
+    this.initForm();
124
+  }
125
+  //关闭新增/编辑弹框
126
+  hidePriorityModal() {
127
+    this.modalPriority = false;
128
+  }
129
+
130
+  changeCommonInp(type, e) {
131
+    this.changeCommonInpSubject.next([type, e]);
132
+  }
133
+
134
+	// 获取故障现象数据
135
+  isLoading:boolean = false;
136
+	searchApplicationCategory(keyWord?){
137
+		let postData = {
138
+		  category: {
139
+        category: keyWord,
140
+        selectType: "mutlQuery",
141
+		    hierarchy: 3,
142
+		  },
143
+		};
144
+    this.isLoading = true;
145
+		this.mainService.incidentPost("listIncidentCategory", postData).subscribe(data => {
146
+		  this.isLoading = false;
147
+      if (data.status == 200) {
148
+        this.malfunctionData = data.data || [];
149
+      }
150
+		})
151
+	}
152
+
153
+  // 编辑
154
+  editPriority(data) {
155
+    console.log(data);
156
+    this.modelName = "编辑";
157
+    this.add = false;
158
+    this.modalPriority = true;
159
+    this.initForm();
160
+    this.coopData = data;
161
+    this.validatePriorityForm.controls.alarmUrgency.setValue(data.alarmUrgency.id);
162
+    this.validatePriorityForm.controls.keywords.setValue(data.keywords?data.keywords:null);
163
+    this.validatePriorityForm.controls.categoryId.setValue(data.categoryDTO?data.categoryDTO.id:null);
164
+		this.validatePriorityForm.controls.groupId.setValue(data.groupDTO.id);
165
+		if(data.groupDTO.id){
166
+			this.getUserList()
167
+			this.validatePriorityForm.controls.userId.setValue(data.userDTO?data.userDTO.id:null);
168
+		}
169
+		this.validatePriorityForm.controls.flag.setValue(data.flag);
170
+  }
171
+
172
+  // 新增/编辑表单提交
173
+  btnLoading: boolean = false; //提交按钮loading状态
174
+  submitPriorityForm(): void {
175
+    for (const i in this.validatePriorityForm.controls) {
176
+      this.validatePriorityForm.controls[i].markAsDirty();
177
+      this.validatePriorityForm.controls[i].updateValueAndValidity();
178
+    }
179
+    if (this.validatePriorityForm.invalid) {
180
+      return;
181
+    }
182
+    console.log(this.validatePriorityForm.value);
183
+    this.btnLoading = true;
184
+    let postData:any = {};
185
+    if (this.add) {
186
+      //增加
187
+      postData = {
188
+				alarmConfig:{
189
+					alarmUrgency: {
190
+						id: this.validatePriorityForm.value.alarmUrgency
191
+					},
192
+					keywords: this.validatePriorityForm.value.keywords || undefined,
193
+					categoryId: this.validatePriorityForm.value.categoryId,
194
+					groupId: this.validatePriorityForm.value.groupId,
195
+					userId: this.validatePriorityForm.value.userId || undefined,
196
+					flag: this.validatePriorityForm.value.flag,
197
+				}
198
+      };
199
+    } else {
200
+      //编辑
201
+      postData = {
202
+				alarmConfig:{
203
+					...this.coopData,
204
+					alarmUrgency: {
205
+						id: this.validatePriorityForm.value.alarmUrgency
206
+					},
207
+					keywords: this.validatePriorityForm.value.keywords || undefined,
208
+					categoryId: this.validatePriorityForm.value.categoryId,
209
+					groupId: this.validatePriorityForm.value.groupId,
210
+					userId: this.validatePriorityForm.value.userId || undefined,
211
+					flag: this.validatePriorityForm.value.flag,
212
+				}
213
+      };
214
+    }
215
+    this.mainService
216
+      .dataPost(this.add ? "addData": "updData", "alarmConfig", postData)
217
+      .subscribe((result) => {
218
+        this.btnLoading = false;
219
+        this.hidePriorityModal();
220
+        let msg = "";
221
+        if (this.add) {
222
+          msg = "新增";
223
+        } else {
224
+          msg = "修改";
225
+        }
226
+        if (result.status == 200) {
227
+          this.showPromptModal(msg, true, '');
228
+        } else {
229
+          this.showPromptModal(msg, false, result.msg);
230
+        }
231
+      });
232
+  }
233
+
234
+  // 初始化新增form表单
235
+  validatePriorityForm: FormGroup; //新增/编辑表单
236
+  initForm() {
237
+    this.validatePriorityForm = this.fb.group({
238
+      alarmUrgency: [null, [Validators.required]],
239
+      keywords: [null, []],
240
+      categoryId: [null, [Validators.required]],
241
+			groupId: [null, [Validators.required]],
242
+			userId: [null, []],
243
+			flag: [1, [Validators.required]],
244
+    });
245
+    console.log(this.validatePriorityForm.controls)
246
+  }
247
+
248
+  // 获取列表
249
+  loading1:boolean = false;
250
+  commonFaultsList: any[] = []; //表格数据
251
+  tablePriorityHeight:number = 0;
252
+  getCommonFaultsList() {
253
+    let data = {
254
+			idx: 0,
255
+			sum: 99999,
256
+			alarmConfig: {
257
+				hosId: this.hosId
258
+			},
259
+		};
260
+		this.loading1 = true;
261
+		this.mainService
262
+			.getFetchDataList("simple/data", "alarmConfig", data)
263
+			.subscribe((data) => {
264
+				this.loading1 = false;
265
+				this.commonFaultsList = data.list || [];
266
+			});
267
+  }
268
+
269
+  delModal: boolean = false; //删除模态框
270
+  tipsMsg1: string; //提示框信息
271
+  tipsMsg2: string; //操作后信息
272
+  confirmDelType: string; //确认的类型(启用/停用,删除)
273
+  showDelModal(
274
+    data,
275
+    tipsMsg1: string,
276
+    tipsMsg2: string,
277
+    type: string,
278
+  ) {
279
+    this.confirmDelType = type;
280
+    this.delModal = true;
281
+    this.coopData = data;
282
+    console.log(this.coopData);
283
+    this.tipsMsg1 = tipsMsg1;
284
+    this.tipsMsg2 = tipsMsg2;
285
+  }
286
+  // 隐藏删除框
287
+  hideDelModal() {
288
+    this.delModal = false;
289
+  }
290
+  // 确认删除
291
+  confirmDel() {
292
+    this.btnLoading = true;
293
+		this.mainService
294
+			.simplePost("rmvData", "alarmConfig", [this.coopData.id])
295
+			.subscribe((data) => {
296
+				this.btnLoading = false;
297
+				this.delModal = false;
298
+				if (data.status == 200) {
299
+					this.showPromptModal(this.tipsMsg2, true, "");
300
+				} else {
301
+					this.showPromptModal(this.tipsMsg2, false, data.msg);
302
+				}
303
+			});
304
+  }
305
+
306
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
307
+  promptContent: string; //操作提示框提示信息
308
+  ifSuccess: boolean; //操作成功/失败
309
+  promptInfo: string; //操作结果提示信息
310
+  promptModalShow: boolean; //操作提示框是否展示
311
+  showPromptModal(con, success, promptInfo?) {
312
+    this.promptModalShow = false;
313
+    this.promptContent = con;
314
+    this.ifSuccess = success;
315
+    this.promptInfo = promptInfo;
316
+    setTimeout(() => {
317
+      this.promptModalShow = true;
318
+    }, 100);
319
+    this.getCommonFaultsList();
320
+  }
321
+}

+ 19 - 1
src/app/components/order-scope/order-scope.component.html

@@ -31,7 +31,7 @@
31 31
           </div>
32 32
         </div>
33 33
         <div nz-row>
34
-          <div nz-col nzSpan="3">运维分组:</div>
34
+          <div nz-col nzSpan="3">运维分组人员显示范围:</div>
35 35
           <div nz-col nzSpan="21">
36 36
             <label class="checkAll mb8" nz-checkbox *ngIf="itsmCheckedGroup.length" [nzDisabled]="!activeScopeTab.checked" [(ngModel)]="isAllItsmGroupChecked" (ngModelChange)="updateAllItsmGroupChecked()">
37 37
               全选
@@ -39,6 +39,15 @@
39 39
             <nz-checkbox-group class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" [nzDisabled]="!activeScopeTab.checked" [(ngModel)]="itsmCheckedGroup" (ngModelChange)="changeItsmGroup($event)"></nz-checkbox-group>
40 40
           </div>
41 41
         </div>
42
+				<div nz-row>
43
+				  <div nz-col nzSpan="3">根据分组显示工单:</div>
44
+				  <div nz-col nzSpan="21">
45
+				    <label class="checkAll mb8" nz-checkbox *ngIf="itsmCheckedGroup.length" [nzDisabled]="!activeScopeTab.checked" [(ngModel)]="isAllItsmReasonGroupChecked" (ngModelChange)="updateReasonAllItsmGroupChecked()">
46
+				      全选
47
+				    </label>
48
+				    <nz-checkbox-group class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" [nzDisabled]="!activeScopeTab.checked" [(ngModel)]="itsmCheckedReasonGroup" (ngModelChange)="changeItsmReasonGroup($event)"></nz-checkbox-group>
49
+				  </div>
50
+				</div>
42 51
         <div nz-row>
43 52
           <div nz-col nzSpan="3">工单范围:</div>
44 53
           <div nz-col nzSpan="21">
@@ -110,6 +119,15 @@
110 119
             </nz-radio-group>
111 120
           </div>
112 121
         </div>
122
+				<div nz-row>
123
+				  <div nz-col nzSpan="4">是否支持跨院区:</div>
124
+				  <div nz-col nzSpan="20">
125
+				    <nz-radio-group class="w100" [nzDisabled]="!activeScopeTab.checked" [(ngModel)]="crossHospital">
126
+				      <label nz-radio nzValue="0">否</label>
127
+				      <label nz-radio nzValue="1">是</label>
128
+				    </nz-radio-group>
129
+				  </div>
130
+				</div>
113 131
       </div>
114 132
     </div>
115 133
     <div class="btns display_flex justify-content_flex-center">

+ 34 - 11
src/app/components/order-scope/order-scope.component.ts

@@ -15,6 +15,7 @@ export class OrderScopeComponent implements OnInit {
15 15
     checkedHos: undefined,
16 16
     scopeGroups: [],
17 17
     orderScopeRadio: undefined,
18
+		crossHospital: '0',
18 19
   }
19 20
   @Input() itsmData:any = {
20 21
     checkedHos: undefined,
@@ -36,11 +37,13 @@ export class OrderScopeComponent implements OnInit {
36 37
   user = JSON.parse(localStorage.getItem("user")); //用户信息
37 38
   checkedHos;//转运-院区
38 39
   orderScopeRadio:any = '0';//转运-工单范围
39
-
40
+	crossHospital:any = '0';//转运-是否支持跨院区
40 41
   itsmCheckedHos:any[] = [];//运维-院区
41 42
   itsmCheckedGroup:any[] = [];//运维-分组
42 43
   itsmOrderScopeRadio:any = '0';//运维-工单范围
43 44
   isAllItsmGroupChecked:boolean = false;//运维-是否全选分组
45
+	isAllItsmReasonGroupChecked:boolean = false;//运维-根据分组显示工单
46
+	itsmCheckedReasonGroup:any[] = [];//运维-根据分组显示工单
44 47
 	// 工单范选项卡
45 48
 	scopeTabs:any[] = [];
46 49
 	activeScopeTab:any;
@@ -66,6 +69,7 @@ export class OrderScopeComponent implements OnInit {
66 69
 		}
67 70
     this.checkedHos = this.hsmsData.checkedHos;
68 71
     this.orderScopeRadio = this.hsmsData.orderScopeRadio;
72
+		this.crossHospital = this.hsmsData.crossHospital+"" || '0';
69 73
     this.initOrderScope();
70 74
     this.getOrderScope();
71 75
   }
@@ -114,14 +118,17 @@ export class OrderScopeComponent implements OnInit {
114 118
       // 选中的院区和组
115 119
       let itsmCheckedHos = this.itsmData.checkedHos || [];
116 120
       let itsmCheckedGroup = this.itsmData.scopeGroups || [];
117
-
121
+			let itsmCheckedReasonGroup = this.itsmData.groupIds || [];
118 122
       let hosIds = itsmCheckedHos.map(v => v.id);
119 123
       let groupIds = itsmCheckedGroup.map(v => v.id);
120
-
124
+			let groupIds2 = itsmCheckedReasonGroup.map(v => v.id);
121 125
       this.itsmCheckedHos = hosList.map(v => ({ label: v.hosName, value: v.id, checked: hosIds.includes(v.id) }));
122 126
       this.itsmCheckedGroup = groups.filter(v => hosIds.includes(v.hospital.id)).map(v => ({ label: v.hospital.hosName + '-' + v.groupName, value: v.id, checked: groupIds.includes(v.id) }));
123 127
       this.isAllItsmGroupChecked = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
124
-    }
128
+			
129
+			this.itsmCheckedReasonGroup = groups.filter(v => hosIds.includes(v.hospital.id)).map(v => ({ label: v.hospital.hosName + '-' + v.groupName, value: v.id, checked: groupIds2.includes(v.id) }));
130
+			this.isAllItsmReasonGroupChecked = this.itsmCheckedReasonGroup.length ? this.itsmCheckedReasonGroup.every(v => v.checked) : false;
131
+		}
125 132
 
126 133
     // 全选、全不选分组
127 134
     updateAllItsmGroupChecked(){
@@ -131,6 +138,15 @@ export class OrderScopeComponent implements OnInit {
131 138
     changeItsmGroup(e){
132 139
       this.isAllItsmGroupChecked = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
133 140
     }
141
+		
142
+		// 全选、全不选根据分组显示工单
143
+		updateReasonAllItsmGroupChecked(){
144
+		  this.itsmCheckedReasonGroup.forEach(v => v.checked = this.isAllItsmReasonGroupChecked);
145
+		}
146
+		// 选择根据分组显示工单
147
+		changeItsmReasonGroup(e){
148
+		  this.isAllItsmReasonGroupChecked = this.itsmCheckedReasonGroup.length ? this.itsmCheckedReasonGroup.every(v => v.checked) : false;
149
+		}
134 150
     // 选择院区
135 151
     changeItsmHospital(hospitalList){
136 152
       console.log('hospitalList:', hospitalList)
@@ -140,14 +156,17 @@ export class OrderScopeComponent implements OnInit {
140 156
       // 选中的院区和组
141 157
       let itsmCheckedHos = this.itsmCheckedHos || [];
142 158
       let itsmCheckedGroup = this.itsmCheckedGroup || [];
143
-
159
+			let itsmCheckedReasonGroup = this.itsmCheckedReasonGroup|| [];
144 160
       let hosIds = itsmCheckedHos.filter(v => v.checked).map(v => v.value);
145 161
       let groupIds = itsmCheckedGroup.filter(v => v.checked).map(v => v.value);
146
-
162
+			let groupIds2 = itsmCheckedReasonGroup.filter(v => v.checked).map(v => v.value);
147 163
       this.itsmCheckedGroup = groups.filter(v => hosIds.includes(v.hospital.id)).map(v => ({ label: v.hospital.hosName + '-' + v.groupName, value: v.id, checked: groupIds.includes(v.id) }));
148 164
       console.log('this.itsmCheckedGroup:', this.itsmCheckedGroup)
149 165
       this.isAllItsmGroupChecked = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
150
-    }
166
+			
167
+			this.itsmCheckedReasonGroup = groups.filter(v => hosIds.includes(v.hospital.id)).map(v => ({ label: v.hospital.hosName + '-' + v.groupName, value: v.id, checked: groupIds2.includes(v.id) }));
168
+			this.isAllItsmReasonGroupChecked = this.itsmCheckedReasonGroup.length ? this.itsmCheckedReasonGroup.every(v => v.checked) : false;
169
+		}
151 170
     //#endregion 工单范围-运维end
152 171
 
153 172
     //#region 工单范围-配送start
@@ -311,6 +330,7 @@ export class OrderScopeComponent implements OnInit {
311 330
       console.log(e);
312 331
       this.itsmCheckedHos.forEach(v => (v.checked = false));
313 332
       this.itsmCheckedGroup = [];
333
+			this.itsmCheckedReasonGroup = [];
314 334
     }
315 335
 
316 336
     // 保存工单范围设置
@@ -394,24 +414,27 @@ export class OrderScopeComponent implements OnInit {
394 414
 				postData.workerOrderScope.showReassign = this.showReassign;
395 415
 				postData.workerOrderScope.showGovDuty = this.showGovDuty;
396 416
         postData.workerOrderScope.dutyIds = this.itsmCheckedHos.filter(v => v.checked).map(v => v.value).toString() || undefined;
397
-        postData.workerOrderScope.dutyGroupIds = this.itsmCheckedGroup.filter(v => v.checked).map(v => v.value).toString() || undefined;
398
-        postData.workerOrderScope.dutyRange = this.itsmOrderScopeRadio - 0;
417
+        postData.workerOrderScope.dutyGroupUserRangeIds = this.itsmCheckedGroup.filter(v => v.checked).map(v => v.value).toString() || undefined;
418
+        postData.workerOrderScope.dutyGroupIds = this.itsmCheckedReasonGroup.filter(v => v.checked).map(v => v.value).toString() || undefined;
419
+				postData.workerOrderScope.dutyRange = this.itsmOrderScopeRadio - 0;
399 420
       }
421
+
400 422
       if(hsms && hsms.checked){
401 423
         postData.workerOrderScope.hospitalId = this.checkedHos ? { id: this.checkedHos - 0 } : undefined;
402 424
         postData.workerOrderScope.typeIds = typesId || undefined;
403 425
         postData.workerOrderScope.groupIds = groupsId || undefined;
404 426
         postData.workerOrderScope.range = this.orderScopeRadio - 0;
427
+				postData.workerOrderScope.crossHospital = this.crossHospital - 0;
405 428
       }
406 429
       if (this.user.user.scope && this.user.user.scope.id) {
407 430
         postData.workerOrderScope["id"] = this.user.user.scope.id;
408 431
       }
409
-      console.log('allDuty', this.allDuty)
432
+			console.log('88888', this.itsmCheckedReasonGroup)
433
+			console.log('999999', postData.workerOrderScope.groupIds)
410 434
       console.log('itsmCheckedHos', this.itsmCheckedHos)
411 435
       console.log('itsmCheckedGroup', this.itsmCheckedGroup)
412 436
       console.log('itsmOrderScopeRadio', this.itsmOrderScopeRadio)
413 437
       console.log(postData);
414
-      // return;
415 438
       this.mainService
416 439
         .coopTypeConfig("addData", "workerOrderScope", postData)
417 440
         .subscribe((data) => {

+ 8 - 1
src/app/services/main.service.ts

@@ -1270,5 +1270,12 @@ export class MainService {
1270 1270
 		  headers: this.headers,
1271 1271
 		});
1272 1272
 	}
1273
-
1273
+	
1274
+	// 故障工单-告警信息-建单
1275
+	addAlarmIncident(data){
1276
+		return this.http.post(host.host + `/flow/incident/task/createAlarmIncident`, data, {
1277
+		  headers: this.headers,
1278
+		});
1279
+	}
1280
+	
1274 1281
 }

+ 35 - 2
src/app/services/tool.service.ts

@@ -1,5 +1,6 @@
1 1
 import { Injectable } from "@angular/core";
2 2
 import { MainService } from "./main.service";
3
+import { Subject } from "rxjs";
3 4
 
4 5
 @Injectable({
5 6
   providedIn: "root",
@@ -8,13 +9,39 @@ export class ToolService {
8 9
   logoUrl = '';
9 10
   logoTitle = '';
10 11
   faviconUrl = '';
11
-
12
+	changeInpSubject:any;
13
+	allSubject = new Subject();
14
+	allEndSubject = new Subject();
15
+	 
16
+	// 提供方法来触发事件
17
+	triggerEvent(data: any) {
18
+		console.log(9999,data)
19
+		this.allSubject.next(data);
20
+	}
21
+	
22
+	// 提供方法来触发事件
23
+	triggerEndEvent(data: any) {
24
+		this.allEndSubject.next(data);
25
+	}
26
+	
27
+	// 提供方法来订阅事件
28
+	getEventObservable() {
29
+		console.log(3333333)
30
+		return this.allSubject.asObservable();
31
+	}
32
+	
33
+	// 提供方法来订阅事件
34
+	getEventEndObservable() {
35
+		return this.allEndSubject.asObservable();
36
+	}
37
+	
12 38
   // 附件类型
13 39
   // word,excel,pdf,txt,ppt
14 40
   attachmentsTypes:string = 'text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.ms-excel,application/msword,application/vnd.openxmlformats-officedocument.presentationml.presentation';
15 41
 
16 42
   constructor(private mainService: MainService) {}
17
-
43
+	
44
+	
18 45
   // 获取logoUrl和logoTitle
19 46
   getSysNameAndLogoAsync(hosId = ''){
20 47
     return this.mainService.getSysNameAndLogo(hosId);
@@ -342,6 +369,12 @@ export class ToolService {
342 369
 				case "send":
343 370
 				  coopBtns.send = true; //发送消息
344 371
 				  break;
372
+				case "batchRecover":
373
+				  coopBtns.batchRecover = true; //批量恢复
374
+				  break;
375
+				case "batchProcessing":
376
+				  coopBtns.batchProcessing = true; //批量不处理
377
+				  break;
345 378
       }
346 379
     });
347 380
     console.log(coopBtns);

+ 25 - 0
src/app/views/common-info/common-info-routing.module.ts

@@ -0,0 +1,25 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { CommonInfoComponent } from './common-info.component';
4
+import { OrderDetailComponent } from 'src/app/share/order-detail/order-detail.component';
5
+
6
+
7
+const routes: Routes = [
8
+  {
9
+    path: '',
10
+    component: CommonInfoComponent,
11
+    children: [
12
+      {
13
+        // 查看详情
14
+        path: 'orderDetail/:id',
15
+        component: OrderDetailComponent,
16
+      }
17
+    ]
18
+  }
19
+];
20
+
21
+@NgModule({
22
+  imports: [RouterModule.forChild(routes)],
23
+  exports: [RouterModule]
24
+})
25
+export class CommonInfoRoutingModule { }

+ 99 - 0
src/app/views/common-info/common-info.component.html

@@ -0,0 +1,99 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='19' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">申请科室</span>:
7
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择申请科室" [(ngModel)]="searchDto.applyDept" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeInp('department', $event)" (nzOpenChange)="openChangeDept($event)" (ngModelChange)="setIsSelecting(true)">
8
+            <ng-container *ngFor="let option of deptList">
9
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
10
+            </ng-container>
11
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
12
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
13
+            </nz-option>
14
+          </nz-select>
15
+        </div>
16
+        <div class="list-template__searchItem">
17
+          <span class="label">收取人</span>:
18
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择收取人" [(ngModel)]="searchDto.collectionUser" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeInp('patient', $event)" (nzOpenChange)="openChangePatient($event)" (ngModelChange)="setIsSelecting(true)">
19
+            <ng-container *ngFor="let option of deliveryUserList">
20
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
21
+            </ng-container>
22
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
23
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
24
+            </nz-option>
25
+          </nz-select>
26
+        </div>
27
+				<div class="list-template__searchItem">
28
+				  <span class="label">创建时间区间</span>:
29
+				  <nz-range-picker nzShowTime [(ngModel)]="dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)"></nz-range-picker>
30
+				</div>
31
+      </div>
32
+      <div nz-col nzLg="5" class="list-template__btns">
33
+        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
34
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
35
+      </div>
36
+    </div>
37
+    <div class="list-template__bottom">
38
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
39
+        [nzLoading]="loading1">
40
+        <thead>
41
+          <tr class="thead">
42
+            <th nzWidth="9%">业务类型</th>
43
+            <th nzWidth="10%">创建时间|单号</th>
44
+            <th nzWidth="13%">申请科室|终点科室</th>
45
+            <th nzWidth="13%">收取信息</th>
46
+            <th nzWidth="13%">中转信息</th>
47
+            <th nzWidth="13%">送达信息</th>
48
+            <th nzWidth="9%">交接数量</th>
49
+						<th nzWidth="8%">业务状态</th>
50
+            <th nzWidth="15%">工单信息</th>
51
+          </tr>
52
+        </thead>
53
+        <tbody>
54
+          <tr *ngFor="let data of listOfData;let i = index">
55
+            <td>{{data.businessTaskTypeDTO?.businessName}}</td>
56
+            <td>{{ data.createTime | date: 'yyyy-MM-dd HH:mm'}}<br>{{ data.businessNo }}</td>
57
+            <td>{{ data.applyDeptDTO?.dept }}<br>{{ data.endDeptDTO?.dept }}</td>
58
+            <td>
59
+							<div>{{data.collectionUserDTO?.name}} <span *ngIf="data.collectionUserDTO && data.collectionHandoverUserDTO">|</span> {{data.collectionHandoverUserDTO?.name}}</div>
60
+							<div>{{data.collectionTime | date: 'yyyy-MM-dd HH:mm'}}</div>
61
+						</td>
62
+            <td>
63
+							{{ data.transferTime | date: 'yyyy-MM-dd HH:mm' }}<br>
64
+							{{ data.transferStartTime | date: 'yyyy-MM-dd HH:mm' }}<br>
65
+							{{ data.transferUserDTO?.name }}
66
+						</td>
67
+            <td>{{ data.deliveryUserDTO?.name }} <span *ngIf="data.deliveryUserDTO && data.deliveryHandoverUserDTO">|</span>	 {{ data.deliveryHandoverUserDTO?.name }}<br>{{ data.deliveryTime | date: 'yyyy-MM-dd HH:mm'}}</td>
68
+						<td>{{ data.handoverNum1}}</td>
69
+						<td>{{ data.businessStatus?.name}}</td>
70
+            <td>
71
+							<div *ngIf="data.gdCode">收:<span class="clickable" (click)="detail($event, data.gdId)">{{ data.gdCode }}</span></div>
72
+							<div *ngIf="data.transferGdCode">中转:<span class="clickable" (click)="detail($event, data.transferGdId)">{{ data.transferGdCode }}</span></div>
73
+						</td>
74
+          </tr>
75
+        </tbody>
76
+      </nz-table>
77
+      <div class="list-template__pagination">
78
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
79
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
80
+        </nz-pagination>
81
+      </div>
82
+    </div>
83
+  </div>
84
+</div>
85
+<!-- 操作成功/失败提示框 -->
86
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
87
+  [info]="promptInfo">
88
+</app-prompt-modal>
89
+
90
+<!-- 查看日志 -->
91
+<app-specimen-package-log-prompt-modal
92
+  *ngIf="logPromptModalShow"
93
+  [show]="logPromptModalShow"
94
+  [id]="packId"
95
+  (closeModelHs)="closeModelLog($event)"
96
+></app-specimen-package-log-prompt-modal>
97
+
98
+<!-- 查看详情 -->
99
+<router-outlet></router-outlet>

+ 176 - 0
src/app/views/common-info/common-info.component.less

@@ -0,0 +1,176 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host {
4
+  .list-template__top{
5
+    overflow: visible!important;
6
+    .label{
7
+      width: auto!important;
8
+    }
9
+  }
10
+}
11
+.save {
12
+  position: fixed;
13
+  left: 0;
14
+  top: 0;
15
+  width: 100%;
16
+  height: 100%;
17
+  background: rgba(0, 0, 0, 0.4);
18
+  z-index: 99;
19
+
20
+  .modalBody {
21
+    width: 350px;
22
+    background: #fff;
23
+    border-radius: 5px;
24
+    padding: 10px 20px;
25
+    color: #333;
26
+
27
+    .title {
28
+      width: 100%;
29
+      text-align: center;
30
+      font-size: 18px;
31
+      position: relative;
32
+
33
+      i {
34
+        position: absolute;
35
+        right: 0;
36
+        top: 0;
37
+        font-size: 20px;
38
+        color: #666;
39
+        cursor: pointer;
40
+        padding: 0 5px;
41
+      }
42
+    }
43
+
44
+    .content {
45
+      width: 310px;
46
+      background: #f9fafb;
47
+      border: 1px solid #e5e9ed;
48
+      border-radius: 5px;
49
+      overflow: hidden;
50
+      margin-top: 12px;
51
+      padding: 16px 0;
52
+
53
+      .busyList{
54
+        display: flex;
55
+        margin-bottom: 8px;
56
+        .busyContent{
57
+          margin-right: 8px;
58
+          flex: 1;
59
+        }
60
+      }
61
+
62
+      & > div {
63
+        text-align: center;
64
+        margin: 0;
65
+
66
+        &.icon {
67
+          // margin-top: 17px;
68
+
69
+          i {
70
+            color: #34b349;
71
+            font-size: 30px !important;
72
+
73
+            &.transport-wenhao {
74
+              color: #f5a523;
75
+            }
76
+
77
+            &.transport-shibai {
78
+              color: #ff3a52;
79
+            }
80
+          }
81
+        }
82
+
83
+        &.defeat {
84
+          color: #333;
85
+          font-size: 14px;
86
+        }
87
+
88
+        &:nth-child(3) {
89
+          font-size: 14px;
90
+          color: #666;
91
+        }
92
+      }
93
+      .workAssignmentTips {
94
+        font-size: 12px;
95
+      }
96
+    }
97
+
98
+    button {
99
+      margin-top: 10px;
100
+
101
+      &.btn {
102
+        margin-left: 8px;
103
+      }
104
+    }
105
+  }
106
+
107
+  // 新增
108
+  &.add {
109
+    .modalBody {
110
+      width: 480px;
111
+      height: auto;
112
+
113
+      .content {
114
+        width: 100%;
115
+        height: auto;
116
+        padding: 16px;
117
+        max-height: 497px;
118
+        overflow-y: auto;
119
+
120
+        .addForm {
121
+          .ant-form-item {
122
+            margin-bottom: 0;
123
+
124
+            .ant-form-item-label {
125
+              text-align: left;
126
+            }
127
+
128
+            .desc {
129
+              margin-top: 5px;
130
+            }
131
+          }
132
+
133
+          .datesControl {
134
+            margin-top: -16px;
135
+
136
+            .ant-form-item-label {
137
+              line-height: 40px;
138
+            }
139
+          }
140
+
141
+          .timer {
142
+            .ant-form-item-label {
143
+              width: 100%;
144
+              text-align: left;
145
+            }
146
+
147
+            .numInp {
148
+              margin-right: 5px;
149
+            }
150
+
151
+            .line {
152
+              margin-right: 5px;
153
+            }
154
+          }
155
+
156
+          .timer2 {
157
+            .ant-form-item-label {
158
+              line-height: 20px;
159
+            }
160
+          }
161
+        }
162
+
163
+        .editForm {
164
+          .ant-form-item {
165
+            margin-bottom: 15px;
166
+
167
+            .ant-form-item-label {
168
+              line-height: 14px;
169
+              text-align: left;
170
+            }
171
+          }
172
+        }
173
+      }
174
+    }
175
+  }
176
+}

+ 230 - 0
src/app/views/common-info/common-info.component.ts

@@ -0,0 +1,230 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { ToolService } from "../../services/tool.service";
7
+import { NzMessageService } from 'ng-zorro-antd';
8
+import { Subject } from 'rxjs';
9
+import { debounceTime } from 'rxjs/operators';
10
+import { startOfDay, endOfDay, format } from 'date-fns';
11
+@Component({
12
+  selector: "app-common-info",
13
+  templateUrl: "./common-info.component.html",
14
+  styleUrls: ["./common-info.component.less"],
15
+})
16
+export class CommonInfoComponent implements OnInit {
17
+  constructor(
18
+    private fb: FormBuilder,
19
+    private mainService: MainService,
20
+    private route: ActivatedRoute,
21
+    private router: Router,
22
+    private tool: ToolService,
23
+    private message: NzMessageService,
24
+  ) {}
25
+
26
+  listOfData: any[] = []; //表格数据
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 10; //表格每页展示条数
29
+  listLength: number = 10; //表格总数据量
30
+  modal: boolean = false; //新增/编辑模态框
31
+  add: boolean; //true:新增;false:编辑
32
+  validateForm: FormGroup; //新增/编辑表单
33
+  coopData: any; //当前操作列
34
+  currentHospital; //当前院区
35
+
36
+  btnLoading: boolean = false; //提交按钮loading状态
37
+
38
+  promptContent: string; //操作提示框提示信息
39
+  ifSuccess: boolean; //操作成功/失败
40
+  promptInfo: string; //操作结果提示信息
41
+  promptModalShow: boolean; //操作提示框是否展示
42
+  modelName = ""; //模态框名称
43
+
44
+  searchTimerSubject = new Subject(); //防抖
45
+  showDropdown:boolean = false;
46
+
47
+  dateRange: any = []; //发起时间
48
+
49
+  ngOnInit() {
50
+    //防抖
51
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
52
+      let fun = v[0];
53
+      fun.call(this, v[1]);
54
+    });
55
+    this.currentHospital = this.tool.getCurrentHospital();
56
+    this.coopBtns = this.tool.initCoopBtns(this.route);
57
+    this.getList(1);
58
+    this.getStatus();
59
+  }
60
+
61
+  // 初始化增删改按钮
62
+  coopBtns: any = {};
63
+
64
+  // 日期选择
65
+  onCalendarChangeDate(dateArr){
66
+    if(dateArr.length == 2){
67
+      this.dateRange = [startOfDay(dateArr[0]), endOfDay(dateArr[1])];
68
+    }
69
+  }
70
+
71
+  // 搜索
72
+  search() {
73
+    this.getList(1);
74
+  }
75
+  // 重置
76
+  reset() {
77
+    this.searchDto = {};
78
+    this.dateRange = [];
79
+    this.getList(1);
80
+  }
81
+
82
+  // 表格数据
83
+  searchDto: any = {};
84
+  loading1 = false;
85
+  getList(type) {
86
+    if (type == 1) {
87
+      this.pageIndex = 1;
88
+    }
89
+    let data = {
90
+      idx: this.pageIndex - 1,
91
+      sum: this.pageSize,
92
+      businessHandover: {
93
+        hosId: this.currentHospital.id,
94
+        collectionUser: this.searchDto.collectionUser || undefined,
95
+        applyDept: this.searchDto.applyDept || undefined,
96
+        startTime: this.dateRange.length ? format(this.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
97
+        endTime: this.dateRange.length ? format(this.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
98
+      },
99
+    };
100
+    this.loading1 = true;
101
+    this.mainService
102
+      .getFetchDataList("simple/data", "businessHandover", data)
103
+      .subscribe((data) => {
104
+        this.loading1 = false;
105
+        if (data.status == 200) {
106
+          this.listOfData = data.list || [];
107
+          this.listLength = data.totalNum;
108
+        }else{
109
+          this.message.error(data.msg || "请求数据失败");
110
+        }
111
+      });
112
+  }
113
+
114
+  // 防抖
115
+  isLoading = false;
116
+  isSelecting:boolean = false; // 是否在选中状态
117
+  searchTimer(fun, e) {
118
+    if (this.isSelecting) {
119
+      this.isSelecting = false; // 重置标志
120
+      return; // 跳过处理
121
+    }
122
+    this.isLoading = true;
123
+    this.searchTimerSubject.next([fun, e]);
124
+  }
125
+
126
+  // 搜索
127
+  changeInp(type, e) {
128
+    if(type === 'department'){
129
+      this.searchTimer(this.getDeptList, e);
130
+    }else if(type === 'patient'){
131
+      this.searchTimer(this.getDeliveryUserList, e);
132
+    }
133
+  }
134
+
135
+  // 设置标志
136
+  setIsSelecting(flag){
137
+    this.isSelecting = flag; // 设置标志
138
+  }
139
+
140
+  openChangeDept(flag){
141
+    flag && this.setIsSelecting(false);
142
+    flag && this.getDeptList();
143
+  }
144
+
145
+  // 获取科室
146
+  deptList: any = [];
147
+  getDeptList(e = undefined) {
148
+    let postData = {
149
+      idx: 0,
150
+      sum: 20,
151
+      department: {
152
+        searchType: 1,// 简单查询
153
+        cascadeHosId: this.currentHospital.id,
154
+        dept: e,
155
+      }
156
+    };
157
+    this.isLoading = true;
158
+    this.mainService
159
+      .getFetchDataList("simple/data", "department", postData)
160
+      .subscribe((data) => {
161
+        this.isLoading = false;
162
+        this.deptList = data.list || [];
163
+      });
164
+  }
165
+
166
+  openChangePatient(flag){
167
+    flag && this.setIsSelecting(false);
168
+    flag && this.getDeliveryUserList();
169
+  }
170
+
171
+  // 获取送达人
172
+  deliveryUserList: any = [];
173
+  getDeliveryUserList(e = undefined) {
174
+    let postData = {
175
+      idx: 0,
176
+      sum: 20,
177
+      user: {
178
+        hospital: { id: this.currentHospital.id },
179
+        name: e,
180
+      }
181
+    };
182
+    this.isLoading = true;
183
+    this.mainService
184
+      .getFetchDataList("simple/data", "user", postData)
185
+      .subscribe((data) => {
186
+        this.isLoading = false;
187
+        this.deliveryUserList = data.list || [];
188
+      });
189
+  }
190
+
191
+  //获取状态
192
+  stateList:any[] = [];
193
+  getStatus() {
194
+    this.mainService
195
+    .getDictionary('list', 'pathology_pack_status')
196
+    .subscribe((data) => {
197
+      this.stateList = data || [];
198
+    });
199
+  }
200
+
201
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
202
+  showPromptModal(con, success, promptInfo?) {
203
+    this.promptModalShow = false;
204
+    this.promptContent = con;
205
+    this.ifSuccess = success;
206
+    this.promptInfo = promptInfo;
207
+    setTimeout(() => {
208
+      this.promptModalShow = true;
209
+    }, 100);
210
+    this.getList(0);
211
+  }
212
+
213
+  // 查看日志弹窗
214
+  logPromptModalShow = false; //弹窗开关
215
+  packId = ""; //查看记录携带id
216
+  showLogs(data) {
217
+    this.packId = data.id;
218
+    this.logPromptModalShow = true;
219
+  }
220
+  // 关闭日志弹窗
221
+  closeModelLog(e) {
222
+    this.logPromptModalShow = JSON.parse(e).show;
223
+  }
224
+
225
+  // 查看
226
+  detail(e, id) {
227
+    e.stopPropagation();
228
+    this.router.navigateByUrl(`/main/commonInfo/orderDetail/${id}`);
229
+  }
230
+}

+ 19 - 0
src/app/views/common-info/common-info.module.ts

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

+ 22 - 0
src/app/views/emergency-info/emergency-info-routing.module.ts

@@ -0,0 +1,22 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { EmergencyInfoComponent } from './emergency-info.component';
4
+import { OrderDetailComponent } from '../../share/order-detail/order-detail.component'
5
+
6
+const routes: Routes = [{
7
+  path: '',
8
+  component: EmergencyInfoComponent,
9
+	children: [
10
+	  {
11
+	    // 查看详情
12
+	    path: 'orderDetail/:id',
13
+	    component: OrderDetailComponent,
14
+	  }
15
+	]
16
+}];
17
+
18
+@NgModule({
19
+  imports: [RouterModule.forChild(routes)],
20
+  exports: [RouterModule]
21
+})
22
+export class EmergencyInfoRoutingModule { }

+ 225 - 0
src/app/views/emergency-info/emergency-info.component.html

@@ -0,0 +1,225 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='16' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label">状态:</span>
7
+          <nz-select
8
+            [nzDropdownMatchSelectWidth]="false"
9
+            class="formItem"
10
+            nzServerSearch
11
+            nzShowSearch
12
+            nzAllowClear
13
+            nzPlaceHolder="请选择状态"
14
+            [(ngModel)]="alarmStatus"
15
+          >
16
+            <ng-container *ngFor="let data of alarmList">
17
+              <nz-option
18
+                nzLabel="{{ data.name }}"
19
+                nzValue="{{ data.id }}"
20
+              ></nz-option>
21
+            </ng-container>
22
+          </nz-select>
23
+        </div>
24
+      	
25
+				<div class="list-template__searchItem">
26
+				  <span class="label">工单状态:</span>
27
+				  <nz-select
28
+				    [nzDropdownMatchSelectWidth]="false"
29
+				    class="formItem"
30
+				    nzServerSearch
31
+				    nzShowSearch
32
+				    nzAllowClear
33
+				    nzPlaceHolder="请选择工单状态"
34
+				    [(ngModel)]="incidentStatus"
35
+				  >
36
+				    <ng-container *ngFor="let data of gdList">
37
+				      <nz-option
38
+				        nzLabel="{{ data.name }}"
39
+				        nzValue="{{ data.id }}"
40
+				      ></nz-option>
41
+				    </ng-container>
42
+				  </nz-select>
43
+				</div>
44
+				
45
+      	<div class="list-template__searchItem">
46
+      	  <span class="label">告警ip:</span>
47
+      	  <input nz-input class="formItem" placeholder="请输入告警ip" [(ngModel)]="alarmIp" />
48
+      	</div>
49
+      	
50
+				<div class="list-template__searchItem">
51
+				  <span class="label">紧急度:</span>
52
+				  <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzShowSearch nzAllowClear
53
+				    nzPlaceHolder="请选择紧急度" [(ngModel)]="alarmUrgency">
54
+				    <ng-container *ngFor="let data of urgencyList">
55
+				      <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}"></nz-option>
56
+				    </ng-container>
57
+				  </nz-select>
58
+				</div>
59
+      	
60
+      	<div class="list-template__searchItem">
61
+      	  <span class="label width-105">告警时间区间:</span>
62
+      	  <nz-range-picker nzShowTime [(ngModel)]="dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)" (ngModelChange)="changeDate($event)"></nz-range-picker>
63
+      	</div>
64
+      </div>
65
+      <div nz-col nzXl='6' class="list-template__btns">
66
+        <button nz-button class="btn default" (click)='search()'>搜索</button>
67
+        <button nz-button class="btn ml8 default" (click)="reset()">重置</button>
68
+        <button nz-button *ngIf="coopBtns.batchRecover" class="btn ml8 default" (click)="batchRecover($event)">批量恢复</button>
69
+				<button nz-button *ngIf="coopBtns.batchProcessing" class="btn ml8 default" (click)="batchNo($event)">批量不处理</button>
70
+			</div>
71
+    </div>
72
+    <div class="list-template__bottom">
73
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
74
+        [nzLoading]="loading1">
75
+        <thead>
76
+          <tr class="thead">
77
+            <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked"
78
+              (nzCheckedChange)="checkAll($event)"></th>
79
+            <th nzWidth="10%">告警id</th>
80
+            <th nzWidth="10%">告警来源</th>
81
+            <th nzWidth="20%">告警内容</th>
82
+            <th nzWidth="9%">告警状态</th>
83
+						<th nzWidth="10%">告警ip</th>
84
+						<th nzWidth="9%">紧急度</th>
85
+						<th nzWidth="15%">告警时间</th>
86
+						<th nzWidth="10%">工单单号</th>
87
+            <th nzWidth="120px">操作</th>
88
+          </tr>
89
+        </thead>
90
+        <tbody>
91
+          <tr *ngFor="let data of listOfData;let index=index;">
92
+            <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
93
+            <td>{{ data.alarmId || '-' }}</td>
94
+            <td>{{ data.alarmSource || '-' }}</td>
95
+            <td>{{ data.alarmContent || '-' }}</td>
96
+            <td>{{ data.alarmStatus?.name }}</td>
97
+						<td>{{ data.alarmIp || '-' }}</td>
98
+						<td>{{ data.alarmUrgency?.name }}</td>
99
+						<td>{{ data.alarmActiveTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
100
+						<td class="text-underline" (click)="detail($event, data)">{{ data.incidentSign || '-' }}</td>
101
+            <td>
102
+              <div class="coop">
103
+                <span *ngIf="coopBtns.view" (click)="look(data)">查看</span>
104
+                <span *ngIf="coopBtns.add && !data.incidentSign" (click)="addOrder(data)">建单</span>
105
+              </div>
106
+            </td>
107
+          </tr>
108
+        </tbody>
109
+      </nz-table>
110
+      <div class="list-template__pagination">
111
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
112
+          (nzPageIndexChange)="getList(false,'page')" (nzPageSizeChange)="getList(false, 'page')">
113
+        </nz-pagination>
114
+      </div>
115
+    </div>
116
+  </div>
117
+</div>
118
+<!-- 新增/编辑模态框 -->
119
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
120
+  <div class="modalBody">
121
+    <div class="title">{{add?"新增":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
122
+    </div>
123
+    <overlay-scrollbars #osComponentRef1 class="content">
124
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
125
+        <nz-form-item>
126
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="title">名称</nz-form-label>
127
+          <nz-form-control nzErrorTip="请填写名称!">
128
+            <nz-input-group>
129
+              <input type="text" nz-input formControlName="title" placeholder="请填写名称" />
130
+            </nz-input-group>
131
+          </nz-form-control>
132
+        </nz-form-item>
133
+        <nz-form-item>
134
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="taskTypeIds">绑定任务类型</nz-form-label>
135
+          <nz-form-control nzErrorTip="请选择绑定任务类型!">
136
+            <nz-select nzMode="multiple" [nzDropdownMatchSelectWidth]="false" formControlName="taskTypeIds" nzShowSearch nzAllowClear nzPlaceHolder="请选择绑定任务类型" nzServerSearch (nzOnSearch)="changeInp($event)" (nzOpenChange)="openTasktype($event)">
137
+              <ng-container *ngFor="let data of taskTypeList">
138
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id">
139
+                </nz-option>
140
+              </ng-container>
141
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
142
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
143
+              </nz-option>
144
+            </nz-select>
145
+          </nz-form-control>
146
+        </nz-form-item>
147
+        <nz-form-item>
148
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="deptIds">绑定科室</nz-form-label>
149
+          <nz-form-control nzErrorTip="请选择绑定科室!">
150
+            <nz-select nzMode="multiple" [nzDropdownMatchSelectWidth]="false" formControlName="deptIds" nzShowSearch nzAllowClear nzPlaceHolder="请选择绑定科室" nzServerSearch (nzOnSearch)="changeDeptInp($event)" (nzOpenChange)="openDept($event)">
151
+              <ng-container *ngFor="let data of deptList">
152
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id">
153
+                </nz-option>
154
+              </ng-container>
155
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
156
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
157
+              </nz-option>
158
+            </nz-select>
159
+          </nz-form-control>
160
+        </nz-form-item>
161
+        <nz-form-item>
162
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="type">快捷类型</nz-form-label>
163
+          <nz-form-control nzErrorTip="请选择快捷类型!">
164
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="type" nzShowSearch nzAllowClear nzPlaceHolder="请选择快捷类型" (nzOpenChange)="openSchedule($event)">
165
+              <ng-container *ngFor="let data of typeList">
166
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id">
167
+                </nz-option>
168
+              </ng-container>
169
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
170
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
171
+              </nz-option>
172
+            </nz-select>
173
+          </nz-form-control>
174
+        </nz-form-item>
175
+      </form>
176
+    </overlay-scrollbars>
177
+    <div class="display_flex justify-content_flex-center">
178
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
179
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
180
+    </div>
181
+  </div>
182
+</div>
183
+
184
+<!-- 查看模态框 -->
185
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="lookModal">
186
+  <div class="viewModalBody">
187
+    <div class="title">查看<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
188
+    </div>
189
+    <overlay-scrollbars #osComponentRef1 class="content">
190
+			<div class="df view-item">
191
+				<div class="df-item">告警id:{{itemData.alarmId || '-'}}</div>
192
+				<div class="df-item">告警ip:{{itemData.alarmIp || '-'}}</div>
193
+				<div class="df-item">告警来源:{{itemData.alarmSource || '-'}}</div>
194
+				<div class="df-item">告警状态:{{itemData.alarmStatus?.name || '-'}}</div>
195
+			</div>
196
+			<div class="df view-item">
197
+				<div class="df-item">告警地点:{{itemData.alarmLocation || '-'}}</div>
198
+				<div class="df-item">紧急度:{{itemData.alarmUrgency?.name  || '-'}}</div>
199
+				<div class="df-item">告警时间:{{itemData.alarmActiveTime | date:'yyyy-MM-dd HH:mm:ss' || '-'}}</div>
200
+			</div>
201
+			<div class="view-item">告警内容:{{itemData.alarmContent || '-'}}</div>
202
+			<div class="view-item">其他数据:{{itemData.alarmExtension || '-'}}</div>
203
+			<div class="view-item">告警描述:{{itemData.alarmDescription  || '-'}}</div>
204
+    </overlay-scrollbars>
205
+    <div class="display_flex justify-content_flex-center">
206
+      <button nzType="primary" nz-button (click)="close()">知道了</button>
207
+    </div>
208
+  </div>
209
+</div>
210
+
211
+<!-- 模态框 -->
212
+<app-dialog-delete [delModal]="optModal" (hideDelModalEvent)="hideOptModal()"
213
+ [btnLoading]="btnLoading" (confirmDelEvent)="confirmOpt()" 
214
+ [content]="infoContent"></app-dialog-delete>
215
+
216
+<!-- 操作成功/失败提示框 -->
217
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow" [info]="promptInfo"></app-prompt-modal>
218
+
219
+<!-- 遮罩 -->
220
+<app-mask *ngIf="maskFlag"></app-mask>
221
+
222
+<!-- 详情 -->
223
+<app-incident-detail [id]="coopData.incidentId" *ngIf="detailModalShow" (closeModelHs)="closeDetailModelOrder($event)" (confirmModelHs)="confirmDetailModelOrder($event)"></app-incident-detail>
224
+
225
+<router-outlet (deactivate)="refreshList()"></router-outlet>

+ 214 - 0
src/app/views/emergency-info/emergency-info.component.less

@@ -0,0 +1,214 @@
1
+@import "../../../../src/theme.less";
2
+.width-105{
3
+	width: 105px !important;
4
+}
5
+.text-underline{
6
+	cursor: pointer;
7
+	text-decoration: underline;
8
+}
9
+.save {
10
+  position: fixed;
11
+  left: 0;
12
+  top: 0;
13
+  width: 100%;
14
+  height: 100%;
15
+  background: rgba(0, 0, 0, 0.4);
16
+  z-index: 99;
17
+	
18
+	.viewModalBody{
19
+		width: 60%;
20
+		background: #fff;
21
+		border-radius: 5px;
22
+		padding: 10px 20px;
23
+		color: #333;
24
+		
25
+		.title {
26
+		  width: 100%;
27
+		  text-align: center;
28
+		  font-size: 18px;
29
+		  position: relative;
30
+		
31
+		  i {
32
+		    position: absolute;
33
+		    right: 0;
34
+		    top: 0;
35
+		    font-size: 20px;
36
+		    color: #666;
37
+		    cursor: pointer;
38
+		    padding: 0 5px;
39
+		  }
40
+		}
41
+		
42
+		.content {
43
+		  width: 100%;
44
+		  background: #f9fafb;
45
+		  border: 1px solid #e5e9ed;
46
+		  border-radius: 5px;
47
+		  margin-top: 12px;
48
+			padding: 20px;
49
+			
50
+			.df{
51
+				display: flex;
52
+				.df-item{
53
+					margin-right: 40px;
54
+				}
55
+			}
56
+			
57
+			.view-item{
58
+				margin-bottom: 20px;
59
+				text-align: left;
60
+			}
61
+			
62
+		  div {
63
+		    text-align: center;
64
+		    margin: 0;
65
+		
66
+		    &.icon {
67
+		      margin-top: 17px;
68
+		
69
+		      i {
70
+		        color: #34b349;
71
+		        font-size: 30px !important;
72
+		
73
+		        &.transport-wenhao {
74
+		          color: #f5a523;
75
+		        }
76
+		
77
+		        &.transport-shibai {
78
+		          color: #ff3a52;
79
+		        }
80
+		      }
81
+		    }
82
+		
83
+		    &.defeat {
84
+		      color: #333;
85
+		      font-size: 18px;
86
+		    }
87
+		  }
88
+		}
89
+		
90
+		button {
91
+		  margin-top: 10px;
92
+		
93
+		  &.btn {
94
+		    margin-left: 8px;
95
+		  }
96
+		}
97
+	}
98
+	
99
+  .modalBody {
100
+    width: 350px;
101
+    background: #fff;
102
+    border-radius: 5px;
103
+    padding: 10px 20px;
104
+    color: #333;
105
+
106
+    .title {
107
+      width: 100%;
108
+      text-align: center;
109
+      font-size: 18px;
110
+      position: relative;
111
+
112
+      i {
113
+        position: absolute;
114
+        right: 0;
115
+        top: 0;
116
+        font-size: 20px;
117
+        color: #666;
118
+        cursor: pointer;
119
+        padding: 0 5px;
120
+      }
121
+    }
122
+
123
+    .content {
124
+      width: 100%;
125
+      height: 117px;
126
+      background: #f9fafb;
127
+      border: 1px solid #e5e9ed;
128
+      border-radius: 5px;
129
+      overflow: hidden;
130
+      margin-top: 12px;
131
+			
132
+      div {
133
+        text-align: center;
134
+        margin: 0;
135
+
136
+        &.icon {
137
+          margin-top: 17px;
138
+
139
+          i {
140
+            color: #34b349;
141
+            font-size: 30px !important;
142
+
143
+            &.transport-wenhao {
144
+              color: #f5a523;
145
+            }
146
+
147
+            &.transport-shibai {
148
+              color: #ff3a52;
149
+            }
150
+          }
151
+        }
152
+
153
+        &.defeat {
154
+          color: #333;
155
+          font-size: 18px;
156
+        }
157
+
158
+        &:nth-child(3) {
159
+          font-size: 14px;
160
+          color: #666;
161
+        }
162
+      }
163
+    }
164
+
165
+    button {
166
+      margin-top: 10px;
167
+
168
+      &.btn {
169
+        margin-left: 8px;
170
+      }
171
+    }
172
+  }
173
+
174
+  // 新增
175
+  &.add {
176
+    .modalBody {
177
+      width: 480px;
178
+      height: auto;
179
+
180
+      .content {
181
+        width: 100%;
182
+        height: auto;
183
+        padding: 19px 14px 0 14px;
184
+        max-height: 500px;
185
+        overflow-y: auto;
186
+
187
+        .addForm {
188
+          .ant-form-item {
189
+            margin-bottom: 8px;
190
+
191
+            .ant-form-item-label {
192
+              line-height: 14px;
193
+              text-align: left;
194
+            }
195
+          }
196
+        }
197
+
198
+        .editForm {
199
+          .ant-form-item {
200
+            margin-bottom: 14px;
201
+
202
+            .ant-form-item-label {
203
+              line-height: 0;
204
+            }
205
+          }
206
+        }
207
+      }
208
+
209
+      button:nth-child(1) {
210
+        margin-right: 20px;
211
+      }
212
+    }
213
+  }
214
+}

+ 496 - 0
src/app/views/emergency-info/emergency-info.component.ts

@@ -0,0 +1,496 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
6
+import { ToolService } from "../../services/tool.service";
7
+import { Subject } from "rxjs";
8
+import { debounceTime } from "rxjs/operators";
9
+import { EmergencyInfoService } from './emergency-info.service';
10
+import { format, startOfDay, endOfDay } from 'date-fns';
11
+import { NzMessageService } from "ng-zorro-antd";
12
+
13
+@Component({
14
+  selector: "app-emergency-info",
15
+  templateUrl: "./emergency-info.component.html",
16
+  styleUrls: ["./emergency-info.component.less"],
17
+})
18
+export class EmergencyInfoComponent implements OnInit {
19
+  @ViewChild("osComponentRef1", {
20
+    read: OverlayScrollbarsComponent,
21
+    static: false,
22
+  })
23
+  osComponentRef1: OverlayScrollbarsComponent;
24
+  constructor(
25
+		private message: NzMessageService,
26
+    private fb: FormBuilder,
27
+    private route: ActivatedRoute,
28
+		private router: Router,
29
+    private tool: ToolService,
30
+    private quickOrderAcceptanceService: EmergencyInfoService,
31
+  ) {}
32
+
33
+  listOfData: any[] = []; //表格数据
34
+
35
+  modal: boolean = false; //新增/编辑模态框
36
+  add: boolean; //true:新增;false:编辑
37
+  validateForm: FormGroup; //新增/编辑表单
38
+  coopId: number; //表格中执行操作的id
39
+  department: any; //所属科室
40
+  hosId: any; //院区(搜索)
41
+  typeList: Array<any>; //快捷类型
42
+  taskTypeList: Array<any>; //所有任务类型
43
+  deptList: Array<any>; //所有科室
44
+  pageIndex: number = 1; //页码
45
+  listLength: number = 10; //总条数
46
+  pageSize: number = 10; //每页条数
47
+
48
+  promptContent: string; //操作提示框提示信息
49
+  ifSuccess: boolean; //操作成功/失败
50
+  promptInfo: string; //操作结果提示信息
51
+  promptModalShow: boolean; //操作提示框是否展示
52
+
53
+  btnLoading: boolean = false; //提交按钮loading状态
54
+  changeInpSubject = new Subject(); //防抖
55
+  changeInpDeptSubject = new Subject(); //防抖
56
+
57
+  // 初始化增删改按钮
58
+  coopBtns: any = {};
59
+	alarmStatus:any;
60
+	incidentStatus:any;
61
+	alarmIp:any;
62
+	alarmUrgency:any;
63
+	dateRange:any = [];
64
+	
65
+  ngOnInit() {
66
+		// 全局监听
67
+		this.tool.getEventEndObservable().subscribe(res => {
68
+			console.log('全局的监听触发2222', res);
69
+			let data:any = res;
70
+			if(data.message == '关单'){
71
+				this.getList(true)
72
+			}
73
+		});
74
+    //防抖
75
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
76
+      this.getTasktype(v[0]);
77
+    });
78
+    //防抖
79
+    this.changeInpDeptSubject.pipe(debounceTime(500)).subscribe((v) => {
80
+      this.getDept(v[0]);
81
+    });
82
+    this.coopBtns = this.tool.initCoopBtns(this.route);
83
+    this.initForm();
84
+    this.hosId = this.tool.getCurrentHospital().id;
85
+    this.getList(true);
86
+		this.getGdList();
87
+  }
88
+	
89
+	// 日期选择
90
+	startDate: string; //发起时间开始
91
+	endDate: string; //发起时间结束
92
+	changeDate(result?): void {
93
+	  if (result.length==0) {
94
+	    this.startDate = this.endDate = null;
95
+	    return;
96
+	  }
97
+		this.startDate = format(result[0], 'yyyy-MM-dd HH:mm:ss');
98
+		this.endDate = format(result[1], 'yyyy-MM-dd HH:mm:ss');
99
+	  this.dateRange = [this.startDate,this.endDate]
100
+	}
101
+	
102
+	onCalendarChangeDate(dateArr){
103
+	  console.log(dateArr)
104
+	  if(dateArr.length == 2){
105
+	    let dateStart = new Date(dateArr[0]);
106
+	    let dateEnd = new Date(dateArr[1]);
107
+	    dateStart.setHours(0,0,0);
108
+	    dateEnd.setHours(23,59,59);
109
+	    this.dateRange = [dateStart,dateEnd];
110
+	  }
111
+	}
112
+	
113
+	// 获取工单状态
114
+	gdList:any = [];
115
+	alarmList:any = [];
116
+	urgencyList:any = [];
117
+	getGdList() {
118
+	  this.isLoading = true;
119
+	  this.quickOrderAcceptanceService.getDictionary("incident_status").subscribe((res) => {
120
+	    this.isLoading = false;
121
+	    this.gdList = res || [];
122
+	  });
123
+		this.quickOrderAcceptanceService.getDictionary("alarm_status").subscribe((res) => {
124
+		  this.isLoading = false;
125
+		  this.alarmList = res || [];
126
+		});
127
+		this.quickOrderAcceptanceService.getDictionary("alarm_urgency").subscribe((res) => {
128
+		  this.isLoading = false;
129
+		  this.urgencyList = res || [];
130
+		});
131
+	}
132
+	
133
+  // 搜索
134
+  search() {
135
+    this.getList(true);
136
+  }
137
+	
138
+	// 重置
139
+	reset() {
140
+		this.alarmStatus = null;
141
+		this.incidentStatus = null;
142
+		this.alarmIp = null;
143
+		this.alarmUrgency = null;
144
+		this.startDate = null;
145
+		this.endDate = null;
146
+		this.dateRange = [];
147
+	  this.getList(true);
148
+	}
149
+	
150
+  // 表格数据
151
+  loading1 = false;
152
+  getList(isResetPageIndex = false, type?) {
153
+    isResetPageIndex && (this.pageIndex = 1);
154
+    let data = {
155
+      pageIndex: this.pageIndex,
156
+      pageSize: this.pageSize,
157
+      hosId: this.hosId,
158
+			alarm:{
159
+				alarmStatus:{
160
+					id:this.alarmStatus
161
+				},
162
+				incidentStatus:this.incidentStatus,
163
+				alarmIp:this.alarmIp,
164
+				alarmUrgency:{
165
+					id:this.alarmUrgency,
166
+				},
167
+				startTime: this.startDate || undefined,
168
+				endTime: this.endDate || undefined,
169
+			}
170
+    };
171
+		if(this.alarmStatus){
172
+			data.alarm.alarmStatus.id = this.alarmStatus
173
+		}else{
174
+			delete data.alarm.alarmStatus
175
+		}
176
+		if(this.alarmUrgency){
177
+			data.alarm.alarmUrgency.id = this.alarmUrgency
178
+		}else{
179
+			delete data.alarm.alarmUrgency
180
+		}
181
+    this.loading1 = true;
182
+		if(type!='page'){
183
+			this.mapOfCheckedId = {};
184
+			this.checkedDepIds = [];
185
+		}
186
+    this.isAllDisplayDataChecked = false;
187
+    this.quickOrderAcceptanceService
188
+      .query(data)
189
+      .subscribe((result) => {
190
+        this.loading1 = false;
191
+        this.listOfData = result.list;
192
+        this.listLength = result.totalNum;
193
+      });
194
+  }
195
+
196
+  // 获取任务类型列表
197
+  getTasktype(keywords = '') {
198
+    let hosId = this.tool.getCurrentHospital().id;
199
+    this.isLoading = true;
200
+    this.quickOrderAcceptanceService.queryTasktype({
201
+      hosId,
202
+      keywords,
203
+    }).subscribe((res) => {
204
+      this.isLoading = false;
205
+      this.taskTypeList = res.list || [];
206
+    });
207
+  }
208
+
209
+  // 获取科室列表
210
+  getDept(keywords = '') {
211
+    let hosId = this.tool.getCurrentHospital().id;
212
+    this.isLoading = true;
213
+    this.quickOrderAcceptanceService.queryDept({
214
+      hosId,
215
+      keywords,
216
+    }).subscribe((res) => {
217
+      this.isLoading = false;
218
+      this.deptList = res.list || [];
219
+    });
220
+  }
221
+
222
+  // 获取快捷类型
223
+  getTypeList() {
224
+    this.isLoading = true;
225
+    this.quickOrderAcceptanceService.getDictionary("receiveRuleType").subscribe((res) => {
226
+      this.isLoading = false;
227
+      this.typeList = res || [];
228
+    });
229
+  }
230
+
231
+  // 新增弹框
232
+  showModal() {
233
+    this.add = true;
234
+    this.modal = true;
235
+    this.initForm();
236
+  }
237
+  hideModal() {
238
+    this.modal = false;
239
+    this.initForm();
240
+  }
241
+
242
+  // 初始化新增form表单
243
+  initForm() {
244
+    if (this.add) {
245
+      this.typeList = [];
246
+      this.taskTypeList = [];
247
+      this.deptList = [];
248
+    }
249
+    this.validateForm = this.fb.group({
250
+      title: ['', [Validators.required]],
251
+      taskTypeIds: [null, [Validators.required]],
252
+      deptIds: [null, [Validators.required]],
253
+      type: [null, [Validators.required]],
254
+    });
255
+  }
256
+  // 表单提交
257
+  submitForm(): void {
258
+    for (const i in this.validateForm.controls) {
259
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
260
+      this.validateForm.controls[i].updateValueAndValidity();
261
+    }
262
+    if (this.validateForm.invalid) return;
263
+    this.btnLoading = true;
264
+    if(this.add){
265
+      this.quickOrderAcceptanceService
266
+      .add({
267
+        title: this.validateForm.value.title,
268
+        taskTypeIds: this.validateForm.value.taskTypeIds,
269
+        deptIds: this.validateForm.value.deptIds,
270
+        type: {id: this.validateForm.value.type},
271
+        hosId: this.hosId,
272
+      })
273
+      .subscribe((data) => {
274
+        this.btnLoading = false;
275
+        this.hideModal();
276
+        this.initForm();
277
+        if (data.status == 200) {
278
+          this.showPromptModal(this.add ? "新增" : "编辑", true, "");
279
+        } else {
280
+          this.showPromptModal(this.add ? "新增" : "编辑", false, data.msg);
281
+        }
282
+      });
283
+    }else{
284
+      this.quickOrderAcceptanceService
285
+      .update({
286
+        title: this.validateForm.value.title,
287
+        taskTypeIds: this.validateForm.value.taskTypeIds,
288
+        deptIds: this.validateForm.value.deptIds,
289
+        type: {id: this.validateForm.value.type},
290
+        coopData: this.coopData,
291
+      })
292
+      .subscribe((data) => {
293
+        this.btnLoading = false;
294
+        this.hideModal();
295
+        this.initForm();
296
+        if (data.status == 200) {
297
+          this.showPromptModal(this.add ? "新增" : "编辑", true, "");
298
+        } else {
299
+          this.showPromptModal(this.add ? "新增" : "编辑", false, data.msg);
300
+        }
301
+      });
302
+    }
303
+  }
304
+	
305
+	// 批量恢复
306
+	infoContent:any;
307
+	optModal:boolean = false;
308
+	operationType:any;
309
+	batchRecover(){
310
+		if(this.checkedDepIds.length==0){
311
+			this.message.error('请勾选告警列表')
312
+			return
313
+		}
314
+		this.operationType = 'batchRecovery'
315
+		this.infoContent=`您确认要恢复${this.checkedDepIds.length}项告警吗?`
316
+		this.optModal = true
317
+	}
318
+	
319
+	// 批量不处理
320
+	batchNo(){
321
+		if(this.checkedDepIds.length==0){
322
+			this.message.error('请勾选告警列表')
323
+			return
324
+		}
325
+		this.operationType = 'batchUnprocessed'
326
+		this.infoContent=`您确认要不处理${this.checkedDepIds.length}项告警吗?`
327
+		this.optModal = true
328
+	}
329
+	
330
+	// 确认
331
+	confirmOpt() {
332
+	  this.btnLoading = true;
333
+	  this.quickOrderAcceptanceService
334
+	  .operation({
335
+	    operationType: this.operationType,
336
+	    ids: this.checkedDepIds,
337
+	  })
338
+	  .subscribe((data) => {
339
+	    this.btnLoading = false;
340
+	    this.hideOptModal();
341
+	    if (data.status == 200) {
342
+	      this.showPromptModal("操作", true, "");
343
+	    } else {
344
+	      this.showPromptModal("操作", false, data.msg);
345
+	    }
346
+	  });
347
+	}
348
+	
349
+	// 关闭模态框
350
+	hideOptModal() {
351
+	  this.optModal = false;
352
+	}
353
+	
354
+	// 建单
355
+	addOrder(data){
356
+		this.tool.triggerEvent({
357
+			message:'建单',
358
+			data: data
359
+		})
360
+	}
361
+	
362
+	// 查看工单
363
+	detailModalShow = false; //弹窗开关
364
+	detail(e, data) {
365
+	  e.stopPropagation();
366
+	  this.coopData = data;
367
+	  this.detailModalShow = true;
368
+	}
369
+	// 关闭弹窗
370
+	closeDetailModelOrder(e) {
371
+	  this.detailModalShow = JSON.parse(e).show;
372
+	}
373
+	// 弹窗确定
374
+	confirmDetailModelOrder(e){
375
+	  console.log(e);
376
+	  this.detailModalShow = false;
377
+	  this.getList(true);
378
+	}
379
+	
380
+	refreshList(){
381
+		
382
+	}
383
+	
384
+	// 查看列表
385
+	itemData:any;
386
+	lookModal:boolean = false;
387
+	look(data){
388
+		this.itemData = data;
389
+		this.lookModal = true
390
+	}
391
+	
392
+	// 关闭查看
393
+	close(){
394
+		this.lookModal = false
395
+	}
396
+	
397
+  // 选中表格中科室
398
+  mapOfCheckedId: { [key: string]: boolean } = {};
399
+  checkedDepIds = []; //已选中科室id
400
+  refreshStatus(): void {
401
+    this.isAllDisplayDataChecked = this.listOfData.every(
402
+      (item) => this.mapOfCheckedId[item.id]
403
+    );
404
+    let arr = [];
405
+    for (var k in this.mapOfCheckedId) {
406
+      if (this.mapOfCheckedId[k]) {
407
+        arr.push(Number(k));
408
+      }
409
+    }
410
+    this.checkedDepIds = arr;
411
+    console.log(this.checkedDepIds);
412
+  }
413
+
414
+  //表格整行选中
415
+  selectedListData(id) {
416
+    this.mapOfCheckedId[id] = !this.mapOfCheckedId[id];
417
+    this.refreshStatus();
418
+  }
419
+
420
+  // 全选
421
+  isAllDisplayDataChecked = false; //当前页是否全选
422
+  checkAll(value: boolean): void {
423
+    this.listOfData.forEach((item) => (this.mapOfCheckedId[item.id] = value));
424
+    this.refreshStatus();
425
+  }
426
+
427
+  // 编辑
428
+  maskFlag: any = false;
429
+  coopData = {};
430
+  edit(data) {
431
+    this.validateForm.controls.title.setValue(data.title);
432
+    this.validateForm.controls.type.setValue(data.type ? data.type.id : null);
433
+    this.validateForm.controls.taskTypeIds.setValue(data.taskTypeList ? data.taskTypeList.map(v => v.id) : null);
434
+    this.validateForm.controls.deptIds.setValue(data.deptList ? data.deptList.map(v => v.id) : null);
435
+    this.modal = true;
436
+    this.add = false;
437
+    this.coopId = data.id;
438
+    this.coopData = data;
439
+    this.getTasktype();
440
+    this.getDept();
441
+    this.getTypeList();
442
+  }
443
+
444
+  // 删除
445
+  delModal: boolean = false; //删除模态框
446
+  del(data) {
447
+    this.coopId = data.id;
448
+    this.delModal = true;
449
+  }
450
+
451
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
452
+  showPromptModal(con, success, promptInfo?) {
453
+    this.promptModalShow = false;
454
+    this.promptContent = con;
455
+    this.ifSuccess = success;
456
+    this.promptInfo = promptInfo;
457
+    setTimeout(() => {
458
+      this.promptModalShow = true;
459
+    }, 100);
460
+    this.getList(true);
461
+  }
462
+
463
+  // 边输边搜节流阀
464
+  isLoading = false;
465
+  changeInp(e) {
466
+    this.changeInpSubject.next([e]);
467
+  }
468
+
469
+  // 边输边搜节流阀
470
+  changeDeptInp(e) {
471
+    this.changeInpDeptSubject.next([e]);
472
+  }
473
+
474
+  // 打开任务类型
475
+  openTasktype(e){
476
+    if(e){
477
+      this.getTasktype();
478
+    }
479
+  }
480
+
481
+  // 打开科室
482
+  openDept(e){
483
+    if(e){
484
+      this.getDept();
485
+    }
486
+  }
487
+
488
+  // 打开班次
489
+  openSchedule(e){
490
+    if(e){
491
+      this.getTypeList();
492
+    }
493
+  }
494
+}
495
+
496
+

+ 20 - 0
src/app/views/emergency-info/emergency-info.module.ts

@@ -0,0 +1,20 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { EmergencyInfoRoutingModule } from './emergency-info-routing.module';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+import { EmergencyInfoComponent } from './emergency-info.component';
7
+import { IncidentDetailModule } from 'src/app/components/incidentManagement/incident-detail/incident-detail.module';
8
+
9
+@NgModule({
10
+  declarations: [
11
+    EmergencyInfoComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    EmergencyInfoRoutingModule,
16
+    ShareModule,
17
+		IncidentDetailModule
18
+  ]
19
+})
20
+export class EmergencyInfoModule { }

+ 110 - 0
src/app/views/emergency-info/emergency-info.service.ts

@@ -0,0 +1,110 @@
1
+import { Injectable } from '@angular/core';
2
+import { MainService } from 'src/app/services/main.service';
3
+import { map } from 'rxjs/operators';
4
+
5
+@Injectable({
6
+  providedIn: 'root'
7
+})
8
+export class EmergencyInfoService {
9
+  constructor(
10
+    private mainService: MainService,
11
+  ) { }
12
+
13
+  // 列表-查
14
+  query({pageIndex, pageSize, alarm}) {
15
+    let data = {
16
+      idx: pageIndex - 1,
17
+      sum: pageSize,
18
+      alarm
19
+    };
20
+    return this.mainService.getFetchDataList("simple/data", "alarm", data);
21
+  }
22
+
23
+  // 列表-删
24
+  delete({id}) {
25
+    return this.mainService.simplePost("rmvData", "alarm", [id]);
26
+  }
27
+
28
+  // 列表-增
29
+  add({title, type, taskTypeIds, deptIds, hosId}) {
30
+    let data = {
31
+      title,
32
+      taskTypeIds: taskTypeIds.toString(),
33
+      deptIds: deptIds.toString(),
34
+      type,
35
+      hosId,
36
+    };
37
+    return this.mainService.simplePost("addData", "alarm", data);
38
+  }
39
+
40
+  // 列表-改
41
+  update({title, type, taskTypeIds, deptIds, coopData}) {
42
+    let data = {
43
+      title,
44
+      taskTypeIds: taskTypeIds.toString(),
45
+      deptIds: deptIds.toString(),
46
+      type,
47
+    };
48
+    data = {...coopData, ...data};
49
+    return this.mainService.simplePost("addData", "alarm", data);
50
+  }
51
+	
52
+	// 恢复、不处理
53
+	operation(data) {
54
+	  return this.mainService.simplePost("updData", "alarm", data);
55
+	}
56
+	
57
+  // 查询任务类型
58
+  queryTasktype({hosId, keywords}){
59
+    let postData = {
60
+      taskType: {
61
+        simpleQuery: true,
62
+        hosId: {id: hosId},
63
+        taskName: keywords,
64
+      },
65
+      idx: 0,
66
+      sum: 9999,
67
+    };
68
+    return this.mainService.getFetchDataList("configuration", "taskType", postData).pipe(map((v:any) => {
69
+      if(Array.isArray(v.list)){
70
+        v.list = v.list.map(vv => ({id: vv.id, name: vv.taskName}));
71
+      }else{
72
+        v.list = [];
73
+      }
74
+      return v;
75
+    }));
76
+  }
77
+
78
+  // 查询科室
79
+  queryDept({hosId, keywords}){
80
+    let postData = {
81
+      department: {
82
+        simpleQuery: true,
83
+        hospital: {id: hosId},
84
+        dept: keywords,
85
+      },
86
+      idx: 0,
87
+      sum: 9999,
88
+    };
89
+    return this.mainService.getFetchDataList("data", "department", postData).pipe(map((v:any) => {
90
+      if(Array.isArray(v.list)){
91
+        v.list = v.list.map(vv => ({id: vv.id, name: vv.dept}));
92
+      }else{
93
+        v.list = [];
94
+      }
95
+      return v;
96
+    }));
97
+  }
98
+
99
+  // 字典
100
+  getDictionary(type) {
101
+    return this.mainService.getDictionary("list", type);
102
+  }
103
+
104
+  // 打印二维码
105
+  print(ids) {
106
+    return this.mainService.coopWorkerOrder("generateReceiveCodes", ids)
107
+  }
108
+}
109
+
110
+

+ 80 - 6
src/app/views/fuwutai/fuwutai.component.html

@@ -998,9 +998,20 @@
998 998
       <div class="title" *ngIf="currentTabIndex !== '故障报修' && currentTabIndex !== '政务值班'">
999 999
         <div class="newTop">
1000 1000
           <div class="name">来电咨询</div>
1001
-          <div class="newTopItem">
1001
+					<div class="newTopItem" *ngIf="crossHospital==1">
1002
+					  <span class="grayFont required">院区:</span>
1003
+					  <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" [(ngModel)]="inHosId" (ngModelChange)="changeInHospital($event)" nzAllowClear [nzDisabled]="buildType === '编辑事件'">
1004
+					    <ng-container *ngFor="let option of applicationHospitalList">
1005
+					      <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1006
+					    </ng-container>
1007
+					    <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1008
+					      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1009
+					    </nz-option>
1010
+					  </nz-select>
1011
+					</div>
1012
+          <div class="newTopItem" *ngIf="crossHospital==1">
1002 1013
             <span class="grayFont">申请科室:</span>
1003
-            <nz-select style="width: 146px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('hsms', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="applyDept" (ngModelChange)="changeApply($event)" (nzOpenChange)="openChangeApply($event)">
1014
+            <nz-select style="width: 146px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('hsms', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="applyDept" (ngModelChange)="changeApply($event)">
1004 1015
               <ng-container *ngFor="let option of applicationDepartmentList">
1005 1016
                 <nz-option *ngIf="!isLoadingApply" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
1006 1017
               </ng-container>
@@ -1009,6 +1020,17 @@
1009 1020
               </nz-option>
1010 1021
             </nz-select>
1011 1022
           </div>
1023
+					<div class="newTopItem" *ngIf="crossHospital!=1">
1024
+					  <span class="grayFont">申请科室:</span>
1025
+					  <nz-select style="width: 146px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('hsms', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="applyDept" (ngModelChange)="changeApply($event)" (nzOpenChange)="openChangeApply($event)">
1026
+					    <ng-container *ngFor="let option of applicationDepartmentList">
1027
+					      <nz-option *ngIf="!isLoadingApply" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
1028
+					    </ng-container>
1029
+					    <nz-option *ngIf="isLoadingApply" nzDisabled nzCustomContent>
1030
+					      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1031
+					    </nz-option>
1032
+					  </nz-select>
1033
+					</div>
1012 1034
           <div class="newTopItem" *ngIf="false">
1013 1035
             <span class="grayFont">任务类型:</span>
1014 1036
             <nz-select *ngIf="applyDept" style="width: 146px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="onSearchTaskBuild($event)" nzPlaceHolder="请选择任务类型" [(ngModel)]="taskBuild" (ngModelChange)="changeTaskBuild($event)">
@@ -1203,7 +1225,20 @@
1203 1225
                           </div>
1204 1226
                         </div>
1205 1227
                         <div *ngIf="!isTaskTypeInspect && radioValueZy" nz-col [nzSpan]="deptZyList['startStatus'] != 201 ? 12 : 24" [ngStyle]="{ display: (deptZyList['startStatus'] != 201 && !isTaskTypeInspect) ? 'block' : 'none'}">
1206
-                          <nz-form-item>
1228
+                          <nz-form-item *ngIf="(deptZyList.startStatus == 204 || deptZyList.startStatus == 205) && deptZyList.startMultipleHospital==1">
1229
+                            <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startHosId">起点科室院区</nz-form-label>
1230
+                            <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择起点科室院区!">
1231
+                              <nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择起点科室院区" formControlName="startHosId" (ngModelChange)="changeTypeHospital($event, 1)" nzAllowClear>
1232
+                                <ng-container *ngFor="let option of applicationHospitalList">
1233
+                                  <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1234
+                                </ng-container>
1235
+                                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1236
+                                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1237
+                                </nz-option>
1238
+                              </nz-select>
1239
+                            </nz-form-control>
1240
+                          </nz-form-item>
1241
+													<nz-form-item>
1207 1242
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startDept">起点科室</nz-form-label>
1208 1243
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择起点科室!">
1209 1244
                               <nz-select formControlName="startDept" [nzDisabled]="deptZyList.startStatus == 201 || deptZyList.startStatus == 203 || deptZyList.startStatus == 206" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="isStartFixedType" [nzServerSearch]="isStartFixedType" (nzOnSearch)="searchHosDepartment(checkedHos, 'start', $event)" nzAllowClear nzPlaceHolder="请选择起点科室" [(ngModel)]="startDeptZy">
@@ -1219,7 +1254,20 @@
1219 1254
                           </nz-form-item>
1220 1255
                         </div>
1221 1256
                         <div *ngIf="!isTaskTypeInspect && radioValueZy" nz-col [nzSpan]="deptZyList['startStatus'] != 201 ? 12 : 24">
1222
-                          <nz-form-item>
1257
+                          <nz-form-item *ngIf="(deptZyList.endStatus == 204 || deptZyList.endStatus == 205) && deptZyList.endMultipleHospital==1">
1258
+                            <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endHosId">终点科室院区</nz-form-label>
1259
+                            <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择终点科室院区!">
1260
+                              <nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择终点科室院区" formControlName="endHosId" (ngModelChange)="changeTypeHospital($event, 2)" nzAllowClear>
1261
+                                <ng-container *ngFor="let option of applicationHospitalList">
1262
+                                  <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1263
+                                </ng-container>
1264
+                                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1265
+                                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1266
+                                </nz-option>
1267
+                              </nz-select>
1268
+                            </nz-form-control>
1269
+                          </nz-form-item>
1270
+													<nz-form-item>
1223 1271
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endDepts">终点科室</nz-form-label>
1224 1272
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择终点科室!">
1225 1273
                               <nz-select formControlName="endDepts" [nzDisabled]="deptZyList.endStatus == 201 || deptZyList.endStatus == 203 || deptZyList.endStatus == 206" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="isEndFixedType" [nzServerSearch]="isEndFixedType" (nzOnSearch)="searchHosDepartment(checkedHos, 'end', $event)" nzAllowClear nzPlaceHolder="请选择终点科室" [(ngModel)]="endDeptZy" (ngModelChange)="endDeptZyChange()">
@@ -1314,7 +1362,20 @@
1314 1362
                           </nz-form-item>
1315 1363
                         </div>
1316 1364
                         <div *ngIf="deptQtList.taskType && deptQtList.taskType.associationType.value !== 'specimen'" nz-col [nzSpan]="12" [ngStyle]="{ display: deptQtList['startStatus'] != 201 ? 'block' : 'none' }">
1317
-                          <nz-form-item>
1365
+													<nz-form-item *ngIf="(deptQtList.startStatus == 204 || deptQtList.startStatus == 205) && deptQtList.startMultipleHospital==1">
1366
+													  <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startHosId">起点科室院区</nz-form-label>
1367
+													  <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择起点科室院区!">
1368
+													    <nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择起点科室院区" formControlName="startHosId" (ngModelChange)="changeTypeQtHospital($event, 1)" nzAllowClear>
1369
+													      <ng-container *ngFor="let option of applicationHospitalList">
1370
+													        <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1371
+													      </ng-container>
1372
+													      <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1373
+													        <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1374
+													      </nz-option>
1375
+													    </nz-select>
1376
+													  </nz-form-control>
1377
+													</nz-form-item>
1378
+													<nz-form-item>
1318 1379
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startDeptQt">起点科室</nz-form-label>
1319 1380
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择起点科室!">
1320 1381
                               <nz-select formControlName="startDeptQt" [nzDisabled]="deptQtList.startStatus == 201 || deptQtList.startStatus == 203" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="isStartFixedType" [nzServerSearch]="isStartFixedType" (nzOnSearch)="searchHosDepartmentQt(checkedHos, 'start', $event)" nzAllowClear nzPlaceHolder="请选择起点科室" [(ngModel)]="startDeptQt">
@@ -1330,7 +1391,20 @@
1330 1391
                           </nz-form-item>
1331 1392
                         </div>
1332 1393
                         <div *ngIf="deptQtList.taskType && deptQtList.taskType.associationType.value !== 'specimen'" nz-col [nzSpan]="12">
1333
-                          <nz-form-item>
1394
+                          <nz-form-item *ngIf="(deptQtList.endStatus == 204 || deptQtList.endStatus == 205) && deptQtList.endMultipleHospital==1">
1395
+														<nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endHosId">终点科室院区</nz-form-label>
1396
+														<nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择终点科室院区!">
1397
+															<nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择终点科室院区" formControlName="endHosId" (ngModelChange)="changeTypeQtHospital($event, 2)" nzAllowClear>
1398
+																<ng-container *ngFor="let option of applicationHospitalList">
1399
+																	<nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1400
+																</ng-container>
1401
+																<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1402
+																	<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1403
+																</nz-option>
1404
+															</nz-select>
1405
+														</nz-form-control>
1406
+													</nz-form-item>
1407
+													<nz-form-item>
1334 1408
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endDeptsQt">终点科室</nz-form-label>
1335 1409
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择终点科室!">
1336 1410
                               <nz-select formControlName="endDeptsQt" [nzDisabled]="deptQtList.endStatus == 201 || deptQtList.endStatus == 203" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="isEndFixedType" [nzServerSearch]="isEndFixedType" (nzOnSearch)="searchHosDepartmentQt(checkedHos, 'end', $event)"

+ 1 - 1
src/app/views/fuwutai/fuwutai.component.less

@@ -1869,7 +1869,7 @@
1869 1869
   // 右侧悬浮菜单-录音盒或呼叫中心状态
1870 1870
   .fixedAll {
1871 1871
     position: fixed;
1872
-    top: 0;
1872
+    top: 30%;
1873 1873
     right: 0;
1874 1874
     z-index: 10;
1875 1875
     border-radius: 5px 0 0 5px;

+ 325 - 30
src/app/views/fuwutai/fuwutai.component.ts

@@ -6,7 +6,7 @@ import {
6 6
   ElementRef,
7 7
   HostListener,
8 8
 } from "@angular/core";
9
-import { FormBuilder, FormGroup, Validators } from "@angular/forms";
9
+import { FormBuilder, FormGroup, Validators, FormControl } from "@angular/forms";
10 10
 import { Router, ActivatedRoute } from "@angular/router";
11 11
 
12 12
 import { MainService } from "../../services/main.service";
@@ -975,6 +975,8 @@ export class FuwutaiComponent implements OnInit {
975 975
       goods: [null], //携带设备
976 976
       inspectScore: [null], //陪检方式
977 977
       workOrderRemarkZy: [null], //工单备注
978
+			startHosId: [null, [Validators.required]],
979
+			endHosId: [null, [Validators.required]],
978 980
     });
979 981
     //其他
980 982
     this.validateFormQt = this.fb.group({
@@ -982,6 +984,8 @@ export class FuwutaiComponent implements OnInit {
982 984
       startDeptQt: [null, [Validators.required]], //起点科室
983 985
       endDeptsQt: [null, [Validators.required]], //终点科室
984 986
       workOrderRemark: [null], //工单备注
987
+			startHosId: [null, [Validators.required]],
988
+			endHosId: [null, [Validators.required]],
985 989
     });
986 990
 
987 991
     this.getWebsocketSer();
@@ -1500,7 +1504,7 @@ export class FuwutaiComponent implements OnInit {
1500 1504
   checkedHosDTO;// 配送-院区选择
1501 1505
   scopeGroups = []; //配送-当前所属人员分组
1502 1506
   orderScopeRadio;// 配送-工单范围
1503
-
1507
+	crossHospital:any = '0'; // 配送-是否支持跨院区
1504 1508
   itsmCheckedHos;// 运维-院区选择
1505 1509
   itsmScopeGroups = []; //运维-当前所属人员分组
1506 1510
   itsmOrderScopeRadio;// 运维-工单范围
@@ -1508,13 +1512,17 @@ export class FuwutaiComponent implements OnInit {
1508 1512
     checkedHos: undefined,
1509 1513
     scopeGroups: [],
1510 1514
     orderScopeRadio: '0',
1515
+		crossHospital: '0',
1511 1516
   }; //转运工单范围相关信息
1512 1517
 	showGovDuty:any; //是否开通政务值班
1513 1518
   itsmData: any = {
1514 1519
     checkedHos: [],
1515 1520
     scopeGroups: [],
1521
+		groupIds: [],
1516 1522
     orderScopeRadio: '0',
1517 1523
   }; //运维工单范围相关信息
1524
+	inHosId:any;
1525
+	dutyGroupUserRangeList:any = [];
1518 1526
   initOrderScope() {
1519 1527
     if (!this.user || !this.user.user || !this.user.user.scope){
1520 1528
       this.showOrderScope();
@@ -1524,9 +1532,10 @@ export class FuwutaiComponent implements OnInit {
1524 1532
     this.checkedHos = scopeInfo.hospitalId ? scopeInfo.hospitalId.id : undefined;
1525 1533
     this.checkedHosDTO = scopeInfo.hospitalId || undefined;
1526 1534
     this.orderScopeRadio = scopeInfo.range + "";
1535
+		this.crossHospital = scopeInfo.crossHospital || '0';
1527 1536
 		this.showGovDuty = scopeInfo.showGovDuty;
1528 1537
     let groupIds = scopeInfo.groupIds || [];
1529
-    let dutyGroupList = scopeInfo.dutyGroupList || [];
1538
+    let dutyGroupList = scopeInfo.dutyGroupUserRangeList || [];
1530 1539
     this.scopeGroups = dutyGroupList.concat(groupIds);
1531 1540
     if(this.scopeGroups.length){
1532 1541
       this.typeId = this.scopeGroups[0].id;
@@ -1537,16 +1546,19 @@ export class FuwutaiComponent implements OnInit {
1537 1546
       scopeGroups: this.scopeGroups,
1538 1547
       orderScopeRadio: this.orderScopeRadio || '0',
1539 1548
       hsmsSwitch: scopeInfo.hsmsSwitch === 1,
1549
+			crossHospital: this.crossHospital || '0',
1540 1550
     }
1541 1551
     this.flagList.hsmsFlag1 = this.hsmsData.hsmsSwitch;
1542 1552
     this.flagList.hsmsFlag2 = this.hsmsData.hsmsSwitch;
1543 1553
     this.flagList.hsmsFlag3 = this.hsmsData.hsmsSwitch;
1544 1554
     this.itsmCheckedHos = scopeInfo.dutyList || [];
1545 1555
     this.itsmOrderScopeRadio = scopeInfo.dutyRange + "";
1546
-    this.itsmScopeGroups = scopeInfo.dutyGroupList || [];
1556
+    this.itsmScopeGroups = scopeInfo.dutyGroupUserRangeList || [];
1557
+		this.dutyGroupUserRangeList = scopeInfo.dutyGroupList || []
1547 1558
     this.itsmData = {
1548 1559
       checkedHos: this.itsmCheckedHos,
1549 1560
       scopeGroups: this.itsmScopeGroups,
1561
+			groupIds: this.dutyGroupUserRangeList,
1550 1562
       orderScopeRadio: this.itsmOrderScopeRadio || '0',
1551 1563
       mdv2Switch: scopeInfo.mdv2Switch === 1,
1552 1564
       allDuty: scopeInfo.allDuty === undefined ? 1 : scopeInfo.allDuty,
@@ -2357,9 +2369,10 @@ export class FuwutaiComponent implements OnInit {
2357 2369
         idx: 0,
2358 2370
         sum: 1,
2359 2371
       }
2372
+			let groupIds = this.dutyGroupUserRangeList.map(i=> i.id)
2360 2373
       if(stateId == 1){
2361 2374
         postData.incidentQuery.incident = {
2362
-          // "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
2375
+          "groupIds": groupIds.length>0 ? groupIds.toString() : undefined,
2363 2376
           "acceptDutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
2364 2377
           "urgentType": +this.itsmData.orderScopeRadio + 1,
2365 2378
           "queryTask": "storageAcceptReassign",
@@ -2375,7 +2388,7 @@ export class FuwutaiComponent implements OnInit {
2375 2388
 				!this.user.user.scope.showGovDuty ? undefined : this.user.user.scope.showGovDuty
2376 2389
 			}else if(stateId == 2){
2377 2390
         postData.incidentQuery.incident = {
2378
-          // "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
2391
+          "groupIds": groupIds.length>0 ? groupIds.toString() : undefined,
2379 2392
           "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
2380 2393
           "urgentType": +this.itsmData.orderScopeRadio + 1,
2381 2394
           "queryTask": "todoState",
@@ -2384,7 +2397,7 @@ export class FuwutaiComponent implements OnInit {
2384 2397
         }
2385 2398
       }else if(stateId == 3){
2386 2399
         postData.incidentQuery.incident = {
2387
-          // "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
2400
+          "groupIds": groupIds.length>0 ? groupIds.toString() : undefined,
2388 2401
           "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
2389 2402
           "urgentType": +this.itsmData.orderScopeRadio + 1,
2390 2403
           "queryTask": "doing",
@@ -2822,6 +2835,7 @@ export class FuwutaiComponent implements OnInit {
2822 2835
 		this.malPriorityDTO = null;
2823 2836
     this.buildType = buildType;
2824 2837
 		console.log(123,buildType)
2838
+		this.searchApplicationHospital();
2825 2839
     if(this.itsmData.mdv2Switch){
2826 2840
       if(this.buildType !== '继续建单' && this.buildType !== '编辑事件' && this.buildType !== '报修转事件'){
2827 2841
         this.resetOrderData();
@@ -2829,7 +2843,6 @@ export class FuwutaiComponent implements OnInit {
2829 2843
         this.resetOrderData2();
2830 2844
       }
2831 2845
 			this.getSysConfig(type);
2832
-      this.searchApplicationHospital();
2833 2846
       this.searchApplicationCategory();
2834 2847
       this.searchApplicationPriority();
2835 2848
       this.searchApplicationSource();
@@ -2909,7 +2922,9 @@ export class FuwutaiComponent implements OnInit {
2909 2922
       this.noWorkerPhone = false;
2910 2923
     } else {
2911 2924
       //正常初始化
2912
-      this.searchApplicationDepartment("hsms");
2925
+			if(this.crossHospital!=1){
2926
+				this.searchApplicationDepartment("hsms");
2927
+			}
2913 2928
       this.noWorkerPhone = true;
2914 2929
     }
2915 2930
     this.getSearchTaskList("").subscribe((result) => {
@@ -3208,11 +3223,18 @@ export class FuwutaiComponent implements OnInit {
3208 3223
 						if(Number(this.deathTasktypeId) != this.taskTypeId){
3209 3224
 							// 患者信息自动带入
3210 3225
 							let item = this.patientList.find(i=> i.patientCode == this.patientCode)
3226
+							console.log(22222, item)
3211 3227
 							if(item){
3212 3228
 								this.validateFormZy.controls.patient.setValue(item.patientCode+"");
3229
+							}else{
3230
+								this.validateFormZy.controls.patient.setValue(null);
3213 3231
 							}
3214 3232
 						}
3215 3233
 					}
3234
+				}else{
3235
+					this.patientObj = null;
3236
+					this.patientCode = null;
3237
+					this.taskTypeId = null;
3216 3238
 				}
3217 3239
         // if (this.patientList.length) {
3218 3240
         //   this.patientList = this.patientList.filter((item) => !!item.bednum);
@@ -3293,6 +3315,98 @@ export class FuwutaiComponent implements OnInit {
3293 3315
         }
3294 3316
       });
3295 3317
   }
3318
+	
3319
+	// 患者转运-任务类型-院区切换
3320
+	changeTypeHospital(e, type){
3321
+		console.log(111,e)
3322
+		if(type==1){
3323
+			this.validateFormZy.controls.startDept.setValue(null)
3324
+		}else{
3325
+			this.validateFormZy.controls.endDepts.setValue(null)
3326
+		}
3327
+		this.getStartDept(type)
3328
+	}
3329
+	
3330
+	// 患者转运-任务类型-搜索起点科室
3331
+	getStartDept(type){
3332
+		let dataObj = {
3333
+		  idx: 0,
3334
+		  sum: 20,
3335
+		  department: {
3336
+		    searchType: 1,// 简单查询
3337
+		    cascadeHosId: type==1 ? this.validateFormZy.controls.startHosId.value : this.validateFormZy.controls.endHosId.value,
3338
+		    flag: 1,
3339
+		  },
3340
+		};
3341
+		this.mainService
3342
+		  .getFetchDataList("data", "department", dataObj)
3343
+		  .subscribe((data) => {
3344
+		    if (data.status == 200) {
3345
+					if(data.list.length>0){
3346
+						data.list.forEach(i=>{
3347
+							if(i.inputcode){
3348
+								i.inputcode = i.inputcode.toUpperCase()
3349
+								i.dept = i.dept + '('+i.inputcode+')'
3350
+							}
3351
+						})
3352
+					}
3353
+					if(type==1){
3354
+						this.deptZyList.startDept = data.list
3355
+					}else{
3356
+						this.deptZyList.endDept = data.list
3357
+					}
3358
+		    }
3359
+		  });
3360
+	}
3361
+	
3362
+	// 物品配送-任务类型-院区切换
3363
+	changeTypeQtHospital(e, type){
3364
+		if(type==1){
3365
+			this.validateFormQt.controls.startDeptQt.setValue(null)
3366
+		}else{
3367
+			this.validateFormQt.controls.endDeptsQt.setValue(null)
3368
+		}
3369
+		this.getStartQtDept(type)
3370
+	}
3371
+	
3372
+	// 物品配送-任务类型-搜索起点科室
3373
+	getStartQtDept(type){
3374
+		let dataObj = {
3375
+		  idx: 0,
3376
+		  sum: 20,
3377
+		  department: {
3378
+		    searchType: 1,// 简单查询
3379
+		    cascadeHosId: type==1 ? this.validateFormQt.controls.startHosId.value : this.validateFormQt.controls.endHosId.value,
3380
+		    flag: 1,
3381
+		  },
3382
+		};
3383
+		this.mainService
3384
+		  .getFetchDataList("data", "department", dataObj)
3385
+		  .subscribe((data) => {
3386
+		    if (data.status == 200) {
3387
+					if(data.list.length>0){
3388
+						data.list.forEach(i=>{
3389
+							if(i.inputcode){
3390
+								i.inputcode = i.inputcode.toUpperCase()
3391
+								i.dept = i.dept + '('+i.inputcode+')'
3392
+							}
3393
+						})
3394
+					}
3395
+					if(type==1){
3396
+						this.deptQtList.startDept = data.list
3397
+					}else{
3398
+						this.deptQtList.endDept = data.list
3399
+					}
3400
+		    }
3401
+		  });
3402
+	}
3403
+	
3404
+	// 配送院区选择
3405
+	changeInHospital(e){
3406
+		this.applyDept = undefined;
3407
+		this.searchApplicationDepartment('hsms');
3408
+	}
3409
+	
3296 3410
   // 选择院区
3297 3411
   changeApplyHospital(e){
3298 3412
     console.log(e);
@@ -3937,7 +4051,7 @@ export class FuwutaiComponent implements OnInit {
3937 4051
     if(type == 'itsm'){
3938 4052
       cascadeHosId = this.incidentModel.hosId || undefined;
3939 4053
     }else{
3940
-      cascadeHosId = this.checkedHos;
4054
+      cascadeHosId = this.inHosId ? this.inHosId : this.checkedHos;
3941 4055
     }
3942 4056
     let dataObj = {
3943 4057
       idx: 0,
@@ -4232,7 +4346,11 @@ export class FuwutaiComponent implements OnInit {
4232 4346
       if (this.currentTabIndex == "患者转运") {
4233 4347
         //患者转运
4234 4348
         //获取患者信息
4235
-        this.getPatientList(this.applyDept, "");
4349
+				this.patientObj = null;
4350
+				this.patientCode = null;
4351
+				this.taskTypeId = null;
4352
+				console.log(99988778899, this.patientCode)
4353
+        this.getPatientList(this.applyDept, "", "", "change");
4236 4354
       }
4237 4355
       if (this.currentRTab === 0) {
4238 4356
         this.getWorkOrders(this.applyDept);
@@ -4623,6 +4741,8 @@ export class FuwutaiComponent implements OnInit {
4623 4741
         this.jry_shixian();
4624 4742
       }
4625 4743
 			this.goType = null;
4744
+			this.patientObj = null;
4745
+			this.taskTypeId = null;
4626 4746
 			this.patientCode = null;
4627 4747
       this.newOrderShow = false; //关闭弹窗
4628 4748
       this.newOrderShowOpen = false; //此时可出现新的弹窗
@@ -4788,11 +4908,19 @@ export class FuwutaiComponent implements OnInit {
4788 4908
     //id院区,type起点科室'start',终点科室'end'。科室名称dept。
4789 4909
     let value = "";
4790 4910
     if (dept) {
4791
-      value = dept;
4911
+      value = dept.toUpperCase();
4792 4912
     }
4793 4913
 		if (type === "start" && this.deptZyList["startStatus"] == 202) {
4794 4914
 		  //固定科室范围,禁止搜索
4795 4915
 			this.mainService.getdeptList(this.radioValueZy).subscribe((data:any) => {
4916
+				if(data.startDept){
4917
+					data.startDept.forEach(i=>{
4918
+						if(i.inputcode){
4919
+							i.inputcode = i.inputcode.toUpperCase()
4920
+							i.dept = i.dept + '('+i.inputcode+')'
4921
+						}
4922
+					})
4923
+				}
4796 4924
 				let arr = data;
4797 4925
 				if(value!=''){
4798 4926
 					data = arr.startDept.filter(i=>i.dept.indexOf(value) !=-1)
@@ -4805,6 +4933,14 @@ export class FuwutaiComponent implements OnInit {
4805 4933
 		} else if (type === "end" && this.deptZyList["endStatus"] == 202) {
4806 4934
 		  //固定科室范围,禁止搜索
4807 4935
 			this.mainService.getdeptList(this.radioValueZy).subscribe((data:any) => {
4936
+				if(data.endDept){
4937
+					data.endDept.forEach(i=>{
4938
+						if(i.inputcode){
4939
+							i.inputcode = i.inputcode.toUpperCase()
4940
+							i.dept = i.dept + '('+i.inputcode+')'
4941
+						}
4942
+					})
4943
+				}
4808 4944
 				let arr = data;
4809 4945
 				if(value!=''){
4810 4946
 					data = arr.endDept.filter(i=>i.dept.indexOf(value) !=-1)
@@ -4815,12 +4951,19 @@ export class FuwutaiComponent implements OnInit {
4815 4951
 			})
4816 4952
 		  return;
4817 4953
 		}
4954
+		let hsoId = null
4955
+		if(type === "start" && this.deptZyList.startMultipleHospital==1){
4956
+			hsoId = this.validateFormZy.controls.startHosId.value
4957
+		}
4958
+		if(type === "end" && this.deptZyList.endMultipleHospital==1){
4959
+			hsoId = this.validateFormZy.controls.endHosId.value
4960
+		}
4818 4961
     let postData = {
4819 4962
       idx: 0,
4820 4963
       sum: 10,
4821 4964
       department: {
4822 4965
         dept: value,
4823
-        cascadeHosId: id
4966
+        cascadeHosId: hsoId ? hsoId : id
4824 4967
       },
4825 4968
     };
4826 4969
     if (type == "start" && this.deptZyList["startStatus"] == 205) {
@@ -4834,6 +4977,14 @@ export class FuwutaiComponent implements OnInit {
4834 4977
       .subscribe((data) => {
4835 4978
         this.isLoading = false;
4836 4979
         if (data["status"] == 200) {
4980
+					if(data.list.length>0){
4981
+						data.list.forEach(i=>{
4982
+							if(i.inputcode){
4983
+							  i.inputcode = i.inputcode.toUpperCase()
4984
+							  i.dept = i.dept + '('+i.inputcode+')'
4985
+							}
4986
+						})
4987
+					}
4837 4988
           if (type === "start") {
4838 4989
             this.deptZyList["startDept"] = data.list;
4839 4990
           } else if (type === "end") {
@@ -4855,11 +5006,19 @@ export class FuwutaiComponent implements OnInit {
4855 5006
     //id院区,type起点科室'start',终点科室'end'。科室名称dept。
4856 5007
     let value = "";
4857 5008
     if (dept) {
4858
-      value = dept;
5009
+      value = dept.toUpperCase();
4859 5010
     }
4860 5011
     if (type === "start" && this.deptQtList["startStatus"] == 202) {
4861 5012
       //固定科室范围,禁止搜索
4862 5013
 			this.mainService.getdeptList(this.psValue).subscribe((data:any) => {
5014
+				if(data.startDept){
5015
+					data.startDept.forEach(i=>{
5016
+						if(i.inputcode){
5017
+							i.inputcode = i.inputcode.toUpperCase()
5018
+							i.dept = i.dept + '('+i.inputcode+')'
5019
+						}
5020
+					})
5021
+				}
4863 5022
 				let arr = data;
4864 5023
 				if(value!=''){
4865 5024
 					data = arr.startDept.filter(i=>i.dept.indexOf(value) !=-1)
@@ -4872,6 +5031,14 @@ export class FuwutaiComponent implements OnInit {
4872 5031
     } else if (type === "end" && this.deptQtList["endStatus"] == 202) {
4873 5032
       //固定科室范围,禁止搜索
4874 5033
 			this.mainService.getdeptList(this.psValue).subscribe((data:any) => {
5034
+				if(data.endDept){
5035
+					data.endDept.forEach(i=>{
5036
+						if(i.inputcode){
5037
+							i.inputcode = i.inputcode.toUpperCase()
5038
+							i.dept = i.dept + '('+i.inputcode+')'
5039
+						}
5040
+					})
5041
+				}
4875 5042
 				let arr = data;
4876 5043
 				if(value!=''){
4877 5044
 					data = arr.endDept.filter(i=>i.dept.indexOf(value) !=-1)
@@ -4882,12 +5049,19 @@ export class FuwutaiComponent implements OnInit {
4882 5049
 			})
4883 5050
       return;
4884 5051
     }
5052
+		let hsoId = null
5053
+		if(type === "start" && this.deptQtList.startMultipleHospital==1){
5054
+			hsoId = this.validateFormQt.controls.startHosId.value
5055
+		}
5056
+		if(type === "end" && this.deptQtList.endMultipleHospital==1){
5057
+			hsoId = this.validateFormQt.controls.endHosId.value
5058
+		}
4885 5059
     let postData = {
4886 5060
       idx: 0,
4887 5061
       sum: 10,
4888 5062
       department: {
4889 5063
         dept: value,
4890
-        cascadeHosId: id
5064
+        cascadeHosId: hsoId ? hsoId : id
4891 5065
       },
4892 5066
     };
4893 5067
     if (type == "start" && this.deptQtList["startStatus"] == 205) {
@@ -4901,6 +5075,14 @@ export class FuwutaiComponent implements OnInit {
4901 5075
       .subscribe((data) => {
4902 5076
         this.isLoading = false;
4903 5077
         if (data["status"] == 200) {
5078
+					if(data.list.length>0){
5079
+						data.list.forEach(i=>{
5080
+							if(i.inputcode){
5081
+							  i.inputcode = i.inputcode.toUpperCase()
5082
+							  i.dept = i.dept + '('+i.inputcode+')'
5083
+							}
5084
+						})
5085
+					}
4904 5086
           if (type === "start") {
4905 5087
             this.deptQtList["startDept"] = data.list;
4906 5088
           } else if (type === "end") {
@@ -5190,11 +5372,33 @@ export class FuwutaiComponent implements OnInit {
5190 5372
     // 返回值的status是201 则是默认发起科室,把申请科室作为值
5191 5373
     // 返回值的status是202 则是固定科室范围,会返回科室列表
5192 5374
     // 返回值的status是203 则是固定科室,会返回单个科室
5193
-    // 返回值的status是204 则让前端自己调用科室搜索接口
5375
+    // 返回值的status是204 则让前端自己调用科室搜索接口-自主填写
5194 5376
     // 返回值的status是205 则是固定科室类型,会返回科室列表
5195 5377
     // 返回值的status是206 则是默认患者所在科室,把患者所在科室作为值
5196 5378
     this.mainService.getdeptList(value, patientCode, (taskType.associationTypeValue === 'inspect' ? format(startOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss') : undefined), (taskType.associationTypeValue === 'inspect' ? format(endOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss') : undefined)).subscribe((data:any) => {
5197
-      this.deptZyList = data;
5379
+			if(data.startDept){
5380
+				data.startDept.forEach(i=>{
5381
+					if(i.inputcode){
5382
+						i.inputcode = i.inputcode.toUpperCase()
5383
+						i.dept = i.dept + '('+i.inputcode+')'
5384
+					}
5385
+				})
5386
+			}
5387
+			if(data.endDept){
5388
+				data.endDept.forEach(i=>{
5389
+					if(i.inputcode){
5390
+						i.inputcode = i.inputcode.toUpperCase()
5391
+						i.dept = i.dept + '('+i.inputcode+')'
5392
+					}
5393
+				})
5394
+			}
5395
+			this.deptZyList = data;
5396
+			if(this.deptZyList.startMultipleHospital==1){
5397
+				this.deptZyList.startDept = []
5398
+			}
5399
+			if(this.deptZyList.endMultipleHospital==1){
5400
+				this.deptZyList.endDept = []
5401
+			}
5198 5402
 			if(data.startStatus==202 || data.startStatus==204 || data.startStatus==205){
5199 5403
 				this.isStartFixedType = true
5200 5404
 			}else{
@@ -5205,7 +5409,34 @@ export class FuwutaiComponent implements OnInit {
5205 5409
 			}else{
5206 5410
 				this.isEndFixedType = false
5207 5411
 			}
5208
-
5412
+			if((data.startStatus==204 || data.startStatus==205) && data.startMultipleHospital==1){
5413
+				if(this.validateFormZy.value.startHosId){
5414
+					this.validateFormZy.controls.startHosId.setValue(null)
5415
+				}
5416
+				this.validateFormZy.addControl(
5417
+				  "startHosId",
5418
+				  new FormControl(null, Validators.required)
5419
+				);
5420
+			}else{
5421
+				if(this.validateFormZy.value.startHosId){
5422
+					this.validateFormZy.controls.startHosId.setValue(null)
5423
+				}
5424
+				this.validateFormZy.removeControl("startHosId");
5425
+			}
5426
+			if((data.endStatus==204 || data.endStatus==205) && data.endMultipleHospital==1){
5427
+				if(this.validateFormZy.value.endHosId){
5428
+					this.validateFormZy.controls.endHosId.setValue(null)
5429
+				}
5430
+				this.validateFormZy.addControl(
5431
+				  "endHosId",
5432
+				  new FormControl(null, Validators.required)
5433
+				);
5434
+			}else{
5435
+				if(this.validateFormZy.value.endHosId){
5436
+					this.validateFormZy.controls.endHosId.setValue(null)
5437
+				}
5438
+				this.validateFormZy.removeControl("endHosId");
5439
+			}
5209 5440
       // 预约start
5210 5441
       this.currentTasktype = data.taskType;
5211 5442
       this.isYyInspect = false;
@@ -5235,7 +5466,7 @@ export class FuwutaiComponent implements OnInit {
5235 5466
       }
5236 5467
       // 起点科室
5237 5468
       if (data["startStatus"] == 201 || data["startStatus"] == 206) {
5238
-        if (this.applyDept) {
5469
+        if (this.applyDept && data.startMultipleHospital!=1) {
5239 5470
           //选择了申请科室,则起点科室就是申请科室
5240 5471
           this.deptZyList["startDept"] = this.applicationDepartmentList.filter(
5241 5472
             (item) => item.id == this.applyDept
@@ -5244,12 +5475,12 @@ export class FuwutaiComponent implements OnInit {
5244 5475
         }
5245 5476
       } else if (data["startStatus"] == 203) {
5246 5477
         this.startDeptZy = data["startDept"][0]["id"];
5247
-      } else if (data["startStatus"] == 204 || data["startStatus"] == 205) {
5478
+      } else if ((data["startStatus"] == 204 || data["startStatus"] == 205) && data.startMultipleHospital!=1) {
5248 5479
         this.getHosDepartment(this.checkedHos, "start", "");
5249 5480
       }
5250 5481
       // 终点科室
5251 5482
       if (data["endStatus"] == 201 || data["endStatus"] == 206) {
5252
-        if (this.applyDept) {
5483
+        if (this.applyDept && data.endMultipleHospital!=1) {
5253 5484
           //选择了申请科室,则终点科室就是申请科室
5254 5485
           this.deptZyList["endDept"] = this.applicationDepartmentList.filter(
5255 5486
             (item) => item.id == this.applyDept
@@ -5258,7 +5489,7 @@ export class FuwutaiComponent implements OnInit {
5258 5489
         }
5259 5490
       } else if (data["endStatus"] == 203) {
5260 5491
         this.endDeptZy = data["endDept"][0]["id"];
5261
-      } else if (data["endStatus"] == 204 || data["endStatus"] == 205) {
5492
+      } else if ((data["endStatus"] == 204 || data["endStatus"] == 205) && data.endMultipleHospital!=1) {
5262 5493
         this.getHosDepartment(this.checkedHos, "end", "");
5263 5494
       }
5264 5495
       if (this.currentTabIndex == "患者转运") {
@@ -5336,7 +5567,30 @@ export class FuwutaiComponent implements OnInit {
5336 5567
     // 返回值的status是204 则让前端自己调用科室搜索接口
5337 5568
     // 返回值的status是205 则是固定科室类型,会返回科室列表
5338 5569
     this.mainService.getdeptList(value).subscribe((data:any) => {
5570
+			if(data.startDept){
5571
+				data.startDept.forEach(i=>{
5572
+					if(i.inputcode){
5573
+					  i.inputcode = i.inputcode.toUpperCase()
5574
+					  i.dept = i.dept + '('+i.inputcode+')'
5575
+					}
5576
+				})
5577
+			}
5578
+			if(data.endDept){
5579
+				data.endDept.forEach(i=>{
5580
+					if(i.inputcode){
5581
+					  i.inputcode = i.inputcode.toUpperCase()
5582
+					  i.dept = i.dept + '('+i.inputcode+')'
5583
+					}
5584
+				})
5585
+			}
5339 5586
       this.deptQtList = data;
5587
+			if(this.deptQtList.startMultipleHospital==1){
5588
+				this.deptQtList.startDept = []
5589
+			}
5590
+			if(this.deptQtList.endMultipleHospital==1){
5591
+				this.deptQtList.endDept = []
5592
+			}
5593
+
5340 5594
 			if(data.startStatus==202 || data.startStatus==204 || data.startStatus==205){
5341 5595
 				this.isStartFixedType = true
5342 5596
 			}else{
@@ -5347,6 +5601,34 @@ export class FuwutaiComponent implements OnInit {
5347 5601
 			}else{
5348 5602
 				this.isEndFixedType = false
5349 5603
 			}
5604
+			if((data.startStatus==204 || data.startStatus==205) && data.startMultipleHospital==1){
5605
+				if(this.validateFormQt.value.startHosId){
5606
+					this.validateFormQt.controls.startHosId.setValue(null)
5607
+				}
5608
+				this.validateFormQt.addControl(
5609
+				  "startHosId",
5610
+				  new FormControl(null, Validators.required)
5611
+				);
5612
+			}else{
5613
+				if(this.validateFormQt.value.startHosId){
5614
+					this.validateFormQt.controls.startHosId.setValue(null)
5615
+				}
5616
+				this.validateFormQt.removeControl("startHosId");
5617
+			}
5618
+			if((data.endStatus==204 || data.endStatus==205) && data.endMultipleHospital==1){
5619
+				if(this.validateFormQt.value.endHosId){
5620
+					this.validateFormQt.controls.endHosId.setValue(null)
5621
+				}
5622
+				this.validateFormQt.addControl(
5623
+				  "endHosId",
5624
+				  new FormControl(null, Validators.required)
5625
+				);
5626
+			}else{
5627
+				if(this.validateFormQt.value.endHosId){
5628
+					this.validateFormQt.controls.endHosId.setValue(null)
5629
+				}
5630
+				this.validateFormQt.removeControl("endHosId");
5631
+			}
5350 5632
       // 预约start
5351 5633
       this.currentTasktype = data.taskType;
5352 5634
       this.isYyInspect = false;
@@ -5366,7 +5648,7 @@ export class FuwutaiComponent implements OnInit {
5366 5648
         }
5367 5649
       } else if (data["startStatus"] == 203) {
5368 5650
         this.startDeptQt = data["startDept"][0]["id"];
5369
-      } else if (data["startStatus"] == 204 || data["startStatus"] == 205) {
5651
+      } else if ((data["startStatus"] == 204 || data["startStatus"] == 205) && data.startMultipleHospital!=1) {
5370 5652
         this.getHosDepartmentQt(this.checkedHos, "start", "");
5371 5653
       }
5372 5654
       // 终点科室
@@ -5380,7 +5662,7 @@ export class FuwutaiComponent implements OnInit {
5380 5662
         }
5381 5663
       } else if (data["endStatus"] == 203) {
5382 5664
         this.endDeptQt = data["endDept"][0]["id"];
5383
-      } else if (data["endStatus"] == 204 || data["endStatus"] == 205) {
5665
+      } else if ((data["endStatus"] == 204 || data["endStatus"] == 205) && data.endMultipleHospital!=1) {
5384 5666
         this.getHosDepartmentQt(this.checkedHos, "end", "");
5385 5667
       }
5386 5668
     });
@@ -5420,6 +5702,14 @@ export class FuwutaiComponent implements OnInit {
5420 5702
 		if(this.currentTabIndex!='患者转运'){
5421 5703
 			this.patientCode = null;
5422 5704
 		}
5705
+		if(this.crossHospital==1){
5706
+			if(!this.inHosId){
5707
+				this.msg.error('院区不能为空'!)
5708
+				this.isOkLoading = false;
5709
+				this.isGoLoading = false;
5710
+				return
5711
+			}
5712
+		}
5423 5713
     if (objZy && objZy.associationTypeValue === 'patientTransport') {
5424 5714
       //患者转运
5425 5715
       go === "&go&" ? this.submitFormZy(go) : this.submitFormZy();
@@ -5452,6 +5742,7 @@ export class FuwutaiComponent implements OnInit {
5452 5742
 		this.selectProvince = false;
5453 5743
 		this.itsmZwOrders = [];
5454 5744
 		this.patientCode = null;
5745
+		this.inHosId = null;
5455 5746
     this.currentTabIndex = "";
5456 5747
     this.fixedTab = "";
5457 5748
     this.fixedMenuShangla();
@@ -5467,6 +5758,9 @@ export class FuwutaiComponent implements OnInit {
5467 5758
     this.goodsNow = [];
5468 5759
     this.workOrderInspectScore = undefined;
5469 5760
     this.patientList = [];
5761
+		this.patientObj = null;
5762
+		this.taskTypeId = null;
5763
+		this.patientCode = null;
5470 5764
     this.workOrderRemark = "";
5471 5765
     this.workOrderRemarkZy = "";
5472 5766
     this.deptZyList["startDept"] = [];
@@ -5901,7 +6195,7 @@ export class FuwutaiComponent implements OnInit {
5901 6195
 						'position': 'fixed',
5902 6196
 						'top': '0',
5903 6197
 						'left': '0',
5904
-						'z-index': '8',
6198
+						'z-index': '50',
5905 6199
 						'border-radius': '5px 0 0 5px'
5906 6200
 					}
5907 6201
 				}else if(this.leftMenuLocation==2){
@@ -5909,7 +6203,7 @@ export class FuwutaiComponent implements OnInit {
5909 6203
 						'position': 'fixed',
5910 6204
 						'top': '40%',
5911 6205
 						'left': '0',
5912
-						'z-index': '8',
6206
+						'z-index': '50',
5913 6207
 						'border-radius': '5px 0 0 5px'
5914 6208
 					}
5915 6209
 				}else{
@@ -5917,7 +6211,7 @@ export class FuwutaiComponent implements OnInit {
5917 6211
 						'position': 'fixed',
5918 6212
 						'bottom': '0',
5919 6213
 						'left': '0',
5920
-						'z-index': '8',
6214
+						'z-index': '50',
5921 6215
 						'border-radius': '5px 0 0 5px'
5922 6216
 					}
5923 6217
 				}
@@ -5926,7 +6220,7 @@ export class FuwutaiComponent implements OnInit {
5926 6220
 						'position': 'fixed',
5927 6221
 						'top': '0',
5928 6222
 						'right': '0',
5929
-						'z-index': '8',
6223
+						'z-index': '50',
5930 6224
 						'border-radius': '5px 0 0 5px'
5931 6225
 					}
5932 6226
 				}else if(this.rightMenuLocation==2){
@@ -5934,7 +6228,7 @@ export class FuwutaiComponent implements OnInit {
5934 6228
 						'position': 'fixed',
5935 6229
 						'top': '40%',
5936 6230
 						'right': '0',
5937
-						'z-index': '8',
6231
+						'z-index': '50',
5938 6232
 						'border-radius': '5px 0 0 5px'
5939 6233
 					}
5940 6234
 				}else{
@@ -5942,7 +6236,7 @@ export class FuwutaiComponent implements OnInit {
5942 6236
 						'position': 'fixed',
5943 6237
 						'bottom': '0',
5944 6238
 						'right': '0',
5945
-						'z-index': '8',
6239
+						'z-index': '50',
5946 6240
 						'border-radius': '5px 0 0 5px'
5947 6241
 					}
5948 6242
 				}
@@ -6016,6 +6310,7 @@ export class FuwutaiComponent implements OnInit {
6016 6310
 		console.log(99999,e)
6017 6311
     if (e === "close") {
6018 6312
 			this.goType = null;
6313
+			this.inHosId = null;
6019 6314
       this.newOrderShowOpen = false; //此时可出现新的弹窗
6020 6315
     } else if (e === "closeGo") {
6021 6316
 			console.log(1111)

+ 4 - 0
src/app/views/incident-config/incident-config.component.html

@@ -44,6 +44,10 @@
44 44
 	<ng-container *ngIf="activeTagLink === 'sysConfiguration'">
45 45
 	  <app-configuration-sys></app-configuration-sys>
46 46
 	</ng-container>
47
+	<!-- 自动建单 -->
48
+	<ng-container *ngIf="activeTagLink === 'incidentConfigVoluntarilyBuild'">
49
+	  <app-configuration-voluntarilyBuild [voluntarilyTabList]="voluntarilyTabList"></app-configuration-voluntarilyBuild>
50
+	</ng-container>
47 51
 </div>
48 52
 
49 53
 

+ 5 - 1
src/app/views/incident-config/incident-config.component.ts

@@ -31,7 +31,7 @@ export class IncidentConfigComponent implements OnInit, AfterViewInit {
31 31
     { id: 5, name: '状态', key: "incident_status"},
32 32
     { id: 6, name: '维修记录', key: "repair_type"},
33 33
     { id: 7, name: '满意度评价', key: "incident_degree"},
34
-		// { id: 8, name: '告警紧急度', key: "alarm_urgency"},
34
+		{ id: 8, name: '告警紧急度', key: "alarm_urgency"},
35 35
   ]
36 36
 
37 37
   // 院区配置
@@ -40,6 +40,10 @@ export class IncidentConfigComponent implements OnInit, AfterViewInit {
40 40
     { id: 2, name: '评价', key: "evaluate"}
41 41
   ]
42 42
 	
43
+	// 自动建单
44
+	voluntarilyTabList:any[] = [
45
+	  { id: 1, name: '告警建单', key: "alarmConfig"},
46
+	]
43 47
   ngOnInit(): void {}
44 48
 
45 49
   ngAfterViewInit(){

+ 3 - 2
src/app/views/incident-config/incident-config.module.ts

@@ -13,7 +13,7 @@ import { ConfigurationDictionaryModule } from 'src/app/components/configurationC
13 13
 import { ConfigurationMessageModule } from 'src/app/components/configurationCenter/configuration-message/configuration-message.module';
14 14
 import { ConfigurationCommonFaultsComponent } from 'src/app/components/configurationCenter/configuration-commonFaults/configuration-commonFaults.component';
15 15
 import { ConfigurationSysComponent } from 'src/app/components/configurationCenter/configuration-sys/configuration-sys.component';
16
-
16
+import { ConfigurationVoluntarilyBuildComponent } from 'src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component';
17 17
 
18 18
 @NgModule({
19 19
   declarations: [
@@ -24,7 +24,8 @@ import { ConfigurationSysComponent } from 'src/app/components/configurationCente
24 24
 		ConfigurationDeptUserComponent,
25 25
     ConfigurationHospitalComponent,
26 26
     ConfigurationCommonFaultsComponent,
27
-		ConfigurationSysComponent
27
+		ConfigurationSysComponent,
28
+		ConfigurationVoluntarilyBuildComponent
28 29
   ],
29 30
   imports: [
30 31
     CommonModule,

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

@@ -668,7 +668,16 @@ const routes: Routes = [
668 668
 			  path: "governmentDuty",
669 669
 			  loadChildren: () => import("../government-duty/government-duty.module").then((m) => m.GovernmentDutyModule),
670 670
 			},
671
-			
671
+			// 故障管理-告警信息
672
+			{
673
+			  path: "emergencyInfo",
674
+			  loadChildren: () => import("../emergency-info/emergency-info.module").then((m) => m.EmergencyInfoModule),
675
+			},
676
+			// 故障管理-通用信息
677
+			{
678
+			  path: "commonInfo",
679
+			  loadChildren: () => import("../common-info/common-info.module").then((m) => m.CommonInfoModule),
680
+			}
672 681
     ],
673 682
   },
674 683
 ];

+ 1 - 1
src/app/views/main/main.component.html

@@ -321,7 +321,7 @@
321 321
 									<div class="col alignItemsStart">
322 322
 										<span class="name required">故障描述:</span>
323 323
 										<nz-input-group [nzSuffix]="suffixTemplate">
324
-											<textarea class="w100" nz-input rows="4" placeholder="请填写故障描述" [(ngModel)]="incidentModel.description"></textarea>
324
+											<textarea class="w100" [innerHTML]="incidentModel.description" nz-input rows="4" placeholder="请填写故障描述" [(ngModel)]="incidentModel.description"></textarea>
325 325
 										</nz-input-group>
326 326
 										<span #suffixTemplate class="ant-input-clear-icon ml8" *ngIf="incidentModel.description" (click)="incidentModel.description = null">清空</span>
327 327
 									</div>

+ 84 - 17
src/app/views/main/main.component.ts

@@ -1,4 +1,4 @@
1
-import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core";
1
+import { Component, OnInit, TemplateRef, ViewChild, OnDestroy  } from "@angular/core";
2 2
 import { NavigationEnd, Router } from "@angular/router";
3 3
 import { MainService } from "../../services/main.service";
4 4
 
@@ -34,7 +34,7 @@ function range(start: number, end: number): number[] {
34 34
   templateUrl: "./main.component.html",
35 35
   styleUrls: ["./main.component.less"],
36 36
 })
37
-export class MainComponent implements OnInit {
37
+export class MainComponent implements OnInit, OnDestroy {
38 38
   userInfo: any = JSON.parse(localStorage.getItem("user"));
39 39
 	user: any = JSON.parse(localStorage.getItem("user"));
40 40
   menus: any = JSON.parse(localStorage.getItem("menu"));
@@ -78,8 +78,12 @@ export class MainComponent implements OnInit {
78 78
     public tool: ToolService,
79 79
 		public incomingService: WebsocketIncomingService,
80 80
 		private http: HttpClient,
81
+		// private eventSubscription: Subscription
81 82
   ) {}
83
+	
84
+	eventData:any
82 85
   ngOnInit() {
86
+		this.getEvent();
83 87
 		this.initHospitalAndDuty(this.tool.getCurrentHospital());
84 88
     this.highlightMenuByUrl();
85 89
     this.routerEventsListener = this.router.events
@@ -92,13 +96,29 @@ export class MainComponent implements OnInit {
92 96
     this.initMenu();
93 97
     this.getWebsocket();
94 98
   }
95
-
99
+	
100
+	getEvent(){
101
+		// 全局监听
102
+		let that = this;
103
+		that.tool.getEventObservable().subscribe(res => {
104
+			that.eventData = res;
105
+			console.log('全局的监听触发111111', that.eventData);
106
+			if(that.eventData.message == '建单'){
107
+				that.speedinessAdd()
108
+			}
109
+		});
110
+	}
111
+	
96 112
   // 离开管理端
97 113
   ngOnDestroy() {
98 114
     //取消路由监听
99 115
     this.routerEventsListener.unsubscribe();
100 116
     // 断掉连接
101 117
     this.webs.closeWs(true);
118
+		
119
+		// if (this.eventSubscription) {
120
+			// this.eventSubscription.unsubscribe();
121
+		// }
102 122
   }
103 123
 
104 124
   // 菜单图标名称是否包含transport-
@@ -755,7 +775,7 @@ export class MainComponent implements OnInit {
755 775
 	      this.applyDept = null;
756 776
 	      this.countRemarkIndex = -1;
757 777
 	      this.incidentModel.department = isInit ? this.incidentModel.department : null;
758
-
778
+				
759 779
 	      //正常初始化
760 780
 	      this.getAutoWorkTypes(false, isInit);
761 781
 				this.newOrderShowOpen = true
@@ -1352,6 +1372,7 @@ export class MainComponent implements OnInit {
1352 1372
 	  let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
1353 1373
 	  let postData:any = {
1354 1374
 	    solutionId: this.solutionId,
1375
+			alarmId:null,
1355 1376
 	    "incident": {
1356 1377
 	      "id": this.incidentModel.id || undefined,
1357 1378
 	      "deleteFlag": 0,
@@ -1393,10 +1414,16 @@ export class MainComponent implements OnInit {
1393 1414
 	      postData.incident = Object.assign({}, this.editOrder, postData.incident);
1394 1415
 	    }
1395 1416
 	  }
1396
-
1397
-	  this.mainService
1417
+		let url = null
1418
+		if(this.eventData){
1419
+			postData.alarmId = this.eventData.data.id
1420
+			url = this.mainService.addAlarmIncident(postData)
1421
+		}else{
1422
+			delete postData.alarmId
1423
+			url = this.mainService
1398 1424
 	    .flowPost("incident/task/accept", postData)
1399
-	    .subscribe((result) => {
1425
+		}
1426
+	  url.subscribe((result) => {
1400 1427
 	      this.msg.remove(this.maskFlag);
1401 1428
 	      this.maskFlag = false;
1402 1429
 
@@ -1789,6 +1816,27 @@ export class MainComponent implements OnInit {
1789 1816
 	            this.changeApplicationDepartment(phone);
1790 1817
 	          }
1791 1818
 	        }else if(type == 'itsm'){
1819
+						if(this.eventData){
1820
+							this.applicationRequesterList.push({
1821
+								name: this.userInfo.user.name,
1822
+								id: this.userInfo.user.id,
1823
+							})
1824
+							this.incidentModel.requester = this.userInfo.user.id;
1825
+							this.incidentModel.description = 
1826
+							'告警id:' + this.eventData.data.alarmId + ';' +
1827
+							'告警来源:' + this.eventData.data.alarmSource + ';' +
1828
+							'\n' +
1829
+							'告警地点:' + this.eventData.data.alarmLocation + ';' +
1830
+							'\n' +
1831
+							'紧急度:' + this.eventData.data.alarmUrgency.name + ';' +
1832
+							'告警时间:' + format(new Date(this.eventData.data.alarmActiveTime), 'yyyy-MM-dd HH:mm:ss') + ';' +
1833
+							'\n' +
1834
+							'告警ip:' + this.eventData.data.alarmIp + ';' +
1835
+							'\n' +
1836
+							'告警描述:' + this.eventData.data.alarmDescription + ';' +
1837
+							'\n' +
1838
+							'告警内容:' + this.eventData.data.alarmContent 
1839
+						}
1792 1840
 	          this.applicationDeptList = data.list;
1793 1841
 	          let ids = this.applicationDeptList.map(v => v.id);
1794 1842
 	          isInit && !ids.includes(this.incidentModel.department) && (this.applicationDeptList.unshift({id: this.incidentModel.department, dept: this.incidentMsg.deptName}))
@@ -2133,6 +2181,7 @@ export class MainComponent implements OnInit {
2133 2181
 
2134 2182
 	  let postData:any = {
2135 2183
 	    solutionId: this.solutionId,
2184
+			alarmId:null,
2136 2185
 	    "incident": {
2137 2186
 	      "id": this.incidentModel.id || undefined,
2138 2187
 	      "deleteFlag": 0,
@@ -2170,12 +2219,18 @@ export class MainComponent implements OnInit {
2170 2219
 	      postData.incident = Object.assign({}, this.editOrder, postData.incident);
2171 2220
 	    }
2172 2221
 	  }
2173
-	  console.log(postData);
2222
+	  console.log('哈哈哈哈哈哈=====', this.eventData);
2174 2223
 	  // return;
2175
-
2176
-	  this.mainService
2177
-	    .flowPost("incident/task/accept", postData)
2178
-	    .subscribe((result) => {
2224
+		let url = null
2225
+		if(this.eventData){
2226
+			postData.alarmId = this.eventData.data.id
2227
+			url = this.mainService.addAlarmIncident(postData)
2228
+		}else{
2229
+			delete postData.alarmId
2230
+			url = this.mainService
2231
+		  .flowPost("incident/task/accept", postData)
2232
+		}
2233
+		url.subscribe((result) => {
2179 2234
 	      this.msg.remove(this.maskFlag);
2180 2235
 	      this.maskFlag = false;
2181 2236
 
@@ -3036,6 +3091,10 @@ export class MainComponent implements OnInit {
3036 3091
 	  this.deptQtList["endDept"] = [];
3037 3092
 	  this.deptQtList["startStatus"] = 0;
3038 3093
 	  this.deptQtList["endStatus"] = 0;
3094
+		this.eventData = null
3095
+		this.tool.triggerEndEvent({
3096
+			message:'关单',
3097
+		})
3039 3098
 	}
3040 3099
 
3041 3100
 	// 撤回
@@ -3479,6 +3538,10 @@ export class MainComponent implements OnInit {
3479 3538
 	  // }
3480 3539
 		// this.newOrderShow = false;
3481 3540
 		// this.newOrderShowOpen = false;
3541
+		this.eventData = null
3542
+		this.tool.triggerEndEvent({
3543
+			message:'关单',
3544
+		})
3482 3545
 	  this.fixedTab = "";
3483 3546
 	  this.fixedMenuShangla();
3484 3547
 	}
@@ -3909,12 +3972,16 @@ export class MainComponent implements OnInit {
3909 3972
 									break;
3910 3973
 							}
3911 3974
 						});
3912
-						if(this.publicRepair && !this.deptRepair){
3975
+						if(this.eventData){
3913 3976
 							this.incidentModel.repairIncidentType = 'public'
3914
-							this.isRelatedDepartment = false
3915
-						}
3916
-						if(!this.publicRepair && this.deptRepair){
3917
-							this.incidentModel.repairIncidentType = 'dept'
3977
+						}else{
3978
+							if(this.publicRepair && !this.deptRepair){
3979
+								this.incidentModel.repairIncidentType = 'public'
3980
+								this.isRelatedDepartment = false
3981
+							}
3982
+							if(!this.publicRepair && this.deptRepair){
3983
+								this.incidentModel.repairIncidentType = 'dept'
3984
+							}
3918 3985
 						}
3919 3986
 						if(this.hospitalModel==1){
3920 3987
 							if(this.tool.getCurrentHospital().parent){

+ 5 - 1
src/app/views/nurse-config/nurse-config.component.html

@@ -1,7 +1,7 @@
1 1
 <div class="incidentConfig">
2 2
   <div class="tagsAndTemplete">
3 3
     <div class="tags">
4
-      <div><i class="icon_transport transport-peizhizhongxin"></i>配置中心&emsp;&gt;&emsp;护士端配置</div>
4
+      <div><i class="icon_transport transport-peizhizhongxin"></i>配置中心&emsp;&gt;&emsp;配送陪检配置</div>
5 5
       <div class="tagList">
6 6
         <span *ngFor="let tag of tagList" [ngClass]="{ active: activeTagLink === tag.link }" (click)="clickTag(tag)">{{ tag.title }}</span>
7 7
       </div>
@@ -16,6 +16,10 @@
16 16
   <ng-container *ngIf="activeTagLink === 'nurseDictionary'">
17 17
     <app-configuration-dictionary [dictionaryKeyList]="dictionaryKeyList"></app-configuration-dictionary>
18 18
   </ng-container>
19
+	<!-- 自定义业务 -->
20
+	<ng-container *ngIf="activeTagLink === 'customBusiness'">
21
+	  <app-configuration-custom-business [customBusinessList]="customBusinessList"></app-configuration-custom-business>
22
+	</ng-container>
19 23
 </div>
20 24
 
21 25
 

+ 7 - 1
src/app/views/nurse-config/nurse-config.component.ts

@@ -19,13 +19,19 @@ export class NurseConfigComponent implements OnInit, AfterViewInit {
19 19
   // 数据字典
20 20
   dictionaryKeyList:any[] = [
21 21
     { id: 1, name: '携带设备', key: "goods"},
22
+		{ id: 2, name: '业务类型', key: "business_type"},
22 23
   ]
23 24
 
24 25
   // 院区配置
25 26
   hospitalTabList:any[] = [
26 27
     { id: 2, name: '评价', key: "evaluate"}
27 28
   ]
28
-
29
+	
30
+	// 自定义业务
31
+	customBusinessList:any[] = [
32
+	  { id: 1, name: '一键交接', key: "one_connect"}
33
+	]
34
+	
29 35
   ngOnInit(): void {}
30 36
 
31 37
   ngAfterViewInit(){

+ 3 - 1
src/app/views/nurse-config/nurse-config.module.ts

@@ -6,17 +6,19 @@ import { NurseConfigComponent } from './nurse-config.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { ConfigurationDistributionHospitalComponent } from 'src/app/components/configurationCenter/configuration-distribution-hospital/configuration-distribution-hospital.component';
8 8
 import { ConfigurationDictionaryModule } from 'src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.module';
9
+import { ConfigurationCustomBusinessComponent } from 'src/app/components/configurationCenter/configuration-custom-business/configuration-custom-business.component';
9 10
 
10 11
 @NgModule({
11 12
   declarations: [
12 13
     NurseConfigComponent,
13 14
     ConfigurationDistributionHospitalComponent,
15
+		ConfigurationCustomBusinessComponent
14 16
   ],
15 17
   imports: [
16 18
     CommonModule,
17 19
     NurseConfigRoutingModule,
18 20
     ShareModule,
19
-    ConfigurationDictionaryModule,
21
+    ConfigurationDictionaryModule
20 22
   ]
21 23
 })
22 24
 export class NurseConfigModule { }

+ 320 - 10
src/app/views/operation-search/operation-search.component.html

@@ -17,7 +17,7 @@
17 17
             nzAllowClear
18 18
             nzPlaceHolder="请选择申请科室"
19 19
             [(ngModel)]="searchCriteria.department"
20
-            (nzOnSearch)="changeInp($event, 'search')"
20
+            (nzOnSearch)="changeDeptInp($event)"
21 21
             (nzOpenChange)="changeSearch($event)"
22 22
           >
23 23
             <ng-container *ngFor="let data of departmentSearch">
@@ -90,6 +90,7 @@
90 90
 				</div>
91 91
       </div>
92 92
       <div nz-col nzXl="6" class="list-template__btns">
93
+				<button nz-button class="btn default" (click)="addMoadl()" *ngIf="coopBtns.add">新增</button>
93 94
 				<button nz-button class="btn default ml8" (click)="getList(1)">
94 95
 				  搜索
95 96
 				</button>
@@ -110,25 +111,56 @@
110 111
         <thead (nzSortChange)="sort($event)">
111 112
           <tr class="thead">
112 113
             <th>序号</th>
114
+						<th>安排单号</th>
115
+						<th>台次台序</th>
113 116
             <th>患者信息</th>
114
-            <th>手术时间</th>
115
-            <th>申请科室</th>
116
-            <th>手术室</th>
117
-            <th>手术名称</th>
117
+						<th>申请日期|手术时间</th>
118
+						<th>手术室|申请科室</th>
119
+						<th>手术名称|手术诊断</th>
120
+						<th>手术医生</th>
121
+						<th>洗手|巡回</th>
118 122
             <th>状态</th>
119 123
             <th>是否首台</th>
124
+						<th>操作</th>
120 125
           </tr>
121 126
         </thead>
122 127
         <tbody>
123 128
           <tr *ngFor="let data of listOfData; let i = index">
124 129
             <td>{{i+(pageIndex-1) * pageSize + 1}}</td>
125
-            <td>{{ data.patientName }} <span *ngIf="data.patientDTO && data.patientDTO.bedNum">({{data.patientDTO.bedNum}} 床)</span> | {{data.patientDTO ? data.patientDTO.residenceNo : '无'}}</td>
126
-						<td>{{ data.printDate | date:"yyyy-MM-dd HH:mm:ss"  }}</td>
127
-            <td>{{ data.areaDeptDTO ? data.areaDeptDTO.dept : '-' }}</td>
128
-            <td>{{ data.surgeryDeptDTO ? data.surgeryDeptDTO.dept : '-' }}</td>
129
-            <td>{{ data.surgeryName }}</td>
130
+            <td>{{ data.applyCode }}</td>
131
+						<td>{{ data.total }}</td>
132
+						<td>
133
+							<div>{{data.patientDTO && data.patientDTO.residenceNo || ''}}</div>
134
+							<div>
135
+								{{ data.patientName}}<span *ngIf="data.patientDTO && data.patientDTO.bedNum">({{data.patientDTO.bedNum}})</span>
136
+							</div>
137
+						</td>
138
+						<td>
139
+							<div>{{ data.applyDate | date:"yyyy-MM-dd HH:mm:ss"  }}</div>
140
+							<div>{{ data.printDate | date:"yyyy-MM-dd HH:mm:ss"  }}</div>
141
+						</td>
142
+						<td>
143
+							<div>{{ data.surgeryDeptDTO ? data.surgeryDeptDTO.dept : '-'  }}</div>
144
+							<div>{{ data.areaDeptDTO ? data.areaDeptDTO.dept : '-' }}</div>
145
+						</td>
146
+						<td>
147
+							<div>{{ data.surgeryName || '-'  }}</div>
148
+							<div>{{ data.diagnose || '-' }}</div>
149
+						</td>
150
+            <td>{{ data.doctorName }} 、{{data.assistantDoctorName}}</td>
151
+            <td>
152
+							<div>{{ data.nurseName }}</div>
153
+							<div>{{ data.itinerantNurseName || ''}}</div>
154
+						</td>
130 155
             <td>{{ data.state ? data.state.name : "-" }}</td>
131 156
             <td>{{ data.firstOperation==1 ? '是' : '否'}}</td>
157
+						<td>
158
+						  <div class="coop">
159
+						    <span *ngIf="coopBtns.look" (click)="detail($event,data)">查看</span>
160
+								<span *ngIf="coopBtns.edit" (click)="edit($event,data)">编辑</span>
161
+								<span *ngIf="coopBtns.log && data.logs" (click)="viewLog($event,data)">查看日志</span>
162
+							</div>
163
+						</td>
132 164
           </tr>
133 165
         </tbody>
134 166
       </nz-table>
@@ -145,6 +177,252 @@
145 177
     </div>
146 178
   </div>
147 179
 </div>
180
+
181
+<!-- 新增/编辑模态框 -->
182
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
183
+  <div class="modalBody">
184
+    <div class="title">{{add?"新增":view?"查看":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
185
+    </div>
186
+    <div class="content">
187
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
188
+				<div class="df"> 
189
+					<nz-form-item>
190
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="patientName">患者</nz-form-label>
191
+					  <nz-form-control nzErrorTip="请选择患者!">
192
+					    <nz-input-group>
193
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
194
+								  (nzOnSearch)="changePatient($event)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientName">
195
+									<ng-container *ngFor="let option of patientList">
196
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
197
+									</ng-container>
198
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
199
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
200
+									</nz-option>
201
+								</nz-select>
202
+					    </nz-input-group>
203
+					  </nz-form-control>
204
+					</nz-form-item>
205
+					
206
+					<nz-form-item>
207
+					  <nz-form-label [nzSm]="7" [nzXs]="24" nzFor="patientPhone">患者电话</nz-form-label>
208
+					  <nz-form-control nzErrorTip="请选择患者电话!">
209
+					    <nz-input-group>
210
+								<input nz-input [disabled]="view" class="formItem" formControlName="patientPhone" placeholder="请输入患者电话" nzSize="default" />
211
+					    </nz-input-group>
212
+					  </nz-form-control>
213
+					</nz-form-item>
214
+					
215
+					<nz-form-item>
216
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patientFamilyPhone">患者家属电话</nz-form-label>
217
+					  <nz-form-control nzErrorTip="请选择患者家属电话!">
218
+					    <nz-input-group>
219
+								<input nz-input [disabled]="view" class="formItem" formControlName="patientFamilyPhone" placeholder="请输入患者家属电话" nzSize="default" />
220
+					    </nz-input-group>
221
+					  </nz-form-control>
222
+					</nz-form-item>
223
+				</div>
224
+				
225
+      	<div class="df">
226
+					<nz-form-item>
227
+					  <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="applyDate">申请日期</nz-form-label>
228
+					  <nz-form-control nzErrorTip="请选择申请日期!">
229
+					    <nz-input-group>
230
+					      <nz-date-picker
231
+									[nzDisabled]="view"
232
+									nzShowTime
233
+									nzFormat="yyyy-MM-dd HH:mm"
234
+									nzPlaceHolder="请选择申请日期"
235
+									formControlName="applyDate"
236
+									(ngModelChange)="onApplyChange($event)"
237
+								></nz-date-picker>
238
+					    </nz-input-group>
239
+					  </nz-form-control>
240
+					</nz-form-item>
241
+					
242
+					<nz-form-item>
243
+					  <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="printDate">手术时间</nz-form-label>
244
+					  <nz-form-control nzErrorTip="请选择手术时间!">
245
+					    <nz-input-group>
246
+					      <nz-date-picker
247
+									[nzDisabled]="view"
248
+									nzShowTime
249
+									nzFormat="yyyy-MM-dd HH:mm"
250
+									nzPlaceHolder="请选择手术时间"
251
+									formControlName="printDate"
252
+									(ngModelChange)="onOperationChange($event)"
253
+								></nz-date-picker>
254
+					    </nz-input-group>
255
+					  </nz-form-control>
256
+					</nz-form-item>
257
+					
258
+					<nz-form-item>
259
+					  <nz-form-label [nzSm]="6" nzRequired [nzXs]="24" nzFor="firstOperation">是否首台</nz-form-label>
260
+					  <nz-form-control nzErrorTip="请选择是否首台!">
261
+					    <nz-input-group>
262
+								<nz-radio-group [nzDisabled]="view" [disabled]="view" formControlName="firstOperation">
263
+									<label nz-radio nzValue="1">是</label>
264
+									<label nz-radio nzValue="0">否</label>
265
+								</nz-radio-group>
266
+							</nz-input-group>
267
+					  </nz-form-control>
268
+					</nz-form-item>
269
+				</div>
270
+				
271
+				<div class="df">
272
+					<nz-form-item>
273
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="areaDept">申请科室</nz-form-label>
274
+						<nz-form-control nzErrorTip="请选择申请科室!">
275
+							<nz-input-group>
276
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
277
+									(nzOnSearch)="changeDeptInp($event,2)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="areaDept">
278
+									<ng-container *ngFor="let option of departmentSearch">
279
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
280
+									</ng-container>
281
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
282
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
283
+									</nz-option>
284
+								</nz-select>
285
+							</nz-input-group>
286
+						</nz-form-control>
287
+					</nz-form-item>
288
+					
289
+					<nz-form-item>
290
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="surgeryDept">手术室</nz-form-label>
291
+						<nz-form-control nzErrorTip="请选择手术室!">
292
+							<nz-input-group>
293
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
294
+									(nzOnSearch)="changeOperatingRoomInp($event, 'search')" (nzOpenChange)="changeSearch2($event)" nzAllowClear nzPlaceHolder="请选择手术室" formControlName="surgeryDept">
295
+									<ng-container *ngFor="let option of operatingRoomDept">
296
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
297
+									</ng-container>
298
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
299
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
300
+									</nz-option>
301
+								</nz-select>
302
+							</nz-input-group>
303
+						</nz-form-control>
304
+					</nz-form-item>
305
+					
306
+	<!--      	<nz-form-item>
307
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="surgeryName">手术名称</nz-form-label>
308
+						<nz-form-control nzErrorTip="请选择手术名称!">
309
+							<nz-input-group>
310
+								<textarea [disabled]="view" formControlName="surgeryName" nz-input rows="3" placeholder="请输入手术名称"></textarea>
311
+							</nz-input-group>
312
+						</nz-form-control>
313
+					</nz-form-item> -->
314
+					
315
+					<nz-form-item>
316
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="doctorId">主刀医生</nz-form-label>
317
+						<nz-form-control nzErrorTip="请选择主刀医生!">
318
+							<nz-input-group>
319
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
320
+									(nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择主刀医生" formControlName="doctorId">
321
+									<ng-container *ngFor="let option of userList">
322
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
323
+									</ng-container>
324
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
325
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
326
+									</nz-option>
327
+								</nz-select>
328
+							</nz-input-group>
329
+						</nz-form-control>
330
+					</nz-form-item>
331
+				</div>
332
+				
333
+				<div class="df">
334
+					<nz-form-item>
335
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="docAssistantInfos">助理医生</nz-form-label>
336
+					  <nz-form-control nzErrorTip="请选择助理医生!">
337
+					    <nz-input-group>
338
+								<nz-select [nzDisabled]="view" class="formItem" nzMode="multiple" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
339
+								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择助理医生" formControlName="docAssistantInfos">
340
+									<ng-container *ngFor="let option of userList">
341
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
342
+									</ng-container>
343
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
344
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
345
+									</nz-option>
346
+								</nz-select>
347
+					    </nz-input-group>
348
+					  </nz-form-control>
349
+					</nz-form-item>
350
+					
351
+					<nz-form-item>
352
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="itinerantNurseId">巡回护士</nz-form-label>
353
+					  <nz-form-control nzErrorTip="请选择巡回护士!">
354
+					    <nz-input-group>
355
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
356
+								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择巡回护士" formControlName="itinerantNurseId">
357
+									<ng-container *ngFor="let option of userList">
358
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
359
+									</ng-container>
360
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
361
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
362
+									</nz-option>
363
+								</nz-select>
364
+					    </nz-input-group>
365
+					  </nz-form-control>
366
+					</nz-form-item>
367
+					
368
+					<nz-form-item>
369
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="nurseId">洗手护士</nz-form-label>
370
+					  <nz-form-control nzErrorTip="请选择洗手护士!">
371
+					    <nz-input-group>
372
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
373
+								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择洗手护士" formControlName="nurseId">
374
+									<ng-container *ngFor="let option of userList">
375
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
376
+									</ng-container>
377
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
378
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
379
+									</nz-option>
380
+								</nz-select>
381
+					    </nz-input-group>
382
+					  </nz-form-control>
383
+					</nz-form-item>
384
+				</div>
385
+				
386
+				<div class="df">
387
+					<nz-form-item>
388
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="state">状态</nz-form-label>
389
+					  <nz-form-control nzErrorTip="请选择状态!">
390
+					    <nz-input-group>
391
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" 
392
+								nzShowSearch nzAllowClear nzPlaceHolder="请选择状态" 
393
+								formControlName="state">
394
+								  <ng-container *ngFor="let option of types">
395
+								    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
396
+								  </ng-container>
397
+								</nz-select>
398
+					    </nz-input-group>
399
+					  </nz-form-control>
400
+					</nz-form-item>
401
+					
402
+					<nz-form-item>
403
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="type">手术类型</nz-form-label>
404
+					  <nz-form-control nzErrorTip="请选择手术类型!">
405
+					    <nz-input-group>
406
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" 
407
+								nzShowSearch nzAllowClear nzPlaceHolder="请选择手术类型" 
408
+								formControlName="type">
409
+								  <ng-container *ngFor="let option of operationType">
410
+								    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
411
+								  </ng-container>
412
+								</nz-select>
413
+					    </nz-input-group>
414
+					  </nz-form-control>
415
+					</nz-form-item>
416
+				</div>
417
+      </form>
418
+    </div>
419
+    <div class="display_flex justify-content_flex-center">
420
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
421
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
422
+    </div>
423
+  </div>
424
+</div>
425
+
148 426
 <!-- 操作成功/失败提示框 -->
149 427
 <app-prompt-modal
150 428
   *ngIf="promptModalShow"
@@ -154,3 +432,35 @@
154 432
   [info]="promptInfo"
155 433
 >
156 434
 </app-prompt-modal>
435
+
436
+	<!-- 日志查看模态框 -->
437
+	<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="logModal">
438
+	  <div class="modalBody modalLogBody">
439
+	    <div class="title">日志查看<i class="icon_transport transport-guanbi" (click)="hideLogModal()"></i>
440
+	    </div>
441
+	    <div class="content">
442
+	      <div class="list-template__bottom">
443
+	        <nz-table class="list-template__nzTable" [nzData]="itemData.logs" nzSize="middle" [nzShowPagination]="false"
444
+	          [nzLoading]="loading2">
445
+	          <thead>
446
+	            <tr class="thead">
447
+								<th>动作</th>
448
+	              <th>操作时间</th>
449
+	              <th>操作人</th>
450
+	            </tr>
451
+	          </thead>
452
+	          <tbody>
453
+	            <tr *ngFor="let data of itemData.logs">
454
+								<td>{{ data.operationType ? data.operationType.name : '-' }}</td>
455
+	              <td>{{ data.operationTime|date:'yyyy-MM-dd HH:mm'}}</td>
456
+	              <td>{{ data.username }}</td>
457
+	            </tr>
458
+	          </tbody>
459
+	        </nz-table>
460
+	      </div>
461
+	    </div>
462
+	    <div class="display_flex justify-content_flex-center">
463
+	      <button class="btn" nz-button nzType="primary" (click)="hideLogModal()">知道了</button>
464
+	    </div>
465
+	  </div>
466
+	</div>

+ 113 - 15
src/app/views/operation-search/operation-search.component.less

@@ -16,7 +16,7 @@
16 16
   z-index: 99;
17 17
 
18 18
   .modalBody {
19
-    width: 350px;
19
+    width: 80%;
20 20
     height: 220px;
21 21
     background: #fff;
22 22
     border-radius: 5px;
@@ -97,7 +97,7 @@
97 97
   // 新增
98 98
   &.add {
99 99
     .modalBody {
100
-      width: 480px;
100
+      width: 80%;
101 101
       height: auto;
102 102
 
103 103
       .content {
@@ -106,21 +106,119 @@
106 106
         padding: 18px 14px 0 14px;
107 107
         max-height: 497px;
108 108
         overflow-y: auto;
109
-
109
+				
110
+				.list-template__bottom {
111
+				  background: #f9fafb;
112
+				  border: 1px solid #e5e9ed;
113
+				  border-radius: 8px;
114
+				  // padding-bottom: 56px;
115
+				  position: relative;
116
+				  .list-template__nzTable {
117
+				    padding: 16px 16px 0;
118
+				
119
+				    .thead {
120
+				      background-image: linear-gradient(to right, @bg-start, @bg-end);
121
+				
122
+				      th {
123
+				        background: transparent;
124
+				        color: #fff;
125
+				        text-align: center;
126
+				      }
127
+				    }
128
+				
129
+				    .ant-table-body {
130
+				      border-bottom: 1px solid #e5e9ed;
131
+				    }
132
+				
133
+				    .ant-table-tbody {
134
+				      tr {
135
+				        text-align: center;
136
+				        color: #333;
137
+				
138
+				        td {
139
+				          border: none;
140
+				
141
+				          &.tab_hover:hover{
142
+				            text-decoration: underline;
143
+				            cursor: pointer;
144
+				          }
145
+				
146
+				          .coop {
147
+				            button{
148
+				              color: #333;
149
+				            }
150
+				            span,button {
151
+				              display: inline-block;
152
+				              padding: 0 8px;
153
+				              cursor: pointer;
154
+				              position: relative;
155
+				
156
+				              &::after {
157
+				                content: "|";
158
+				                position: absolute;
159
+				                top: 0;
160
+				                right: 0;
161
+				              }
162
+				
163
+				              &:hover,
164
+				              &:active {
165
+				                color: @primary-color;
166
+				              }
167
+				
168
+				              &:nth-last-child(1) {
169
+				                &::after {
170
+				                  content: "";
171
+				                }
172
+				              }
173
+				            }
174
+				          }
175
+				        }
176
+				      }
177
+				    }
178
+				  }
179
+				}
180
+				
110 181
         .addForm {
111
-          .ant-form-item {
112
-            margin-bottom: 15px;
113
-
114
-            .ant-form-item-label {
115
-              line-height: 14px;
116
-              text-align: left;
117
-            }
118
-
119
-            .desc {
120
-              margin-top: 5px;
121
-            }
122
-          }
182
+					.df{
183
+						display: flex;
184
+						margin-bottom: 15px;
185
+						.ant-form-item {
186
+							width: 30%;
187
+							margin-right: 3%;
188
+							.ant-form-item-label{
189
+								overflow: visible !important;
190
+							}
191
+							
192
+							.ant-select{
193
+								width: 100% !important;
194
+							}
195
+							
196
+						  .ant-form-item-label {
197
+						    line-height: 14px;
198
+						    text-align: left;
199
+						  }
200
+						
201
+						  .desc {
202
+						    margin-top: 5px;
203
+						  }
204
+						}
205
+					}
123 206
 
207
+					.ant-form-item {
208
+						.ant-select{
209
+							width: 100% !important;
210
+						}
211
+						
212
+					  .ant-form-item-label {
213
+					    line-height: 14px;
214
+					    text-align: left;
215
+					  }
216
+					
217
+					  .desc {
218
+					    margin-top: 5px;
219
+					  }
220
+					}
221
+					
124 222
           .datesControl {
125 223
             margin-top: -16px;
126 224
 

+ 408 - 30
src/app/views/operation-search/operation-search.component.ts

@@ -4,13 +4,21 @@ import { ToolService } from "../../services/tool.service";
4 4
 import { Subject } from "rxjs";
5 5
 import { debounceTime } from "rxjs/operators";
6 6
 import { format } from "date-fns";
7
+import { ActivatedRoute, Router } from "@angular/router";
8
+import { FormBuilder, Validators, FormGroup, FormControl } from "@angular/forms";
7 9
 @Component({
8 10
   selector: "app-operation-search",
9 11
   templateUrl: "./operation-search.component.html",
10 12
   styleUrls: ["./operation-search.component.less"],
11 13
 })
12 14
 export class OperationSearchComponent implements OnInit {
13
-  constructor(private mainService: MainService, private tool: ToolService) {}
15
+  constructor(
16
+		private mainService: MainService, 
17
+		private tool: ToolService,
18
+		public route: ActivatedRoute,
19
+		private router: Router,
20
+		private fb: FormBuilder,
21
+	) {}
14 22
 
15 23
   currentUserAccount: any = JSON.parse(localStorage.getItem("user")).user.account; //当前登录人账号
16 24
   searchCriteria = {
@@ -34,20 +42,386 @@ export class OperationSearchComponent implements OnInit {
34 42
     { label: "服务中心收取", value: "0", checked: true },
35 43
   ];
36 44
   changeInpSubject = new Subject();
37
-  changeInp2Subject = new Subject();
45
+  changeInpUserSubject = new Subject();
46
+	changeDeptInpSubject = new Subject();
38 47
 	changeRoomInpSubject = new Subject();
48
+	changeDoctorSubject = new Subject();
49
+	validateForm: FormGroup; //新增/编辑表单
50
+	coopBtns:any;
51
+	hosId:any;
52
+	
39 53
   ngOnInit() {
54
+		this.coopBtns = this.tool.initCoopBtns(this.route);
55
+		this.hosId = this.tool.getCurrentHospital().id;
40 56
     this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
41
-      this.searchDepartment(v[0], v[1]);
57
+      this.getPatient(v);
42 58
     });
43
-    this.changeInp2Subject.pipe(debounceTime(500)).subscribe((v) => {
44
-      this.searchUser(v[0], v[1]);
59
+    this.changeInpUserSubject.pipe(debounceTime(500)).subscribe((v) => {
60
+      this.getUserList(v);
45 61
     });
62
+		this.changeDeptInpSubject.pipe(debounceTime(500)).subscribe((v) => {
63
+		  this.searchDepartment(v);
64
+		});
46 65
 		this.changeRoomInpSubject.pipe(debounceTime(500)).subscribe((v) => {
47 66
 		  this.operatingRoom(v[0], v[1]);
48 67
 		});
68
+		this.getPatient();
69
+		this.getUserList();
70
+		this.operatingRoom('', '');
71
+		this.searchDepartment('');
72
+		this.searchTypes();
49 73
     this.getAllHospital();
50 74
   }
75
+	
76
+	// 搜索患者
77
+	changePatient(e){
78
+		this.isLoading = true;
79
+		this.changeInpSubject.next(e);
80
+	}	
81
+	
82
+	// 搜索用户
83
+	changeUser(e){
84
+		this.isLoading = true;
85
+		this.changeInpUserSubject.next(e);
86
+	}	
87
+	
88
+	// 获取用户
89
+	userList:any = [];
90
+	getUserList(name?){
91
+		let data = {
92
+		  idx: 0,
93
+		  sum: 20,
94
+		  user: {
95
+		    name: name,
96
+		    hospital: { id: this.hosId || "" },
97
+		  },
98
+		};
99
+		this.mainService
100
+		  .getFetchDataList("data", "user", data)
101
+		  .subscribe((data) => {
102
+		    this.isLoading = false;
103
+		    this.userList = data.list;
104
+		  });
105
+	}
106
+	
107
+	// 获取患者
108
+	patientList:any = [];
109
+	getPatient(patientName?){
110
+		let postData = {
111
+		  idx: 0,
112
+		  sum: 20,
113
+		  hosId: this.hosId,
114
+		  patientName: patientName,
115
+		};
116
+		this.mainService.listMsgByMain('listPatient',postData).subscribe((data) => {
117
+		  this.isLoading = false;
118
+		  if (data["status"] == 200) {
119
+				data["list"].forEach(i=>{
120
+					if(i.bedNum && i.residenceNo){
121
+						i.patientName = i.patientName + '('+ i.bedNum +')' +'-'+ i.residenceNo
122
+					}
123
+					if(i.bedNum && !i.residenceNo){
124
+						i.patientName = i.patientName + '('+ i.bedNum +')'
125
+					}
126
+					if(!i.bedNum && !i.residenceNo){
127
+						i.patientName = i.patientName 
128
+					}
129
+					if(!i.bedNum && i.residenceNo){
130
+						i.patientName = i.patientName +'-'+ i.residenceNo
131
+					}
132
+				})
133
+		    this.patientList = data["list"];
134
+		  }
135
+		});
136
+	}
137
+	
138
+	// 选择患者
139
+	onPatientChange(e){
140
+		console.log(2222, e)
141
+		let item = this.patientList.find(i=>i.id == e)
142
+		console.log(777,item)
143
+		if(item){
144
+			if(item.department){
145
+				let list = this.departmentSearch.find(i =>i.id == item.department.id)
146
+				if(list){
147
+					this.validateForm.controls.areaDept.setValue(item.department.id)
148
+				}else{
149
+					this.departmentSearch.push({
150
+						dept: item.department.dept,
151
+						id: item.department.id
152
+					})
153
+					this.validateForm.controls.areaDept.setValue(item.department.id)
154
+				}
155
+			}else{
156
+				this.validateForm.controls.areaDept.setValue(null)
157
+			}
158
+		}
159
+	}
160
+	
161
+	//  选择开始时间
162
+	applyDate:any;
163
+	onApplyChange(result: Date): void {
164
+		this.applyDate = format(result, 'yyyy-MM-dd HH:mm');
165
+		console.log('Selected Time: ', this.applyDate );
166
+		this.validateForm.controls.applyDate.setValue(this.applyDate + ':00');
167
+	}
168
+	
169
+	//  选择开始时间
170
+	printDate:any;
171
+	onOperationChange(result: Date): void {
172
+		this.printDate = format(result, 'yyyy-MM-dd HH:mm');
173
+		console.log('Selected Time: ', this.printDate );
174
+		this.validateForm.controls.printDate.setValue(this.printDate + ':00');
175
+	}
176
+	
177
+	// 新增弹框
178
+	add:boolean = true;
179
+	modal:boolean = false;
180
+	addMoadl() {
181
+	  this.add = true;
182
+		this.view = false;
183
+		this.modal = true;
184
+		this.itemData = null;
185
+		this.getUserList();
186
+	  this.initForm();
187
+	}
188
+	hideModal() {
189
+	  this.modal = false;
190
+	  this.initForm();
191
+	}
192
+	
193
+	// 初始化新增form表单
194
+	initForm() {
195
+	  this.validateForm = this.fb.group({
196
+			patientName:[null, [Validators.required]],
197
+	    patientPhone: [null, []],
198
+	    patientFamilyPhone: [null, []],
199
+			applyDate: [null, [Validators.required]],
200
+	    printDate: [null, [Validators.required]],
201
+	    firstOperation: ['0', [Validators.required]],
202
+			areaDept: [null, [Validators.required]],
203
+			surgeryDept: [null, [Validators.required]],
204
+			// surgeryName: [null, [Validators.required]],
205
+			doctorId: [null, []],
206
+			docAssistantInfos: [null, []],
207
+			itinerantNurseId: [null, []],
208
+			nurseId: [null, []],
209
+			state: [null, [Validators.required]],
210
+			type: [null, [Validators.required]],
211
+	  });
212
+	}
213
+		
214
+	// 表单提交
215
+	submitForm(): void {
216
+	  var that = this;
217
+		for (const i in that.validateForm.controls) {
218
+		  that.validateForm.controls[i].markAsDirty();
219
+		  that.validateForm.controls[i].updateValueAndValidity();
220
+		}
221
+		if (that.validateForm.invalid) return;
222
+	  let data = {
223
+			surgery:{
224
+				...this.itemData,
225
+				patientDTO:{
226
+					id: this.validateForm.value.patientName
227
+				},
228
+				patientPhone: this.validateForm.value.patientPhone || undefined,
229
+				patientFamilyPhone: this.validateForm.value.patientFamilyPhone || undefined,
230
+				applyDate: this.validateForm.value.applyDate,
231
+				printDate: this.validateForm.value.printDate,
232
+				firstOperation: this.validateForm.value.firstOperation,
233
+				areaDept: this.validateForm.value.areaDept,
234
+				surgeryDept: this.validateForm.value.surgeryDept,
235
+				// surgeryName: this.validateForm.value.surgeryName,
236
+				doctorId: this.validateForm.value.doctorId,
237
+				docAssistantInfos: this.validateForm.value.docAssistantInfos ? this.validateForm.value.docAssistantInfos.join(",") : undefined,
238
+				itinerantNurseId: this.validateForm.value.itinerantNurseId || undefined,
239
+				nurseId: this.validateForm.value.nurseId || undefined,
240
+				state:{
241
+					id:this.validateForm.value.state,
242
+				},
243
+				type:{
244
+					id:this.validateForm.value.type,
245
+				},
246
+				id:0,
247
+			}
248
+	  };
249
+	  if (!that.add) {
250
+	    data.surgery.id = that.coopId;
251
+	  }else{
252
+			delete data.surgery.id
253
+		}
254
+		that.btnLoading = true;
255
+	  that.mainService
256
+	    .dataPost(this.add ? "addData":"updData", "surgery", data)
257
+	    .subscribe((data) => {
258
+	      that.btnLoading = false;
259
+	      that.hideModal();
260
+	      that.initForm();
261
+	      if (data.status == 200) {
262
+	        that.showPromptModal(that.add ? "新增" : "编辑", true, "");
263
+	      } else {
264
+	        that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
265
+	      }
266
+	    });
267
+	}
268
+	
269
+	// 查看
270
+	view:boolean = false
271
+	detail(e, data){
272
+		this.view = true;
273
+		this.initForm();
274
+		this.itemData = data;
275
+		this.coopId = data.id;
276
+		this.setForm(data)
277
+	}
278
+	
279
+	// 编辑
280
+	itemData:any;
281
+	coopId:any;
282
+	edit(e, data) {
283
+		this.view = false;
284
+		this.add = false
285
+		this.initForm();
286
+		this.getUserList();
287
+		this.itemData = data;
288
+		this.coopId = data.id;
289
+		this.setForm(data)
290
+	}
291
+	
292
+	// 数据回显
293
+	setForm(data){
294
+		if(data.patientDTO){
295
+			let item = this.patientList.find(i => i.id == data.patientDTO.id)
296
+			if(item){
297
+				this.validateForm.controls.patientName.setValue(data.patientDTO.id);
298
+			}else{
299
+				let i = data.patientDTO
300
+				if(i.bedNum && i.residenceNo){
301
+					i.patientName = i.patientName + '('+ i.bedNum +')' +'-'+ i.residenceNo
302
+				}
303
+				if(i.bedNum && !i.residenceNo){
304
+					i.patientName = i.patientName + '('+ i.bedNum +')'
305
+				}
306
+				if(!i.bedNum && !i.residenceNo){
307
+					i.patientName = i.patientName 
308
+				}
309
+				if(!i.bedNum && i.residenceNo){
310
+					i.patientName = i.patientName +'-'+ i.residenceNo
311
+				}
312
+				this.patientList.push({
313
+					patientName: i.patientName,
314
+					id: data.patientDTO.id,
315
+					department: i.department
316
+				})
317
+				this.validateForm.controls.patientName.setValue(data.patientDTO.id);
318
+			}
319
+		}
320
+		this.validateForm.controls.patientPhone.setValue(data.patientPhone);
321
+		this.validateForm.controls.patientFamilyPhone.setValue(data.patientFamilyPhone);
322
+		this.validateForm.controls.applyDate.setValue(data.applyDate)
323
+		this.validateForm.controls.printDate.setValue(data.printDate);
324
+		this.validateForm.controls.firstOperation.setValue(data.firstOperation+"");
325
+		if(data.areaDeptDTO){
326
+			let item = this.departmentSearch.find(i => i.id == data.areaDeptDTO.id)
327
+			if(item){
328
+				this.validateForm.controls.areaDept.setValue(data.areaDeptDTO.id);
329
+			}else{
330
+				this.departmentSearch.push({
331
+					dept: data.areaDeptDTO.dept,
332
+					id: data.areaDeptDTO.id
333
+				})
334
+				this.validateForm.controls.areaDept.setValue(data.areaDeptDTO.id);
335
+			}
336
+		}
337
+		if(data.surgeryDeptDTO){
338
+			let item = this.operatingRoomDept.find(i => i.id == data.surgeryDeptDTO.id)
339
+			if(item){
340
+				this.validateForm.controls.surgeryDept.setValue(data.surgeryDeptDTO.id);
341
+			}else{
342
+				this.operatingRoomDept.push({
343
+					dept: data.surgeryDeptDTO.dept,
344
+					id: data.surgeryDeptDTO.id
345
+				})
346
+				this.validateForm.controls.surgeryDept.setValue(data.surgeryDeptDTO.id);
347
+			}
348
+		}
349
+		if(data.doctorId){
350
+			let item = this.userList.find(i => i.id == data.doctorId)
351
+			if(item){
352
+				this.validateForm.controls.doctorId.setValue(data.doctorId);
353
+			}else{
354
+				this.userList.push({
355
+					name: data.doctorName,
356
+					id: data.doctorId
357
+				})
358
+				this.validateForm.controls.doctorId.setValue(data.doctorId);
359
+			}
360
+		}
361
+		if(data.docAssistantInfos){
362
+			let arr = data.docAssistantInfos.split(";")
363
+			let arr2 = data.assistantDoctorName.split(";")
364
+			let docAssistantInfosArr = []
365
+			for(let i = 0; i<arr.length; i++){
366
+				arr[i] = Number(arr[i])
367
+				docAssistantInfosArr.push({
368
+					name: arr2[i],
369
+					id: arr[i]
370
+				})
371
+			}
372
+			docAssistantInfosArr.forEach(i=> {
373
+				let item = this.userList.find(x => x.id == i.id)
374
+				if(!item){
375
+					this.userList.push({
376
+						name: i.name,
377
+						id: i.id
378
+					})
379
+				}
380
+			})
381
+			this.validateForm.controls.docAssistantInfos.setValue(arr);
382
+		}
383
+		if(data.itinerantNurseId){
384
+			let item = this.userList.find(i => i.id == data.itinerantNurseId)
385
+			if(item){
386
+				this.validateForm.controls.itinerantNurseId.setValue(data.itinerantNurseId);
387
+			}else{
388
+				this.userList.push({
389
+					name: data.itinerantNurseName,
390
+					id: data.itinerantNurseId
391
+				})
392
+				this.validateForm.controls.itinerantNurseId.setValue(data.itinerantNurseId);
393
+			}
394
+		}
395
+		if(data.nurseId){
396
+			let item = this.userList.find(i => i.id == data.nurseId)
397
+			if(item){
398
+				this.validateForm.controls.nurseId.setValue(data.nurseId);
399
+			}else{
400
+				this.userList.push({
401
+					name: data.nurseName,
402
+					id: data.nurseId
403
+				})
404
+				this.validateForm.controls.nurseId.setValue(data.nurseId);
405
+			}
406
+		}
407
+		this.validateForm.controls.state.setValue(data.state && data.state.id || null);
408
+		this.validateForm.controls.type.setValue(data.type && data.type.id || null);
409
+		this.modal = true
410
+	}
411
+	
412
+	// 查看日志
413
+	logModal:boolean = false;
414
+	viewLog(e, data){
415
+		this.view = false;
416
+		this.add = false;
417
+		this.itemData = data;
418
+		this.logModal = true;
419
+	}
420
+	
421
+	hideLogModal(){
422
+		this.logModal = false;
423
+	}
424
+	
51 425
   // 表格筛选
52 426
   log(value: object[]): void {
53 427
     console.log(value);
@@ -55,12 +429,17 @@ export class OperationSearchComponent implements OnInit {
55 429
   }
56 430
   // 搜索类型
57 431
   isLoading1 = false;
432
+	operationType:any = [];
58 433
   searchTypes() {
59 434
     this.isLoading1 = true;
60 435
     this.mainService.getDictionary("list", "surgery_trans_state").subscribe((res) => {
61 436
       this.isLoading1 = false;
62 437
       this.types = res;
63 438
     });
439
+		this.mainService.getDictionary("list", "surgery_trans_type").subscribe((res) => {
440
+		  this.isLoading1 = false;
441
+		  this.operationType = res;
442
+		});
64 443
   }
65 444
   // 清空标本
66 445
   delModal: boolean = false; //删除模态框
@@ -156,7 +535,7 @@ export class OperationSearchComponent implements OnInit {
156 535
   // 打开搜索框
157 536
   changeSearch(flag) {
158 537
     if (flag) {
159
-      this.changeInp("no", "search");
538
+      this.changeDeptInp("no", "search");
160 539
     }
161 540
   }
162 541
   // 打开搜索框
@@ -165,10 +544,16 @@ export class OperationSearchComponent implements OnInit {
165 544
       this.changeOperatingRoomInp("no", "search");
166 545
     }
167 546
   }
547
+	
548
+	changeDoctor(name){
549
+		this.isLoading = true;
550
+		this.changeDoctorSubject.next(name);
551
+	}
552
+	
168 553
   // 边输边搜节流阀
169 554
   isLoading = false;
170 555
   deptKey = "";
171
-  changeInp(dept, type) {
556
+  changeDeptInp(dept, type?) {
172 557
     if (!dept) {
173 558
       return;
174 559
     }
@@ -177,7 +562,7 @@ export class OperationSearchComponent implements OnInit {
177 562
     }
178 563
     this.deptKey = dept;
179 564
     this.isLoading = true;
180
-    this.changeInpSubject.next([dept, type]);
565
+    this.changeDeptInpSubject.next(dept);
181 566
   }
182 567
 	
183 568
 	changeOperatingRoomInp(dept, type) {
@@ -193,7 +578,7 @@ export class OperationSearchComponent implements OnInit {
193 578
   }
194 579
 	
195 580
   // 搜索科室
196
-  searchDepartment(dept, type) {
581
+  searchDepartment(dept) {
197 582
     let data = {
198 583
       department: {
199 584
         dept,
@@ -208,12 +593,8 @@ export class OperationSearchComponent implements OnInit {
208 593
       .getFetchDataList("data", "department", data)
209 594
       .subscribe((data) => {
210 595
         if (data.status == 200) {
211
-          if (type === "search") {
212
-            if (this.deptKey === dept) {
213
-              this.isLoading = false;
214
-              this.departmentSearch = data.list;
215
-            }
216
-          }
596
+					this.isLoading = false;
597
+					this.departmentSearch = data.list;
217 598
         }
218 599
       });
219 600
   }
@@ -237,12 +618,8 @@ export class OperationSearchComponent implements OnInit {
237 618
 			that.mainService
238 619
 			  .getFetchDataList("data", "department", data1)
239 620
 			  .subscribe((res) => {
240
-					if (type === "search") {
241
-					  if (this.deptKey === dept) {
242
-					    this.isLoading = false;
243
-					    that.operatingRoomDept = res.list;
244
-					  }
245
-					}
621
+					this.isLoading = false;
622
+					that.operatingRoomDept = res.list;
246 623
 			  });
247 624
 		});
248 625
 	}
@@ -250,15 +627,15 @@ export class OperationSearchComponent implements OnInit {
250 627
   // 边输边搜节流阀
251 628
   userKey = "";
252 629
   changeInp2(keyword, type) {
253
-    if (!keyword) {
254
-      return;
255
-    }
256
-    if (keyword === "no") {
257
-      keyword = "";
258
-    }
259
-    this.userKey = keyword;
260
-    this.isLoading = true;
261
-    this.changeInp2Subject.next([keyword, type]);
630
+    // if (!keyword) {
631
+    //   return;
632
+    // }
633
+    // if (keyword === "no") {
634
+    //   keyword = "";
635
+    // }
636
+    // this.userKey = keyword;
637
+    // this.isLoading = true;
638
+    // this.changeInp2Subject.next([keyword, type]);
262 639
   }
263 640
   // 搜索科室
264 641
   searchUser(keyword, type) {
@@ -312,6 +689,7 @@ export class OperationSearchComponent implements OnInit {
312 689
       surgery: {
313 690
 				applyDateStart: this.startDate,
314 691
 				applyDateEnd: this.endDate,
692
+				platform: 'list',
315 693
         firstOperation: this.searchCriteria.firstOperation ? 1 : undefined,
316 694
         hosId: this.searchCriteria.hospital,
317 695
         areaDept: this.searchCriteria.department ? this.searchCriteria.department :undefined,

+ 1 - 0
src/app/views/questionnaire-answer/questionnaire-answer.component.html

@@ -38,6 +38,7 @@
38 38
 						<td *ngIf="data.data">{{ data.data.patientName }}</td>
39 39
 						<td *ngIf="data.data">{{ data.data.residenceNo }}</td>
40 40
 						<td *ngIf="data.data">{{data.data.gdCode}}/{{data.data.taskTypeName}}</td>
41
+						<td *ngIf="data.data">{{data.data.userName}}</td>
41 42
 						<td *ngFor="let item of data">
42 43
 							{{ item.answer }}
43 44
 						</td>

+ 1 - 0
src/app/views/questionnaire-answer/questionnaire-answer.component.ts

@@ -156,6 +156,7 @@ export class QuestionnaireAnswerComponent implements OnInit {
156 156
 							{describe:'患者姓名'},
157 157
 							{describe:'住院号'},
158 158
 							{describe:'工单编号/任务类型'},
159
+							{describe:'执行人员'},
159 160
 						]
160 161
 						for(let i in this.listBaseInfos){
161 162
 							this.listOfData[i].data = this.listBaseInfos[i]

+ 4 - 4
src/app/views/shortcut-build-orders/shortcut-build-orders.component.html

@@ -91,9 +91,9 @@
91 91
           <nz-form-item>
92 92
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="roundRobinType">快捷建单类型</nz-form-label>
93 93
             <nz-form-control nzErrorTip="请选择快捷建单类型!">
94
-              <nz-select [nzDropdownMatchSelectWidth]="false" [nzDisabled]="true" formControlName="roundRobinType"
95
-                nzShowSearch nzAllowClear nzPlaceHolder="请选择快捷建单类型">
96
-                <nz-option nzLabel="{{data.hosName}}" nzValue="{{data.id}}" *ngFor="let data of roundRobinTypes">
94
+              <nz-select [nzDropdownMatchSelectWidth]="false" [nzDisabled]="false" formControlName="roundRobinType"
95
+                (ngModelChange)="changeType($event)" nzShowSearch nzAllowClear nzPlaceHolder="请选择快捷建单类型">
96
+                <nz-option nzLabel="{{data.taskName}}" nzValue="{{data.id}}" *ngFor="let data of roundRobinTypes">
97 97
                 </nz-option>
98 98
               </nz-select>
99 99
             </nz-form-control>
@@ -144,7 +144,7 @@
144 144
           <nz-form-item>
145 145
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="endDepartment">终点科室</nz-form-label>
146 146
             <nz-form-control nzErrorTip="请选择终点科室!">
147
-              <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" formControlName="endDepartment"
147
+              <nz-select [(nzMode)]="isOrther" [nzDropdownMatchSelectWidth]="false" formControlName="endDepartment"
148 148
                 nzShowSearch nzAllowClear nzPlaceHolder="请选择终点科室" nzServerSearch
149 149
                 (nzOnSearch)="changeInp($event,'formEnd')" (nzOpenChange)="changeFormEnd($event)">
150 150
                 <ng-container *ngFor="let data of department1">

+ 127 - 32
src/app/views/shortcut-build-orders/shortcut-build-orders.component.ts

@@ -83,18 +83,16 @@ export class ShortcutBuildOrdersComponent implements OnInit {
83 83
   getRoundRobinTypes(id) {
84 84
     this.mainService
85 85
       .getFetchDataList("configuration", "taskType", {
86
-        taskType: { hosId: { id }, associationType: { id: 380 } },
86
+        taskType: { hosId: { id }, associationTypeIds: '380,259' },
87 87
         idx: 0,
88 88
         sum: 100,
89 89
       })
90 90
       .subscribe((data) => {
91 91
         if (data.status == 200) {
92
-          this.roundRobinTypes = data.list.map((item) => {
93
-            return { id: item.id + "", hosName: item.taskName };
94
-          });
95
-          this.validateForm.controls.roundRobinType.setValue(
96
-            this.roundRobinTypes[0] && this.roundRobinTypes[0].id
97
-          );
92
+          this.roundRobinTypes = data.list
93
+          // this.validateForm.controls.roundRobinType.setValue(
94
+          //   this.roundRobinTypes[0] && this.roundRobinTypes[0].id
95
+          // );
98 96
         }
99 97
       });
100 98
   }
@@ -196,6 +194,11 @@ export class ShortcutBuildOrdersComponent implements OnInit {
196 194
       idx: 0,
197 195
       sum: 20,
198 196
     };
197
+		if(this.deptDicId){
198
+			delete data2.department.type
199
+		}else{
200
+			data2.department.type.id = 282
201
+		}
199 202
     this.mainService
200 203
       .getFetchDataList("data", "department", data2)
201 204
       .subscribe((data) => {
@@ -251,6 +254,9 @@ export class ShortcutBuildOrdersComponent implements OnInit {
251 254
     let data = {
252 255
       department: {
253 256
         dept,
257
+				deptHandoverType:{
258
+					id: null
259
+				},
254 260
         type: { id: 383 },
255 261
         hospital: {
256 262
           id: this.hosId,
@@ -260,8 +266,15 @@ export class ShortcutBuildOrdersComponent implements OnInit {
260 266
       sum: 20,
261 267
     };
262 268
     if (type === "form") {
269
+			if(this.deptDicId){
270
+				data.department.deptHandoverType.id = this.deptDicId;
271
+				delete data.department.type
272
+			}else{
273
+				data.department.type.id = 383
274
+				delete data.department.deptHandoverType
275
+			}
263 276
       if(this.validateForm.value.startDepartmentHospital){
264
-        data.department.hospital.id = this.validateForm.value.startDepartmentHospital;
277
+				data.department.hospital.id = this.validateForm.value.startDepartmentHospital;
265 278
       }else{
266 279
         this.department = [];
267 280
         this.isLoading = false;
@@ -270,7 +283,13 @@ export class ShortcutBuildOrdersComponent implements OnInit {
270 283
     }
271 284
     // 终点科室的科室类型为检验科
272 285
     if (type === "formEnd") {
273
-      data.department.type.id = 282;
286
+			if(this.deptDicId){
287
+				delete data.department.deptHandoverType
288
+				delete data.department.type
289
+			}else{
290
+				data.department.type.id = 282
291
+				delete data.department.deptHandoverType
292
+			}
274 293
       if(this.validateForm.value.endDepartmentHospital){
275 294
         data.department.hospital.id = this.validateForm.value.endDepartmentHospital;
276 295
       }else{
@@ -356,7 +375,47 @@ export class ShortcutBuildOrdersComponent implements OnInit {
356 375
         }
357 376
       });
358 377
   }
359
-
378
+	
379
+	// 选择任务类型
380
+	isOrther:any = 'multiple';
381
+	changeType(e){
382
+		this.validateForm.controls.startDepartmentHospital.setValue(null);
383
+		this.validateForm.controls.startDepartment.setValue(null);
384
+		this.validateForm.controls.endDepartmentHospital.setValue(null);
385
+		this.department1 = [];
386
+		this.validateForm.controls.endDepartment.setValue(null);
387
+		let item = this.roundRobinTypes.find(i=>i.id == e)
388
+		if(item){
389
+			if(item.associationType.value == 'other'){
390
+				this.mainService.getDictionary("list", "dept_handover_type").subscribe((data) => {
391
+				  let item = data.find(i=>i.value == 'comprehensive')
392
+					if(item){
393
+						this.isOrther = 'default'
394
+						this.deptDicId = item.id
395
+					}else{
396
+						this.isOrther = 'multiple'
397
+						this.deptDicId = null
398
+					}
399
+				});
400
+			}else{
401
+				this.isOrther = 'multiple'
402
+				this.deptDicId = null
403
+			}
404
+		}else{
405
+			this.isOrther = 'multiple'
406
+			this.deptDicId = null
407
+		}
408
+		
409
+		setTimeout(_=>{
410
+			this.validateForm.controls.startDepartmentHospital.setValue(null);
411
+			this.validateForm.controls.startDepartment.setValue(null);
412
+			this.validateForm.controls.endDepartmentHospital.setValue(null);
413
+			this.department1 = [];
414
+			this.validateForm.controls.endDepartment.setValue(null);
415
+		},100)
416
+	}
417
+	
418
+	deptDicId:any;
360 419
   // 新增/编辑弹框
361 420
   addModal() {
362 421
     this.add = true; //新增
@@ -379,9 +438,9 @@ export class ShortcutBuildOrdersComponent implements OnInit {
379 438
       endDepartmentHospital: [null, [Validators.required]],
380 439
       endDepartment: [null, [Validators.required]],
381 440
     });
382
-    this.validateForm.controls.roundRobinType.setValue(
383
-      this.roundRobinTypes[0] && this.roundRobinTypes[0].id
384
-    );
441
+    // this.validateForm.controls.roundRobinType.setValue(
442
+    //   this.roundRobinTypes[0] && this.roundRobinTypes[0].id
443
+    // );
385 444
     this.timeSelectedValue = [];
386 445
   }
387 446
 
@@ -405,8 +464,8 @@ export class ShortcutBuildOrdersComponent implements OnInit {
405 464
           title: this.validateForm.value.roundRobinName,
406 465
           hospital: this.hosId,
407 466
           startDept: this.validateForm.value.startDepartment,
408
-          taskType: this.roundRobinTypes[0].id,
409
-          targetDept: this.validateForm.value.endDepartment.join(),
467
+          taskType: this.validateForm.value.roundRobinType,
468
+          targetDept: this.deptDicId ? this.validateForm.value.endDepartment : this.validateForm.value.endDepartment.join(),
410 469
         },
411 470
       };
412 471
     } else {
@@ -417,8 +476,8 @@ export class ShortcutBuildOrdersComponent implements OnInit {
417 476
           title: this.validateForm.value.roundRobinName,
418 477
           hospital: this.hosId,
419 478
           startDept: this.validateForm.value.startDepartment,
420
-          taskType: this.roundRobinTypes[0].id,
421
-          targetDept: this.validateForm.value.endDepartment.join(),
479
+          taskType: this.validateForm.value.roundRobinType,
480
+          targetDept: this.deptDicId ? this.validateForm.value.endDepartment : this.validateForm.value.endDepartment.join(),
422 481
         },
423 482
       };
424 483
     }
@@ -453,7 +512,7 @@ export class ShortcutBuildOrdersComponent implements OnInit {
453 512
       {
454 513
         taskType: {
455 514
           hosId: { id: data.hospital },
456
-          associationType: { id: 380 },
515
+          associationTypeIds: '380,259',
457 516
         },
458 517
         idx: 0,
459 518
         sum: 100,
@@ -476,11 +535,41 @@ export class ShortcutBuildOrdersComponent implements OnInit {
476 535
     // --------/起点科室---
477 536
     // --------终点科室---
478 537
     let targetDeptArr = []; //临时终点科室数组
479
-    let targetDept = data.targetDept.split(","); //科室id
480
-    let targetDeptShow = data.targetDeptShow.split(","); //科室名称
481
-    targetDept.forEach((item, index) => {
482
-      targetDeptArr.push({ id: item, dept: targetDeptShow[index] });
483
-    });
538
+		let item = this.roundRobinTypes.find(i=>i.id == data.taskType)
539
+		if(item){
540
+			if(item.associationType.value == 'other'){
541
+				this.mainService.getDictionary("list", "dept_handover_type").subscribe((data) => {
542
+				  let item = data.find(i=>i.value == 'comprehensive')
543
+					if(item){
544
+						this.isOrther = 'default'
545
+						this.deptDicId = item.id
546
+					}else{
547
+						this.isOrther = 'multiple'
548
+						this.deptDicId = null
549
+					}
550
+				});
551
+			}else{
552
+				this.isOrther = 'multiple'
553
+				this.deptDicId = null
554
+			}
555
+		}else{
556
+			this.isOrther = 'multiple'
557
+			this.deptDicId = null
558
+		}
559
+		let targetDept = null;
560
+		let targetDeptShow = null;
561
+		if(!this.deptDicId){
562
+			targetDept = data.targetDept.split(","); //科室id
563
+			targetDeptShow = data.targetDeptShow.split(","); //科室名称
564
+			targetDept.forEach((item, index) => {
565
+			  targetDeptArr.push({ id: item, dept: targetDeptShow[index] });
566
+			});
567
+		}else{
568
+			targetDept = data.targetDept;
569
+			targetDeptShow = data.targetDeptShow; //科室名称
570
+			targetDeptArr.push({ id: targetDept, dept: targetDeptShow });
571
+		}
572
+
484 573
     let targetDept$ = this.mainService.getFetchDataList("data", "department", {
485 574
       department: {
486 575
         hospital: { id: data.targetDeptHosId },
@@ -499,11 +588,9 @@ export class ShortcutBuildOrdersComponent implements OnInit {
499 588
       this.modal = true;
500 589
       // 任务类型
501 590
       if (res[0]["status"] == 200) {
502
-        this.roundRobinTypes = res[0]["list"].map((item) => {
503
-          return { id: item.id + "", hosName: item.taskName };
504
-        });
591
+        this.roundRobinTypes = res[0]["list"]
505 592
         this.validateForm.controls.roundRobinType.setValue(
506
-          this.roundRobinTypes[0].id
593
+          data.taskType + ""
507 594
         ); //快捷建单类型
508 595
       }
509 596
       //起点科室
@@ -518,11 +605,19 @@ export class ShortcutBuildOrdersComponent implements OnInit {
518 605
       }
519 606
       //终点科室
520 607
       if (res[2]["status"] == 200) {
521
-        let add = targetDeptArr.filter(
522
-          (item) => !res[2]["list"].some((ele) => ele.id == item.id)
523
-        ); //过滤掉已有的选项
524
-        this.department1 = add.concat(res[2]["list"]); //拼接数组
525
-        this.validateForm.controls.endDepartment.setValue(targetDept); //终点科室
608
+				if(!this.deptDicId){
609
+					let add = targetDeptArr.filter(
610
+					  (item) => !res[2]["list"].some((ele) => ele.id == item.id)
611
+					); //过滤掉已有的选项
612
+					this.department1 = add.concat(res[2]["list"]); //拼接数组
613
+					this.validateForm.controls.endDepartment.setValue(targetDept); //终点科室
614
+				}else{
615
+					let add = targetDeptArr.filter(
616
+					  (item) => !res[2]["list"].some((ele) => ele.id == item.id)
617
+					); //过滤掉已有的选项
618
+					this.department1 = add.concat(res[2]["list"]); //拼接数组
619
+					this.validateForm.controls.endDepartment.setValue(targetDept.toString());
620
+				}
526 621
       }
527 622
     });
528 623
   }

+ 13 - 2
src/app/views/task-type-management/task-type-management.component.html

@@ -101,6 +101,13 @@
101 101
             <label nz-radio nzValue='0'>否</label>
102 102
           </nz-radio-group>
103 103
         </div>
104
+				<div class="mb8 w100" *ngIf="association.value == 'other'">
105
+				  <nz-form-label class="label" nzRequired>是否配送人员可以新建工单</nz-form-label>
106
+				  <nz-radio-group class="handlerType" [(ngModel)]="deliveryUserCreate">
107
+				    <label nz-radio nzValue='1'>是</label>
108
+				    <label nz-radio nzValue='0'>否</label>
109
+				  </nz-radio-group>
110
+				</div>
104 111
         <!-- 患者其他服务 -->
105 112
         <div class="mb8 w100" *ngIf="association.value == 'patientTransport'">
106 113
           <nz-form-label class="label" nzRequired>护士端是否允许预约建单</nz-form-label>
@@ -778,9 +785,9 @@
778 785
             <label nz-checkbox [(ngModel)]="carryingCourses[indexs].handoverSwitch">是否必填交接人信息</label>
779 786
           </div>
780 787
 					<!-- 是否支持多院区 -->
781
-					<!-- <div class="turnoff" *ngIf="departmentStrategy.idv=='20047__3' || departmentStrategy.idv=='20048__4'">
788
+					<div class="turnoff" *ngIf="multipleShow">
782 789
 					  <label nz-checkbox [(ngModel)]="carryingCourses[indexs].multipleHospital">是否支持多院区</label>
783
-					</div> -->
790
+					</div>
784 791
           <!-- 是否支持拍照签到 -->
785 792
           <div class="turnoff" *ngIf="currentChoice.associationType.value == 'other'&&indexs==0">
786 793
             <label nz-checkbox [nzDisabled]="carryingCourses[indexs].actionsSwitch == 1" [(ngModel)]="carryingCourses[indexs].photoSwitch">是否支持拍照签到</label>
@@ -817,6 +824,10 @@
817 824
           <div class="turnoff" *ngIf="carryingCourses[indexs].actionsSwitch">
818 825
             <label nz-checkbox [(ngModel)]="carryingCourses[indexs].actionPhotoSwitch">拍照动作</label>
819 826
           </div>
827
+					<!-- 数字交接 -->
828
+					<div class="turnoff" *ngIf="carryingCourses[indexs].actionsSwitch && association.value == 'other' && indexs == 0">
829
+					  <label nz-checkbox [(ngModel)]="carryingCourses[indexs].digitalHandover">数字交接</label>
830
+					</div>
820 831
           <!-- 运送过程备注 -->
821 832
           <div class="mb8 w100" *ngIf="currentChoice.associationType.value == 'other' && indexs==1">
822 833
             <label nz-checkbox [(ngModel)]="carryingCourses[indexs].logSwitch" (ngModelChange)="changeLogSwitch($event)">是否开通备注填写</label>

+ 59 - 9
src/app/views/task-type-management/task-type-management.component.ts

@@ -105,6 +105,7 @@ export class TaskTypeManagementComponent implements OnInit {
105 105
   allowUrgent = "1"; //是否加急
106 106
   urgentAudit = "0"; //加急是否审核
107 107
   autoFlag = "0"; //调度台是否可以新建工单
108
+	deliveryUserCreate = "0"; //是否配送人员可以新建工单
108 109
   isRemand = "0"; //是否开通自动送回
109 110
   remandTypeId = null; //开通自动送回,选择的任务类型
110 111
   defaultNullDeptId = null; //空单默认科室-标本配送
@@ -848,7 +849,7 @@ export class TaskTypeManagementComponent implements OnInit {
848 849
   //选择类型
849 850
   currentChoice;
850 851
   itemChoice(data, index) {
851
-    console.log(data);
852
+    console.log('点击了任务类型', data);
852 853
     if (data === undefined) {
853 854
       return;
854 855
     }
@@ -961,6 +962,7 @@ export class TaskTypeManagementComponent implements OnInit {
961 962
     this.allowUrgent = data.allowUrgent + "";
962 963
     this.urgentAudit = data.urgentAudit + "";
963 964
     this.autoFlag = data.autoFlag + "";
965
+		this.deliveryUserCreate = data.deliveryUserCreate ? data.deliveryUserCreate + "" : "0";
964 966
     this.isRemand = data.isRemand ? data.isRemand + "" : "0";
965 967
     if (data.remandTypeId) {
966 968
       this.remandTypeId = `${data.remandTypeId.id}__${data.remandTypeId.taskName}`;
@@ -1072,6 +1074,21 @@ export class TaskTypeManagementComponent implements OnInit {
1072 1074
       if (this.indexs == 2 && this.association.value != "inspect") {
1073 1075
         this.indexs = 1;
1074 1076
       }
1077
+			if(data.carryingCourses[0].multipleHospital==1){
1078
+				data.carryingCourses[0].multipleHospital = true
1079
+			}else{
1080
+				data.carryingCourses[0].multipleHospital = false
1081
+			}
1082
+			if(data.carryingCourses[1].multipleHospital==1){
1083
+				data.carryingCourses[1].multipleHospital = true
1084
+			}else{
1085
+				data.carryingCourses[1].multipleHospital = false
1086
+			}
1087
+			if(data.carryingCourses[0].digitalHandover==1){
1088
+				data.carryingCourses[0].digitalHandover = true
1089
+			}else{
1090
+				data.carryingCourses[0].digitalHandover = false
1091
+			}
1075 1092
       this.carryingCourses = data.carryingCourses;
1076 1093
       this.ysgcData(this.carryingCourses[this.indexs]);
1077 1094
       this.depa(
@@ -1260,6 +1277,7 @@ export class TaskTypeManagementComponent implements OnInit {
1260 1277
     this.taskData.taskType["allowUrgent"] = parseInt(this.allowUrgent);
1261 1278
     this.taskData.taskType["urgentAudit"] = parseInt(this.urgentAudit);
1262 1279
     this.taskData.taskType["autoFlag"] = parseInt(this.autoFlag);
1280
+		this.taskData.taskType["deliveryUserCreate"] = parseInt(this.deliveryUserCreate);
1263 1281
     this.taskData.taskType["isRemand"] = parseInt(this.isRemand);
1264 1282
     if (this.isRemand == "1") {
1265 1283
       let arr = this.remandTypeId.split("__");
@@ -1414,10 +1432,16 @@ export class TaskTypeManagementComponent implements OnInit {
1414 1432
     }
1415 1433
     for(let i = 0; i < this.taskData.taskType.carryingCourses.length; i++){
1416 1434
       // 其他临床服务,是否支持多动作签到开启后,必须配置至少确认动作,拍照动作
1417
-      if(this.taskData.taskType.associationType.value === 'other' && this.taskData.taskType.carryingCourses[i].actionsSwitch && !this.taskData.taskType.carryingCourses[i].actionConfirmSwitch && !this.taskData.taskType.carryingCourses[i].actionPhotoSwitch){
1418
-        this.showPromptModal("提示", false, `【${i == 0 ? '起点科室' : '终点科室'}】是否支持多动作签到开启后,请配置确认动作或拍照动作!`);
1419
-        return;
1420
-      }
1435
+      if(this.taskData.taskType.associationType.value === 'other'){
1436
+				if(i==0 && this.taskData.taskType.carryingCourses[i].actionsSwitch && !this.taskData.taskType.carryingCourses[i].actionConfirmSwitch && !this.taskData.taskType.carryingCourses[i].actionPhotoSwitch && !this.taskData.taskType.carryingCourses[i].digitalHandover){
1437
+					this.showPromptModal("提示", false, `【起点科室】是否支持多动作签到开启后,请配置确认动作或拍照动作或数字交接!`);
1438
+					return;
1439
+				}else if(i==1 && this.taskData.taskType.carryingCourses[i].actionsSwitch && !this.taskData.taskType.carryingCourses[i].actionConfirmSwitch && !this.taskData.taskType.carryingCourses[i].actionPhotoSwitch){
1440
+					this.showPromptModal("提示", false, `【终点科室】是否支持多动作签到开启后,请配置确认动作或拍照动作!`);
1441
+					return;
1442
+				}
1443
+			}
1444
+
1421 1445
       // 其他临床服务,多动作开启后,必须配置至少一个动作
1422 1446
       if(this.taskData.taskType.associationType.value === 'other' && this.taskData.taskType.carryingCourses[i].actionConfirmSwitch && !this.taskData.taskType.carryingCourses[i].actionRemarks){
1423 1447
         this.showPromptModal("提示", false, `【${i == 0 ? '起点科室' : '终点科室'}】确认动作开启后,至少配置一个动作!`);
@@ -1429,11 +1453,28 @@ export class TaskTypeManagementComponent implements OnInit {
1429 1453
         return;
1430 1454
       }
1431 1455
     }
1432
-    console.log(this.taskData);
1433
-    // return;
1456
+		let newData = JSON.parse(JSON.stringify(this.taskData))
1457
+		if(newData.taskType.carryingCourses[0].multipleHospital){
1458
+			newData.taskType.carryingCourses[0].multipleHospital = 1
1459
+		}else{
1460
+			newData.taskType.carryingCourses[0].multipleHospital = 0
1461
+		}
1462
+		if(newData.taskType.carryingCourses[1].multipleHospital){
1463
+			newData.taskType.carryingCourses[1].multipleHospital = 1
1464
+		}else{
1465
+			newData.taskType.carryingCourses[1].multipleHospital = 0
1466
+		}
1467
+		
1468
+		if(newData.taskType.carryingCourses[0].digitalHandover){
1469
+			newData.taskType.carryingCourses[0].digitalHandover = 1
1470
+		}else{
1471
+			newData.taskType.carryingCourses[0].digitalHandover = 0
1472
+		}
1473
+		
1474
+    console.log(newData.taskType.carryingCourses[this.indexs]);
1434 1475
     this.loading5 = true;
1435 1476
     that.mainService
1436
-      .coopTypeConfig("addData", "taskType", this.taskData)
1477
+      .coopTypeConfig("addData", "taskType", newData)
1437 1478
       .subscribe((data) => {
1438 1479
         this.loading5 = false;
1439 1480
         if (data.status == 200) {
@@ -1511,6 +1552,7 @@ export class TaskTypeManagementComponent implements OnInit {
1511 1552
     this.allowUrgent = "1"; //是否加急
1512 1553
     this.urgentAudit = "0"; //加急是否审核
1513 1554
     this.autoFlag = "0"; //调度台是否可以新建工单
1555
+		this.deliveryUserCreate = "0"; //是否配送人员可以新建工单
1514 1556
     this.isRemand = "0"; //是否开通自动送回
1515 1557
     this.remandTypeId = null; //自动送回,选择任务类型
1516 1558
     this.defaultNullDeptId = null; //标本配送空单默认值
@@ -2315,6 +2357,7 @@ export class TaskTypeManagementComponent implements OnInit {
2315 2357
   }
2316 2358
   //默认科室选择
2317 2359
 	selectValue:boolean = false;
2360
+	multipleShow:boolean = false;
2318 2361
   depa(data, e, doing?): void {
2319 2362
     let arr = e.split("__");
2320 2363
     if (doing === "clear") {
@@ -2327,8 +2370,9 @@ export class TaskTypeManagementComponent implements OnInit {
2327 2370
         data.id = null;
2328 2371
         data.value = null;
2329 2372
       }
2373
+			// this.carryingCourses[this.indexs].multipleHospital = false
2330 2374
     }
2331
-		console.log(999999, data.idv);
2375
+		console.log(999999, data);
2332 2376
     let value = arr[1];
2333 2377
     if (value) {
2334 2378
       if (value == "2") {
@@ -2376,10 +2420,16 @@ export class TaskTypeManagementComponent implements OnInit {
2376 2420
         this.depaShow = false;
2377 2421
         this.depaShow4 = false;
2378 2422
       }
2423
+			if(value == 4 || value == 5){
2424
+				this.multipleShow = true
2425
+			}else{
2426
+				this.multipleShow = false;
2427
+			}
2379 2428
     } else {
2380 2429
       this.depaShow = false;
2381 2430
       this.depaShow1 = false;
2382 2431
       this.depaShow4 = false;
2432
+			this.multipleShow = false;
2383 2433
     }
2384 2434
   }
2385 2435
   //删除标本类型