Ver código fonte

Merge branch 'lmm' into develop

seimin 3 anos atrás
pai
commit
9f2929d842
1 arquivos alterados com 42 adições e 1 exclusões
  1. 42 1
      src/app/views/fuwutai/fuwutai.component.ts

+ 42 - 1
src/app/views/fuwutai/fuwutai.component.ts

@@ -165,10 +165,13 @@ export class FuwutaiComponent implements OnInit {
165
   unassignedBuilding = [];
165
   unassignedBuilding = [];
166
   bLoading = false;
166
   bLoading = false;
167
   getUnassignedBuilding() {
167
   getUnassignedBuilding() {
168
-    let postData = {
168
+    let postData: any = {
169
       hosId: this.checkedHos,
169
       hosId: this.checkedHos,
170
       unassignedOder: 1, //未派单
170
       unassignedOder: 1, //未派单
171
     };
171
     };
172
+    if (this.allUnassignedOrders) {
173
+      postData.wokerIds = this.allUnassignedOrders;
174
+    }
172
     this.bLoading = true;
175
     this.bLoading = true;
173
     this.mainService
176
     this.mainService
174
       .getBuildingOrFloor("building", postData)
177
       .getBuildingOrFloor("building", postData)
@@ -179,6 +182,41 @@ export class FuwutaiComponent implements OnInit {
179
         }
182
         }
180
       });
183
       });
181
   }
184
   }
185
+  allUnassignedOrders = "";
186
+  getUnassignedBuilding2() {
187
+    if (this.user.user.scope) {
188
+      this.user.user.scope.typeIds = this.user.user.scope.typeIds || [];
189
+    } else {
190
+      return;
191
+    }
192
+    let types = "";
193
+    this.user.user.scope.typeIds.forEach((e) => {
194
+      types += e.id + ",";
195
+    });
196
+    types = types.slice(0, types.length - 1);
197
+    let postData = {
198
+      workOrder: {
199
+        serTaskTypes: types || "null",
200
+        serGdState: 1,
201
+        range: this.orderScopeRadio,
202
+        platform: 3,
203
+        searchDays: 1,
204
+        keyWord: "",
205
+      },
206
+      idx: 0,
207
+      sum: 9999,
208
+    };
209
+    this.mainService
210
+      .getFetchDataList("ser", "workOrder", postData)
211
+      .subscribe((result) => {
212
+        if (result.status == 200) {
213
+          this.allUnassignedOrders = result.list
214
+            .map((item) => item.id)
215
+            .toString();
216
+        }
217
+      });
218
+    // -----------------------
219
+  }
182
   // 选中未派单列表-全选
220
   // 选中未派单列表-全选
183
   changeAllUnassignedList(e) {
221
   changeAllUnassignedList(e) {
184
     this.unassignedList.forEach((v) => (v.checked = e));
222
     this.unassignedList.forEach((v) => (v.checked = e));
@@ -495,6 +533,7 @@ export class FuwutaiComponent implements OnInit {
495
     this.checkTab(this.typeId);
533
     this.checkTab(this.typeId);
496
     this.moveMenu();
534
     this.moveMenu();
497
     this.getPhoneNum();
535
     this.getPhoneNum();
536
+    this.getUnassignedBuilding2();
498
   }
537
   }
499
   ngOnDestroy() {
538
   ngOnDestroy() {
500
     console.log("关闭ser", this.webs.ws);
539
     console.log("关闭ser", this.webs.ws);
@@ -762,6 +801,7 @@ export class FuwutaiComponent implements OnInit {
762
       }
801
       }
763
       this.workerRefreshTime--;
802
       this.workerRefreshTime--;
764
       if (this.orderRefreshTime == 0) {
803
       if (this.orderRefreshTime == 0) {
804
+        this.getUnassignedBuilding2();
765
         this.getOrderList(1, true);
805
         this.getOrderList(1, true);
766
         this.getOrderList(2);
806
         this.getOrderList(2);
767
         this.getOrderList(3);
807
         this.getOrderList(3);
@@ -786,6 +826,7 @@ export class FuwutaiComponent implements OnInit {
786
   }
826
   }
787
   // 刷新工单列表
827
   // 刷新工单列表
788
   refreshList() {
828
   refreshList() {
829
+    this.getUnassignedBuilding2();
789
     this.resetList();
830
     this.resetList();
790
     this.getOrderList(1);
831
     this.getOrderList(1);
791
     this.getOrderList(2);
832
     this.getOrderList(2);