5 次代碼提交 25b351e29e ... 0aad0e7e2f

作者 SHA1 備註 提交日期
  maotao 0aad0e7e2f 长江水利,白求恩需求开发 1 月之前
  maotao 86f0ad65dd 拉取代码 1 月之前
  maotao 6f8c0921f5 Merge branch 'master' of http://git.dashitech.com/seimin/zy-pc 1 月之前
  maotao fa83b192f5 拉取代码 1 月之前
  maotao 3b108ee273 拉取代码 1 月之前

+ 6 - 0
src/app/components/configurationCenter/configuration-system-security/configuration-system-security.component.html

@@ -41,6 +41,12 @@
41 41
 									<nz-input-number [(ngModel)]="validity" [nzMin]="0" [nzMax]="99999" [nzStep]="1"></nz-input-number>&nbsp;&nbsp;分钟 
42 42
 								</div>
43 43
 								
44
+								<!-- 验证码干扰线数量 -->
45
+								<div class="display_flex align-items_center mb8" *ngIf="verificationCode[0].checked">
46
+									<nz-form-label class="label">验证码干扰线数量</nz-form-label>
47
+									<nz-input-number [(ngModel)]="verificationCodeNoiseLines" [nzMin]="1" [nzMax]="50" [nzStep]="1"></nz-input-number>
48
+								</div>
49
+								
44 50
                 <!-- 是否限制账户错误登录次数 -->
45 51
                 <div class="display_flex align-items_center mb8">
46 52
                   <nz-form-label class="label">是否限制账户错误登录次数</nz-form-label>

+ 11 - 1
src/app/components/configurationCenter/configuration-system-security/configuration-system-security.component.ts

@@ -32,6 +32,7 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
32 32
 	validity:any; //验证码有效期
33 33
   isErrorTime:any = [{ label:'是否开启', value: 0 }];//是否限制账户错误登录次数
34 34
   errorTime:any;//支持错误次数
35
+	verificationCodeNoiseLines:any;//验证码干扰线数量
35 36
   astrictIp:any = [{ label:'是否开启', value: 1 }];//终点科室支持核对
36 37
   drugsEndCheckScanIds:any = [];//是否限制单点登录ip
37 38
   rangeIp:any;//单点登录范围内IP
@@ -100,6 +101,10 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
100 101
 				this.msg.error('验证码有效期不能为空')
101 102
 				return 
102 103
 			}
104
+			if(!this.verificationCodeNoiseLines){
105
+				this.msg.error('验证码干扰线数量不能为空')
106
+				return 
107
+			}
103 108
 		}
104 109
 		
105 110
 		if(this.isErrorTime[0].checked){
@@ -108,7 +113,7 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
108 113
 				return 
109 114
 			}
110 115
 		}
111
-	
116
+		
112 117
 		// if(this.astrictIp[0].checked){
113 118
 		// 	let isEmpty = this.ipData.filter(i=>i.rangeIp=='')
114 119
 		// 	if(isEmpty.length>0){
@@ -131,6 +136,8 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
131 136
 			  item.configValue = this.digit;
