maotao 2 mesi fa
parent
commit
cd1ce9b9f3
29 ha cambiato i file con 3217 aggiunte e 143 eliminazioni
  1. 6 3
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html
  2. 15 0
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.less
  3. 83 32
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts
  4. 139 0
      src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.html
  5. 386 0
      src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.less
  6. 316 0
      src/app/components/configurationCenter/configuration-voluntarilyBuild/configuration-voluntarilyBuild.component.ts
  7. 19 1
      src/app/components/order-scope/order-scope.component.html
  8. 34 11
      src/app/components/order-scope/order-scope.component.ts
  9. 7 0
      src/app/services/main.service.ts
  10. 35 2
      src/app/services/tool.service.ts
  11. 22 0
      src/app/views/emergency-info/emergency-info-routing.module.ts
  12. 228 0
      src/app/views/emergency-info/emergency-info.component.html
  13. 215 0
      src/app/views/emergency-info/emergency-info.component.less
  14. 501 0
      src/app/views/emergency-info/emergency-info.component.ts
  15. 19 0
      src/app/views/emergency-info/emergency-info.module.ts
  16. 110 0
      src/app/views/emergency-info/emergency-info.service.ts
  17. 67 4
      src/app/views/fuwutai/fuwutai.component.html
  18. 1 1
      src/app/views/fuwutai/fuwutai.component.less
  19. 139 16
      src/app/views/fuwutai/fuwutai.component.ts
  20. 4 0
      src/app/views/incident-config/incident-config.component.html
  21. 5 1
      src/app/views/incident-config/incident-config.component.ts
  22. 3 2
      src/app/views/incident-config/incident-config.module.ts
  23. 5 1
      src/app/views/main/main-routing.module.ts
  24. 53 11
      src/app/views/main/main.component.ts
  25. 320 10
      src/app/views/operation-search/operation-search.component.html
  26. 113 15
      src/app/views/operation-search/operation-search.component.less
  27. 357 30
      src/app/views/operation-search/operation-search.component.ts
  28. 2 2
      src/app/views/task-type-management/task-type-management.component.html
  29. 13 1
      src/app/views/task-type-management/task-type-management.component.ts

+ 6 - 3
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html

@@ -11,9 +11,9 @@
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,12 @@
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="mask-style" *ngIf="!initTyepe">
68
+			<nz-spin nzSimple class="spin-style"></nz-spin>
69
+		</div>
67 70
   </div>
68 71
 </div>
69 72
 

+ 15 - 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{

+ 83 - 32
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts

@@ -123,7 +123,9 @@ export class ConfigurationDictionaryComponent implements OnInit {
123 123
 
124 124
   // 获取数据字典数据
125 125
   maskFlag: any = false;
126
+	initTyepe:boolean = false;
126 127
   getDictionaryList() {
128
+		this.initTyepe = false
127 129
     let postData = {
128 130
       idx: 0,
129 131
       sum: 9999,
@@ -139,25 +141,51 @@ export class ConfigurationDictionaryComponent implements OnInit {
139 141
       this.maskFlag = false;
140 142
       let list = data.list || [];
141 143
       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
-        });
144
+				if(this.activeDictionaryKey.key == 'alarm_urgency'){
145
+					this.dictionaryList = list.map(v => {
146
+					  return {
147
+					    id: v.id,
148
+					    name: v.name || null,
149
+					    value: v.value || null,
150
+					    orders: v.orders || null,
151
+					    system: v.system || false,
152
+							extra1: v.extra1 || null,
153
+					  }
154
+					});
155
+				}else{
156
+					this.dictionaryList = list.map(v => {
157
+					  return {
158
+					    id: v.id,
159
+					    name: v.name || null,
160
+					    value: v.value || null,
161
+					    orders: v.orders || null,
162
+					    system: v.system || false,
163
+					  }
164
+					});
165
+				}
151 166
       }else{
152
-        this.dictionaryList = [
153
-          {
154
-            id: uuidv4(),
155
-            name: null,
156
-            value: null,
157
-            orders: null,
158
-            system: false,
159
-          }
160
-        ];
167
+				if(this.activeDictionaryKey.key == 'alarm_urgency'){
168
+					this.dictionaryList = [
169
+					  {
170
+					    id: uuidv4(),
171
+					    name: null,
172
+					    value: null,
173
+					    orders: null,
174
+					    system: false,
175
+							extra1: null,
176
+					  }
177
+					];
178
+				}else{
179
+					this.dictionaryList = [
180
+					  {
181
+					    id: uuidv4(),
182
+					    name: null,
183
+					    value: null,
184
+					    orders: null,
185
+					    system: false,
186
+					  }
187
+					];
188
+				}
161 189
       }
162 190
 
163 191
       console.log(this.dictionaryList);
@@ -167,31 +195,54 @@ export class ConfigurationDictionaryComponent implements OnInit {
167 195
           if(key !== 'id' && key !== 'system'){
168 196
             if(this.activeDictionaryKey.key === 'incident_status' || this.activeDictionaryKey.key === 'incident_degree'){
169 197
               this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: true}, [Validators.required]))
198
+            }else if(this.activeDictionaryKey.key === 'alarm_urgency'){
199
+							console.log(22222)
200
+              this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, []))
170 201
             }else{
171
-              this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, [Validators.required]))
172
-            }
202
+							this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, [Validators.required]))
203
+						}
173 204
           }
174 205
         }
175 206
       })
176
-      console.log(this.validateDictionaryForm.controls)
207
+			setTimeout(_=>{
208
+				this.initTyepe = true
209
+				console.log(this.validateDictionaryForm.controls)
210
+			},1000)
177 211
     })
178 212
   }
179 213
 
180 214
   // 添加数据字典
181 215
   addField(i:number): void{
182
-    let obj = {
183
-      id: uuidv4(),
184
-      name: null,
185
-      value: null,
186
-      orders: null,
187
-      system: false,
188
-    };
216
+		let obj:any = {}
217
+		if(this.activeDictionaryKey.key == 'alarm_urgency'){
218
+			obj = {
219
+			  id: uuidv4(),
220
+			  name: null,
221
+			  value: null,
222
+			  orders: null,
223
+			  system: false,
224
+				extra1:null,
225
+			};
226
+		}else{
227
+			obj = {
228
+			  id: uuidv4(),
229
+			  name: null,
230
+			  value: null,
231
+			  orders: null,
232
+			  system: false,
233
+			};
234
+		}
235
+
189 236
 
190 237
     // 动态添加表单
191 238
     for (const key in obj) {
192 239
       console.log(key + '_' + obj.id)
193 240
       if(key !== 'id' && key !== 'system'){
194
-        this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, [Validators.required]))
241
+				if(key !== 'extra1'){
242
+					this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, [Validators.required]))
243
+				}else{
244
+					this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, []))
245
+				}
195 246
       }
196 247
     }
197 248
 
