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 58
     console.log('初始化')
59 59
     this.hosId = this.tool.getCurrentHospital().id;
60 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 62
     this.getHandleCategorys();
67 63
     this.getSynergeticList();
68 64
     this.getAssetProductList();
@@ -82,11 +78,11 @@ export class IncidentHandleInfoSimpleComponent implements OnInit, OnChanges {
82 78
   // 获取处理方式列表
83 79
   handleCategoryList:any[] = [];
84 80
   getHandleCategorys(){
85
-    this.mainService.getDictionary("list", "incident_handleCategory").subscribe((data) => {
81
+    this.mainService.getDictionary("list", "incident_handle_type").subscribe((data) => {
86 82
       this.handleCategoryList = data || [];
87 83
       console.log(this.incidentDataCopy)
88 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 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 66
     this.hosId = this.tool.getCurrentHospital().id;
67 67
     console.log('this.incidentData:', this.incidentData)
68 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 70
     if(this.incidentDataCopy.category){
75 71
       this.incidentDataCopy.category = this.incidentDataCopy.category.id;
76 72
     }