seimin 3 years ago
parent
commit
f8264994ba

+ 6 - 4
src/app/share/allocation-worker/allocation-worker.component.html

@@ -4,12 +4,13 @@
4
     <div nz-row class="select">
4
     <div nz-row class="select">
5
       <div nz-col nzSpan="6">
5
       <div nz-col nzSpan="6">
6
         <div class="label">人员姓名:</div>
6
         <div class="label">人员姓名:</div>
7
-        <input nz-input placeholder="请输入人员姓名" [(ngModel)]="searchName" nzSize="default" (ngModelChange)="searchInp()" />
7
+        <input [disabled]="nameMask" nz-input placeholder="请输入人员姓名" [(ngModel)]="searchName" nzSize="default"
8
+          (ngModelChange)="searchInp('worker')" />
8
       </div>
9
       </div>
9
       <div nz-col nzSpan="6" class="ml8">
10
       <div nz-col nzSpan="6" class="ml8">
10
         <div class="label">人员分组:</div>
11
         <div class="label">人员分组:</div>
11
-        <nz-select style="width: 220px;" [nzDropdownMatchSelectWidth]="false" [(ngModel)]="checkedGroup"
12
-          (ngModelChange)="searchInp()" nzPlaceHolder="请选择人员分组">
12
+        <nz-select nzAllowClear [nzDisabled]="groupMask" style="width: 220px;" [nzDropdownMatchSelectWidth]="false"
13
+          [(ngModel)]="checkedGroup" (ngModelChange)="searchInp('group')" nzPlaceHolder="请选择人员分组">
13
           <nz-option *ngFor="let optionData of groupList" [nzLabel]="optionData.groupName" [nzValue]="optionData.id">
14
           <nz-option *ngFor="let optionData of groupList" [nzLabel]="optionData.groupName" [nzValue]="optionData.id">
14
           </nz-option>
15
           </nz-option>
15
         </nz-select>
16
         </nz-select>
@@ -46,7 +47,8 @@
46
     </div>
47
     </div>
47
   </div>
48
   </div>
48
   <div class="btns display_flex justify-content_flex-center">
49
   <div class="btns display_flex justify-content_flex-center">
49
-    <button nz-button nzType="primary" [nzLoading]="btnLoading" (click)="submit()" *ngIf="mapOfCheckedId[worderId]">确认</button>
50
+    <button nz-button nzType="primary" [nzLoading]="btnLoading" (click)="submit()"
51
+      *ngIf="mapOfCheckedId[worderId]">确认</button>
50
     <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
52
     <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
51
   </div>
53
   </div>
52
 </div>
54
 </div>

+ 34 - 32
src/app/share/allocation-worker/allocation-worker.component.ts

@@ -17,8 +17,10 @@ export class AllocationWorkerComponent implements OnInit {
17
   ) {}
17
   ) {}
18
 
18
 
19
   ngOnInit() {
19
   ngOnInit() {
20
+    this.groupList = JSON.parse(
21
+      localStorage.getItem("user")
22
+    ).user.scope.groupIds;
20
     this.getWorkerList();
23
     this.getWorkerList();
21
-    // this.getGroupList();
22
   }
24
   }
23
   // 支助人员数据
25
   // 支助人员数据
24
   workerList = [];
26
   workerList = [];
@@ -42,13 +44,13 @@ export class AllocationWorkerComponent implements OnInit {
42
 
44
 
43
   // 支助人员数据
45
   // 支助人员数据
44
   groupList: Array<{ groupName: string; id: string }> = []; //分组下拉框
46
   groupList: Array<{ groupName: string; id: string }> = []; //分组下拉框
45
-  groupIds;
46
   snum = 0;
47
   snum = 0;
47
   loading1 = false;
48
   loading1 = false;
49
+  nameMask = false; //是否禁用
50
+  groupMask = false; //是否禁用
48
   getWorkerList(pageIndex?) {
51
   getWorkerList(pageIndex?) {
49
-    let that = this;
50
-    that.id = that.route.snapshot.paramMap.get("id");
51
-    that.stateId = that.route.snapshot.paramMap.get("stateId");
52
+    this.id = this.route.snapshot.paramMap.get("id");
53
+    this.stateId = this.route.snapshot.paramMap.get("stateId");
52
     this.pageIndex = pageIndex ? pageIndex : this.pageIndex;
54
     this.pageIndex = pageIndex ? pageIndex : this.pageIndex;
53
 
55
 
54
     let groupsId = [];
56
     let groupsId = [];
@@ -58,18 +60,25 @@ export class AllocationWorkerComponent implements OnInit {
58
       }
60
       }
59
     );
61
     );