@@ -214,7 +265,6 @@ export class ConfigurationDictionaryComponent implements OnInit {
214 265
 
215 266
   // 保存数据字典
216 267
   saveDictionary(): void {
217
-    console.log(this.coopData)
218 268
     for (const i in this.validateDictionaryForm.controls) {
219 269
       this.validateDictionaryForm.controls[i].markAsDirty();
220 270
       this.validateDictionaryForm.controls[i].updateValueAndValidity();
@@ -228,18 +278,19 @@ export class ConfigurationDictionaryComponent implements OnInit {
228 278
     //增加
229 279
     postData = [];
230 280
     let rawValueObj = this.validateDictionaryForm.getRawValue();
281
+		console.log(8888, rawValueObj)
231 282
     for (let i = 0; i < this.dictionaryList.length; i++) {
232 283
       postData.push({
233 284
         id: uuidValidate(this.dictionaryList[i].id) ? undefined : this.dictionaryList[i].id,
234 285
         name: rawValueObj['name_' + this.dictionaryList[i].id],
235 286
         value: rawValueObj['value_' + this.dictionaryList[i].id],
236 287
         orders: rawValueObj['orders_' + this.dictionaryList[i].id],
237
-				// extra1: this.activeDictionaryKey.key == 'alarm_urgency' ? rawValueObj['extra1_' + this.dictionaryList[i].id]: undefined,
288
+				extra1: this.activeDictionaryKey.key == 'alarm_urgency' ? rawValueObj['extra1_' + this.dictionaryList[i].id]: undefined,
238 289
         system: uuidValidate(this.dictionaryList[i].id) ? false : this.dictionaryList[i].system,
239 290
         key: this.activeDictionaryKey.key,
240 291
       })
241 292
     }
242
-    console.log(postData);
293
+
243 294
     this.btnLoading = true;
244 295
     this.mainService
245 296
       .simplePost("addListData", "dictionary", postData)

+ 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
+}

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

@@ -0,0 +1,316 @@
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
+			}
73
+		};
74
+		this.mainService
75
+			.getFetchDataList("simple/data", "group2", data)
76
+			.subscribe((data) => {
77
+				this.groupList = data.list || [];
78
+			});
79
+	}
80
+	
81
+	// 选择处理组
82
+	changeGroup(e){
83
+		this.validatePriorityForm.controls.userId.setValue(null);
84
+		this.getUserList();
85
+	}
86
+	
87
+	// 获取处理人
88
+	userList:any = [];
89
+	getUserList() {
90
+	  let data = {
91
+			idx: 0,
92
+			sum: 99999,
93
+			user: {
94
+				groupdata: {
95
+					id: this.validatePriorityForm.value.groupId
96
+				}
97
+			}
98
+		};
99
+		this.mainService
100
+			.getFetchDataList("data", "user", data)
101
+			.subscribe((data) => {
102
+				this.userList = data.list || [];
103
+			});
104
+	}
105
+	
106
+	// 获取告警优先级
107
+	emergencyData:any = [];
108
+	getEmergencyDic() {
109
+	  this.mainService.getDictionary("list", "alarm_urgency").subscribe((data) => {
110
+	    this.emergencyData = data || [];
111
+	  });
112
+	}
113
+	
114
+  // 新增优先级弹框
115
+  modelName = ""; //模态框名称
116
+  modalPriority: boolean = false; //新增/编辑模态框
117
+  add: boolean; //true:新增;false:编辑
118
+  addPriorityModal() {
119
+    this.modelName = "新增";
120
+    this.add = true; //新增
121
+    this.modalPriority = true;
122
+    this.initForm();
123
+  }
124
+  //关闭新增/编辑弹框
125
+  hidePriorityModal() {
126
+    this.modalPriority = false;
127
+  }
128
+
129
+  changeCommonInp(type, e) {
130
+    this.changeCommonInpSubject.next([type, e]);
131
+  }
132
+
133
+	// 获取故障现象数据
134
+  isLoading:boolean = false;
135
+	searchApplicationCategory(keyWord?){
136
+		let postData = {
137
+		  category: {
138
+        category: keyWord,
139
+        selectType: "mutlQuery",
140
+		    hierarchy: 3,
141
+		  },
142
+		};
143
+    this.isLoading = true;
144
+		this.mainService.incidentPost("listIncidentCategory", postData).subscribe(data => {
145
+		  this.isLoading = false;
146
+      if (data.status == 200) {
147
+        this.malfunctionData = data.data || [];
148
+      }
149
+		})
150
+	}
151
+
152
+  // 编辑
153
+  editPriority(data) {
154
+    console.log(data);
155
+    this.modelName = "编辑";
156
+    this.add = false;
157
+    this.modalPriority = true;
158
+    this.initForm();
159
+    this.coopData = data;
160
+    this.validatePriorityForm.controls.alarmUrgency.setValue(data.alarmUrgency.id);
161
+    this.validatePriorityForm.controls.keywords.setValue(data.keywords?data.keywords:null);
162
+    this.validatePriorityForm.controls.categoryId.setValue(data.categoryDTO?data.categoryDTO.id:null);
163
+		this.validatePriorityForm.controls.groupId.setValue(data.groupDTO.id);
164
+		if(data.groupDTO.id){
165
+			this.getUserList()
166
+			this.validatePriorityForm.controls.userId.setValue(data.userDTO?data.userDTO.id:null);
167
+		}
168
+		this.validatePriorityForm.controls.flag.setValue(data.flag);
169
+  }
170
+
171
+  // 新增/编辑表单提交
172
+  btnLoading: boolean = false; //提交按钮loading状态
173
+  submitPriorityForm(): void {
174
+    for (const i in this.validatePriorityForm.controls) {
175
+      this.validatePriorityForm.controls[i].markAsDirty();
176
+      this.validatePriorityForm.controls[i].updateValueAndValidity();
177
+    }
178
+    if (this.validatePriorityForm.invalid) {
179
+      return;
180
+    }
181
+    console.log(this.validatePriorityForm.value);
182
+    this.btnLoading = true;
183
+    let postData:any = {};
184
+    if (this.add) {
185
+      //增加
186
+      postData = {
187
+				alarmUrgency: {
188
+					id: this.validatePriorityForm.value.alarmUrgency
189
+				},
190
+				keywords: this.validatePriorityForm.value.keywords || undefined,
191
+				categoryId: this.validatePriorityForm.value.categoryId,
192
+				groupId: this.validatePriorityForm.value.groupId,
193
+				userId: this.validatePriorityForm.value.userId || undefined,
194
+				flag: this.validatePriorityForm.value.flag,
195
+      };
196
+    } else {
197
+      //编辑
198
+      postData = {
199
+				...this.coopData,
200
+				alarmUrgency: {
201
+					id: this.validatePriorityForm.value.alarmUrgency
202
+				},
203
+				keywords: this.validatePriorityForm.value.keywords || undefined,
204
+				categoryId: this.validatePriorityForm.value.categoryId,
205
+				groupId: this.validatePriorityForm.value.groupId,
206
+				userId: this.validatePriorityForm.value.userId || undefined,
207
+				flag: this.validatePriorityForm.value.flag,
208
+      };
209
+    }
210
+    this.mainService
211
+      .simplePost(this.add ? "addData": "upData", "alarmConfig", postData)
212
+      .subscribe((result) => {
213
+        this.btnLoading = false;
214
+        this.hidePriorityModal();
215
+        let msg = "";
216
+        if (this.add) {
217
+          msg = "新增";
218
+        } else {
219
+          msg = "修改";
220
+        }
221
+        if (result.status == 200) {
222
+          this.showPromptModal(msg, true, '');
223
+        } else {
224
+          this.showPromptModal(msg, false, result.msg);
225
+        }
226
+      });
227
+  }
228
+
229
+  // 初始化新增form表单
230
+  validatePriorityForm: FormGroup; //新增/编辑表单
231
+  initForm() {
232
+    this.validatePriorityForm = this.fb.group({
233
+      alarmUrgency: [null, [Validators.required]],
234
+      keywords: [null, []],
235
+      categoryId: [null, [Validators.required]],
236
+			groupId: [null, [Validators.required]],
237
+			userId: [null, []],
238
+			flag: [null, [Validators.required]],
239
+    });
240
+    console.log(this.validatePriorityForm.controls)
241
+  }
242
+
243
+  // 获取列表
244
+  loading1:boolean = false;
245
+  commonFaultsList: any[] = []; //表格数据
246
+  tablePriorityHeight:number = 0;
247
+  getCommonFaultsList() {
248
+    let data = {
249
+			idx: 0,
250
+			sum: 99999,
251
+			alarmConfig: {
252
+				hosId: this.hosId
253
+			},
254
+		};
255
+		this.loading1 = true;
256
+		this.mainService
257
+			.getFetchDataList("simple/data", "alarmConfig", data)
258
+			.subscribe((data) => {
259
+				this.loading1 = false;
260
+				this.commonFaultsList = data.list || [];
261
+			});
262
+  }
263
+
264
+  delModal: boolean = false; //删除模态框
265
+  tipsMsg1: string; //提示框信息
266
+  tipsMsg2: string; //操作后信息
267
+  confirmDelType: string; //确认的类型(启用/停用,删除)
268
+  showDelModal(
269
+    data,
270
+    tipsMsg1: string,
271
+    tipsMsg2: string,
272
+    type: string,
273
+  ) {
274
+    this.confirmDelType = type;
275
+    this.delModal = true;
276
+    this.coopData = data;
277
+    console.log(this.coopData);
278
+    this.tipsMsg1 = tipsMsg1;
279
+    this.tipsMsg2 = tipsMsg2;
280
+  }
281
+  // 隐藏删除框
282
+  hideDelModal() {
283
+    this.delModal = false;
284
+  }
285
+  // 确认删除
286
+  confirmDel() {
287
+    this.btnLoading = true;
288
+		this.mainService
289
+			.simplePost("rmvData", "alarmConfig", [this.coopData.id])
290
+			.subscribe((data) => {
291
+				this.btnLoading = false;
292
+				this.delModal = false;
293
+				if (data.status == 200) {
294
+					this.showPromptModal(this.tipsMsg2, true, "");
295
+				} else {
296
+					this.showPromptModal(this.tipsMsg2, false, data.msg);
297
+				}
298
+			});
299
+  }
300
+
301
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
302
+  promptContent: string; //操作提示框提示信息
303
+  ifSuccess: boolean; //操作成功/失败
304
+  promptInfo: string; //操作结果提示信息
305
+  promptModalShow: boolean; //操作提示框是否展示
306
+  showPromptModal(con, success, promptInfo?) {
307
+    this.promptModalShow = false;
308
+    this.promptContent = con;
309
+    this.ifSuccess = success;
310
+    this.promptInfo = promptInfo;
311
+    setTimeout(() => {
312
+      this.promptModalShow = true;
313
+    }, 100);
314
+    this.getCommonFaultsList();
315
+  }
316
+}