132 137
 			}else if (item.configKey === "verificationCodeDuration") {
133 138
 		    item.configValue = this.validity;
139
+		  }else if (item.configKey === "verificationCodeNoiseLines") {
140
+		    item.configValue = this.verificationCodeNoiseLines;
134 141
 		  }else if (item.configKey === "limitIncorrectLogin") {
135 142
 		    let value = null
136 143
 		    if(this.isErrorTime[0].checked){
@@ -209,6 +216,9 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
209 216
 								case "verificationCodeDuration":
210 217
 									this.validity = c[1]
211 218
 									break;
219
+								case "verificationCodeNoiseLines":
220
+									this.verificationCodeNoiseLines = c[1]
221
+									break;
212 222
 								case "limitIncorrectLogin":
213 223
 									if(c[1]=='1'){
214 224
 										this.isErrorTime[0].checked = true

+ 9 - 5
src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.ts

@@ -36,14 +36,14 @@ export class IncidentHandleInfoSimpleComponent implements OnInit {
36 36
       if(v[0] === 'synergetic'){
37 37
         this.getSynergeticList(v[1]);
38 38
       }else if(v[0] === 'assetId'){
39
-        this.getAssetList(v[1]);
39
+        this.getAssetList('search', v[1]);
40 40
       }
41 41
     });
42 42
     this.init();
43 43
   }
44 44
 
45 45
   init(){
46
-    console.log('初始化')
46
+    console.log('初始化', this.incidentData)
47 47
     this.hosId = this.tool.getCurrentHospital().id;
48 48
     this.incidentDataCopy = cloneDeep(this.incidentData);
49 49
     this.incidentDataCopy.synergetic = [];
@@ -51,7 +51,7 @@ export class IncidentHandleInfoSimpleComponent implements OnInit {
51 51
     this.getHandleCategorys();
52 52
     this.getClosecodes();
53 53
     this.getSynergeticList();
54
-    this.getAssetList();
54
+    this.getAssetList('load', '');
55 55
   }
56 56
 
57 57
   // 边输边搜节流阀
@@ -141,10 +141,10 @@ export class IncidentHandleInfoSimpleComponent implements OnInit {
141 141
 
142 142
   // 获取资产列表
143 143
   assetList: any = [];
144
-  getAssetList(keyword = '') {
144
+  getAssetList(type, keyword = '') {
145 145
     let postData = {
146 146
       asset: {
147
-        hosId: this.hosId,
147
+        downHosId: this.hosId,
148 148
         name: keyword,
149 149
       },
150 150
       idx: 0,
@@ -153,7 +153,11 @@ export class IncidentHandleInfoSimpleComponent implements OnInit {
153 153
     this.mainService
154 154
       .getFetchDataList("simple/data", "asset", postData)
155 155
       .subscribe((data) => {
156
+				this.isLoading = false;
156 157
         this.assetList = data.list;
158
+				if(this.incidentDataCopy.assetDTO && type=='load'){
159
+					this.incidentDataCopy.assetId = Number(this.incidentDataCopy.assetId)
160
+				}
157 161
       });
158 162
   }
159 163
 

+ 8 - 4
src/app/components/incidentManagement/incident-handle-info/incident-handle-info.component.ts

@@ -45,7 +45,7 @@ export class IncidentHandleInfoComponent implements OnInit, OnChanges {
45 45
       if(v[0] === 'synergetic'){
46 46
         this.getSynergeticList(v[1]);
47 47
       }else if(v[0] === 'assetId'){
48
-        this.getAssetList(v[1]);
48
+        this.getAssetList('search', v[1]);
49 49
       }else if(v[0] === 'category'){
50 50
         this.getIncidentCategoryList(v[1]);
51 51
       }
@@ -70,7 +70,7 @@ export class IncidentHandleInfoComponent implements OnInit, OnChanges {
70 70
     this.getHandleCategorys();
71 71
     this.getClosecodes();
72 72
     this.getSynergeticList();
73
-    this.getAssetList();
73
+    this.getAssetList('load');
74 74
     this.getIncidentCategoryList('', true);
75 75
   }
76 76
 
@@ -204,10 +204,10 @@ export class IncidentHandleInfoComponent implements OnInit, OnChanges {
204 204
 
205 205
   // 获取资产列表
206 206
   assetList: any = [];
207
-  getAssetList(keyword = '') {
207
+  getAssetList(type, keyword = '') {
208 208
     let postData = {
209 209
       asset: {
210
-        hosId: this.hosId,
210
+        downHosId: this.hosId,
211 211
         name: keyword,
212 212
       },
213 213
       idx: 0,
@@ -216,7 +216,11 @@ export class IncidentHandleInfoComponent implements OnInit, OnChanges {
216 216
     this.mainService
217 217
       .getFetchDataList("simple/data", "asset", postData)
218 218
       .subscribe((data) => {
219
+				this.isLoading = false;
219 220
         this.assetList = data.list;
221
+				if(this.incidentDataCopy.assetDTO && type=='load'){
222
+					this.incidentDataCopy.assetId = Number(this.incidentDataCopy.assetId)
223
+				}
220 224
       });
221 225
   }
222 226
 

+ 4 - 3
src/app/share/detail-bx/detail-bx.component.html

@@ -22,9 +22,10 @@
22 22
               <div class="thumb" *ngFor="let item of imgs_incident;let index = index;" (click)="previewImageHandler(imgs_incident, index)"><img [src]="item.thumbFilePath" alt=""></div>
23 23
             </div>
24 24
           </div>
25
-          <div nz-col nzSpan="8">维修人:<ng-container *ngIf="orderInfo.handlingPersonnelUser">{{ orderInfo.handlingPersonnelUser.name }}</ng-container></div>
26
-          <div nz-col nzSpan="8">维修人电话:<ng-container *ngIf="orderInfo.handlingPersonnelUser">{{ orderInfo.handlingPersonnelUser.phone }}</ng-container></div>
27
-          <div nz-col nzSpan="8">维修总金额:{{orderInfo.rsPrice === undefined ? '无' : orderInfo.rsPrice + '元'}}</div>
25
+					<div nz-col nzSpan="6">关联资产:<ng-container *ngIf="orderInfo.assetDTO">{{ orderInfo.assetDTO.name }}</ng-container></div>
26
+          <div nz-col nzSpan="6">维修人:<ng-container *ngIf="orderInfo.handlingPersonnelUser">{{ orderInfo.handlingPersonnelUser.name }}</ng-container></div>
27
+          <div nz-col nzSpan="6">维修人电话:<ng-container *ngIf="orderInfo.handlingPersonnelUser">{{ orderInfo.handlingPersonnelUser.phone }}</ng-container></div>
28
+          <div nz-col nzSpan="6">维修总金额:{{orderInfo.rsPrice === undefined ? '无' : orderInfo.rsPrice + '元'}}</div>
28 29
         </div>
29 30
       </div>
30 31
       <div class="center" *ngIf="amplificationShow">

+ 2 - 2
src/app/views/emergency-info/emergency-info.component.html

@@ -97,7 +97,7 @@
97 97
 						<td>{{ data.alarmIp || '-' }}</td>
98 98
 						<td>{{ data.alarmUrgency?.name }}</td>
99 99
 						<td>{{ data.alarmActiveTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
100
-						<td class="text-underline" (click)="detail($event, data)">{{ data.incidentSign || '-' }}</td>
100
+						<td class="text-underline" (click)="detail($event, data)">{{ data.incidentSign }}</td>
101 101
             <td>
102 102
               <div class="coop">
103 103
                 <span *ngIf="coopBtns.view" (click)="look(data)">查看</span>
@@ -184,7 +184,7 @@
184 184
 <!-- 查看模态框 -->
185 185
 <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="lookModal">
186 186
   <div class="viewModalBody">
187
-    <div class="title">查看<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
187
+    <div class="title">查看<i class="icon_transport transport-guanbi" (click)="close()"></i>
188 188
     </div>
189 189
     <overlay-scrollbars #osComponentRef1 class="content">
190 190
 			<div class="df view-item">

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

@@ -363,6 +363,9 @@ export class EmergencyInfoComponent implements OnInit {
363 363
 	detailModalShow = false; //弹窗开关
364 364
 	detail(e, data) {
365 365
 	  e.stopPropagation();
366
+		if(!data.incidentSign){
367
+			return
368
+		}
366 369
 	  this.coopData = data;
367 370
 	  this.detailModalShow = true;
368 371
 	}

+ 14 - 2
src/app/views/fuwutai/fuwutai.component.html

@@ -1,5 +1,5 @@
1 1
 <div class="fuwutai">
2
-  <div class="top" id="top" *ngIf="hurseInfoHiding != 1">
2
+  <div class="top" id="top" *ngIf="hurseInfoHiding != 1 && hsmsData.hsmsSwitch==1">
3 3
     <!-- 头部Tab -->
4 4
     <div class="tabBox">
5 5
       <div class="tab" #tabs>
@@ -1083,7 +1083,7 @@
1083 1083
             <ng-container *ngIf="buildType !== '报修转事件'">
1084 1084
               <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
1085 1085
                 <ng-container *ngFor="let option of applicationRequesterList">
1086
-                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
1086
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name + '('+option.account+')'" [nzValue]="option.id"></nz-option>
1087 1087
                 </ng-container>
1088 1088
                 <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1089 1089
                   <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -1527,6 +1527,18 @@
1527 1527
                   </div>
1528 1528
 
1529 1529
                   <div class="row">
1530
+										<div class="col" *ngIf="cmdbRepair">
1531
+											<span class="name">资产:</span>
1532
+											<nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzPlaceHolder="请选择资产" (nzOnSearch)="changeAsset($event)" [(ngModel)]="incidentModel.assetId">
1533
+												<ng-container *ngFor="let option of assetData">
1534
+													<nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
1535
+												</ng-container>
1536
+												<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
1537
+													<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1538
+												</nz-option>
1539
+											</nz-select>
1540
+										</div>
1541
+																			
1530 1542
                     <div class="col">
1531 1543
                       <span class="name required">故障现象:</span>
1532 1544
                       <nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('category', $event)" nzPlaceHolder="请选择故障现象" [(ngModel)]="incidentModel.category" (ngModelChange)="changeApplyCategory($event)" (nzOpenChange)="openChangeApplyCategory($event)">

+ 121 - 33
src/app/views/fuwutai/fuwutai.component.ts

@@ -177,7 +177,7 @@ export class FuwutaiComponent implements OnInit {
177 177
   searchHosDepartmentQtSubject = new Subject();
178 178
   searchPatientListSubject = new Subject();
179 179
   inspectSubject = new Subject();
180
-
180
+	changeAssetInpSubject = new Subject();
181 181
   // 运维相关
182 182
   incidentModel:any = {};
183 183
   incidentMsg:any = {};
@@ -954,9 +954,11 @@ export class FuwutaiComponent implements OnInit {
954 954
       });
955 955
   }
956 956
 	currentDept:any;
957
+	currentHospital:any;
957 958
   ngOnInit() {
958 959
     this.websocketLoading = true;
959 960
 		this.currentDept = this.tool.getCurrentUserDept();
961
+		this.currentHospital = this.tool.getCurrentHospital();
960 962
     this.coopBtns = this.tool.initCoopBtns(this.route);
961 963
 		// console.log(8989899,this.coopBtns)
962 964
     //防抖
@@ -966,6 +968,9 @@ export class FuwutaiComponent implements OnInit {
966 968
     this.inspectSubject.pipe(debounceTime(500)).subscribe((v) => {
967 969
       this.refreshInspectList();
968 970
     });
971
+		this.changeAssetInpSubject.pipe(debounceTime(500)).subscribe((v) => {
972
+		  this.getAssetData(v);
973
+		});
969 974
     this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
970 975
       if(v[0] === 'requester'){
971 976
         this.searchApplicationRequester(v[1]);
@@ -1936,6 +1941,7 @@ export class FuwutaiComponent implements OnInit {
1936 1941
       });
1937 1942
   }
1938 1943
   rightTitleHandler(i) {
1944
+		console.log(4444, i)
1939 1945
     this.currentRTab = i;
1940 1946
     if (i === 0) {
1941 1947
       this.getWorkOrders(this.applyDept);
@@ -1996,7 +2002,7 @@ export class FuwutaiComponent implements OnInit {
1996 2002
     if(!this.itsmData.mdv2Switch){
1997 2003
       return;
1998 2004
     }
1999
-    if (id == -1 || id === null || id === undefined && this.incidentModel.repairIncidentType === 'dept') {
2005
+    if ((id == -1 || id === null || id === undefined) && this.incidentModel.repairIncidentType === 'dept') {
2000 2006
       this.itsmOrders = [];
2001 2007
       return;
2002 2008
     }
@@ -2730,6 +2736,7 @@ export class FuwutaiComponent implements OnInit {
2730 2736
   // 获取配置文件写死的任务类型ID(转科,给转出院记录用6)
2731 2737
   patientLogTasktypeLoading: boolean = false;
2732 2738
 	showGovDutyConfig:any;
2739
+	cmdbRepair:boolean = false;
2733 2740
   patientLogTasktype() {
2734 2741
     if(!this.hsmsData.hsmsSwitch){
2735 2742
       return;
@@ -2760,6 +2767,33 @@ export class FuwutaiComponent implements OnInit {
2760 2767
       }
2761 2768
     });
2762 2769
   }
2770
+	
2771
+	changeAsset(e){
2772
+		this.changeAssetInpSubject.next(e);
2773
+	}
2774
+	
2775
+	// 获取资产列表
2776
+	assetData:any = [];
2777
+	getAssetData(name?){
2778
+		console.log('nimadede===========', this.hospitalModel)
2779
+		let data = {
2780
+		  idx: 0,
2781
+		  sum: 20,
2782
+		  asset: {
2783
+		    downHosId: this.hospitalModel!=1 ? this.incidentModel.hosId : this.currentHospital.id,
2784
+		    name: name
2785
+		  },
2786
+		};
2787
+		
2788
+		this.mainService
2789
+		  .getFetchDataList("simple/data", "asset", data)
2790
+		  .subscribe((data) => {
2791
+		    if (data.status == 200) {
2792
+		      this.assetData = data.list;
2793
+		    }
2794
+		  });
2795
+	}
2796
+	
2763 2797
   // 重置新建工单数据
2764 2798
   resetOrderData(){
2765 2799
     this.applicationRequesterList = [];
@@ -2826,6 +2860,13 @@ export class FuwutaiComponent implements OnInit {
2826 2860
 									break;	
2827 2861
 								case "applicantMustFillIn":
2828 2862
 									this.applicantMustFillIn = c[1]
2863
+									break;
2864
+								case "cmdbRepair":
2865
+									if(c[1]=='1'){
2866
+										this.cmdbRepair = true
2867
+									}else{
2868
+										this.cmdbRepair = false
2869
+									}
2829 2870
 									break;	
2830 2871
 							}
2831 2872
 							if(type==1){
@@ -2841,6 +2882,9 @@ export class FuwutaiComponent implements OnInit {
2841 2882
 						if(this.hospitalModel==1){
2842 2883
 							this.searchApplicationBuilding()
2843 2884
 						}
2885
+						if(this.cmdbRepair && this.hospitalModel==1){
2886
+							this.getAssetData()
2887
+						}
2844 2888
 					}
2845 2889
 				}
2846 2890
 			});
@@ -3441,7 +3485,10 @@ export class FuwutaiComponent implements OnInit {
3441 3485
 
3442 3486
     this.incidentModel.department = undefined;
3443 3487
     this.searchApplicationDepartment('itsm');
3444
-
3488
+		if(this.cmdbRepair){
3489
+			this.incidentModel.assetId = null;
3490
+			this.getAssetData()
3491
+		}
3445 3492
     if(this.buildType !== '报修转事件'){
3446 3493
       this.incidentModel.requester = undefined;
3447 3494
       this.searchApplicationRequester();
@@ -3519,6 +3566,7 @@ export class FuwutaiComponent implements OnInit {
3519 3566
         hospital: this.isRelatedDepartment ? undefined : { id: this.incidentModel.hosId },
3520 3567
         dept: this.isRelatedDepartment ? { id: this.incidentModel.department } : undefined,
3521 3568
         name: keyWord,
3569
+				// phone: this.incidentModel.incomingPhone || undefined
3522 3570
         // simpleQuery: true,
3523 3571
       },
3524 3572
     };
@@ -3547,25 +3595,35 @@ export class FuwutaiComponent implements OnInit {
3547 3595
 			this.userPriorityDTO = null
3548 3596
 		}
3549 3597
 		let orders = [];
3550
-		if(this.addressDTO&&this.addressDTO.orders){
3598
+		let id = [];
3599
+		if(this.addressDTO&&this.addressDTO.id){
3551 3600
 			orders.push(this.addressDTO.orders)
3601
+			id.push(this.addressDTO.id)
3552 3602
 		}
3553
-		if(this.deptPriorityDTO&&this.deptPriorityDTO.orders){
3603
+		if(this.deptPriorityDTO&&this.deptPriorityDTO.id){
3554 3604
 			orders.push(this.deptPriorityDTO.orders)
3605
+			id.push(this.deptPriorityDTO.id)
3555 3606
 		}
3556
-		if(this.userPriorityDTO&&this.userPriorityDTO.orders){
3607
+		if(this.userPriorityDTO&&this.userPriorityDTO.id){
3557 3608
 			orders.push(this.userPriorityDTO.orders)
3609
+			id.push(this.userPriorityDTO.id)
3558 3610
 		}
3559
-		if(this.malPriorityDTO&&this.malPriorityDTO.orders){
3611
+		if(this.malPriorityDTO&&this.malPriorityDTO.id){
3560 3612
 			orders.push(this.malPriorityDTO.orders)
3613
+			id.push(this.malPriorityDTO.id)
3561 3614
 		}
3562 3615
 		let minNumber = Math.min(...orders)
3616
+		let index = orders.indexOf(minNumber) 
3563 3617
 		console.log('最小值的orders', orders, minNumber)
3564 3618
 		setTimeout(_=>{
3565
-			this.incidentModel.priorityId = minNumber != Infinity ? minNumber : null
3619
+			this.incidentModel.priorityId = minNumber != Infinity ? id[index] : null
3566 3620
 		})
3567 3621
 		if(this.incidentModel.repairIncidentType === 'public'){
3568 3622
 			this.getItsmOrders('')
3623
+			if(this.cmdbRepair){
3624
+				this.incidentModel.assetId = null;
3625
+				this.getAssetData()
3626
+			}
3569 3627
 		}
3570 3628
   }
3571 3629
   // 故障现象列表
@@ -3622,7 +3680,6 @@ export class FuwutaiComponent implements OnInit {
3622 3680
           hosId: this.incidentModel.hosId,
3623 3681
         },
3624 3682
       };
3625
-      console.log(postData);
3626 3683
       // return;
3627 3684
       this.isLoading = true;
3628 3685
       this.mainService
@@ -3643,23 +3700,32 @@ export class FuwutaiComponent implements OnInit {
3643 3700
 							this.malPriorityDTO = null
3644 3701
 						}
3645 3702
 						let orders = [];
3646
-						if(this.addressDTO&&this.addressDTO.orders){
3703
+						let id = [];
3704
+						if(this.addressDTO&&this.addressDTO.id){
3647 3705
 							orders.push(this.addressDTO.orders)
3706
+							id.push(this.addressDTO.id)
3648 3707
 						}
3649
-						if(this.deptPriorityDTO&&this.deptPriorityDTO.orders){
3708
+						if(this.deptPriorityDTO&&this.deptPriorityDTO.id){
3650 3709
 							orders.push(this.deptPriorityDTO.orders)
3710
+							id.push(this.deptPriorityDTO.id)
3651 3711
 						}
3652
-						if(this.userPriorityDTO&&this.userPriorityDTO.orders){
3712
+						if(this.userPriorityDTO&&this.userPriorityDTO.id){
3653 3713
 							orders.push(this.userPriorityDTO.orders)
3714
+							id.push(this.userPriorityDTO.id)
3654 3715
 						}
3655
-						if(this.malPriorityDTO&&this.malPriorityDTO.orders){
3716
+						if(this.malPriorityDTO&&this.malPriorityDTO.id){
3656 3717
 							orders.push(this.malPriorityDTO.orders)
3718
+							id.push(this.malPriorityDTO.id)
3657 3719
 						}
3658
-						let minNumber = Math.min(...orders)
3659
-						console.log('最小值的orders', orders, minNumber)
3660
-						setTimeout(_=>{
3661
-							this.incidentModel.priorityId = minNumber != Infinity ? minNumber : null
3662
-						})
3720
+						if(orders.length>0){
3721
+							let minNumber = Math.min(...orders)
3722
+							let index = orders.indexOf(minNumber)
3723
+							console.log('最小值的orders', orders, minNumber)
3724
+							setTimeout(_=>{
3725
+								this.incidentModel.priorityId = minNumber != Infinity ? id[index] : null
3726
+							})
3727
+						}
3728
+
3663 3729
             // 根据院区和故障现象带出责任部门,优先级,维修人/组
3664 3730
             this.incidentModel.duty = this.incidentCategoryConfig.dutyDTO;
3665 3731
             // this.incidentModel.priorityId = this.incidentCategoryConfig.priority;
@@ -3725,6 +3791,7 @@ export class FuwutaiComponent implements OnInit {
3725 3791
         "callID": this.incidentModel.callID || undefined,
3726 3792
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
3727 3793
         "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
3794
+				"assetId": this.incidentModel.assetId || undefined
3728 3795
       },
3729 3796
     };
3730 3797
 
@@ -4165,7 +4232,10 @@ export class FuwutaiComponent implements OnInit {
4165 4232
   changeApply(e) {
4166 4233
     this.changeApplicationDepartment("&same&");
4167 4234
     this.defaultInspectFn();
4168
-
4235
+		if(this.cmdbRepair){
4236
+			this.incidentModel.assetId = null;
4237
+			this.getAssetData()
4238
+		}
4169 4239
     if(this.applyDept && this.currentTabIndex !== '故障报修'){
4170 4240
       this.rightTitle_tab = [
4171 4241
         { id: 0, name: '近期配送' },
@@ -4196,22 +4266,28 @@ export class FuwutaiComponent implements OnInit {
4196 4266
 			this.deptPriorityDTO = null
4197 4267
 		}
4198 4268
 		let orders = [];
4199
-		if(this.addressDTO&&this.addressDTO.orders){
4269
+		let id = [];
4270
+		if(this.addressDTO&&this.addressDTO.id){
4200 4271
 			orders.push(this.addressDTO.orders)
4272
+			id.push(this.addressDTO.id)
4201 4273
 		}
4202
-		if(this.deptPriorityDTO&&this.deptPriorityDTO.orders){
4274
+		if(this.deptPriorityDTO&&this.deptPriorityDTO.id){
4203 4275
 			orders.push(this.deptPriorityDTO.orders)
4276
+			id.push(this.deptPriorityDTO.id)
4204 4277
 		}
4205
-		if(this.userPriorityDTO&&this.userPriorityDTO.orders){
4278
+		if(this.userPriorityDTO&&this.userPriorityDTO.id){
4206 4279
 			orders.push(this.userPriorityDTO.orders)
4280
+			id.push(this.userPriorityDTO.id)
4207 4281
 		}
4208
-		if(this.malPriorityDTO&&this.malPriorityDTO.orders){
4282
+		if(this.malPriorityDTO&&this.malPriorityDTO.id){
4209 4283
 			orders.push(this.malPriorityDTO.orders)
4284
+			id.push(this.malPriorityDTO.id)
4210 4285
 		}
4211 4286
 		let minNumber = Math.min(...orders)
4212
-		console.log('最小值的orders', orders, minNumber)
4287
+		let index = orders.indexOf(minNumber) 
4288
+		console.log('最小值的orders', index)
4213 4289
 		setTimeout(_=>{
4214
-			this.incidentModel.priorityId = minNumber != Infinity ? minNumber : null
4290
+			this.incidentModel.priorityId = minNumber != Infinity ? id[index] : null
4215 4291
 		})
4216 4292
     if(this.incidentModel.department && this.currentTabIndex === '故障报修'){
4217 4293
       this.rightTitle_tab = [
@@ -4542,6 +4618,7 @@ export class FuwutaiComponent implements OnInit {
4542 4618
         "candidateGroups": this.incidentModel.group || undefined,
4543 4619
         "assignee": this.incidentModel.user || undefined,
4544 4620
         "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
4621
+				"assetId": this.incidentModel.assetId || undefined
4545 4622
       }
4546 4623
     };
4547 4624
     if(this.buildType){
@@ -4617,6 +4694,7 @@ export class FuwutaiComponent implements OnInit {
4617 4694
         "candidateGroups": this.incidentModel.group || undefined,
4618 4695
         "assignee": this.incidentModel.user || undefined,
4619 4696
         "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
4697
+				"assetId": this.incidentModel.assetId || undefined
4620 4698
       }
4621 4699
     };
4622 4700
     if(this.buildType){
@@ -6609,7 +6687,6 @@ export class FuwutaiComponent implements OnInit {
6609 6687
     this.editOrder = cloneDeep(data);
6610 6688
     let incidentModel = cloneDeep(data);
6611 6689
     let incidentMsg:any = {};
6612
-		
6613 6690
     // incidentModel.department && (this.applicationDeptList = [cloneDeep(incidentModel.department)]);
6614 6691
     incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
6615 6692
     incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
@@ -6629,11 +6706,16 @@ export class FuwutaiComponent implements OnInit {
6629 6706
     incidentModel.category && (incidentModel.category = incidentModel.category.id);
6630 6707
     this.incidentModel = incidentModel;
6631 6708
     this.incidentMsg = incidentMsg;
6709
+		// this.incidentModel.department && this.changeApply(this.incidentModel.department.id);
6632 6710
     this.incidentModel.category && this.changeApplyCategory(this.incidentModel.category, true);
6633 6711
     console.log('this.applicationDeptList:', this.applicationDeptList)
6634 6712
     console.log('incidentModel:', incidentModel)
6635 6713
     this.showNewOrder(0, '', '', true, '报修转事件');
6636 6714
 		console.log(2345,this.incidentModel.repairIncidentType)
6715
+		if(incidentModel.assetId){
6716
+			this.getAssetData()
6717
+			incidentModel.assetId = Number(incidentModel.assetId)
6718
+		}
6637 6719
     // 查询报修图片
6638 6720
     this.getRepairImgs(data.id);
6639 6721
   }
@@ -7014,8 +7096,8 @@ export class FuwutaiComponent implements OnInit {
7014 7096
 
7015 7097
   // 选择地址
7016 7098
 	addressDTO:any;
7017
-  selectAddress(name, id){
7018
-		let item = this.addressList.find(i=>i.id == id)
7099
+  selectAddress(name, idx){
7100
+		let item = this.addressList.find(i=>i.id == idx)
7019 7101
 		console.log('选中的地址11111',item);
7020 7102
 		if(item && item.priority){
7021 7103
 			this.addressDTO = item.priority
@@ -7023,22 +7105,28 @@ export class FuwutaiComponent implements OnInit {
7023 7105
 			this.addressDTO = null
7024 7106
 		}
7025 7107
 		let orders = [];
7026
-		if(this.addressDTO&&this.addressDTO.orders){
7108
+		let id = [];
7109
+		if(this.addressDTO&&this.addressDTO.id){
7027 7110
 			orders.push(this.addressDTO.orders)
7111
+			id.push(this.addressDTO.id)
7028 7112
 		}
7029
-		if(this.deptPriorityDTO&&this.deptPriorityDTO.orders){
7113
+		if(this.deptPriorityDTO&&this.deptPriorityDTO.id){
7030 7114
 			orders.push(this.deptPriorityDTO.orders)
7115
+			id.push(this.deptPriorityDTO.id)
7031 7116
 		}
7032
-		if(this.userPriorityDTO&&this.userPriorityDTO.orders){
7117
+		if(this.userPriorityDTO&&this.userPriorityDTO.id){
7033 7118
 			orders.push(this.userPriorityDTO.orders)
7119
+			id.push(this.userPriorityDTO.id)
7034 7120
 		}
7035
-		if(this.malPriorityDTO&&this.malPriorityDTO.orders){
7121
+		if(this.malPriorityDTO&&this.malPriorityDTO.id){
7036 7122
 			orders.push(this.malPriorityDTO.orders)
7123
+			id.push(this.malPriorityDTO.id)
7037 7124
 		}
7038 7125
 		let minNumber = Math.min(...orders)
7126
+		let index = orders.indexOf(minNumber) 
7039 7127
 		console.log('最小值的orders', orders, minNumber)
7040 7128
 		setTimeout(_=>{
7041
-			this.incidentModel.priorityId = minNumber != Infinity ? minNumber : null
7129
+			this.incidentModel.priorityId = minNumber != Infinity ? id[index] : null
7042 7130
 		})
7043 7131
     this.incidentModel.houseNumber = name;
7044 7132
     this.isShowAddressList = false;

+ 27 - 1
src/app/views/hushijiandan/hushijiandan.component.html

@@ -2413,7 +2413,33 @@
2413 2413
     </div>
2414 2414
     <div class="content">
2415 2415
       <form nz-form [formGroup]="validateBxForm" class="bxFormAdd" (ngSubmit)="confirmBx()">
2416
-        <nz-form-item>
2416
+        <nz-form-item *ngIf="cmdbRepair">
2417
+          <nz-form-label [nzSm]="4" [nzXs]="4" nzFor="assetId">资产</nz-form-label>
2418
+          <nz-form-control style="display: inline-block;">
2419
+            <nz-select style="width:168px;margin-right: 8px;" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzPlaceHolder="请选择资产" (nzOnSearch)="changeAsset($event)" formControlName="assetId" (ngModelChange)="changeAssetData($event)">
2420
+            	<ng-container *ngFor="let option of assetData">
2421
+            		<nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
2422
+            	</ng-container>
2423
+            	<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
2424
+            		<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
2425
+            	</nz-option>
2426
+            </nz-select>
2427
+          </nz-form-control>
2428
+        
2429
+    <!--      <nz-form-label nzFor="contactsInformation">故障现象</nz-form-label>
2430
+          <nz-form-control style="display: inline-block;">
2431
+            <nz-select style="width:185px;" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择故障现象" formControlName="category" (ngModelChange)="changeApplyCategory($event)">
2432
+            	<ng-container *ngFor="let option of applicationCategoryList">
2433
+            		<nz-option *ngIf="!isLoading" [nzLabel]="option.mutiCategory" [nzValue]="option.id"></nz-option>
2434
+            	</ng-container>
2435
+            	<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
2436
+            		<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
2437
+            	</nz-option>
2438
+            </nz-select>
2439
+          </nz-form-control> -->
2440
+        </nz-form-item>
2441
+				
2442
+				<nz-form-item>
2417 2443
           <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="description">故障描述</nz-form-label>
2418 2444
           <nz-form-control>
2419 2445
             <nz-input-group style="width:442px;">

+ 123 - 4
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -118,6 +118,8 @@ export class HushijiandanComponent implements OnInit {
118 118
   searchTabInpSubject = new Subject(); //左侧查患者信息和检查信息防抖
119 119
   otherSearchChangeSubject = new Subject(); //其他建单搜索防抖
120 120
   inspectSubject = new Subject();
121
+	changeAssetInpSubject = new Subject();
122
+	changeCommonInpSubject = new Subject();
121 123
   isYyInspect = false; //需要预约检查
122 124
   inspectAndPatientTransportConfig:any = {timeMod: 30};
123 125
   constructor(
@@ -191,6 +193,7 @@ export class HushijiandanComponent implements OnInit {
191 193
     this.getUpdateTipsForNurses();
192 194
     this.getRefreshNurseWorkOrderTime();
193 195
     this.getCloseTimeFlag();
196
+		this.getCmdbRepairFlag();
194 197
     this.currentDept = this.tool.getCurrentUserDept();
195 198
     console.log(this.currentDept, this.tabSearchCont);
196 199
     this.currentDept.typeValue == 'surgery' && !this.tabSearchCont && this.getSurgeryConfig();
@@ -209,7 +212,12 @@ export class HushijiandanComponent implements OnInit {
209 212
     this.inspectSubject.pipe(debounceTime(500)).subscribe((v) => {
210 213
       this.refreshInspectList();
211 214
     });
212
-
215
+		this.changeAssetInpSubject.pipe(debounceTime(500)).subscribe((v) => {
216
+		  this.getAssetData(v);
217
+		});
218
+		this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
219
+		  this.searchApplicationCategory(v);
220
+		});
213 221
     this.getTodayNum();
214 222
     this.initLogin();
215 223
     this.getDeptTaskType();
@@ -1027,6 +1035,100 @@ export class HushijiandanComponent implements OnInit {
1027 1035
         }
1028 1036
       });
1029 1037
   }
1038
+	// 获取资产报修是否开启
1039
+	cmdbRepair:Boolean = false;
1040
+	getCmdbRepairFlag() {
1041
+	  let postData = {
1042
+	    idx: 0,
1043
+	    sum: 1,
1044
+	    systemConfiguration: { keyconfig: "cmdbRepair" },
1045
+	  };
1046
+	  this.mainService
1047
+	    .getFetchDataList("simple/data", "systemConfiguration", postData)
1048
+	    .subscribe((result) => {
1049
+	      if (result.status == 200) {
1050
+					if(result.list[0].valueconfig==1){
1051
+						this.cmdbRepair = true
1052
+						this.getAssetData();
1053
+					}else{
1054
+						this.cmdbRepair = false
1055
+					}
1056
+	      }
1057
+	    });
1058
+	}
1059
+	
1060
+	changeCommonInp(e) {
1061
+		return
1062
+	  this.changeCommonInpSubject.next(e);
1063
+	}
1064
+	changeApplyCategory(e){
1065
+	  console.log(111, e)
1066
+		if(e){
1067
+		  // 根据故障现象带出故障描述
1068
+		  if(this.validateBxForm.value.description){
1069
+				this.validateBxForm.controls.description.setValue(this.validateBxForm.value.description +';'+this.applicationCategoryList.find(v => v.id == e).mutiCategory)
1070
+		  }else{
1071
+				this.validateBxForm.controls.description.setValue(this.applicationCategoryList.find(v => v.id == e).mutiCategory)
1072
+		  }
1073
+		}
1074
+	}
1075
+	// 故障现象列表
1076
+	applicationCategoryList:any[] = [];
1077
+	searchApplicationCategory(keyWord?) {
1078
+		let item = this.assetData.find(i=> i.id == this.validateBxForm.value.assetId)
1079
+		if(!item.assetProductDTO.incidentCategoryIds){
1080
+			return
1081
+		}
1082
+		let postData = {
1083
+			incidentCategoryIds: item.assetProductDTO.incidentCategoryIds,
1084
+	   //  category: {
1085
+	   //    category: keyWord,
1086
+	   //    selectType: 'mutlQuery',
1087
+				// hierarchy: 3,//只差有三级的故障现象列表
1088
+	   //  },
1089
+	  };
1090
+	  console.log(postData);
1091
+	  this.isLoading = true;
1092
+	  this.mainService
1093
+	    .incidentPost("listIncidentCategory", postData)
1094
+	    .subscribe((data) => {
1095
+	      this.isLoading = false;
1096
+	      if (data.status == 200) {
1097
+	        this.applicationCategoryList = data.data;
1098
+	      }
1099
+	    });
1100
+	}
1101
+	
1102
+	changeAsset(e){
1103
+		this.changeAssetInpSubject.next(e);
1104
+	}
1105
+	// 选择资产
1106
+	changeAssetData(e){
1107
+		this.validateBxForm.controls.category.setValue(null)
1108
+		this.searchApplicationCategory();
1109
+	}
1110
+	
1111
+	// 获取资产列表
1112
+	assetData:any = [];
1113
+	getAssetData(name?){
1114
+		let data = {
1115
+		  idx: 0,
1116
+		  sum: 20,
1117
+		  asset: {
1118
+		    downHosId: this.currentHospital.id,
1119
+		    name: name
1120
+		  },
1121
+		};
1122
+		
1123
+		this.mainService
1124
+		  .getFetchDataList("simple/data", "asset", data)
1125
+		  .subscribe((data) => {
1126
+		    if (data.status == 200) {
1127
+		      this.assetData = data.list;
1128
+		    }
1129
+		  });
1130
+	}
1131
+	
1030 1132
   //获取综合日志
1031 1133
   rLoading = false;
1032 1134
   listDeptOrderRecords: any = [];
@@ -1532,7 +1634,22 @@ export class HushijiandanComponent implements OnInit {
1532 1634
       officeAddress: [null, [Validators.required]],
1533 1635
       contacts: [this.loginUser.name, [Validators.required]],
1534 1636
       contactsInformation: [this.loginUser.phone, [Validators.required]],
1637
+			assetId: [null, []],
1638
+			// category: [null, []],
1535 1639
     });
1640
+		if(this.cmdbRepair){
1641
+			this.validateBxForm.addControl(
1642
+				'assetId',
1643
+				new FormControl(null, [])
1644
+			);
1645
+			// this.validateBxForm.addControl(
1646
+			// 	'category',
1647
+			// 	new FormControl(null, [])
1648
+			// );
1649
+		}else{
1650
+			this.validateBxForm.removeControl('assetId');
1651
+			// this.validateBxForm.removeControl('category');
1652
+		}
1536 1653
     this.getDeptById(this.currentDept.id);
1537 1654
   }
1538 1655
   // 根据科室ID获取详情
@@ -1711,11 +1828,13 @@ export class HushijiandanComponent implements OnInit {
1711 1828
               requester: this.loginUser,
1712 1829
               acceptUser: this.loginUser,
1713 1830
               deleteFlag: 0,
1831
+							assetId: this.validateBxForm.value.assetId || undefined,
1832
+							// category: this.validateBxForm.value.category ? { id: this.validateBxForm.value.category } : undefined,
1714 1833
             },
1715 1834
           };
1716
-          if (this.coopBx.category) {
1717
-            postData.incident.category = this.coopBx.categoryDTO;
1718
-          }
1835
+          // if (this.coopBx.category) {
1836
+          //   postData.incident.category = this.coopBx.categoryDTO;
1837
+          // }
1719 1838
           this.mainService.flowPost("incident/task/request", postData).subscribe((res) => {
1720 1839
             this.btnLoading = false;
1721 1840
             this.cancenlLoading = false;

+ 34 - 4
src/app/views/login/login.component.ts

@@ -294,6 +294,7 @@ export class LoginComponent implements OnInit {
294 294
     let roleMenus = data.user.menu;
295 295
     let canLogin = false; //是否可以进入系统主页面(无护士端,调度台,药房端权限)
296 296
     let successLoginMsg = true; //登录成功提示,true是提示,false不提示
297
+		let sy = false;
297 298
     let fwt = false;
298 299
     let ddt = false;
299 300
 		let bbj = false;
@@ -302,8 +303,13 @@ export class LoginComponent implements OnInit {
302 303
 		let blk = false;
303 304
 		let web = false;
304 305
     let yfang = false;
306
+		let gglb = false;
307
+		let gzgd = false;
305 308
     roleMenus.forEach((e) => {
306
-      if (e.link == "pharmacy") {
309
+			if (e.link == "home") {
310
+			  sy = true;
311
+			  console.log("首页");
312
+			}else if (e.link == "pharmacy") {
307 313
         yfang = true;
308 314
         console.log("药房端");
309 315
       } else if (e.link == "nurse") {
@@ -328,6 +334,12 @@ export class LoginComponent implements OnInit {
328 334
       } else if (e.link == "webRepairs") {
329 335
         web = true;
330 336
         console.log("web报修");
337
+      }else if (e.link == "orderManagement") {
338
+        gglb = true;
339
+        console.log("工单列表");
340
+      }else if (e.link == "incidentManagement") {
341
+        gzgd = true;
342
+        console.log("故障工单");
331 343
       }
332 344
       canLogin = true;
333 345
     });
@@ -445,18 +457,36 @@ export class LoginComponent implements OnInit {
445 457
     }
446 458
     // 有菜单可以进入系统主页面
447 459
     if (!canLogin) {
448
-      this.msg.success("暂无权限进入系统!", {
460
+      this.msg.error("暂无权限进入系统!", {
449 461
         nzDuration: 2000,
450 462
       });
451 463
     } else {
464
+			if(!gglb && !gzgd && !sy){
465
+				this.msg.error("暂无权限进入系统!", {
466
+				  nzDuration: 2000,
467
+				});
468
+				return
469
+			}
452 470
       if (successLoginMsg) {
453 471
         this.msg.success("登录成功!", {
454 472
           nzDuration: 2000,
455 473
         });
456 474
       }
457 475
       successLoginMsg = false;
458
-      localStorage.setItem("user", JSON.stringify(data.user));
459
-      this.router.navigateByUrl("/main/home");
476
+			localStorage.setItem("user", JSON.stringify(data.user));
477
+			if(gglb){
478
+				this.router.navigateByUrl("/main/orderManagement");
479
+				return
480
+			}else if(gzgd){
481
+				this.router.navigateByUrl("/main/incidentManagement");
482
+				return
483
+			}
484
+			if(gglb && gzgd && sy){
485
+				this.router.navigateByUrl("/main/home");
486
+			}
487
+			if(!gglb && !gzgd && sy){
488
+				this.router.navigateByUrl("/main/home");
489
+			}
460 490
     }
461 491
   }
462 492
   // 处理树数据(parent格式转为children格式)

+ 14 - 2
src/app/views/main/main.component.html

@@ -7,7 +7,7 @@
7 7
     </div>
8 8
     <!-- 导航重写,兼容chrome39 -->
9 9
     <ul id="ds-menu">
10
-      <li class="mainMenuOne" (click)="totoMenu('首页')" [ngClass]="{mainMenuSelected:indexFlag}">
10
+      <li class="mainMenuOne" *ngIf="homeRole" (click)="totoMenu('首页')" [ngClass]="{mainMenuSelected:indexFlag}">
11 11
         <i nz-icon nzType="home"></i>
12 12
         <span nzTooltipPlacement="right" nz-tooltip nzTooltipTitle="首页">首页</span>
13 13
       </li>
@@ -199,7 +199,7 @@
199 199
 					<ng-container *ngIf="buildType !== '报修转事件'">
200 200
 						<nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
201 201
 							<ng-container *ngFor="let option of applicationRequesterList">
202
-								<nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
202
+								<nz-option *ngIf="!isLoading" [nzLabel]="option.name + '('+option.account+')'" [nzValue]="option.id"></nz-option>
203 203
 							</ng-container>
204 204
 							<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
205 205
 								<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -304,6 +304,18 @@
304 304
 								</div>
305 305
 
306 306
 								<div class="row">
307
+									<div class="col" *ngIf="cmdbRepair">
308
+										<span class="name">资产:</span>
309
+										<nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzPlaceHolder="请选择资产" (nzOnSearch)="changeAsset($event)" [(ngModel)]="incidentModel.assetId">
310
+											<ng-container *ngFor="let option of assetData">
311
+												<nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
312
+											</ng-container>
313
+											<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
314
+												<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
315
+											</nz-option>
316
+										</nz-select>
317
+									</div>
318
+									
307 319
 									<div class="col">
308 320
 										<span class="name required">故障现象:</span>
309 321
 										<nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('category', $event)" nzPlaceHolder="请选择故障现象" [(ngModel)]="incidentModel.category" (ngModelChange)="changeApplyCategory($event)" (nzOpenChange)="openChangeApplyCategory($event)">

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

@@ -40,7 +40,7 @@ export class MainComponent implements OnInit, OnDestroy {
40 40
   menus: any = JSON.parse(localStorage.getItem("menu"));
41 41
   currentHospital; //当前院区
42 42
   routerEventsListener; //监听路由
43
-
43
+	homeRole: boolean = false; //首页权限
44 44
 	speediness: boolean = false; //新增报修权限
45 45
   deskRole: boolean = false; //调度台权限
46 46
   nurseRole: boolean = false; //护士端权限
@@ -316,6 +316,10 @@ export class MainComponent implements OnInit, OnDestroy {
316 316
     let menus = JSON.parse(localStorage.getItem("menu"));
317 317
     let arr = [];
318 318
     menus.forEach((e) => {
319
+			if (e.link == "home") {
320
+			  this.homeRole = true;
321
+			  console.log("首页权限");
322
+			}
319 323
       if (e.link == "nurse") {
320 324
         this.nurseRole = true;
321 325
         console.log("护士端权限");
@@ -544,7 +548,8 @@ export class MainComponent implements OnInit, OnDestroy {
544 548
 	searchHosDepartmentQtSubject = new Subject();
545 549
 	searchPatientListSubject = new Subject();
546 550
 	inspectSubject = new Subject();
547
-
551
+	changeAssetInpSubject = new Subject();
552
+	
548 553
 	// 运维相关
549 554
 	incidentModel:any = {};
550 555
 	incidentMsg:any = {};
@@ -654,9 +659,9 @@ export class MainComponent implements OnInit, OnDestroy {
654 659
 
655 660
 	// 获取院区配置配置,是否核酸打印
656 661
 	getHospitalConfigList(key) {
657
-	  if(!this.hsmsData.hsmsSwitch){
658
-	    return;
659
-	  }
662
+	  // if(!this.hsmsData.hsmsSwitch){
663
+	  //   return;
664
+	  // }
660 665
 	  let postData = { idx: 0, sum: 1, hospitalConfig: { hosId: this.checkedHos, key } };
661 666
 	  this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe(result=>{
662 667
 	    if(result.status == 200){
@@ -670,9 +675,9 @@ export class MainComponent implements OnInit, OnDestroy {
670 675
 	// 获取配置文件写死的任务类型ID(送病人回病房9),选择此任务类型的话,患者信息从终点科室获取
671 676
 	getConfigTasktypeLoading: boolean = false;
672 677
 	getConfigTasktype() {
673
-	  if(!this.hsmsData.hsmsSwitch){
674
-	    return;
675
-	  }
678
+	  // if(!this.hsmsData.hsmsSwitch){
679
+	  //   return;
680
+	  // }
676 681
 	  let postData = {
677 682
 	    idx: 0,
678 683
 	    sum: 1,
@@ -694,9 +699,9 @@ export class MainComponent implements OnInit, OnDestroy {
694 699
 	// 获取配置文件写死的任务类型ID(转科,给转出院记录用6)
695 700
 	patientLogTasktypeLoading: boolean = false;
696 701
 	patientLogTasktype() {
697
-	  if(!this.hsmsData.hsmsSwitch){
698
-	    return;
699
-	  }
702
+	  // if(!this.hsmsData.hsmsSwitch){
703
+	  //   return;
704
+	  // }
700 705
 	  let postData = {
701 706
 	    idx: 0,
702 707
 	    sum: 1,
@@ -857,9 +862,9 @@ export class MainComponent implements OnInit, OnDestroy {
857 862
 	searchTaskList;
858 863
 	searchTaskLoading = false;
859 864
 	getSearchTaskList(keyword, countRemark = '') {
860
-	  if(!this.hsmsData.hsmsSwitch){
861
-	    return;
862
-	  }
865
+	  // if(!this.hsmsData.hsmsSwitch){
866
+	  //   return;
867
+	  // }
863 868
 	  this.searchTaskLoading = true;
864 869
 	  return this.mainService.getTaskTypeBySearchKey({
865 870
 	    searchKey: keyword || undefined,
@@ -883,9 +888,9 @@ export class MainComponent implements OnInit, OnDestroy {
883 888
 	patientLogList:any;
884 889
 	loading5:boolean = false
885 890
 	getPatientLog(id) {
886
-	  if(!this.hsmsData.hsmsSwitch){
887
-	    return;
888
-	  }
891
+	  // if(!this.hsmsData.hsmsSwitch){
892
+	  //   return;
893
+	  // }
889 894
 	  if (id == -1 || id === null || id === undefined) {
890 895
 	    this.patientLogList = [];
891 896
 	    return;
@@ -911,9 +916,9 @@ export class MainComponent implements OnInit, OnDestroy {
911 916
 	// 服务台新建工单—根据申请科室id来查询未到达工单(科室id)
912 917
 	loading4 = false;
913 918
 	getWorkOrders(id) {
914
-	  if(!this.hsmsData.hsmsSwitch){
915
-	    return;
916
-	  }
919
+	  // if(!this.hsmsData.hsmsSwitch){
920
+	  //   return;
921
+	  // }
917 922
 	  if (id == -1 || id === null || id === undefined) {
918 923
 	    this.noArrives = [];
919 924
 	    return;
@@ -952,10 +957,10 @@ export class MainComponent implements OnInit, OnDestroy {
952 957
 	loading6 = false;
953 958
 	itsmOrders:any[] = [];
954 959
 	getItsmOrders(id) {
955
-	  if(!this.itsmData.mdv2Switch){
956
-	    return;
957
-	  }
958
-	  if (id == -1 || id === null || id === undefined && this.incidentModel.repairIncidentType === 'dept') {
960
+	  // if(!this.itsmData.mdv2Switch){
961
+	  //   return;
962
+	  // }
963
+	  if ((id == -1 || id === null || id === undefined ) && this.incidentModel.repairIncidentType === 'dept') {
959 964
 	    this.itsmOrders = [];
960 965
 	    return;
961 966
 	  }
@@ -1019,9 +1024,9 @@ export class MainComponent implements OnInit, OnDestroy {
1019 1024
 	loading7 = false;
1020 1025
 	knowageList:any[] = [];
1021 1026
 	getKnowageList() {
1022
-	  if(!this.itsmData.mdv2Switch){
1023
-	    return;
1024
-	  }
1027
+	  // if(!this.itsmData.mdv2Switch){
1028
+	  //   return;
1029
+	  // }
1025 1030
 
1026 1031
 	  if(!(this.incidentModel.category && this.solutionStatus && this.solutionType)){
1027 1032
 	    this.loading7 = false;
@@ -1159,7 +1164,10 @@ export class MainComponent implements OnInit, OnDestroy {
1159 1164
 
1160 1165
 	//   this.incidentModel.department = undefined;
1161 1166
 	  this.searchApplicationDepartment('itsm');
1162
-
1167
+		if(this.cmdbRepair){
1168
+			this.incidentModel.assetId = null;
1169
+			this.getAssetData()
1170
+		}
1163 1171
 	  if(this.buildType !== '报修转事件'){
1164 1172
 	    this.incidentModel.requester = undefined;
1165 1173
 	    this.searchApplicationRequester();
@@ -1260,6 +1268,10 @@ export class MainComponent implements OnInit, OnDestroy {
1260 1268
 	  }
1261 1269
 		if(this.incidentModel.repairIncidentType === 'public'){
1262 1270
 			this.getItsmOrders('')
1271
+			if(this.cmdbRepair){
1272
+				this.incidentModel.assetId = null;
1273
+				this.getAssetData()
1274
+			}
1263 1275
 		}
1264 1276
 	}
1265 1277
 	// 故障现象列表
@@ -1401,6 +1413,7 @@ export class MainComponent implements OnInit, OnDestroy {
1401 1413
 	      "callID": this.incidentModel.callID || undefined,
1402 1414
 	      "incomingPhone": this.incidentModel.incomingPhone || undefined,
1403 1415
 	      "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
1416
+				"assetId": this.incidentModel.assetId || undefined
1404 1417
 	    },
1405 1418
 	  };
1406 1419
 
@@ -1750,9 +1763,9 @@ export class MainComponent implements OnInit, OnDestroy {
1750 1763
 	applicationDeptList:any[] = [];
1751 1764
 	applyStartDept:any;
1752 1765
 	searchApplicationDepartment(type, e?, phone?, deptId?, isInit?) {
1753
-	  if(!this.hsmsData.hsmsSwitch && !this.itsmData.mdv2Switch){
1754
-	    return;
1755
-	  }
1766
+	  // if(!this.hsmsData.hsmsSwitch && !this.itsmData.mdv2Switch){
1767
+	  //   return;
1768
+	  // }
1756 1769
 	  let keyWord = "";
1757 1770
 	  if (e && e !== "&ks&" && e !== "&go&") {
1758 1771
 	    keyWord = e;
@@ -1869,6 +1882,10 @@ export class MainComponent implements OnInit, OnDestroy {
1869 1882
 	// 配送-选择科室
1870 1883
 	changeApply(e) {
1871 1884
 	  console.log(e, this.applicationDepartmentList);
1885
+		if(this.cmdbRepair){
1886
+			this.incidentModel.assetId = null;
1887
+			this.getAssetData()
1888
+		}
1872 1889
 	  this.changeApplicationDepartment("&same&");
1873 1890
 	  if(this.applyDept && this.currentTabIndex !== '故障报修'){
1874 1891
 	    this.rightTitle_tab = [
@@ -2207,6 +2224,7 @@ export class MainComponent implements OnInit, OnDestroy {
2207 2224
 	      "candidateGroups": this.incidentModel.group || undefined,
2208 2225
 	      "assignee": this.incidentModel.user || undefined,
2209 2226
 	      "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
2227
+				"assetId": this.incidentModel.assetId || undefined
2210 2228
 	    }
2211 2229
 	  };
2212 2230
 	  if(this.buildType){
@@ -2496,53 +2514,14 @@ export class MainComponent implements OnInit, OnDestroy {
2496 2514
 	getAutoWorkTypes(isFirst, isInit) {
2497 2515
 	  this.workTypesArrange = [];
2498 2516
 	  // 运维
2499
-	  if(this.itsmData.mdv2Switch){
2517
+	  // if(this.itsmData.mdv2Switch){
2500 2518
 	    this.workTypesArrange = [{key:'故障报修', value: []}];
2501
-	    if(!this.hsmsData.hsmsSwitch){
2502
-	      console.log('workTypesArrange', this.workTypesArrange);
2503
-	      // 是否显示操作项
2504
-	      this.workTypesFlag = this.workTypesArrange.length >= 5;
2505
-	    }
2506
-	  }
2507
-	  // 配送
2508
-	  if(this.hsmsData.hsmsSwitch){
2509
-	    this.newLoading = true;
2510
-	    this.mainService.getTaskTypeBySearchKey({
2511
-	      hosId: this.checkedHos,
2512
-	    }).subscribe((data) => {
2513
-	      this.newLoading = false;
2514
-	      if (data["status"] == 200) {
2515
-	        this.workTypes = data["data"];
2516
-	        // 整理后的任务类型
2517
-	        this.isShowResidenceNo = false;
2518
-	        this.workTypes.forEach((item) => {
2519
-	          if(item.associationTypeValue === 'patientTransport' || item.associationTypeValue === 'inspect'){
2520
-	            // 患者其他服务
2521
-	            let obj = this.workTypesArrange.find(v => v.key === '患者转运');
2522
-	            if(obj){
2523
-	              obj.value.push(item);
2524
-	            }else{
2525
-	              this.workTypesArrange.unshift({ key: '患者转运', value: [item] });
2526
-	              this.isShowResidenceNo = true;
2527
-	            }
2528
-	          }else if(item.associationTypeValue === 'other' || item.associationTypeValue === 'specimen' || item.associationTypeValue === 'ordinary'){
2529
-	            // 物品配送
2530
-	            let obj = this.workTypesArrange.find(v => v.key === '物品配送');
2531
-	            if(obj){
2532
-	              obj.value.push(item);
2533
-	            }else{
2534
-	              this.workTypesArrange.unshift({ key: '物品配送', value: [item] });
2535
-	            }
2536
-	          }
2537
-	        });
2538
-	        console.log('workTypesArrange', this.workTypesArrange);
2539
-	        // 任务类型是否显示操作项
2540
-	        let arr = this.workTypesArrange;
2541
-	        this.workTypesFlag = arr.length >= 5;
2542
-	      }
2543
-	    });
2544
-	    this.getTaskTypeCountRemarkList();
2545
-	  }
2519
+	    // if(!this.hsmsData.hsmsSwitch){
2520
+	    //   console.log('workTypesArrange', this.workTypesArrange);
2521
+	    //   // 是否显示操作项
2522
+	    //   this.workTypesFlag = this.workTypesArrange.length >= 5;
2523
+	    // }
2524
+	  // }
2546 2525
 	}
2547 2526
 	// 查类型
2548 2527
 	getTaskTypeCountRemarkList(){
@@ -3701,12 +3680,12 @@ export class MainComponent implements OnInit, OnDestroy {
3701 3680
 
3702 3681
 	// 运维、配送工单切换
3703 3682
 	filterOrderList(type, state){
3704
-	  if(!this.itsmData.mdv2Switch && this.hsmsData.hsmsSwitch){
3705
-	    return;
3706
-	  }
3707
-	  if(this.itsmData.mdv2Switch && !this.hsmsData.hsmsSwitch){
3708
-	    return;
3709
-	  }
3683
+	  // if(!this.itsmData.mdv2Switch && this.hsmsData.hsmsSwitch){
3684
+	  //   return;
3685
+	  // }
3686
+	  // if(this.itsmData.mdv2Switch && !this.hsmsData.hsmsSwitch){
3687
+	  //   return;
3688
+	  // }
3710 3689
 	  this.flagList[`${type}Flag${state}`] = !this.flagList[`${type}Flag${state}`];
3711 3690
 	  // this.getOrderList(state, state === 1);
3712 3691
 	}
@@ -3907,6 +3886,11 @@ export class MainComponent implements OnInit, OnDestroy {
3907 3886
 		    this.getPatientByResidenceNo(v[1]);
3908 3887
 		  }
3909 3888
 		});
3889
+		
3890
+		this.changeAssetInpSubject.pipe(debounceTime(500)).subscribe((v) => {
3891
+		  this.getAssetData(v);
3892
+		});
3893
+		
3910 3894
 		this.onSearchTaskBuildSubject.pipe(debounceTime(500)).subscribe((v) => {
3911 3895
 		  this.getTasktypeByPhone(v);
3912 3896
 		});
@@ -3937,6 +3921,7 @@ export class MainComponent implements OnInit, OnDestroy {
3937 3921
 	applicantMustFillIn:any; //申请人是否必填 1是,0否
3938 3922
 	deptRepair:boolean = false; //科内报修
3939 3923
 	publicRepair:boolean = false; ; //公共报修
3924
+	cmdbRepair:boolean = false; ; //是否支持资产报修
3940 3925
 	getSysConfig() {
3941 3926
 		const postData = { idx: 0, sum: 99 };
3942 3927
 		this.mainService
@@ -3970,6 +3955,13 @@ export class MainComponent implements OnInit, OnDestroy {
3970 3955
 								case "applicantMustFillIn":
3971 3956
 									this.applicantMustFillIn = c[1]
3972 3957
 									break;
3958
+								case "cmdbRepair":
3959
+									if(c[1]=='1'){
3960
+										this.cmdbRepair = true
3961
+									}else{
3962
+										this.cmdbRepair = false
3963
+									}
3964
+									break;	
3973 3965
 							}
3974 3966
 						});
3975 3967
 						if(this.eventData){
@@ -3991,11 +3983,43 @@ export class MainComponent implements OnInit, OnDestroy {
3991 3983
 							}
3992 3984
 							this.searchApplicationBuilding()
3993 3985
 						}
3986
+						
3987
+						if(this.cmdbRepair && this.hospitalModel==1){
3988
+							this.getAssetData()
3989
+						}
3994 3990
 					}
3995 3991
 				}
3996 3992
 			});
3997 3993
 	 }
3998
-
3994
+	
3995
+	changeAsset(e){
3996
+		this.changeAssetInpSubject.next(e);
3997
+	}
3998
+	
3999
+  // 获取资产列表
4000
+	assetData:any = [];
4001
+	getAssetData(name?){
4002
+		// if(!this.incidentModel.hosId){
4003
+		// 	return
4004
+		// }
4005
+		let data = {
4006
+		  idx: 0,
4007
+		  sum: 20,
4008
+		  asset: {
4009
+		    downHosId: this.hospitalModel!=1 ? this.incidentModel.hosId : this.currentHospital.id,
4010
+		    name: name
4011
+		  },
4012
+		};
4013
+		
4014
+		this.mainService
4015
+		  .getFetchDataList("simple/data", "asset", data)
4016
+		  .subscribe((data) => {
4017
+		    if (data.status == 200) {
4018
+		      this.assetData = data.list;
4019
+		    }
4020
+		  });
4021
+	}
4022
+	
3999 4023
 	// 新增报修
4000 4024
 	speedinessAdd(): void {
4001 4025
 		this.addOrder();