seimin 3 年之前
父節點
當前提交
93ee76572b

+ 10 - 0
src/app/views/building-floor/building-floor.component.ts

@@ -6,6 +6,7 @@ import { MainService } from "../../services/main.service";
6 6
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7 7
 import { ToolService } from "../../services/tool.service";
8 8
 import { GenerateFloorComponent } from "src/app/share/generate-floor/generate-floor.component";
9
+import { NzMessageService } from "ng-zorro-antd";
9 10
 
10 11
 @Component({
11 12
   selector: "app-building-floor",
@@ -46,6 +47,7 @@ export class BuildingFloorComponent implements OnInit {
46 47
     private fb: FormBuilder,
47 48
     private route: ActivatedRoute,
48 49
     private mainService: MainService,
50
+    private msg: NzMessageService,
49 51
     private tool: ToolService
50 52
   ) {}
51 53
 
@@ -144,6 +146,10 @@ export class BuildingFloorComponent implements OnInit {
144 146
 
145 147
   // 新增/编辑楼栋模态框
146 148
   showCoopModal(type) {
149
+    if (type == "edit" && !this.checkedBuilding.id) {
150
+      this.msg.create("warning", "请选择需要编辑的楼栋!");
151
+      return;
152
+    }
147 153
     this.coopModal = true;
148 154
     this.add = type == "add";
149 155
     if (type == "edit") {
@@ -313,6 +319,10 @@ export class BuildingFloorComponent implements OnInit {
313 319
 
314 320
   //删除楼栋
315 321
   showDelModal() {
322
+    if (!this.checkedBuilding.id) {
323
+      this.msg.create("warning", "请选择需要删除的楼栋!");
324
+      return;
325
+    }
316 326
     this.delModal = true;
317 327
   }
318 328
   hideDelModal() {

+ 6 - 2
src/app/views/task-type-management/task-type-management.component.ts

@@ -6,6 +6,7 @@ import { FormBuilder, FormGroup } from "@angular/forms";
6 6
 import { ToolService } from "../../services/tool.service";
7 7
 import { Subject } from "rxjs";
8 8
 import { debounceTime } from "rxjs/operators";
9
+import { NzMessageService } from "ng-zorro-antd";
9 10
 export interface Data {
10 11
   id: number;
11 12
   name: string;
@@ -22,7 +23,7 @@ export class TaskTypeManagementComponent implements OnInit {
22 23
   constructor(
23 24
     private mainService: MainService,
24 25
     private route: ActivatedRoute,
25
-    private router: Router,
26
+    private msg: NzMessageService,
26 27
     private fb: FormBuilder,
27 28
     private tool: ToolService
28 29
   ) {
@@ -2229,8 +2230,11 @@ export class TaskTypeManagementComponent implements OnInit {
2229 2230
 
2230 2231
   delModal: boolean = false; //删除模态框
2231 2232
   showConfimModal() {
2233
+    if (!this.allTaskType.length) {
2234
+      this.msg.create("warning", "请选择需要删除的任务类型!");
2235
+      return;
2236
+    }
2232 2237
     this.delModal = true;
2233
-    // this.coopId = id;
2234 2238
   }
2235 2239
   hideDelModal() {
2236 2240
     this.delModal = false;