+ 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) => {

+ 7 - 0
src/app/services/main.service.ts

@@ -1263,4 +1263,11 @@ export class MainService {
1263 1263
 		});
1264 1264
 	}
1265 1265
 	
1266
+	// 故障工单-告警信息-建单
1267
+	addAlarmIncident(data){
1268
+		return this.http.post(host.host + `/flow/incident/task/createAlarmIncident`, data, {
1269
+		  headers: this.headers,
1270
+		});
1271
+	}
1272
+	
1266 1273
 }

+ 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);
@@ -337,6 +364,12 @@ export class ToolService {
337 364
 				case "send":
338 365
 				  coopBtns.send = true; //发送消息
339 366
 				  break;
367
+				case "batchRecover":
368
+				  coopBtns.batchRecover = true; //批量恢复
369
+				  break;
370
+				case "batchProcessing":
371
+				  coopBtns.batchProcessing = true; //批量不处理
372
+				  break;
340 373
       }
341 374
     });
342 375
     console.log(coopBtns);

+ 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 { }

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

@@ -0,0 +1,228 @@
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 alarmList">
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" (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()" (nzPageSizeChange)="getList()">
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
+<div id="report" style="display: none">
224
+  <div *ngFor="let img of codes" style="display: inline-block;">
225
+    <img style="width: 200px;height:200px;" [src]="img.base64" alt="">
226
+    <p style="margin: 0;text-align: center; font-size: 20px;width: 200px;">{{img.name}}</p>
227
+  </div>
228
+</div>

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

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

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

@@ -0,0 +1,501 @@
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
+	getGdList() {
117
+	  this.isLoading = true;
118
+	  this.quickOrderAcceptanceService.getDictionary("incident_status").subscribe((res) => {
119
+	    this.isLoading = false;
120
+	    this.gdList = res || [];
121
+	  });
122
+		this.quickOrderAcceptanceService.getDictionary("alarm_status").subscribe((res) => {
123
+		  this.isLoading = false;
124
+		  this.alarmList = res || [];
125
+		});
126
+	}
127
+	
128
+  // 搜索
129
+  search() {
130
+    this.getList(true);
131
+  }
132
+	
133
+	// 重置
134
+	reset() {
135
+		this.alarmStatus = null;
136
+		this.incidentStatus = null;
137
+		this.alarmIp = null;
138
+		this.alarmUrgency = null;
139
+		this.startDate = null;
140
+		this.endDate = null;
141
+		this.dateRange = [];
142
+	  this.getList(true);
143
+	}
144
+	
145
+  // 表格数据
146
+  loading1 = false;
147
+  getList(isResetPageIndex = false) {
148
+    isResetPageIndex && (this.pageIndex = 1);
149
+    let data = {
150
+      pageIndex: this.pageIndex,
151
+      pageSize: this.pageSize,
152
+      hosId: this.hosId,
153
+			alarm:{
154
+				alarmStatus:{
155
+					id:this.alarmStatus
156
+				},
157
+				incidentStatus:this.incidentStatus,
158
+				alarmIp:this.alarmIp,
159
+				alarmUrgency:{
160
+					id:this.alarmUrgency,
161
+				},
162
+				startTime: this.startDate || undefined,
163
+				endTime: this.endDate || undefined,
164
+			}
165
+    };
166
+		if(this.alarmStatus){
167
+			data.alarm.alarmStatus.id = this.alarmStatus
168
+		}else{
169
+			delete data.alarm.alarmStatus
170
+		}
171
+		if(this.alarmUrgency){
172
+			data.alarm.alarmUrgency.id = this.alarmUrgency
173
+		}else{
174
+			delete data.alarm.alarmUrgency
175
+		}
176
+    this.loading1 = true;
177
+    this.mapOfCheckedId = {};
178
+    this.checkedDepIds = [];
179
+    this.isAllDisplayDataChecked = false;
180
+    this.quickOrderAcceptanceService
181
+      .query(data)
182
+      .subscribe((result) => {
183
+        this.loading1 = false;
184
+        this.listOfData = result.list;
185
+        this.listLength = result.totalNum;
186
+      });
187
+  }
188
+
189
+  // 获取任务类型列表
190
+  getTasktype(keywords = '') {
191
+    let hosId = this.tool.getCurrentHospital().id;
192
+    this.isLoading = true;
193
+    this.quickOrderAcceptanceService.queryTasktype({
194
+      hosId,
195
+      keywords,
196
+    }).subscribe((res) => {
197
+      this.isLoading = false;
198
+      this.taskTypeList = res.list || [];
199
+    });
200
+  }
201
+
202
+  // 获取科室列表
203
+  getDept(keywords = '') {
204
+    let hosId = this.tool.getCurrentHospital().id;
205
+    this.isLoading = true;
206
+    this.quickOrderAcceptanceService.queryDept({
207
+      hosId,
208
+      keywords,
209
+    }).subscribe((res) => {
210
+      this.isLoading = false;
211
+      this.deptList = res.list || [];
212
+    });
213
+  }
214
+
215
+  // 获取快捷类型
216
+  getTypeList() {
217
+    this.isLoading = true;
218
+    this.quickOrderAcceptanceService.getDictionary("receiveRuleType").subscribe((res) => {
219
+      this.isLoading = false;
220
+      this.typeList = res || [];
221
+    });
222
+  }
223
+
224
+  // 新增弹框
225
+  showModal() {
226
+    this.add = true;
227
+    this.modal = true;
228
+    this.initForm();
229
+  }
230
+  hideModal() {
231
+    this.modal = false;
232
+    this.initForm();
233
+  }
234
+
235
+  // 初始化新增form表单
236
+  initForm() {
237
+    if (this.add) {
238
+      this.typeList = [];
239
+      this.taskTypeList = [];
240
+      this.deptList = [];
241
+    }
242
+    this.validateForm = this.fb.group({
243
+      title: ['', [Validators.required]],
244
+      taskTypeIds: [null, [Validators.required]],
245
+      deptIds: [null, [Validators.required]],
246
+      type: [null, [Validators.required]],
247
+    });
248
+  }
249
+  // 表单提交
250
+  submitForm(): void {
251
+    for (const i in this.validateForm.controls) {
252
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
253
+      this.validateForm.controls[i].updateValueAndValidity();
254
+    }
255
+    if (this.validateForm.invalid) return;
256
+    this.btnLoading = true;
257
+    if(this.add){
258
+      this.quickOrderAcceptanceService
259
+      .add({
260
+        title: this.validateForm.value.title,
261
+        taskTypeIds: this.validateForm.value.taskTypeIds,
262
+        deptIds: this.validateForm.value.deptIds,
263
+        type: {id: this.validateForm.value.type},
264
+        hosId: this.hosId,
265
+      })
266
+      .subscribe((data) => {
267
+        this.btnLoading = false;
268
+        this.hideModal();
269
+        this.initForm();
270
+        if (data.status == 200) {
271
+          this.showPromptModal(this.add ? "新增" : "编辑", true, "");
272
+        } else {
273
+          this.showPromptModal(this.add ? "新增" : "编辑", false, data.msg);
274
+        }
275
+      });
276
+    }else{
277
+      this.quickOrderAcceptanceService
278
+      .update({
279
+        title: this.validateForm.value.title,
280
+        taskTypeIds: this.validateForm.value.taskTypeIds,
281
+        deptIds: this.validateForm.value.deptIds,
282
+        type: {id: this.validateForm.value.type},
283
+        coopData: this.coopData,
284
+      })
285
+      .subscribe((data) => {
286
+        this.btnLoading = false;
287
+        this.hideModal();
288
+        this.initForm();
289
+        if (data.status == 200) {
290
+          this.showPromptModal(this.add ? "新增" : "编辑", true, "");
291
+        } else {
292
+          this.showPromptModal(this.add ? "新增" : "编辑", false, data.msg);
293
+        }
294
+      });
295
+    }
296
+  }
297
+	
298
+	// 批量恢复
299
+	infoContent:any;
300
+	optModal:boolean = false;
301
+	operationType:any;
302
+	batchRecover(){
303
+		if(this.checkedDepIds.length==0){
304
+			this.message.error('请勾选告警列表')
305
+			return
306
+		}
307
+		this.operationType = 'batchRecovery'
308
+		this.infoContent=`您确认要恢复${this.checkedDepIds.length}项告警吗?`
309
+		this.optModal = true
310
+	}
311
+	
312
+	// 批量不处理
313
+	batchNo(){
314
+		if(this.checkedDepIds.length==0){
315
+			this.message.error('请勾选告警列表')
316
+			return
317
+		}
318
+		this.operationType = 'batchUnprocessed'
319
+		this.infoContent=`您确认要不处理${this.checkedDepIds.length}项告警吗?`
320
+		this.optModal = true
321
+	}
322
+	
323
+	// 确认
324
+	confirmOpt() {
325
+	  this.btnLoading = true;
326
+	  this.quickOrderAcceptanceService
327
+	  .operation({
328
+	    operationType: this.operationType,
329
+	    ids: this.checkedDepIds,
330
+	  })
331
+	  .subscribe((data) => {
332
+	    this.btnLoading = false;
333
+	    this.hideOptModal();
334
+	    if (data.status == 200) {
335
+	      this.showPromptModal("操作", true, "");
336
+	    } else {
337
+	      this.showPromptModal("操作", false, data.msg);
338
+	    }
339
+	  });
340
+	}
341
+	
342
+	// 关闭模态框
343
+	hideOptModal() {
344
+	  this.optModal = false;
345
+	}
346
+	
347
+	// 建单
348
+	addOrder(data){
349
+		this.tool.triggerEvent({
350
+			message:'建单',
351
+			data:{id:data.id}
352
+		})
353
+	}
354
+	
355
+	// 查看工单
356
+	detail(e, data) {
357
+		if(!data.workOrderDTO){
358
+			return
359
+		}
360
+	  e.stopPropagation();
361
+	  this.router.navigateByUrl("/main/emergencyInfo/orderDetail/" + data.workOrderDTO.id);
362
+	}
363
+	
364
+	// 查看列表
365
+	itemData:any;
366
+	lookModal:boolean = false;
367
+	look(data){
368
+		this.itemData = data;
369
+		this.lookModal = true
370
+	}
371
+	
372
+	// 关闭查看
373
+	close(){
374
+		this.lookModal = false
375
+	}
376
+	
377
+  // 选中表格中科室
378
+  mapOfCheckedId: { [key: string]: boolean } = {};
379
+  checkedDepIds = []; //已选中科室id
380
+  refreshStatus(): void {
381
+    this.isAllDisplayDataChecked = this.listOfData.every(
382
+      (item) => this.mapOfCheckedId[item.id]
383
+    );
384
+    let arr = [];
385
+    for (var k in this.mapOfCheckedId) {
386
+      if (this.mapOfCheckedId[k]) {
387
+        arr.push(Number(k));
388
+      }
389
+    }
390
+    this.checkedDepIds = arr;
391
+    console.log(this.checkedDepIds);
392
+  }
393
+
394
+  //表格整行选中
395
+  selectedListData(id) {
396
+    this.mapOfCheckedId[id] = !this.mapOfCheckedId[id];
397
+    this.refreshStatus();
398
+  }
399
+
400
+  // 全选
401
+  isAllDisplayDataChecked = false; //当前页是否全选
402
+  checkAll(value: boolean): void {
403
+    this.listOfData.forEach((item) => (this.mapOfCheckedId[item.id] = value));
404
+    this.refreshStatus();
405
+  }
406
+
407
+  // 打印
408
+  codes = []; //二维码
409
+  printLoading: boolean = false; //批量打印按钮loading状态
410
+  print(e, batch, id?) {
411
+    e.stopPropagation();
412
+    this.printLoading = true;
413
+    this.quickOrderAcceptanceService
414
+      .print({
415
+        ids: batch ? this.checkedDepIds.toString() : id.toString()
416
+      })
417
+      .subscribe((data) => {
418
+        this.codes = data.data;
419
+        this.printLoading = false;
420
+        setTimeout(() => {
421
+          const printContent = document.getElementById("report");
422
+          const WindowPrt = window.open("", "", "width=700,height=900");
423
+          WindowPrt.document.write(printContent.innerHTML);
424
+          WindowPrt.document.close();
425
+          WindowPrt.focus();
426
+          WindowPrt.print();
427
+          WindowPrt.close();
428
+        }, 100);
429
+      });
430
+  }
431
+
432
+  // 编辑
433
+  maskFlag: any = false;
434
+  coopData = {};
435
+  edit(data) {
436
+    this.validateForm.controls.title.setValue(data.title);
437
+    this.validateForm.controls.type.setValue(data.type ? data.type.id : null);
438
+    this.validateForm.controls.taskTypeIds.setValue(data.taskTypeList ? data.taskTypeList.map(v => v.id) : null);
439
+    this.validateForm.controls.deptIds.setValue(data.deptList ? data.deptList.map(v => v.id) : null);
440
+    this.modal = true;
441
+    this.add = false;
442
+    this.coopId = data.id;
443
+    this.coopData = data;
444
+    this.getTasktype();
445
+    this.getDept();
446
+    this.getTypeList();
447
+  }
448
+
449
+  // 删除
450
+  delModal: boolean = false; //删除模态框
451
+  del(data) {
452
+    this.coopId = data.id;
453
+    this.delModal = true;
454
+  }
455
+
456
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
457
+  showPromptModal(con, success, promptInfo?) {
458
+    this.promptModalShow = false;
459
+    this.promptContent = con;
460
+    this.ifSuccess = success;
461
+    this.promptInfo = promptInfo;
462
+    setTimeout(() => {
463
+      this.promptModalShow = true;
464
+    }, 100);
465
+    this.getList(true);
466
+  }
467
+
468
+  // 边输边搜节流阀
469
+  isLoading = false;
470
+  changeInp(e) {
471
+    this.changeInpSubject.next([e]);
472
+  }
473
+
474
+  // 边输边搜节流阀
475
+  changeDeptInp(e) {
476
+    this.changeInpDeptSubject.next([e]);
477
+  }
478
+
479
+  // 打开任务类型
480
+  openTasktype(e){
481
+    if(e){
482
+      this.getTasktype();
483
+    }
484
+  }
485
+
486
+  // 打开科室
487
+  openDept(e){
488
+    if(e){
489
+      this.getDept();
490
+    }
491
+  }
492
+
493
+  // 打开班次
494
+  openSchedule(e){
495
+    if(e){
496
+      this.getTypeList();
497
+    }
498
+  }
499
+}
500
+
501
+

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

