seimin 6 months ago
parent
commit
599e8f0551

+ 1 - 1
src/app/components/incidentManagement/incident-handle/incident-handle.component.ts

@@ -159,7 +159,7 @@ export class IncidentHandleComponent implements OnInit {
159 159
       idx: 0,
160 160
       sum: 9999,
161 161
       solution: {
162
-        category: categoryId,
162
+        categoryId,
163 163
 				status: this.solutionStatus,
164 164
 				type: this.solutionType,
165 165
       },

+ 60 - 34
src/app/views/fuwutai/fuwutai.component.ts

@@ -648,19 +648,17 @@ export class FuwutaiComponent implements OnInit {
648 648
     this.coopBtns = this.tool.initCoopBtns(this.route);
649 649
     //防抖
650 650
     this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
651
-      v[1] !== '' && this.searchApplicationDepartment(v[0], v[1]);
651
+      this.searchApplicationDepartment(v[0], v[1]);
652 652
     });
653 653
     this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
654
-      if(v[1] !== ''){
655
-        if(v[0] === 'requester'){
656
-          this.searchApplicationRequester(v[1]);
657
-        }else if(v[0] === 'category'){
658
-          this.searchApplicationCategory(v[1]);
659
-        }else if(v[0] === 'group'){
660
-          this.searchApplicationGroup(v[1]);
661
-        }else if(v[0] === 'user'){
662
-          this.searchApplicationUser(v[1]);
663
-        }
654
+      if(v[0] === 'requester'){
655
+        this.searchApplicationRequester(v[1]);
656
+      }else if(v[0] === 'category'){
657
+        this.searchApplicationCategory(v[1]);
658
+      }else if(v[0] === 'group'){
659
+        this.searchApplicationGroup(v[1]);
660
+      }else if(v[0] === 'user'){
661
+        this.searchApplicationUser(v[1]);
664 662
       }
665 663
     });
666 664
     this.onSearchTaskBuildSubject.pipe(debounceTime(500)).subscribe((v) => {
@@ -1640,7 +1638,7 @@ export class FuwutaiComponent implements OnInit {
1640 1638
       idx: 0,
1641 1639
       sum: 9999,
1642 1640
       solution: {
1643
-        category: this.incidentModel.category,
1641
+        categoryId: this.incidentModel.category,
1644 1642
 				status: this.solutionStatus,
1645 1643
 				type: this.solutionType,
1646 1644
       },
@@ -2228,12 +2226,18 @@ export class FuwutaiComponent implements OnInit {
2228 2226
       }
2229 2227
     });
2230 2228
   }
2229
+  // 重置新建工单数据
2230
+  resetOrderData(){
2231
+    this.applicationRequesterList = [];
2232
+    this.fileList = [];
2233
+  }
2231 2234
   // 打开新建工单
2232 2235
   deathTasktypeId; //获取这个写死的任务类型的id,送病人回病房
2233 2236
   deathTasktypeIdPatient; //获取这个写死的任务类型的id,转出院记录
2234 2237
   async showNewOrder(des = '', phone = '', isInit = false, buildType = '') {
2235 2238
     this.buildType = buildType;
2236 2239
     if(this.itsmData.mdv2Switch){
2240
+      this.resetOrderData();
2237 2241
       this.searchApplicationHospital();
2238 2242
       this.searchApplicationCategory();
2239 2243
       this.searchApplicationPriority();
@@ -2255,7 +2259,7 @@ export class FuwutaiComponent implements OnInit {
2255 2259
         this.incidentModel.department = isInit ? this.incidentModel.department : null;
2256 2260
 
2257 2261
         //正常初始化
2258
-        this.getAutoWorkTypes(false);
2262
+        this.getAutoWorkTypes(false, isInit);
2259 2263
         return;
2260 2264
       }
2261 2265
     }
@@ -2319,7 +2323,7 @@ export class FuwutaiComponent implements OnInit {
2319 2323
         this.searchTaskList.forEach((item) => {
2320 2324
           item.sid = item.associationTypeId + "_" + item.id;
2321 2325
         });
2322
-        this.getAutoWorkTypes(true);
2326
+        this.getAutoWorkTypes(false, isInit);
2323 2327
       }
2324 2328
     });
