|
@@ -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;
|