@@ -0,0 +1,19 @@
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
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    EmergencyInfoComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    EmergencyInfoRoutingModule,
16
+    ShareModule,
17
+  ]
18
+})
19
+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
+

+ 67 - 4
src/app/views/fuwutai/fuwutai.component.html

@@ -998,6 +998,17 @@
998 998
       <div class="title" *ngIf="currentTabIndex !== '故障报修' && currentTabIndex !== '政务值班'">
999 999
         <div class="newTop">
1000 1000
           <div class="name">来电咨询</div>
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>
1001 1012
           <div class="newTopItem">
1002 1013
             <span class="grayFont">申请科室:</span>
1003 1014
             <nz-select style="width: 146px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('hsms', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="applyDept" (ngModelChange)="changeApply($event)" (nzOpenChange)="openChangeApply($event)">
@@ -1203,7 +1214,20 @@
1203 1214
                           </div>
1204 1215
                         </div>
1205 1216
                         <div *ngIf="!isTaskTypeInspect && radioValueZy" nz-col [nzSpan]="deptZyList['startStatus'] != 201 ? 12 : 24" [ngStyle]="{ display: (deptZyList['startStatus'] != 201 && !isTaskTypeInspect) ? 'block' : 'none'}">
1206
-                          <nz-form-item>
1217
+                          <nz-form-item *ngIf="(deptZyList.startStatus == 204 || deptZyList.startStatus == 205) && deptZyList.startMultipleHospital==1">
1218
+                            <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startHosId">院区</nz-form-label>
1219
+                            <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择院区!">
1220
+                              <nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" formControlName="startHosId" (ngModelChange)="changeTypeHospital($event, 1)" nzAllowClear>
1221
+                                <ng-container *ngFor="let option of applicationHospitalList">
1222
+                                  <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1223
+                                </ng-container>
1224
+                                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1225
+                                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1226
+                                </nz-option>
1227
+                              </nz-select>
1228
+                            </nz-form-control>
1229
+                          </nz-form-item>
1230
+													<nz-form-item>
1207 1231
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startDept">起点科室</nz-form-label>
1208 1232
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择起点科室!">
1209 1233
                               <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 +1243,20 @@
1219 1243
                           </nz-form-item>
1220 1244
                         </div>
1221 1245
                         <div *ngIf="!isTaskTypeInspect && radioValueZy" nz-col [nzSpan]="deptZyList['startStatus'] != 201 ? 12 : 24">
1222
-                          <nz-form-item>
1246
+                          <nz-form-item *ngIf="(deptZyList.endStatus == 204 || deptZyList.endStatus == 205) && deptZyList.endMultipleHospital==1">
1247
+                            <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endHosId">院区</nz-form-label>
1248
+                            <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择院区!">
1249
+                              <nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" formControlName="endHosId" (ngModelChange)="changeTypeHospital($event, 2)" nzAllowClear>
1250
+                                <ng-container *ngFor="let option of applicationHospitalList">
1251
+                                  <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1252
+                                </ng-container>
1253
+                                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1254
+                                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1255
+                                </nz-option>
1256
+                              </nz-select>
1257
+                            </nz-form-control>
1258
+                          </nz-form-item>
1259
+													<nz-form-item>
1223 1260
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endDepts">终点科室</nz-form-label>
1224 1261
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择终点科室!">
1225 1262
                               <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 +1351,20 @@
