Browse Source

分组增加派单分组和统计分组

seimin 3 years ago
parent
commit
d000daa751

+ 18 - 1
src/app/views/group-management/group-management.component.html

@@ -152,6 +152,23 @@
152 152
             </nz-form-control>
153 153
           </nz-form-item>
154 154
           <nz-form-item>
155
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="groupType"
156
+              >分组类型</nz-form-label
157
+            >
158
+            <nz-form-control nzErrorTip="请选择分组类型!">
159
+              <nz-select
160
+                [nzDropdownMatchSelectWidth]="false"
161
+                formControlName="groupType"
162
+                nzShowSearch
163
+                nzAllowClear
164
+                nzPlaceHolder="请选择分组类型"
165
+              >
166
+                <nz-option nzLabel="统计分组" nzValue="1"></nz-option>
167
+                <nz-option nzLabel="派单分组" nzValue="2"></nz-option>
168
+              </nz-select>
169
+            </nz-form-control>
170
+          </nz-form-item>
171
+          <nz-form-item>
155 172
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="groupLeader"
156 173
               >分组组长</nz-form-label
157 174
             >
@@ -161,7 +178,7 @@
161 178
                 class="formItem"
162 179
                 nzServerSearch
163 180
                 nzShowSearch
164
-                nzAllowClear
181
+                [nzLoading]="editLoading" 
165 182
                 nzPlaceHolder="请选择分组组长"
166 183
                 formControlName="groupLeader"
167 184
                 (nzOnSearch)="changeInp($event)"

+ 26 - 12
src/app/views/group-management/group-management.component.ts

@@ -76,7 +76,7 @@ export class GroupManagementComponent implements OnInit {
76 76
   }
77 77
   // 打开搜索框
78 78
   changeSearch(flag) {
79
-    if (flag) {
79
+    if (flag && !this.editLoading) {
80 80
       this.changeInp();
81 81
     }
82 82
   }
@@ -270,6 +270,7 @@ export class GroupManagementComponent implements OnInit {
270 270
   // 新增/编辑模态框
271 271
   coopModal: boolean = false; //模态框是否展示
272 272
   add: boolean = true; //true:新增;false:编辑
273
+  editLoading = false;
273 274
   showCoopModal(type) {
274 275
     if (type == "edit" && !this.checkedGroup["groupName"]) {
275 276
       this.msg.create("warning", "请选择需要编辑的分组!");
@@ -278,28 +279,39 @@ export class GroupManagementComponent implements OnInit {
278 279
     this.coopModal = true;
279 280
     this.add = type == "add";
280 281
     if (type == "edit") {
282
+      this.validateForm.controls.groupLeader.setValue(null);//先清空组长
281 283
       this.validateForm.controls.classes.setValue(
282 284
         this.checkedGroup["scheduleClass"].id + ""
283 285
       );
284 286
       this.validateForm.controls.groupName.setValue(
285 287
         this.checkedGroup["groupName"]
286 288
       );
287
-      this.mainService
288
-        .getFetchData("data", "user", this.checkedGroup["manager"])
289
-        .subscribe((result) => {
290
-          if (result.status == 200) {
291
-            if (result.data) {
292
-              this.userList.unshift(result.data);
289
+      this.validateForm.controls.groupType.setValue(
290
+        this.checkedGroup["type"].toString()
291
+      );
292
+      if (this.checkedGroup["manager"]) {
293
+        this.editLoading = true;
294
+        this.mainService
295
+          .getFetchData("data", "user", this.checkedGroup["manager"])
296
+          .subscribe((result) => {
297
+            this.editLoading = false;
298
+            if (result.status == 200) {
299
+              if (result.data) {
300
+                this.userList.unshift(result.data);
301
+              }
302
+              this.validateForm.controls.groupLeader.setValue(
303
+                this.checkedGroup["manager"].toString()
304
+              );
293 305
             }
294
-            this.validateForm.controls.groupLeader.setValue(
295
-              this.checkedGroup["manager"].toString()
296
-            );
297
-          }
298
-        });
306
+          });
307
+      } else {
308
+        this.validateForm.controls.groupLeader.setValue(null);
309
+      }
299 310
     } else {
300 311
       this.validateForm.controls.classes.setValue(null);
301 312
       this.validateForm.controls.groupName.setValue(null);
302 313
       this.validateForm.controls.groupLeader.setValue(null);
314
+      this.validateForm.controls.groupType.setValue(null);
303 315
     }
304 316
   }
305 317
   // 隐藏分组信息模态框
@@ -312,6 +324,7 @@ export class GroupManagementComponent implements OnInit {
312 324
     this.validateForm = this.fb.group({
313 325
       classes: [null, [Validators.required]],
314 326
       groupName: [null, [Validators.required]],
327
+      groupType: [null, [Validators.required]],
315 328
       groupLeader: [null, [Validators.required]],
316 329
     });
317 330
   }
@@ -332,6 +345,7 @@ export class GroupManagementComponent implements OnInit {
332 345
         hospital: { id: that.hosId - 0 },
333 346
         scheduleClass: { id: that.validateForm.value.classes - 0 },
334 347
         manager: that.validateForm.value.groupLeader,
348
+        type: that.validateForm.value.groupType,
335 349
       },
336 350
     };
337 351
     if (!that.add) {

+ 5 - 1
src/app/views/quick-combination/quick-combination.component.ts

@@ -553,7 +553,7 @@ export class QuickCombinationComponent implements OnInit {
553 553
       return;
554 554
     }
555 555
     let hosIds = this.currentHospital.id;
556
-    let postData = {
556
+    let postData:any = {
557 557
       idx: 0,
558 558
       sum: 20,
559 559
       group2: {
@@ -564,6 +564,10 @@ export class QuickCombinationComponent implements OnInit {
564 564
         hospitals: hosIds,
565 565
       },
566 566
     };
567
+    console.log(this.queryParamsType,this.quickCombinationModel);
568
+    if(this.queryParamsType == 2 && (this.quickCombinationModel == 5 || this.quickCombinationModel == 6)){
569
+      postData.group2.type = 2;
570
+    }
567 571
     this.gLoading = true;
568 572
     this.gNum++;
569 573
     this.mainService