seimin 3 年 前
コミット
f8264994ba

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

@@ -4,12 +4,13 @@
4 4
     <div nz-row class="select">
5 5
       <div nz-col nzSpan="6">
6 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 9
       </div>
9 10
       <div nz-col nzSpan="6" class="ml8">
10 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 14
           <nz-option *ngFor="let optionData of groupList" [nzLabel]="optionData.groupName" [nzValue]="optionData.id">
14 15
           </nz-option>
15 16
         </nz-select>
@@ -46,7 +47,8 @@
46 47
     </div>
47 48
   </div>
48 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 52
     <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
51 53
   </div>
52 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 19
   ngOnInit() {
20
+    this.groupList = JSON.parse(
21
+      localStorage.getItem("user")
22
+    ).user.scope.groupIds;
20 23
     this.getWorkerList();
21
-    // this.getGroupList();
22 24
   }
23 25
   // 支助人员数据
24 26
   workerList = [];
@@ -42,13 +44,13 @@ export class AllocationWorkerComponent implements OnInit {
42 44
 
43 45
   // 支助人员数据
44 46
   groupList: Array<{ groupName: string; id: string }> = []; //分组下拉框
45
-  groupIds;
46 47
   snum = 0;
47 48
   loading1 = false;
49
+  nameMask = false; //是否禁用
50
+  groupMask = false; //是否禁用
48 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 54
     this.pageIndex = pageIndex ? pageIndex : this.pageIndex;
53 55
 
54 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 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 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 79
     this.snum++;
71 80
     this.loading1 = true;
72
-    that.mainService
81
+    this.mainService
73 82
       .getSerInfo("getOnlineWorker", postData)
74 83
       .subscribe((data) => {
75 84
         this.snum--;
@@ -77,36 +86,29 @@ export class AllocationWorkerComponent implements OnInit {
77 86
           this.loading1 = false;
78 87
         }
79 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 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 107
   worderId = 0; //支助人员id
108 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 112
     this.worderId = id;
111 113
   }
112 114
 

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

@@ -72,6 +72,9 @@
72 72
     <div class="lists">
73 73
       <div class="head">
74 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 78
         <span class="toLastTime">刷新倒计时<span class="time">{{orderRefreshTime}}s</span></span>
76 79
       </div>
77 80
       <div class="searchBox">