Browse Source

BUG修复

seimin 3 years ago
parent
commit
d157845f06

+ 13 - 9
src/app/views/office-management/office-management.component.ts

@@ -512,17 +512,21 @@ export class OfficeManagementComponent implements OnInit {
512
       .subscribe((data) => {
512
       .subscribe((data) => {
513
         that.btnLoading = false;
513
         that.btnLoading = false;
514
         that.delModal = false;
514
         that.delModal = false;
515
-        if (data.status == 200 && !data.data[0].msg) {
516
-          if (
517
-            that.listOfData.length == 1 &&
518
-            that.pageIndex == Math.ceil(that.listLength / that.pageSize)
519
-          ) {
520
-            that.listLength--;
521
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
515
+        if (data.data && data.data[0]) {
516
+          if (!data.data[0].msg) {
517
+            if (
518
+              that.listOfData.length == 1 &&
519
+              that.pageIndex == Math.ceil(that.listLength / that.pageSize)
520
+            ) {
521
+              that.listLength--;
522
+              that.pageIndex = Math.ceil(that.listLength / that.pageSize);
523
+            }
524
+            that.showPromptModal("删除", true, "");
525
+          } else {
526
+            that.showPromptModal("删除", false, data.data[0].msg);
522
           }
527
           }
523
-          that.showPromptModal("删除", true, "");
524
         } else {
528
         } else {
525
-          that.showPromptModal("删除", false, data.data[0].msg);
529
+          that.showPromptModal("删除", false, "");
526
         }
530
         }
527
       });
531
       });
528
   }
532
   }

+ 9 - 5
src/app/views/task-type-management/task-type-management.component.ts

@@ -1096,12 +1096,16 @@ export class TaskTypeManagementComponent implements OnInit {
1096
         .subscribe((data) => {
1096
         .subscribe((data) => {
1097
           this.btnLoading = false;
1097
           this.btnLoading = false;
1098
           this.delModal = false;
1098
           this.delModal = false;
1099
-          if (data.status == 200 && !data.data[0].msg) {
1100
-            this.showPromptModal("删除", true, "");
1101
-            this.getAllTaskType();
1102
-            this.itemChoice(this.allTaskType[0], this.index);
1099
+          if (data.data && data.data[0]) {
1100
+            if (!data.data[0].msg) {
1101
+              this.showPromptModal("删除", true, "");
1102
+              this.getAllTaskType();
1103
+              this.itemChoice(this.allTaskType[0], this.index);
1104
+            } else {
1105
+              this.showPromptModal("删除", false, data.data[0].msg);
1106
+            }
1103
           } else {
1107
           } else {
1104
-            this.showPromptModal("删除", false, data.data[0].msg);
1108
+            this.showPromptModal("删除", false, "");
1105
           }
1109
           }
1106
         });
1110
         });
1107
     } else {
1111
     } else {