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
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
6
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7
 import { ToolService } from "../../services/tool.service";
7
 import { ToolService } from "../../services/tool.service";
8
 import { GenerateFloorComponent } from "src/app/share/generate-floor/generate-floor.component";
8
 import { GenerateFloorComponent } from "src/app/share/generate-floor/generate-floor.component";
9
+import { NzMessageService } from "ng-zorro-antd";
9
 
10
 
10
 @Component({
11
 @Component({
11
   selector: "app-building-floor",
12
   selector: "app-building-floor",
@@ -46,6 +47,7 @@ export class BuildingFloorComponent implements OnInit {
46
     private fb: FormBuilder,
47
     private fb: FormBuilder,
47
     private route: ActivatedRoute,
48
     private route: ActivatedRoute,
48
     private mainService: MainService,
49
     private mainService: MainService,
50
+    private msg: NzMessageService,
49
     private tool: ToolService
51
     private tool: ToolService
50
   ) {}
52
   ) {}
51
 
53
 
@@ -144,6 +146,10 @@ export class BuildingFloorComponent implements OnInit {
144
 
146
 
145
   // 新增/编辑楼栋模态框
147
   // 新增/编辑楼栋模态框
146
   showCoopModal(type) {
148
   showCoopModal(type) {
149
+    if (type == "edit" && !this.checkedBuilding.id) {
150
+      this.msg.create("warning", "请选择需要编辑的楼栋!");
151
+      return;
152
+    }
147
     this.coopModal = true;
153
     this.coopModal = true;
148
     this.add = type == "add";
154
     this.add = type == "add";
149
     if (type == "edit") {
155
     if (type == "edit") {
@@ -313,6 +319,10 @@ export class BuildingFloorComponent implements OnInit {
313
 
319
 
314
   //删除楼栋
320
   //删除楼栋
315
   showDelModal() {
321
   showDelModal() {
322
+    if (!this.checkedBuilding.id) {
323
+      this.msg.create("warning", "请选择需要删除的楼栋!");
324
+      return;
325
+    }
316
     this.delModal = true;
326
     this.delModal = true;
317
   }
327
   }
318
   hideDelModal() {
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
 import { ToolService } from "../../services/tool.service";
6
 import { ToolService } from "../../services/tool.service";
7
 import { Subject } from "rxjs";
7
 import { Subject } from "rxjs";
8
 import { debounceTime } from "rxjs/operators";
8
 import { debounceTime } from "rxjs/operators";
9
+import { NzMessageService } from "ng-zorro-antd";
9
 export interface Data {
10
 export interface Data {
10
   id: number;
11
   id: number;
11
   name: string;
12
   name: string;
@@ -22,7 +23,7 @@ export class TaskTypeManagementComponent implements OnInit {
22
   constructor(
23
   constructor(
23
     private mainService: MainService,
24
     private mainService: MainService,
24
     private route: ActivatedRoute,
25
     private route: ActivatedRoute,
25
-    private router: Router,
26
+    private msg: NzMessageService,
26
     private fb: FormBuilder,
27
     private fb: FormBuilder,
27
     private tool: ToolService
28
     private tool: ToolService
28
   ) {
29
   ) {
@@ -2229,8 +2230,11 @@ export class TaskTypeManagementComponent implements OnInit {
2229
 
2230
 
2230
   delModal: boolean = false; //删除模态框
2231
   delModal: boolean = false; //删除模态框
2231
   showConfimModal() {
2232
   showConfimModal() {
2233
+    if (!this.allTaskType.length) {
2234
+      this.msg.create("warning", "请选择需要删除的任务类型!");
2235
+      return;
2236
+    }
2232
     this.delModal = true;
2237
     this.delModal = true;
2233
-    // this.coopId = id;
2234
   }
2238
   }
2235
   hideDelModal() {
2239
   hideDelModal() {
2236
     this.delModal = false;
2240
     this.delModal = false;