60
 
62
 
61
-    let postData = {
63
+    let postData: any = {
62
       idx: this.pageIndex - 1,
64
       idx: this.pageIndex - 1,
63
-      sum: that.pageSize,
64
-      // workOrderId: that.id,
65
-      groupId: that.checkedGroup ? that.checkedGroup : "",
66
-      groupIds: that.groupIds ? that.groupIds : "",
67
-      name: that.searchName,
65
+      sum: this.pageSize,
66
+      groupIds: "",
68
       hosId: this.route.snapshot.paramMap.get("hosId"),
67
       hosId: this.route.snapshot.paramMap.get("hosId"),
69
     };
68
     };
69
+    if (this.searchName) {
70
+      postData.name = this.searchName;
71
+    } else {
72
+      delete postData.name;
73
+    }
74
+    if (this.checkedGroup) {
75
+      postData.groupId = this.checkedGroup;
76
+    } else {
77
+      delete postData.groupId;
78
+    }
70
     this.snum++;
79
     this.snum++;
71
     this.loading1 = true;
80
     this.loading1 = true;
72
-    that.mainService
81
+    this.mainService
73
       .getSerInfo("getOnlineWorker", postData)
82
       .getSerInfo("getOnlineWorker", postData)
74
       .subscribe((data) => {
83
       .subscribe((data) => {
75
         this.snum--;
84
         this.snum--;
@@ -77,36 +86,29 @@ export class AllocationWorkerComponent implements OnInit {
77
           this.loading1 = false;
86
           this.loading1 = false;
78
         }
87
         }
79
         console.log(data);
88
         console.log(data);
80
-        that.workerList = data.data;
81
-        that.listLength = data.totalNum;
82
-        if (data.groupIds) {
83
-          // 获取分组
84
-          that.groupIds = data.groupIds;
85
-          that.mainService
86
-            .coopData("group", "findGroup", { groupIds: data.groupIds })
87
-            .subscribe((res) => {
88
-              that.groupList = res.data;
89
-            });
90
-        } else {
91
-          that.groupList = [];
92
-        }
89
+        this.workerList = data.data;
90
+        this.listLength = data.totalNum;
93
       });
91
       });
94
   }
92
   }
95
 
93
 
96
   // 输入用户信息搜索节流阀
94
   // 输入用户信息搜索节流阀
97
   time: any;
95
   time: any;
98
-  searchInp() {
99
-    let that = this;
100
-    // clearTimeout(that.time);
101
-    // that.time = setTimeout(() => {
102
-    that.getWorkerList(1);
103
-    // }, 2000);
96
+  searchInp(type) {
97
+    this.getWorkerList(1);
98
+    console.log(type);
99
+    if (type == "worker") {
100
+      this.groupMask = Boolean(this.searchName);
101
+    } else if (type == "group") {
102
+      this.nameMask = Boolean(this.checkedGroup);
103
+    }
104
   }
104
   }
105
 
105
 
106
   // 选择分配支助人员
106
   // 选择分配支助人员
107
   worderId = 0; //支助人员id
107
   worderId = 0; //支助人员id
108
   checkAllotWorker(id, flag?): void {
108
   checkAllotWorker(id, flag?): void {
109
-    this.mapOfCheckedId = { [id]: flag?!this.mapOfCheckedId[id]:this.mapOfCheckedId[id] };
109
+    this.mapOfCheckedId = {
110
+      [id]: flag ? !this.mapOfCheckedId[id] : this.mapOfCheckedId[id],
111
+    };
110
     this.worderId = id;
112
     this.worderId = id;
111
   }
113
   }
112
 
114
 

+ 3 - 0
src/app/views/fuwutai/fuwutai.component.html

@@ -72,6 +72,9 @@
72
     <div class="lists">
72
     <div class="lists">
73
       <div class="head">
73
       <div class="head">
74
         <span class="auto_tit">未分派({{unassignedList.length}}条)</span>
74
         <span class="auto_tit">未分派({{unassignedList.length}}条)</span>
75
+        <nz-select [(ngModel)]="unassignedBuilding" nzMode="multiple" nzPlaceHolder="请选择楼栋">
76
+          <nz-option *ngFor="let option of listOfOption" [nzLabel]="option.label" [nzValue]="option.value"></nz-option>
77
+        </nz-select>
75
         <span class="toLastTime">刷新倒计时<span class="time">{{orderRefreshTime}}s</span></span>
78
         <span class="toLastTime">刷新倒计时<span class="time">{{orderRefreshTime}}s</span></span>
76
       </div>
79
       </div>
77
       <div class="searchBox">
80
       <div class="searchBox">