Kaynağa Gözat

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

seimin 3 yıl önce
ebeveyn
işleme
d000daa751

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

@@ -152,6 +152,23 @@
152
             </nz-form-control>
152
             </nz-form-control>
153
           </nz-form-item>
153
           </nz-form-item>
154
           <nz-form-item>
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
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="groupLeader"
172
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="groupLeader"
156
               >分组组长</nz-form-label
173
               >分组组长</nz-form-label
157
             >
174
             >
@@ -161,7 +178,7 @@
161
                 class="formItem"
178
                 class="formItem"
162
                 nzServerSearch
179
                 nzServerSearch
163
                 nzShowSearch
180
                 nzShowSearch
164
-                nzAllowClear
181
+                [nzLoading]="editLoading" 
165
                 nzPlaceHolder="请选择分组组长"
182
                 nzPlaceHolder="请选择分组组长"
166
                 formControlName="groupLeader"
183
                 formControlName="groupLeader"
167
                 (nzOnSearch)="changeInp($event)"
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
   changeSearch(flag) {
78
   changeSearch(flag) {
79
-    if (flag) {
79
+    if (flag && !this.editLoading) {
80
       this.changeInp();
80
       this.changeInp();
81
     }
81
     }
82
   }
82
   }
@@ -270,6 +270,7 @@ export class GroupManagementComponent implements OnInit {
270
   // 新增/编辑模态框
270
   // 新增/编辑模态框
271
   coopModal: boolean = false; //模态框是否展示
271
   coopModal: boolean = false; //模态框是否展示
272
   add: boolean = true; //true:新增;false:编辑
272
   add: boolean = true; //true:新增;false:编辑
273
+  editLoading = false;
273
   showCoopModal(type) {
274
   showCoopModal(type) {
274
     if (type == "edit" && !this.checkedGroup["groupName"]) {
275
     if (type == "edit" && !this.checkedGroup["groupName"]) {
275
       this.msg.create("warning", "请选择需要编辑的分组!");
276
       this.msg.create("warning", "请选择需要编辑的分组!");
@@ -278,28 +279,39 @@ export class GroupManagementComponent implements OnInit {
278
     this.coopModal = true;
279
     this.coopModal = true;
279
     this.add = type == "add";
280
     this.add = type == "add";
280
     if (type == "edit") {
281
     if (type == "edit") {
282
+      this.validateForm.controls.groupLeader.setValue(null);//先清空组长
281
       this.validateForm.controls.classes.setValue(
283
       this.validateForm.controls.classes.setValue(
282
         this.checkedGroup["scheduleClass"].id + ""
284
         this.checkedGroup["scheduleClass"].id + ""
283
       );
285
       );
284
       this.validateForm.controls.groupName.setValue(
286
       this.validateForm.controls.groupName.setValue(
285
         this.checkedGroup["groupName"]
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
     } else {
310
     } else {
300
       this.validateForm.controls.classes.setValue(null);
311
       this.validateForm.controls.classes.setValue(null);
301
       this.validateForm.controls.groupName.setValue(null);
312
       this.validateForm.controls.groupName.setValue(null);
302
       this.validateForm.controls.groupLeader.setValue(null);
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
     this.validateForm = this.fb.group({
324
     this.validateForm = this.fb.group({
313
       classes: [null, [Validators.required]],
325
       classes: [null, [Validators.required]],
314
       groupName: [null, [Validators.required]],
326
       groupName: [null, [Validators.required]],
327
+      groupType: [null, [Validators.required]],
315
       groupLeader: [null, [Validators.required]],
328
       groupLeader: [null, [Validators.required]],
316
     });
329
     });
317
   }
330
   }
@@ -332,6 +345,7 @@ export class GroupManagementComponent implements OnInit {
332
         hospital: { id: that.hosId - 0 },
345
         hospital: { id: that.hosId - 0 },
333
         scheduleClass: { id: that.validateForm.value.classes - 0 },
346
         scheduleClass: { id: that.validateForm.value.classes - 0 },
334
         manager: that.validateForm.value.groupLeader,
347
         manager: that.validateForm.value.groupLeader,
348
+        type: that.validateForm.value.groupType,
335
       },
349
       },
336
     };
350
     };
337
     if (!that.add) {
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
       return;
553
       return;
554
     }
554
     }
555
     let hosIds = this.currentHospital.id;
555
     let hosIds = this.currentHospital.id;
556
-    let postData = {
556
+    let postData:any = {
557
       idx: 0,
557
       idx: 0,
558
       sum: 20,
558
       sum: 20,
559
       group2: {
559
       group2: {
@@ -564,6 +564,10 @@ export class QuickCombinationComponent implements OnInit {
564
         hospitals: hosIds,
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
     this.gLoading = true;
571
     this.gLoading = true;
568
     this.gNum++;
572
     this.gNum++;
569
     this.mainService
573
     this.mainService