2325 2329
   }
@@ -2349,7 +2353,7 @@ export class FuwutaiComponent implements OnInit {
2349 2353
     }
2350 2354
   }
2351 2355
   // 点击tab切换
2352
-  tabClick(key) {
2356
+  tabClick(key, isInit = false) {
2353 2357
     let preCurrentTabIndex = this.currentTabIndex;
2354 2358
     this.currentTabIndex = key;
2355 2359
     this.radioValueQt = null;
@@ -2381,7 +2385,7 @@ export class FuwutaiComponent implements OnInit {
2381 2385
 
2382 2386
       let deptObj = this.applicationDeptList.find(v => v.id == this.incidentModel.department);
2383 2387
 
2384
-      if(this.applyDept != this.incidentModel.department){
2388
+      if(this.applyDept !== this.incidentModel.department){
2385 2389
         this.applyDept = this.incidentModel.department;
2386 2390
         this.searchApplicationDepartment('hsms', deptObj ? deptObj.dept : '', undefined, this.incidentModel.department);
2387 2391
       }
@@ -2402,7 +2406,7 @@ export class FuwutaiComponent implements OnInit {
2402 2406
 
2403 2407
       let deptObj = this.applicationDepartmentList.find(v => v.id == this.applyDept);
2404 2408
 
2405
-      if(this.incidentModel.department != this.applyDept){
2409
+      if(this.incidentModel.department !== this.applyDept && !isInit){
2406 2410
         this.incidentModel.department = this.applyDept;
2407 2411
         this.searchApplicationDepartment('itsm', deptObj ? deptObj.dept : '', undefined, this.applyDept);
2408 2412
       }
@@ -2472,11 +2476,13 @@ export class FuwutaiComponent implements OnInit {
2472 2476
   // 选择院区
2473 2477
   changeApplyHospital(e){
2474 2478
     console.log(e);
2479
+
2475 2480
     this.incidentModel.department = undefined;
2476 2481
     this.searchApplicationDepartment('itsm');
2477 2482
 
2478 2483
     if(this.buildType !== '报修转事件'){
2479 2484
       this.incidentModel.requester = undefined;
2485
+      this.searchApplicationRequester();
2480 2486
     }
2481 2487
     this.applicationRequesterList = [];
2482 2488
 
@@ -2530,6 +2536,16 @@ export class FuwutaiComponent implements OnInit {
2530 2536
   applicationRequesterList:any[] = [];
2531 2537
   isRelatedDepartment:boolean = true;
2532 2538
   searchApplicationRequester(keyWord?) {
2539
+    // 关联查询,且没选择申请科室
2540
+    if(this.isRelatedDepartment && !this.incidentModel.department){
2541
+      this.applicationRequesterList = [];
2542
+      return;
2543
+    }
2544
+    // 不关联查询,且没选择院区
2545
+    if(!this.isRelatedDepartment && !this.incidentModel.hosId){
2546
+      this.applicationRequesterList = [];
2547
+      return;
2548
+    }
2533 2549
     let postData = {
2534 2550
       idx: 0,
2535 2551
       sum: 20,
@@ -2588,15 +2604,16 @@ export class FuwutaiComponent implements OnInit {
2588 2604
     console.log(e)
2589 2605
     // 知识库
2590 2606
     this.getKnowageList();
2591
-    // 根据院区和故障现象带出责任部门,优先级,维修人/组,故障描述
2592
-    if(this.incidentModel.hosId && e){
2593
-      // 带出故障描述
2607
+    if(e){
2608
+      // 根据故障现象带出故障描述
2594 2609
       if(this.incidentModel.description){
2595
-        this.incidentModel.description = this.incidentModel.description + ' ' + this.applicationCategoryList.find(v => v.id == e).mutiCategory;
2610
+        this.incidentModel.description = this.incidentModel.description + '' + this.applicationCategoryList.find(v => v.id == e).mutiCategory;
2596 2611
       }else{
2597 2612
         this.incidentModel.description = this.applicationCategoryList.find(v => v.id == e).mutiCategory;
2598 2613
       }
2599
-
2614
+    }
2615
+    // 根据院区和故障现象带出责任部门,优先级,维修人/组
2616
+    if(this.incidentModel.hosId && e){
2600 2617
       let postData = {
2601 2618
         idx: 0,
2602 2619
         sum: 9999,
@@ -2847,7 +2864,7 @@ export class FuwutaiComponent implements OnInit {
2847 2864
       group2: {
2848 2865
         groupName: keyWord,
2849 2866
         hospitals: this.incidentModel.duty ? this.incidentModel.duty.id.toString() : undefined,
2850
-        type: 1,
2867
+        type: 3,
2851 2868
       },
2852 2869
     };
2853 2870
     this.isLoading = true;
@@ -2918,7 +2935,7 @@ export class FuwutaiComponent implements OnInit {
2918 2935
   }
2919 2936
   // 楼栋列表
2920 2937
   applicationBuildingList:any[] = [];
2921
-  searchApplicationBuilding(keyWord?) {
2938
+  searchApplicationBuilding(keyWord?, buildingId?) {
2922 2939
     let postData = {
2923 2940
       idx: 0,
2924 2941
       sum: 9999,
@@ -2933,6 +2950,10 @@ export class FuwutaiComponent implements OnInit {
2933 2950
         this.isLoading = false;
2934 2951
         if (data.status == 200) {
2935 2952
           this.applicationBuildingList = data.list;
2953
+          if(buildingId){
2954
+            let hasBuildingId = this.applicationBuildingList.some(v => v.id == buildingId);
2955
+            hasBuildingId && (this.incidentModel.area = buildingId);
2956
+          }
2936 2957
         }
2937 2958
       });
2938 2959
   }
@@ -2944,7 +2965,7 @@ export class FuwutaiComponent implements OnInit {
2944 2965
   }
2945 2966
   // 楼层列表
2946 2967
   applicationFloorList:any[] = [];
2947
-  searchApplicationFloor(keyWord?) {
2968
+  searchApplicationFloor(keyWord?, floorId?) {
2948 2969
     let postData = {
2949 2970
       idx: 0,
2950 2971
       sum: 9999,
@@ -2960,6 +2981,10 @@ export class FuwutaiComponent implements OnInit {
2960 2981
         this.isLoading = false;
2961 2982
         if (data.status == 200) {
2962 2983
           this.applicationFloorList = data.list;
2984
+          if(floorId){
2985
+            let hasFloorId = this.applicationFloorList.some(v => v.id == floorId);
2986
+            hasFloorId && (this.incidentModel.place = floorId);
2987
+          }
2963 2988
         }
2964 2989
       });
2965 2990
   }
@@ -3043,6 +3068,7 @@ export class FuwutaiComponent implements OnInit {
3043 3068
             this.applicationDeptList = data.list;
3044 3069
             let ids = this.applicationDeptList.map(v => v.id);
3045 3070
             isInit && !ids.includes(this.incidentModel.department) && (this.applicationDeptList.unshift({id: this.incidentModel.department, dept: this.incidentMsg.deptName}))
3071
+            console.log(this.applicationDeptList);
3046 3072
             deptId && this.changeApplyDept(deptId);
3047 3073
           }
3048 3074
         }
@@ -3075,7 +3101,7 @@ export class FuwutaiComponent implements OnInit {
3075 3101
 
3076 3102
     let deptObj = this.applicationDepartmentList.find(v => v.id == e);
3077 3103
 
3078
-    if(this.incidentModel.department != e){
3104
+    if(this.incidentModel.department !== e){
3079 3105
       this.incidentModel.department = e;
3080 3106
       this.searchApplicationDepartment('itsm', deptObj ? deptObj.dept : '', undefined, e);
3081 3107
     }
@@ -3094,7 +3120,7 @@ export class FuwutaiComponent implements OnInit {
3094 3120
 
3095 3121
     let deptObj = this.applicationDeptList.find(v => v.id == e);
3096 3122
 
3097
-    if(this.applyDept != e){
3123
+    if(this.applyDept !== e){
3098 3124
       this.applyDept = e;
3099 3125
       this.searchApplicationDepartment('hsms', deptObj ? deptObj.dept : '', undefined, e);
3100 3126
     }
@@ -3116,10 +3142,10 @@ export class FuwutaiComponent implements OnInit {
3116 3142
     if(deptObj){
3117 3143
       console.log('deptObj:', deptObj)
3118 3144
       this.incidentMsg.deptManyPhone = deptObj.manyPhone;
3119
-      this.incidentModel.area = deptObj.building ? deptObj.building.id : undefined;
3120
-      this.incidentModel.area && this.searchApplicationBuilding();
3121
-      this.incidentModel.place = deptObj.floor ? deptObj.floor.id : undefined;
3122
-      this.incidentModel.place && this.searchApplicationFloor();
3145
+      let buildingId = deptObj.building ? deptObj.building.id : undefined;
3146
+      buildingId && this.searchApplicationBuilding('', buildingId);
3147
+      let floorId = deptObj.floor ? deptObj.floor.id : undefined;
3148
+      floorId && this.searchApplicationFloor('', floorId);
3123 3149
       this.incidentModel.houseNumber = deptObj.address;
3124 3150
     }
3125 3151
 
@@ -3460,7 +3486,7 @@ export class FuwutaiComponent implements OnInit {
3460 3486
   }
3461 3487
 
3462 3488
   // 新建工单->获取新建类型
3463
-  getAutoWorkTypes(isFirst) {
3489
+  getAutoWorkTypes(isFirst, isInit) {
3464 3490
     this.workTypesArrange = {};
3465 3491
     // 运维
3466 3492
     if(this.itsmData.mdv2Switch){
@@ -3471,7 +3497,7 @@ export class FuwutaiComponent implements OnInit {
3471 3497
         this.workTypesFlag = Object.keys(this.workTypesArrange).length >= 5;
3472 3498
         // 默认选中第一项
3473 3499
         if (Object.keys(this.workTypesArrange).length > 0) {
3474
-          this.tabClick(Object.keys(this.workTypesArrange)[0]);
3500
+          this.tabClick(Object.keys(this.workTypesArrange)[0], isInit);
3475 3501
         }
3476 3502
       }
3477 3503
     }
@@ -3497,7 +3523,7 @@ export class FuwutaiComponent implements OnInit {
3497 3523
           this.workTypesFlag = arr.length >= 5;
3498 3524
           // 默认选中第一项
3499 3525
           if (arr.length > 0) {
3500
-            isFirst ? this.tabClick(arr[0]) : this.tabClick(arr[arr.length - 1]);
3526
+            isFirst ? this.tabClick(arr[0], isInit) : this.tabClick(arr[arr.length - 1], isInit);
3501 3527
           }
3502 3528
         }
3503 3529
       });

+ 1 - 1
src/app/views/inspection-plan-config/inspection-plan-config.component.ts

@@ -207,7 +207,7 @@ export class InspectionPlanConfigComponent implements OnInit, AfterViewInit {
207 207
       group2: {
208 208
         groupName: keyword,
209 209
         hospitals: this.currentHospital.id,
210
-        type: 1,
210
+        type: 3,
211 211
       },
212 212
       idx: 0,
213 213
       sum: 10,

+ 28 - 28
src/app/views/repository-manage/repository-manage.component.ts

@@ -41,7 +41,7 @@ export class RepositoryManageComponent implements OnInit {
41 41
   ) {}
42 42
   ngOnInit() {
43 43
     this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
44
-			
44
+
45 45
     });
46 46
 		this.hosId = this.tool.getCurrentHospital().id;
47 47
     this.coopBtns = this.tool.initCoopBtns(this.route);
@@ -58,7 +58,7 @@ export class RepositoryManageComponent implements OnInit {
58 58
   validateForm: FormGroup; //新增/编辑表单
59 59
   coopId: number; //表格中执行操作的id
60 60
   department: number; //所属科室
61
-	hosId: number; 
61
+	hosId: number;
62 62
 	loadAllConsumeDept: boolean = true;//是否加载所有消耗科室
63 63
   solutionNumber; //编号
64 64
 	title; //标题
@@ -115,7 +115,7 @@ export class RepositoryManageComponent implements OnInit {
115 115
   hideDelModal1() {
116 116
     this.editModal = false;
117 117
   }
118
-	
118
+
119 119
   // 编辑保存
120 120
   confirmDel1() {
121 121
     var that = this;
@@ -180,7 +180,7 @@ export class RepositoryManageComponent implements OnInit {
180 180
         that.listLength = data.totalNum;
181 181
       });
182 182
   }
183
-	
183
+
184 184
 	// 版本号点击
185 185
 	versionsClick(data, index){
186 186
 		this.vIndex = index
@@ -192,14 +192,14 @@ export class RepositoryManageComponent implements OnInit {
192 192
 			this.richText = ''
193 193
 		}
194 194
 	}
195
-	
195
+
196 196
 	// 点击附件
197 197
 	fileClick(data){
198 198
 		console.log(222,data)
199 199
 		let a: any = document.createElement('a') // 创建一个元素
200 200
 		a.style = 'display: none' // 不能在页面中被看到,把他隐藏起来
201 201
 		a.style.height = '0px' // 给个0高度,避免影响页面布局
202
-		a.download = data.name; 
202
+		a.download = data.name;
203 203
 		a.href = data.url // 文件url地址
204 204
 		document.body.appendChild(a)  //  将其绑定在body上才能发挥作用
205 205
 		a.click() // 触发a标签的click事件
@@ -209,7 +209,7 @@ export class RepositoryManageComponent implements OnInit {
209 209
   hideModal() {
210 210
     this.modal = false;
211 211
   }
212
-	
212
+
213 213
 	// 审核通过
214 214
 	confirmDel4() {
215 215
 		let data: any = {
@@ -229,16 +229,16 @@ export class RepositoryManageComponent implements OnInit {
229 229
 				}
230 230
 			});
231 231
 	}
232
-	
232
+
233 233
 	hideDelModal4() {
234 234
 	  this.auditModal = false;
235 235
 	}
236
-	
236
+
237 237
 	// 审核驳回
238 238
 	rejectCancel(){
239 239
 		this.rejectModal = false
240 240
 	}
241
-	
241
+
242 242
 	// 审核驳回
243 243
 	rejectOk(){
244 244
 		if(this.rejectData==null){
@@ -263,11 +263,11 @@ export class RepositoryManageComponent implements OnInit {
263 263
 				}
264 264
 			});
265 265
 	}
266
-	
266
+
267 267
 	closeModel(){
268 268
 		this.hideModal()
269 269
 	}
270
-	
270
+
271 271
   // 表单提交
272 272
 	auditModal = false;
273 273
   submitForm(type): void {
@@ -279,18 +279,18 @@ export class RepositoryManageComponent implements OnInit {
279 279
 			this.rejectModal = true
280 280
 		}
281 281
   }
282
-	
282
+
283 283
 	// 升级
284 284
 	upgrade(e, data){
285 285
 		e.stopPropagation();
286 286
 		this.router.navigateByUrl(`/repositoryManageAdd/${data.id}?type=upgrade`);
287 287
 	}
288
-	
288
+
289 289
 	// 新增
290 290
 	addForm(){
291 291
 		this.router.navigateByUrl(`/repositoryManageAdd/0`);
292 292
 	}
293
-	
293
+
294 294
 	// 查看
295 295
 	look(e, data){
296 296
 		e.stopPropagation();
@@ -334,7 +334,7 @@ export class RepositoryManageComponent implements OnInit {
334 334
 				this.isSpinning = false
335 335
 			});
336 336
 	}
337
-	
337
+
338 338
 	getFile(){
339 339
 		this.mainService
340 340
 			.getPreviewImage('solution', this.rowId)
@@ -347,7 +347,7 @@ export class RepositoryManageComponent implements OnInit {
347 347
 				});
348 348
 			});
349 349
 	}
350
-	
350
+
351 351
 	// 审核
352 352
 	rowId=null;
353 353
 	audit(e, data){
@@ -375,22 +375,22 @@ export class RepositoryManageComponent implements OnInit {
375 375
 				this.detailData = data
376 376
 				this.richText = this.sanitizer.bypassSecurityTrustHtml(data[0].content);
377 377
 				for(let i of data[0].solutionLogs){
378
-					i.time = format(i.operationTime, 'yyyy-MM-dd HH:mm') 
378
+					i.time = format(i.operationTime, 'yyyy-MM-dd HH:mm')
379 379
 				}
380 380
 				this.lookData = data[0]
381 381
 				this.solutionLogs = data[0].solutionLogs
382 382
 				this.stepLength = this.solutionLogs.length
383 383
 				this.isSpinning = false
384 384
 			});
385
-	
385
+
386 386
 	}
387
-	
387
+
388 388
 	// 编辑
389 389
 	edit(e, data) {
390 390
 	  e.stopPropagation();
391 391
 	  this.router.navigateByUrl(`/repositoryManageAdd/${data.id}?type=edit`);
392 392
 	}
393
-	
393
+
394 394
 	// 停用
395 395
 	pauseModal = false;
396 396
 	pause(e, data){
@@ -398,7 +398,7 @@ export class RepositoryManageComponent implements OnInit {
398 398
 		this.pauseModal = true;
399 399
 		this.coopId = data.id;
400 400
 	}
401
-	
401
+
402 402
 	// 确认停用
403 403
 	confirmDel2() {
404 404
 	  var that = this;
@@ -419,12 +419,12 @@ export class RepositoryManageComponent implements OnInit {
419 419
 				}
420 420
 			});
421 421
 	}
422
-	
422
+
423 423
 	hideDelModal2() {
424 424
 	  this.pauseModal = false;
425 425
 	}
426
-	
427
-	
426
+
427
+
428 428
 	// 恢复
429 429
 	renewModal = false;
430 430
 	renew(e, data){
@@ -432,7 +432,7 @@ export class RepositoryManageComponent implements OnInit {
432 432
 		this.renewModal = true;
433 433
 		this.coopId = data.id;
434 434
 	}
435
-	
435
+
436 436
 	// 确认恢复
437 437
 	confirmDel3() {
438 438
 	  var that = this;
@@ -453,11 +453,11 @@ export class RepositoryManageComponent implements OnInit {
453 453
 				}
454 454
 			});
455 455
 	}
456
-	
456
+
457 457
 	hideDelModal3() {
458 458
 	  this.renewModal = false;
459 459
 	}
460
-	
460
+
461 461
 
462 462
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
463 463
   showPromptModal(con, success, promptInfo?) {

+ 3 - 3
src/app/views/users-management/users-management.component.ts

@@ -257,7 +257,7 @@ export class UsersManagementComponent implements OnInit {
257 257
     let groupData = {
258 258
       group2: {
259 259
         hospitals: hid,
260
-        type:1
260
+        typeIds: '1,3',
261 261
       },
262 262
       idx: 0,
263 263
       sum: 9999,
@@ -303,7 +303,7 @@ export class UsersManagementComponent implements OnInit {
303 303
     let groupData = {
304 304
       group2: {
305 305
         hospitals: id,
306
-        type:1
306
+        typeIds: '1,3',
307 307
       },
308 308
       idx: 0,
309 309
       sum: 9999,
@@ -469,7 +469,7 @@ export class UsersManagementComponent implements OnInit {
469 469
     let groupData = {
470 470
       group2: {
471 471
         hospitals: hid,
472
-        type:1
472
+        typeIds: '1,3',
473 473
       },
474 474
       idx: 0,
475 475
       sum: 9999,