|
@@ -63,6 +63,8 @@ export class UsersManagementComponent implements OnInit {
|
63
|
63
|
promptModalShow: boolean; //操作提示框是否展示
|
64
|
64
|
|
65
|
65
|
btnLoading: boolean = false; //提交按钮loading状态
|
|
66
|
+ recoverLoading: boolean = false; //提交按钮loading状态
|
|
67
|
+ recoverModal: boolean = false; //恢复模态框
|
66
|
68
|
wxRequired = false; //新增或编辑用户的时候,微信号是否必填
|
67
|
69
|
changeInpSubject = new Subject(); //防抖
|
68
|
70
|
changeInpCompanySubject = new Subject(); //防抖
|
|
@@ -392,6 +394,8 @@ export class UsersManagementComponent implements OnInit {
|
392
|
394
|
}
|
393
|
395
|
}
|
394
|
396
|
// 表单提交
|
|
397
|
+ recoverContent:any;
|
|
398
|
+ userData:any;
|
395
|
399
|
submitForm(): void {
|
396
|
400
|
var that = this;
|
397
|
401
|
for (const i in that.validateForm.controls) {
|
|
@@ -443,9 +447,13 @@ export class UsersManagementComponent implements OnInit {
|
443
|
447
|
that.initForm();
|
444
|
448
|
if (data.status == 200) {
|
445
|
449
|
that.showPromptModal(that.add ? "新增" : "编辑", true, "");
|
446
|
|
- } else {
|
447
|
|
- that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
|
448
|
|
- }
|
|
450
|
+ } else if(data.status == 2002 || data.status == 2004){
|
|
451
|
+ this.userData = data
|
|
452
|
+ this.recoverContent = data.msg
|
|
453
|
+ this.recoverModal = true;
|
|
454
|
+ }else{
|
|
455
|
+ that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
|
|
456
|
+ }
|
449
|
457
|
});
|
450
|
458
|
}
|
451
|
459
|
|
|
@@ -618,6 +626,40 @@ export class UsersManagementComponent implements OnInit {
|
618
|
626
|
}
|
619
|
627
|
});
|
620
|
628
|
}
|
|
629
|
+
|
|
630
|
+ // 确认恢复
|
|
631
|
+ confirmRecover() {
|
|
632
|
+ let that = this;
|
|
633
|
+ let query = {
|
|
634
|
+ account:'',
|
|
635
|
+ weiXin:''
|
|
636
|
+ }
|
|
637
|
+ if(this.userData.status==2002){
|
|
638
|
+ query.account = this.userData.data.account
|
|
639
|
+ delete query.weiXin
|
|
640
|
+ }else if (this.userData.status==2004){
|
|
641
|
+ query.weiXin = this.userData.data.weixin
|
|
642
|
+ delete query.account
|
|
643
|
+ }
|
|
644
|
+ that.recoverLoading = true;
|
|
645
|
+ that.mainService
|
|
646
|
+ .recoveryUser(query)
|
|
647
|
+ .subscribe((data) => {
|
|
648
|
+ that.recoverLoading = false;
|
|
649
|
+ that.hideRecoverModal();
|
|
650
|
+ if (data["status"] == 200) {
|
|
651
|
+ that.showPromptModal("恢复", true, "");
|
|
652
|
+ } else {
|
|
653
|
+ that.showPromptModal("恢复", false, data["msg"]);
|
|
654
|
+ }
|
|
655
|
+ });
|
|
656
|
+ }
|
|
657
|
+
|
|
658
|
+ // 关闭恢复模态框
|
|
659
|
+ hideRecoverModal() {
|
|
660
|
+ this.recoverModal = false;
|
|
661
|
+ }
|
|
662
|
+
|
621
|
663
|
// 关闭删除模态框
|
622
|
664
|
hideDelModal() {
|
623
|
665
|
this.delModal = false;
|