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