|
@@ -41,6 +41,11 @@ export class InspectClosedLoopViewComponent implements OnInit, OnDestroy {
|
41
|
41
|
|
42
|
42
|
searchTimerSubject = new Subject(); //防抖
|
43
|
43
|
|
|
44
|
+ // 初始化增删改按钮
|
|
45
|
+ coopBtns: any = {};
|
|
46
|
+ coopData: any = {}; //当前操作列
|
|
47
|
+ btnLoading: boolean = false; //提交按钮loading状态
|
|
48
|
+
|
44
|
49
|
ngOnInit() {
|
45
|
50
|
//防抖
|
46
|
51
|
this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
|
|
@@ -48,6 +53,7 @@ export class InspectClosedLoopViewComponent implements OnInit, OnDestroy {
|
48
|
53
|
fun.call(this, v[1]);
|
49
|
54
|
});
|
50
|
55
|
|
|
56
|
+ this.coopBtns = this.tool.initCoopBtns(this.route);
|
51
|
57
|
this.init();
|
52
|
58
|
}
|
53
|
59
|
|
|
@@ -55,6 +61,64 @@ export class InspectClosedLoopViewComponent implements OnInit, OnDestroy {
|
55
|
61
|
clearInterval(this.timer);
|
56
|
62
|
}
|
57
|
63
|
|
|
64
|
+ delModal: boolean = false; //删除模态框
|
|
65
|
+ tipsMsg1: string; //提示框信息
|
|
66
|
+ tipsMsg2: string; //操作后信息
|
|
67
|
+ confirmDelType: string; //确认的类型(启用/停用,删除)
|
|
68
|
+ showDelModal(
|
|
69
|
+ data,
|
|
70
|
+ tipsMsg1: string,
|
|
71
|
+ tipsMsg2: string,
|
|
72
|
+ type: string,
|
|
73
|
+ ) {
|
|
74
|
+ this.confirmDelType = type;
|
|
75
|
+ this.delModal = true;
|
|
76
|
+ this.coopData = data;
|
|
77
|
+ this.tipsMsg1 = tipsMsg1;
|
|
78
|
+ this.tipsMsg2 = tipsMsg2;
|
|
79
|
+ }
|
|
80
|
+ // 隐藏删除框
|
|
81
|
+ hideDelModal() {
|
|
82
|
+ this.delModal = false;
|
|
83
|
+ }
|
|
84
|
+ // 确认删除
|
|
85
|
+ confirmDel() {
|
|
86
|
+ this.btnLoading = true;
|
|
87
|
+ if (this.confirmDelType === "tagBackDepartment") {
|
|
88
|
+ let postData = {
|
|
89
|
+ pilId: this.coopData.id,
|
|
90
|
+ };
|
|
91
|
+ //标记回科
|
|
92
|
+ this.mainService
|
|
93
|
+ .setPatientInspectBackDept(postData)
|
|
94
|
+ .subscribe((data:any) => {
|
|
95
|
+ this.btnLoading = false;
|
|
96
|
+ this.delModal = false;
|
|
97
|
+ if (data.state == 200) {
|
|
98
|
+ this.showPromptModal(this.tipsMsg2, true, "");
|
|
99
|
+ } else {
|
|
100
|
+ this.showPromptModal(this.tipsMsg2, false, data.msg);
|
|
101
|
+ }
|
|
102
|
+ });
|
|
103
|
+ }
|
|
104
|
+ }
|
|
105
|
+
|
|
106
|
+ // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
|
|
107
|
+ promptContent: string; //操作提示框提示信息
|
|
108
|
+ ifSuccess: boolean; //操作成功/失败
|
|
109
|
+ promptInfo: string; //操作结果提示信息
|
|
110
|
+ promptModalShow: boolean; //操作提示框是否展示
|
|
111
|
+ showPromptModal(con, success, promptInfo?) {
|
|
112
|
+ this.promptModalShow = false;
|
|
113
|
+ this.promptContent = con;
|
|
114
|
+ this.ifSuccess = success;
|
|
115
|
+ this.promptInfo = promptInfo;
|
|
116
|
+ setTimeout(() => {
|
|
117
|
+ this.promptModalShow = true;
|
|
118
|
+ }, 100);
|
|
119
|
+ this.getList(1);
|
|
120
|
+ }
|
|
121
|
+
|
58
|
122
|
// 日期选择
|
59
|
123
|
onCalendarChangeDate(dateArr){
|
60
|
124
|
if(dateArr.length == 2){
|