浏览代码

Merge branch 'master' into lmm

seimin 3 年之前
父节点
当前提交
26519e2c57

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

@@ -512,17 +512,21 @@ export class OfficeManagementComponent implements OnInit {
512 512
       .subscribe((data) => {
513 513
         that.btnLoading = false;
514 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 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 1096
         .subscribe((data) => {
1097 1097
           this.btnLoading = false;
1098 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 1107
           } else {
1104
-            this.showPromptModal("删除", false, data.data[0].msg);
1108
+            this.showPromptModal("删除", false, "");
1105 1109
           }
1106 1110
         });
1107 1111
     } else {