|
@@ -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;
|
|
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) {
|