Browse Source

代码优化

seimin 9 months ago
parent
commit
8fa29317ac

+ 3 - 7
src/app/components/incidentManagement/incident-handle-info-simple/incident-handle-info-simple.component.ts

@@ -58,11 +58,7 @@ export class IncidentHandleInfoSimpleComponent implements OnInit, OnChanges {
58
     console.log('初始化')
58
     console.log('初始化')
59
     this.hosId = this.tool.getCurrentHospital().id;
59
     this.hosId = this.tool.getCurrentHospital().id;
60
     this.incidentDataCopy = cloneDeep(this.incidentData);
60
     this.incidentDataCopy = cloneDeep(this.incidentData);
61
-    if(Array.isArray(this.incidentDataCopy.synergetic)){
62
-      this.incidentDataCopy.synergetic = this.incidentDataCopy.synergetic.map(v => v.id);
63
-    }else{
64
-      this.incidentDataCopy.synergetic = [];
65
-    }
61
+    this.incidentDataCopy.synergetic = [];
66
     this.getHandleCategorys();
62
     this.getHandleCategorys();
67
     this.getSynergeticList();
63
     this.getSynergeticList();
68
     this.getAssetProductList();
64
     this.getAssetProductList();
@@ -82,11 +78,11 @@ export class IncidentHandleInfoSimpleComponent implements OnInit, OnChanges {
82
   // 获取处理方式列表
78
   // 获取处理方式列表
83
   handleCategoryList:any[] = [];
79
   handleCategoryList:any[] = [];
84
   getHandleCategorys(){
80
   getHandleCategorys(){
85
-    this.mainService.getDictionary("list", "incident_handleCategory").subscribe((data) => {
81
+    this.mainService.getDictionary("list", "incident_handle_type").subscribe((data) => {
86
       this.handleCategoryList = data || [];
82
       this.handleCategoryList = data || [];
87
       console.log(this.incidentDataCopy)
83
       console.log(this.incidentDataCopy)
88
       if(!this.incidentDataCopy.handleCategory){
84
       if(!this.incidentDataCopy.handleCategory){
89
-        let handleCategory = this.handleCategoryList.find(v => v.value == 'SUPPORT');
85
+        let handleCategory = this.handleCategoryList.find(v => v.value == '1');
90
         this.incidentDataCopy.handleCategory = handleCategory ? handleCategory.id : undefined;
86
         this.incidentDataCopy.handleCategory = handleCategory ? handleCategory.id : undefined;
91
       }
87
       }
92
     });
88
     });

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

@@ -66,11 +66,7 @@ export class IncidentHandleInfoComponent implements OnInit, OnChanges {
66
     this.hosId = this.tool.getCurrentHospital().id;
66
     this.hosId = this.tool.getCurrentHospital().id;
67
     console.log('this.incidentData:', this.incidentData)
67
     console.log('this.incidentData:', this.incidentData)
68
     this.incidentDataCopy = cloneDeep(this.incidentData);
68
     this.incidentDataCopy = cloneDeep(this.incidentData);
69
-    if(Array.isArray(this.incidentDataCopy.synergetic)){
70
-      this.incidentDataCopy.synergetic = this.incidentDataCopy.synergetic.map(v => v.id);
71
-    }else{
72
-      this.incidentDataCopy.synergetic = [];
73
-    }
69
+    this.incidentDataCopy.synergetic = [];
74
     if(this.incidentDataCopy.category){
70
     if(this.incidentDataCopy.category){
75
       this.incidentDataCopy.category = this.incidentDataCopy.category.id;
71
       this.incidentDataCopy.category = this.incidentDataCopy.category.id;
76
     }
72
     }