1314 1351
                           </nz-form-item>
1315 1352
                         </div>
1316 1353
                         <div *ngIf="deptQtList.taskType && deptQtList.taskType.associationType.value !== 'specimen'" nz-col [nzSpan]="12" [ngStyle]="{ display: deptQtList['startStatus'] != 201 ? 'block' : 'none' }">
1317
-                          <nz-form-item>
1354
+													<nz-form-item *ngIf="(deptQtList.startStatus == 204 || deptQtList.startStatus == 205) && deptQtList.startMultipleHospital==1">
1355
+													  <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startHosId">院区</nz-form-label>
1356
+													  <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择院区!">
1357
+													    <nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" formControlName="startHosId" (ngModelChange)="changeTypeQtHospital($event, 1)" nzAllowClear>
1358
+													      <ng-container *ngFor="let option of applicationHospitalList">
1359
+													        <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1360
+													      </ng-container>
1361
+													      <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1362
+													        <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1363
+													      </nz-option>
1364
+													    </nz-select>
1365
+													  </nz-form-control>
1366
+													</nz-form-item>
1367
+													<nz-form-item>
1318 1368
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="startDeptQt">起点科室</nz-form-label>
1319 1369
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择起点科室!">
1320 1370
                               <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 +1380,20 @@
1330 1380
                           </nz-form-item>
1331 1381
                         </div>
1332 1382
                         <div *ngIf="deptQtList.taskType && deptQtList.taskType.associationType.value !== 'specimen'" nz-col [nzSpan]="12">
1333
-                          <nz-form-item>
1383
+                          <nz-form-item *ngIf="(deptQtList.endStatus == 204 || deptQtList.endStatus == 205) && deptQtList.endMultipleHospital==1">
1384
+														<nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endHosId">院区</nz-form-label>
1385
+														<nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择院区!">
1386
+															<nz-select [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" formControlName="endHosId" (ngModelChange)="changeTypeQtHospital($event, 2)" nzAllowClear>
1387
+																<ng-container *ngFor="let option of applicationHospitalList">
1388
+																	<nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1389
+																</ng-container>
1390
+																<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1391
+																	<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1392
+																</nz-option>
1393
+															</nz-select>
1394
+														</nz-form-control>
1395
+													</nz-form-item>
1396
+													<nz-form-item>
1334 1397
                             <nz-form-label class="label" [nzSm]="24" [nzXs]="24" nzRequired nzFor="endDeptsQt">终点科室</nz-form-label>
1335 1398
                             <nz-form-control class="control" [nzSm]="24" [nzXs]="24" nzErrorTip="请选择终点科室!">
1336 1399
                               <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;

+ 139 - 16
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",
@@ -3293,6 +3306,83 @@ export class FuwutaiComponent implements OnInit {
3293 3306
         }
3294 3307
       });
3295 3308
   }
3309
+	
3310
+	// 患者转运-任务类型-院区切换
3311
+	changeTypeHospital(e, type){
3312
+		console.log(111,e)
3313
+		if(type==1){
3314
+			this.validateFormZy.controls.startDept.setValue(null)
3315
+		}else{
3316
+			this.validateFormZy.controls.endDepts.setValue(null)
3317
+		}
3318
+		this.getStartDept(type)
3319
+	}
3320
+	
3321
+	// 患者转运-任务类型-搜索起点科室
3322
+	getStartDept(type){
3323
+		let dataObj = {
3324
+		  idx: 0,
3325
+		  sum: 20,
3326
+		  department: {
3327
+		    searchType: 1,// 简单查询
3328
+		    cascadeHosId: type==1 ? this.validateFormZy.controls.startHosId.value : this.validateFormZy.controls.endHosId.value,
3329
+		    flag: 1,
3330
+		  },
3331
+		};
3332
+		this.mainService
3333
+		  .getFetchDataList("data", "department", dataObj)
3334
+		  .subscribe((data) => {
3335
+		    if (data.status == 200) {
3336
+					if(type==1){
3337
+						this.deptZyList.startDept = data.list
3338
+					}else{
3339
+						this.deptZyList.endDept = data.list
3340
+					}
3341
+		    }
3342
+		  });
3343
+	}
3344
+	
3345
+	// 物品配送-任务类型-院区切换
3346
+	changeTypeQtHospital(e, type){
3347
+		console.log(111,e)
3348
+		if(type==1){
3349
+			this.validateFormQt.controls.startDeptQt.setValue(null)
3350
+		}else{
3351
+			this.validateFormQt.controls.endDeptsQt.setValue(null)
3352
+		}
3353
+		this.getStartQtDept(type)
3354
+	}
3355
+	
3356
+	// 物品配送-任务类型-搜索起点科室
3357
+	getStartQtDept(type){
3358
+		let dataObj = {
3359
+		  idx: 0,
3360
+		  sum: 20,
3361
+		  department: {
3362
+		    searchType: 1,// 简单查询
3363
+		    cascadeHosId: type==1 ? this.validateFormQt.controls.startHosId.value : this.validateFormQt.controls.endHosId.value,
3364
+		    flag: 1,
3365
+		  },
3366
+		};
3367
+		this.mainService
3368
+		  .getFetchDataList("data", "department", dataObj)
3369
+		  .subscribe((data) => {
3370
+		    if (data.status == 200) {
3371
+					if(type==1){
3372
+						this.deptQtList.startDept = data.list
3373
+					}else{
3374
+						this.deptQtList.endDept = data.list
3375
+					}
3376
+		    }
3377
+		  });
3378
+	}
3379
+	
3380
+	// 配送院区选择
3381
+	changeInHospital(e){
3382
+		this.applyDept = undefined;
3383
+		this.searchApplicationDepartment('hsms');
3384
+	}
3385
+	
3296 3386
   // 选择院区
