|
@@ -45,8 +45,11 @@ export class OrderScopeComponent implements OnInit {
|
45
|
45
|
activeScopeTab:any;
|
46
|
46
|
//#region 工单范围-运维start
|
47
|
47
|
allDuty:number = 1;
|
|
48
|
+ menuList:any;
|
48
|
49
|
|
49
|
50
|
ngOnInit() {
|
|
51
|
+ let menuItem = JSON.parse(localStorage.getItem("menuItem"))
|
|
52
|
+ this.menuList = menuItem.find(i=>i.link=='gongdanfanwei')
|
50
|
53
|
this.initItsm();
|
51
|
54
|
}
|
52
|
55
|
|
|
@@ -63,12 +66,17 @@ export class OrderScopeComponent implements OnInit {
|
63
|
66
|
}
|
64
|
67
|
|
65
|
68
|
initItsm(){
|
66
|
|
- if(this.coopBtns.maintenance){
|
67
|
|
- this.scopeTabs.push({ name: '运维', value: 1, checked: false })
|
68
|
|
- }
|
69
|
|
- if(this.coopBtns.distributionPj){
|
70
|
|
- this.scopeTabs.push({ name: '配送陪检', value: 2, checked: false })
|
|
69
|
+ if(this.menuList && this.menuList.childrens){
|
|
70
|
+ for(let i of this.menuList.childrens){
|
|
71
|
+ if(i.link=='maintenance'){
|
|
72
|
+ this.scopeTabs.push({ name: '运维', value: 1, checked: false })
|
|
73
|
+ }
|
|
74
|
+ if(i.link=='distributionPj'){
|
|
75
|
+ this.scopeTabs.push({ name: '配送陪检', value: 2, checked: false })
|
|
76
|
+ }
|
|
77
|
+ }
|
71
|
78
|
}
|
|
79
|
+
|
72
|
80
|
if(this.scopeTabs.length>0){
|
73
|
81
|
this.activeScopeTab = this.scopeTabs[0]
|
74
|
82
|
}
|
|
@@ -302,17 +310,21 @@ export class OrderScopeComponent implements OnInit {
|
302
|
310
|
saveOrderScope() {
|
303
|
311
|
// 配送的院区必填
|
304
|
312
|
let value2 = this.scopeTabs.find(v => v.value == 2 );
|
305
|
|
- if(value2.checked && !this.checkedHos){
|
306
|
|
- this.message.warning('【配送】的院区必填!')
|
307
|
|
- return;
|
308
|
|
- }
|
|
313
|
+ if(value2){
|
|
314
|
+ if(value2.checked && !this.checkedHos){
|
|
315
|
+ this.message.warning('【配送】的院区必填!')
|
|
316
|
+ return;
|
|
317
|
+ }
|
|
318
|
+ }
|
309
|
319
|
|
310
|
320
|
// 运维限制部门的时候,部门必填
|
311
|
321
|
let value1 = this.scopeTabs.find(v => v.value == 1 );
|
312
|
|
- if(value1.checked && !this.itsmCheckedHos.filter(v => v.checked).length && this.allDuty != 1){
|
313
|
|
- this.message.warning('【运维】的部门必填!')
|
314
|
|
- return;
|
315
|
|
- }
|
|
322
|
+ if(value1){
|
|
323
|
+ if(value1.checked && !this.itsmCheckedHos.filter(v => v.checked).length && this.allDuty != 1){
|
|
324
|
+ this.message.warning('【运维】的部门必填!')
|
|
325
|
+ return;
|
|
326
|
+ }
|
|
327
|
+ }
|
316
|
328
|
|
317
|
329
|
this.saveLoading = true;
|
318
|
330
|
let types = [];
|
|
@@ -362,20 +374,20 @@ export class OrderScopeComponent implements OnInit {
|
362
|
374
|
let postData:any = {
|
363
|
375
|
workerOrderScope: {
|
364
|
376
|
userId: this.user.user.id,
|
365
|
|
- mdv2Switch: Number(itsm.checked),
|
366
|
|
- hsmsSwitch: Number(hsms.checked),
|
|
377
|
+ mdv2Switch: itsm?Number(itsm.checked):null,
|
|
378
|
+ hsmsSwitch: hsms?Number(hsms.checked):null,
|
367
|
379
|
range: 0,
|
368
|
380
|
dutyRange: 0,
|
369
|
381
|
},
|
370
|
382
|
};
|
371
|
383
|
|
372
|
|
- if(itsm.checked){
|
|
384
|
+ if(itsm && itsm.checked){
|
373
|
385
|
postData.workerOrderScope.allDuty = this.allDuty;
|
374
|
386
|
postData.workerOrderScope.dutyIds = this.itsmCheckedHos.filter(v => v.checked).map(v => v.value).toString() || undefined;
|
375
|
387
|
postData.workerOrderScope.dutyGroupIds = this.itsmCheckedGroup.filter(v => v.checked).map(v => v.value).toString() || undefined;
|
376
|
388
|
postData.workerOrderScope.dutyRange = this.itsmOrderScopeRadio - 0;
|
377
|
389
|
}
|
378
|
|
- if(hsms.checked){
|
|
390
|
+ if(hsms && hsms.checked){
|
379
|
391
|
postData.workerOrderScope.hospitalId = this.checkedHos ? { id: this.checkedHos - 0 } : undefined;
|
380
|
392
|
postData.workerOrderScope.typeIds = typesId || undefined;
|
381
|
393
|
postData.workerOrderScope.groupIds = groupsId || undefined;
|