3297 3387
   changeApplyHospital(e){
3298 3388
     console.log(e);
@@ -3937,7 +4027,7 @@ export class FuwutaiComponent implements OnInit {
3937 4027
     if(type == 'itsm'){
3938 4028
       cascadeHosId = this.incidentModel.hosId || undefined;
3939 4029
     }else{
3940
-      cascadeHosId = this.checkedHos;
4030
+      cascadeHosId = this.inHosId ? this.inHosId : this.checkedHos;
3941 4031
     }
3942 4032
     let dataObj = {
3943 4033
       idx: 0,
@@ -5190,7 +5280,7 @@ export class FuwutaiComponent implements OnInit {
5190 5280
     // 返回值的status是201 则是默认发起科室,把申请科室作为值
5191 5281
     // 返回值的status是202 则是固定科室范围,会返回科室列表
5192 5282
     // 返回值的status是203 则是固定科室,会返回单个科室
5193
-    // 返回值的status是204 则让前端自己调用科室搜索接口
5283
+    // 返回值的status是204 则让前端自己调用科室搜索接口-自主填写
5194 5284
     // 返回值的status是205 则是固定科室类型,会返回科室列表
5195 5285
     // 返回值的status是206 则是默认患者所在科室,把患者所在科室作为值
5196 5286
     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) => {
@@ -5205,7 +5295,22 @@ export class FuwutaiComponent implements OnInit {
5205 5295
 			}else{
5206 5296
 				this.isEndFixedType = false
5207 5297
 			}
5208
-
5298
+			if((data.startStatus==204 || data.startStatus==205) && data.startMultipleHospital==1){
5299
+				this.validateFormZy.addControl(
5300
+				  "startHosId",
5301
+				  new FormControl(null, Validators.required)
5302
+				);
5303
+			}else{
5304
+				this.validateFormZy.removeControl("startHosId");
5305
+			}
5306
+			if((data.endStatus==204 || data.endStatus==205) && data.endMultipleHospital==1){
5307
+				this.validateFormZy.addControl(
5308
+				  "endHosId",
5309
+				  new FormControl(null, Validators.required)
5310
+				);
5311
+			}else{
5312
+				this.validateFormZy.removeControl("endHosId");
5313
+			}
5209 5314
       // 预约start
5210 5315
       this.currentTasktype = data.taskType;
5211 5316
       this.isYyInspect = false;
@@ -5347,6 +5452,22 @@ export class FuwutaiComponent implements OnInit {
5347 5452
 			}else{
5348 5453
 				this.isEndFixedType = false
5349 5454
 			}
5455
+			if((data.startStatus==204 || data.startStatus==205) && data.startMultipleHospital==1){
5456
+				this.validateFormQt.addControl(
5457
+				  "startHosId",
5458
+				  new FormControl(null, Validators.required)
5459
+				);
5460
+			}else{
5461
+				this.validateFormQt.removeControl("startHosId");
5462
+			}
5463
+			if((data.endStatus==204 || data.endStatus==205) && data.endMultipleHospital==1){
5464
+				this.validateFormQt.addControl(
5465
+				  "endHosId",
5466
+				  new FormControl(null, Validators.required)
5467
+				);
5468
+			}else{
5469
+				this.validateFormQt.removeControl("endHosId");
5470
+			}
5350 5471
       // 预约start
5351 5472
       this.currentTasktype = data.taskType;
5352 5473
       this.isYyInspect = false;
@@ -5452,6 +5573,7 @@ export class FuwutaiComponent implements OnInit {
5452 5573
 		this.selectProvince = false;
5453 5574
 		this.itsmZwOrders = [];
5454 5575
 		this.patientCode = null;
5576
+		this.inHosId = null;
5455 5577
     this.currentTabIndex = "";
5456 5578
     this.fixedTab = "";
5457 5579
     this.fixedMenuShangla();
@@ -5901,7 +6023,7 @@ export class FuwutaiComponent implements OnInit {
5901 6023
 						'position': 'fixed',
5902 6024
 						'top': '0',
5903 6025
 						'left': '0',
5904
-						'z-index': '8',
6026
+						'z-index': '50',
5905 6027
 						'border-radius': '5px 0 0 5px'
5906 6028
 					}
5907 6029
 				}else if(this.leftMenuLocation==2){
@@ -5909,7 +6031,7 @@ export class FuwutaiComponent implements OnInit {
5909 6031
 						'position': 'fixed',
5910 6032
 						'top': '40%',
5911 6033
 						'left': '0',
5912
-						'z-index': '8',
6034
+						'z-index': '50',
5913 6035
 						'border-radius': '5px 0 0 5px'
5914 6036
 					}
5915 6037
 				}else{
@@ -5917,7 +6039,7 @@ export class FuwutaiComponent implements OnInit {
5917 6039
 						'position': 'fixed',
5918 6040
 						'bottom': '0',
5919 6041
 						'left': '0',
5920
-						'z-index': '8',
6042
+						'z-index': '50',
5921 6043
 						'border-radius': '5px 0 0 5px'
5922 6044
 					}
5923 6045
 				}
@@ -5926,7 +6048,7 @@ export class FuwutaiComponent implements OnInit {
5926 6048
 						'position': 'fixed',
5927 6049
 						'top': '0',
5928 6050
 						'right': '0',
5929
-						'z-index': '8',
6051
+						'z-index': '50',
5930 6052
 						'border-radius': '5px 0 0 5px'
5931 6053
 					}
5932 6054
 				}else if(this.rightMenuLocation==2){
@@ -5934,7 +6056,7 @@ export class FuwutaiComponent implements OnInit {
5934 6056
 						'position': 'fixed',
5935 6057
 						'top': '40%',
5936 6058
 						'right': '0',
5937
-						'z-index': '8',
6059
+						'z-index': '50',
5938 6060
 						'border-radius': '5px 0 0 5px'
5939 6061
 					}
5940 6062
 				}else{
@@ -5942,7 +6064,7 @@ export class FuwutaiComponent implements OnInit {
5942 6064
 						'position': 'fixed',
5943 6065
 						'bottom': '0',
5944 6066
 						'right': '0',
5945
-						'z-index': '8',
6067
+						'z-index': '50',
5946 6068
 						'border-radius': '5px 0 0 5px'
5947 6069
 					}
5948 6070
 				}
@@ -6016,6 +6138,7 @@ export class FuwutaiComponent implements OnInit {
6016 6138
 		console.log(99999,e)
6017 6139
     if (e === "close") {
6018 6140
 			this.goType = null;
6141
+			this.inHosId = null;
6019 6142
       this.newOrderShowOpen = false; //此时可出现新的弹窗
6020 6143
     } else if (e === "closeGo") {
6021 6144
 			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,

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

@@ -668,7 +668,11 @@ 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
+			}
672 676
     ],
673 677
   },
674 678
 ];

+ 53 - 11
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.highlightMenuByUrl();
84 88
     this.routerEventsListener = this.router.events
85 89
       .pipe(filter((event) => event instanceof NavigationEnd))
@@ -91,13 +95,29 @@ export class MainComponent implements OnInit {
91 95
     this.initMenu();
92 96
     this.getWebsocket();
93 97
   }
94
-
98
+	
99
+	getEvent(){
100
+		// 全局监听
101
+		let that = this;
102
+		that.tool.getEventObservable().subscribe(res => {
103
+			console.log('全局的监听触发111111', res);
104
+			that.eventData = res;
105
+			if(that.eventData.message == '建单'){
106
+				that.speedinessAdd()
107
+			}
108
+		});
109
+	}
110
+	
95 111
   // 离开管理端
96 112
   ngOnDestroy() {
97 113
     //取消路由监听
98 114
     this.routerEventsListener.unsubscribe();
99 115
     // 断掉连接
100 116
     this.webs.closeWs(true);
117
+		
118
+		// if (this.eventSubscription) {
119
+			// this.eventSubscription.unsubscribe();
120
+		// }
101 121
   }
102 122
 
103 123
   // 菜单图标名称是否包含transport-
@@ -1351,6 +1371,7 @@ export class MainComponent implements OnInit {
1351 1371
 	  let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
1352 1372
 	  let postData:any = {
1353 1373
 	    solutionId: this.solutionId,
1374
+			alarmId:null,
1354 1375
 	    "incident": {
1355 1376
 	      "id": this.incidentModel.id || undefined,
1356 1377
 	      "deleteFlag": 0,
@@ -1392,10 +1413,16 @@ export class MainComponent implements OnInit {
1392 1413
 	      postData.incident = Object.assign({}, this.editOrder, postData.incident);
1393 1414
 	    }
1394 1415
 	  }
1395
-
1396
-	  this.mainService
1416
+		let url = null
1417
+		if(this.eventData){
1418
+			postData.alarmId = this.eventData.data.id
1419
+			url = this.mainService.addAlarmIncident(postData)
1420
+		}else{
1421
+			delete postData.alarmId
1422
+			url = this.mainService
1397 1423
 	    .flowPost("incident/task/accept", postData)
1398
-	    .subscribe((result) => {
1424
+		}
1425
+	  url.subscribe((result) => {
1399 1426
 	      this.msg.remove(this.maskFlag);
1400 1427
 	      this.maskFlag = false;
1401 1428
 
@@ -2132,6 +2159,7 @@ export class MainComponent implements OnInit {
2132 2159
 
2133 2160
 	  let postData:any = {
2134 2161
 	    solutionId: this.solutionId,
2162
+			alarmId:null,
2135 2163
 	    "incident": {
2136 2164
 	      "id": this.incidentModel.id || undefined,
2137 2165
 	      "deleteFlag": 0,
@@ -2169,12 +2197,18 @@ export class MainComponent implements OnInit {
2169 2197
 	      postData.incident = Object.assign({}, this.editOrder, postData.incident);
2170 2198
 	    }
2171 2199
 	  }
2172
-	  console.log(postData);
2200
+	  console.log('哈哈哈哈哈哈=====', this.eventData);
2173 2201
 	  // return;
2174
-
2175
-	  this.mainService
2176
-	    .flowPost("incident/task/accept", postData)
2177
-	    .subscribe((result) => {
2202
+		let url = null
2203
+		if(this.eventData){
2204
+			postData.alarmId = this.eventData.data.id
2205
+			url = this.mainService.addAlarmIncident(postData)
2206
+		}else{
2207
+			delete postData.alarmId
2208
+			url = this.mainService
2209
+		  .flowPost("incident/task/accept", postData)
2210
+		}
2211
+		url.subscribe((result) => {
2178 2212
 	      this.msg.remove(this.maskFlag);
2179 2213
 	      this.maskFlag = false;
2180 2214
 
@@ -3035,6 +3069,10 @@ export class MainComponent implements OnInit {
3035 3069
 	  this.deptQtList["endDept"] = [];
3036 3070
 	  this.deptQtList["startStatus"] = 0;
3037 3071
 	  this.deptQtList["endStatus"] = 0;
3072
+		this.eventData = null
3073
+		this.tool.triggerEndEvent({
3074
+			message:'关单',
3075
+		})
3038 3076
 	}
3039 3077
 
3040 3078
 	// 撤回
@@ -3478,6 +3516,10 @@ export class MainComponent implements OnInit {
3478 3516
 	  // }
3479 3517
 		// this.newOrderShow = false;
3480 3518
 		// this.newOrderShowOpen = false;
3519
+		this.eventData = null
3520
+		this.tool.triggerEndEvent({
3521
+			message:'关单',
3522
+		})
3481 3523
 	  this.fixedTab = "";
3482 3524
 	  this.fixedMenuShangla();
3483 3525
 	}

+ 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.residenceNo}}</div>
134
+							<div>
135
+								{{ data.patientName}}<span *ngIf="data.bedNum">({{data.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)" 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
 

+ 357 - 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,335 @@ 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
+		    this.patientList = data["list"];
120
+		  }
121
+		});
122
+	}
123
+	
124
+	//  选择开始时间
125
+	applyDate:any;
126
+	onApplyChange(result: Date): void {
127
+		this.applyDate = format(result, 'yyyy-MM-dd HH:mm');
128
+		console.log('Selected Time: ', this.applyDate );
129
+		this.validateForm.controls.applyDate.setValue(this.applyDate + ':00');
130
+	}
131
+	
132
+	//  选择开始时间
133
+	printDate:any;
134
+	onOperationChange(result: Date): void {
135
+		this.printDate = format(result, 'yyyy-MM-dd HH:mm');
136
+		console.log('Selected Time: ', this.printDate );
137
+		this.validateForm.controls.printDate.setValue(this.printDate + ':00');
138
+	}
139
+	
140
+	// 新增弹框
141
+	add:boolean = true;
142
+	modal:boolean = false;
143
+	addMoadl() {
144
+	  this.add = true;
145
+		this.view = false;
146
+		this.modal = true;
147
+		this.itemData = null;
148
+		this.getUserList();
149
+	  this.initForm();
150
+	}
151
+	hideModal() {
152
+	  this.modal = false;
153
+	  this.initForm();
154
+	}
155
+	
156
+	// 初始化新增form表单
157
+	initForm() {
158
+	  this.validateForm = this.fb.group({
159
+			patientName:[null, [Validators.required]],
160
+	    patientPhone: [null, []],
161
+	    patientFamilyPhone: [null, []],
162
+			applyDate: [null, [Validators.required]],
163
+	    printDate: [null, [Validators.required]],
164
+	    firstOperation: ['0', [Validators.required]],
165
+			areaDept: [null, [Validators.required]],
166
+			surgeryDept: [null, [Validators.required]],
167
+			// surgeryName: [null, [Validators.required]],
168
+			doctorId: [null, []],
169
+			docAssistantInfos: [null, []],
170
+			itinerantNurseId: [null, []],
171
+			nurseId: [null, []],
172
+			state: [null, [Validators.required]],
173
+			type: [null, [Validators.required]],
174
+	  });
175
+	}
176
+		
177
+	// 表单提交
178
+	submitForm(): void {
179
+	  var that = this;
180
+		for (const i in that.validateForm.controls) {
181
+		  that.validateForm.controls[i].markAsDirty();
182
+		  that.validateForm.controls[i].updateValueAndValidity();
183
+		}
184
+		if (that.validateForm.invalid) return;
185
+	  let data = {
186
+			surgery:{
187
+				...this.itemData,
188
+				patientDTO:{
189
+					id: this.validateForm.value.patientName
190
+				},
191
+				patientPhone: this.validateForm.value.patientPhone || undefined,
192
+				patientFamilyPhone: this.validateForm.value.patientFamilyPhone || undefined,
193
+				applyDate: this.validateForm.value.applyDate,
194
+				printDate: this.validateForm.value.printDate,
195
+				firstOperation: this.validateForm.value.firstOperation?1:0,
196
+				areaDept: this.validateForm.value.areaDept,
197
+				surgeryDept: this.validateForm.value.surgeryDept,
198
+				// surgeryName: this.validateForm.value.surgeryName,
199
+				doctorId: this.validateForm.value.doctorId,
200
+				docAssistantInfos: this.validateForm.value.docAssistantInfos.join(",") || undefined,
201
+				itinerantNurseId: this.validateForm.value.itinerantNurseId || undefined,
202
+				nurseId: this.validateForm.value.nurseId || undefined,
203
+				state:{
204
+					id:this.validateForm.value.state,
205
+				},
206
+				type:{
207
+					id:this.validateForm.value.type,
208
+				},
209
+				id:0,
210
+			}
211
+	  };
212
+	  if (!that.add) {
213
+	    data.surgery.id = that.coopId;
214
+	  }else{
215
+			delete data.surgery.id
216
+		}
217
+		that.btnLoading = true;
218
+	  that.mainService
219
+	    .dataPost(this.add ? "addData":"updData", "surgery", data)
220
+	    .subscribe((data) => {
221
+	      that.btnLoading = false;
222
+	      that.hideModal();
223
+	      that.initForm();
224
+	      if (data.status == 200) {
225
+	        that.showPromptModal(that.add ? "新增" : "编辑", true, "");
226
+	      } else {
227
+	        that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
228
+	      }
229
+	    });
230
+	}
231
+	
232
+	// 查看
233
+	view:boolean = false
234
+	detail(e, data){
235
+		this.view = true;
236
+		this.initForm();
237
+		this.itemData = data;
238
+		this.coopId = data.id;
239
+		this.setForm(data)
240
+	}
241
+	
242
+	// 编辑
243
+	itemData:any;
244
+	coopId:any;
245
+	edit(e, data) {
246
+		this.view = false;
247
+		this.add = false
248
+		this.initForm();
249
+		this.getUserList();
250
+		this.itemData = data;
251
+		this.coopId = data.id;
252
+		this.setForm(data)
253
+	}
254
+	
255
+	// 数据回显
256
+	setForm(data){
257
+		if(data.patientDTO){
258
+			let item = this.patientList.find(i => i.id == data.patientDTO.id)
259
+			if(item){
260
+				this.validateForm.controls.patientName.setValue(data.patientDTO.id);
261
+			}else{
262
+				this.patientList.push({
263
+					patientName: data.patientDTO.patientName,
264
+					id: data.patientDTO.id
265
+				})
266
+				this.validateForm.controls.patientName.setValue(data.patientDTO.id);
267
+			}
268
+		}
269
+		this.validateForm.controls.patientPhone.setValue(data.patientPhone);
270
+		this.validateForm.controls.patientFamilyPhone.setValue(data.patientFamilyPhone);
271
+		this.validateForm.controls.applyDate.setValue(data.applyDate)
272
+		this.validateForm.controls.printDate.setValue(data.printDate);
273
+		this.validateForm.controls.firstOperation.setValue(data.firstOperation+"");
274
+		if(data.areaDeptDTO){
275
+			let item = this.departmentSearch.find(i => i.id == data.areaDeptDTO.id)
276
+			if(item){
277
+				this.validateForm.controls.areaDept.setValue(data.areaDeptDTO.id);
278
+			}else{
279
+				this.departmentSearch.push({
280
+					dept: data.areaDeptDTO.dept,
281
+					id: data.areaDeptDTO.id
282
+				})
283
+				this.validateForm.controls.areaDept.setValue(data.areaDeptDTO.id);
284
+			}
285
+		}
286
+		if(data.surgeryDeptDTO){
287
+			let item = this.operatingRoomDept.find(i => i.id == data.surgeryDeptDTO.id)
288
+			if(item){
289
+				this.validateForm.controls.surgeryDept.setValue(data.surgeryDeptDTO.id);
290
+			}else{
291
+				this.operatingRoomDept.push({
292
+					dept: data.surgeryDeptDTO.dept,
293
+					id: data.surgeryDeptDTO.id
294
+				})
295
+				this.validateForm.controls.surgeryDept.setValue(data.surgeryDeptDTO.id);
296
+			}
297
+		}
298
+		if(data.doctorId){
299
+			let item = this.userList.find(i => i.id == data.doctorId)
300
+			if(item){
301
+				this.validateForm.controls.doctorId.setValue(data.doctorId);
302
+			}else{
303
+				this.userList.push({
304
+					name: data.doctorName,
305
+					id: data.doctorId
306
+				})
307
+				this.validateForm.controls.doctorId.setValue(data.doctorId);
308
+			}
309
+		}
310
+		if(data.docAssistantInfos){
311
+			let arr = data.docAssistantInfos.split(";")
312
+			let arr2 = data.assistantDoctorName.split(";")
313
+			let docAssistantInfosArr = []
314
+			for(let i = 0; i<arr.length; i++){
315
+				arr[i] = Number(arr[i])
316
+				docAssistantInfosArr.push({
317
+					name: arr2[i],
318
+					id: arr[i]
319
+				})
320
+			}
321
+			docAssistantInfosArr.forEach(i=> {
322
+				let item = this.userList.find(x => x.id == i.id)
323
+				if(!item){
324
+					this.userList.push({
325
+						name: i.name,
326
+						id: i.id
327
+					})
328
+				}
329
+			})
330
+			this.validateForm.controls.docAssistantInfos.setValue(arr);
331
+		}
332
+		if(data.itinerantNurseId){
333
+			let item = this.userList.find(i => i.id == data.itinerantNurseId)
334
+			if(item){
335
+				this.validateForm.controls.itinerantNurseId.setValue(data.itinerantNurseId);
336
+			}else{
337
+				this.userList.push({
338
+					name: data.itinerantNurseName,
339
+					id: data.itinerantNurseId
340
+				})
341
+				this.validateForm.controls.itinerantNurseId.setValue(data.itinerantNurseId);
342
+			}
343
+		}
344
+		if(data.nurseId){
345
+			let item = this.userList.find(i => i.id == data.nurseId)
346
+			if(item){
347
+				this.validateForm.controls.nurseId.setValue(data.nurseId);
348
+			}else{
349
+				this.userList.push({
350
+					name: data.nurseName,
351
+					id: data.nurseId
352
+				})
353
+				this.validateForm.controls.nurseId.setValue(data.nurseId);
354
+			}
355
+		}
356
+		this.validateForm.controls.state.setValue(data.state && data.state.id || null);
357
+		this.validateForm.controls.type.setValue(data.type && data.type.id || null);
358
+		this.modal = true
359
+	}
360
+	
361
+	// 查看日志
362
+	logModal:boolean = false;
363
+	viewLog(e, data){
364
+		this.view = false;
365
+		this.add = false;
366
+		this.itemData = data;
367
+		this.logModal = true;
368
+	}
369
+	
370
+	hideLogModal(){
371
+		this.logModal = false;
372
+	}
373
+	
51 374
   // 表格筛选
52 375
   log(value: object[]): void {
53 376
     console.log(value);
@@ -55,12 +378,17 @@ export class OperationSearchComponent implements OnInit {
55 378
   }
56 379
   // 搜索类型
57 380
   isLoading1 = false;
381
+	operationType:any = [];
58 382
   searchTypes() {
59 383
     this.isLoading1 = true;
60 384
     this.mainService.getDictionary("list", "surgery_trans_state").subscribe((res) => {
61 385
       this.isLoading1 = false;
62 386
       this.types = res;
63 387
     });
388
+		this.mainService.getDictionary("list", "surgery_trans_type").subscribe((res) => {
389
+		  this.isLoading1 = false;
390
+		  this.operationType = res;
391
+		});
64 392
   }
65 393
   // 清空标本
66 394
   delModal: boolean = false; //删除模态框
@@ -156,7 +484,7 @@ export class OperationSearchComponent implements OnInit {
156 484
   // 打开搜索框
157 485
   changeSearch(flag) {
158 486
     if (flag) {
159
-      this.changeInp("no", "search");
487
+      this.changeDeptInp("no", "search");
160 488
     }
161 489
   }
162 490
   // 打开搜索框
@@ -165,10 +493,16 @@ export class OperationSearchComponent implements OnInit {
165 493
       this.changeOperatingRoomInp("no", "search");
166 494
     }
167 495
   }
496
+	
497
+	changeDoctor(name){
498
+		this.isLoading = true;
499
+		this.changeDoctorSubject.next(name);
500
+	}
501
+	
168 502
   // 边输边搜节流阀
169 503
   isLoading = false;
170 504
   deptKey = "";
171
-  changeInp(dept, type) {
505
+  changeDeptInp(dept, type) {
172 506
     if (!dept) {
173 507
       return;
174 508
     }
@@ -177,7 +511,7 @@ export class OperationSearchComponent implements OnInit {
177 511
     }
178 512
     this.deptKey = dept;
179 513
     this.isLoading = true;
180
-    this.changeInpSubject.next([dept, type]);
514
+    this.changeDeptInpSubject.next(dept);
181 515
   }
182 516
 	
183 517
 	changeOperatingRoomInp(dept, type) {
@@ -193,7 +527,7 @@ export class OperationSearchComponent implements OnInit {
193 527
   }
194 528
 	
195 529
   // 搜索科室
196
-  searchDepartment(dept, type) {
530
+  searchDepartment(dept) {
197 531
     let data = {
198 532
       department: {
199 533
         dept,
@@ -208,12 +542,8 @@ export class OperationSearchComponent implements OnInit {
208 542
       .getFetchDataList("data", "department", data)
209 543
       .subscribe((data) => {
210 544
         if (data.status == 200) {
211
-          if (type === "search") {
212
-            if (this.deptKey === dept) {
213
-              this.isLoading = false;
214
-              this.departmentSearch = data.list;
215
-            }
216
-          }
545
+					this.isLoading = false;
546
+					this.departmentSearch = data.list;
217 547
         }
218 548
       });
219 549
   }
@@ -237,12 +567,8 @@ export class OperationSearchComponent implements OnInit {
237 567
 			that.mainService
238 568
 			  .getFetchDataList("data", "department", data1)
239 569
 			  .subscribe((res) => {
240
-					if (type === "search") {
241
-					  if (this.deptKey === dept) {
242
-					    this.isLoading = false;
243
-					    that.operatingRoomDept = res.list;
244
-					  }
245
-					}
570
+					this.isLoading = false;
571
+					that.operatingRoomDept = res.list;
246 572
 			  });
247 573
 		});
248 574
 	}
@@ -250,15 +576,15 @@ export class OperationSearchComponent implements OnInit {
250 576
   // 边输边搜节流阀
251 577
   userKey = "";
252 578
   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]);
579
+    // if (!keyword) {
580
+    //   return;
581
+    // }
582
+    // if (keyword === "no") {
583
+    //   keyword = "";
584
+    // }
585
+    // this.userKey = keyword;
586
+    // this.isLoading = true;
587
+    // this.changeInp2Subject.next([keyword, type]);
262 588
   }
263 589
   // 搜索科室
264 590
   searchUser(keyword, type) {
@@ -312,6 +638,7 @@ export class OperationSearchComponent implements OnInit {
312 638
       surgery: {
313 639
 				applyDateStart: this.startDate,
314 640
 				applyDateEnd: this.endDate,
641
+				platform: 'list',
315 642
         firstOperation: this.searchCriteria.firstOperation ? 1 : undefined,
316 643
         hosId: this.searchCriteria.hospital,
317 644
         areaDept: this.searchCriteria.department ? this.searchCriteria.department :undefined,

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

@@ -771,9 +771,9 @@
771 771
             <label nz-checkbox [(ngModel)]="carryingCourses[indexs].handoverSwitch">是否必填交接人信息</label>
772 772
           </div>
773 773
 					<!-- 是否支持多院区 -->
774
-					<!-- <div class="turnoff" *ngIf="departmentStrategy.idv=='20047__3' || departmentStrategy.idv=='20048__4'">
774
+					<div class="turnoff" *ngIf="multipleShow">
775 775
 					  <label nz-checkbox [(ngModel)]="carryingCourses[indexs].multipleHospital">是否支持多院区</label>
776
-					</div> -->
776
+					</div>
777 777
           <!-- 是否支持拍照签到 -->
778 778
           <div class="turnoff" *ngIf="currentChoice.associationType.value == 'other'&&indexs==0">
779 779
             <label nz-checkbox [nzDisabled]="carryingCourses[indexs].actionsSwitch == 1" [(ngModel)]="carryingCourses[indexs].photoSwitch">是否支持拍照签到</label>

+ 13 - 1
src/app/views/task-type-management/task-type-management.component.ts

@@ -1426,6 +1426,11 @@ export class TaskTypeManagementComponent implements OnInit {
1426 1426
         return;
1427 1427
       }
1428 1428
     }
1429
+		if(this.taskData.taskType.carryingCourses[this.indexs].multipleHospital){
1430
+			this.taskData.taskType.carryingCourses[this.indexs].multipleHospital = 1
1431
+		}else{
1432
+			this.taskData.taskType.carryingCourses[this.indexs].multipleHospital = 0
1433
+		}
1429 1434
     console.log(this.taskData);
1430 1435
     // return;
1431 1436
     this.loading5 = true;
@@ -2311,6 +2316,7 @@ export class TaskTypeManagementComponent implements OnInit {
2311 2316
   }
2312 2317
   //默认科室选择
2313 2318
 	selectValue:boolean = false;
2319
+	multipleShow:boolean = false;
2314 2320
   depa(data, e, doing?): void {
2315 2321
     let arr = e.split("__");
2316 2322
     if (doing === "clear") {
@@ -2324,7 +2330,7 @@ export class TaskTypeManagementComponent implements OnInit {
2324 2330
         data.value = null;
2325 2331
       }
2326 2332
     }
2327
-		console.log(999999, data.idv);
2333
+		console.log(999999, data);
2328 2334
     let value = arr[1];
2329 2335
     if (value) {
2330 2336
       if (value == "2") {
@@ -2372,10 +2378,16 @@ export class TaskTypeManagementComponent implements OnInit {
2372 2378
         this.depaShow = false;
2373 2379
         this.depaShow4 = false;
2374 2380
       }
2381
+			if(value == 4 || value == 5){
2382
+				this.multipleShow = true
2383
+			}else{
2384
+				this.multipleShow = false;
2385
+			}
2375 2386
     } else {
2376 2387
       this.depaShow = false;
2377 2388
       this.depaShow1 = false;
2378 2389
       this.depaShow4 = false;
2390
+			this.multipleShow = false;
2379 2391
     }
2380 2392
   }
2381 2393
   //删除标本类型