Browse Source

知识库增加创建人筛选

seimin 4 months ago
parent
commit
49331bdc85

+ 24 - 12
src/app/views/repository-manage/repository-manage.component.html

@@ -11,7 +11,7 @@
11
 				    </ng-container>
11
 				    </ng-container>
12
 				  </nz-select>
12
 				  </nz-select>
13
 				</div>
13
 				</div>
14
-				
14
+
15
         <div class="list-template__searchItem">
15
         <div class="list-template__searchItem">
16
           <span class="label">标题:</span>
16
           <span class="label">标题:</span>
17
           <input nz-input class="formItem" [(ngModel)]="title" placeholder="请输入标题" nzSize="default" />
17
           <input nz-input class="formItem" [(ngModel)]="title" placeholder="请输入标题" nzSize="default" />
@@ -20,6 +20,18 @@
20
           <span class="label">编号:</span>
20
           <span class="label">编号:</span>
21
           <input nz-input class="formItem" [(ngModel)]="solutionNumber" placeholder="请输入编号" nzSize="default" />
21
           <input nz-input class="formItem" [(ngModel)]="solutionNumber" placeholder="请输入编号" nzSize="default" />
22
         </div>
22
         </div>
23
+        <div class="list-template__searchItem">
24
+          <span class="label">创建人</span>:
25
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
26
+            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择创建人" [(ngModel)]="createUserId">
27
+            <ng-container *ngFor="let option of createUserList">
28
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
29
+            </ng-container>
30
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
31
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
32
+            </nz-option>
33
+          </nz-select>
34
+        </div>
23
       </div>
35
       </div>
24
       <div nz-col nzLg="6" class="list-template__btns">
36
       <div nz-col nzLg="6" class="list-template__btns">
25
         <button class="btn default" (click)='search()'>搜索</button>
37
         <button class="btn default" (click)='search()'>搜索</button>
@@ -49,11 +61,11 @@
49
 						<td>
61
 						<td>
50
 							<div>V{{ data.versionNumber }}</div>
62
 							<div>V{{ data.versionNumber }}</div>
51
 							<div>{{ data.type ? data.type.name : '-' }}</div>
63
 							<div>{{ data.type ? data.type.name : '-' }}</div>
52
-						</td>	
64
+						</td>
53
 						<td>
65
 						<td>
54
 							<div>{{ data.createUser.name }}</div>
66
 							<div>{{ data.createUser.name }}</div>
55
 							<div>{{ data.createTime|date:'yyyy-MM-dd HH:mm' }}</div>
67
 							<div>{{ data.createTime|date:'yyyy-MM-dd HH:mm' }}</div>
56
-						</td>	
68
+						</td>
57
 						<td>{{ data.status ? data.status.name : '-' }}</td>
69
 						<td>{{ data.status ? data.status.name : '-' }}</td>
58
             <td>
70
             <td>
59
               <div class="coop">
71
               <div class="coop">
@@ -84,7 +96,7 @@
84
       <!-- <overlay-scrollbars #osComponentRef1 class="content"> -->
96
       <!-- <overlay-scrollbars #osComponentRef1 class="content"> -->
85
        <div class="view-box">
97
        <div class="view-box">
86
 				 <div class="view-item left-box">
98
 				 <div class="view-item left-box">
87
-					 <div class="item-left-list" 
99
+					 <div class="item-left-list"
88
 					 [ngClass]="{'activeClass': index == vIndex}"
100
 					 [ngClass]="{'activeClass': index == vIndex}"
89
 					 *ngFor="let item of detailData let index=index;" (click)="versionsClick(item, index)">V{{item.versionNumber}}</div>
101
 					 *ngFor="let item of detailData let index=index;" (click)="versionsClick(item, index)">V{{item.versionNumber}}</div>
90
 				 </div>
102
 				 </div>
@@ -111,7 +123,7 @@
111
 						 </div>
123
 						 </div>
112
 					 </div>
124
 					 </div>
113
 				 </div>
125
 				 </div>
114
-				 <div class="view-item right-box" *ngIf="solutionLogs"> 
126
+				 <div class="view-item right-box" *ngIf="solutionLogs">
115
 					 <nz-steps [nzCurrent]="stepLength" nzDirection="vertical" nzSize="small">
127
 					 <nz-steps [nzCurrent]="stepLength" nzDirection="vertical" nzSize="small">
116
 						<ng-container *ngFor="let item of solutionLogs; let index = index">
128
 						<ng-container *ngFor="let item of solutionLogs; let index = index">
117
 						    <nz-step
129
 						    <nz-step
@@ -148,7 +160,7 @@
148
 				<button class="btn" *ngIf="optType=='audit' && vIndex==0" nz-button nzType="primary" (click)="submitForm(2)" [nzLoading]="btnLoading2">驳回</button>
160
 				<button class="btn" *ngIf="optType=='audit' && vIndex==0" nz-button nzType="primary" (click)="submitForm(2)" [nzLoading]="btnLoading2">驳回</button>
149
 				<button class="btn cancel" *ngIf="optType=='audit'" nz-button nzType="default" (click)="hideModal()">取消</button>
161
 				<button class="btn cancel" *ngIf="optType=='audit'" nz-button nzType="default" (click)="hideModal()">取消</button>
150
 				<button class="btn" *ngIf="optType=='look'" nz-button nzType="primary" (click)="hideModal()">知道了</button>
162
 				<button class="btn" *ngIf="optType=='look'" nz-button nzType="primary" (click)="hideModal()">知道了</button>
151
-				
163
+
152
 			</div>
164
 			</div>
153
 			<div class="mask-style" *ngIf="isSpinning">
165
 			<div class="mask-style" *ngIf="isSpinning">
154
 				<nz-spin nzSimple class="spin-style"></nz-spin>
166
 				<nz-spin nzSimple class="spin-style"></nz-spin>
@@ -158,19 +170,19 @@
158
   <!-- 删除模态框 -->
170
   <!-- 删除模态框 -->
159
   <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
171
   <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
160
     (confirmDelEvent)="confirmDel()" content="您确认要删除此知识库吗?"></app-dialog-delete>
172
     (confirmDelEvent)="confirmDel()" content="您确认要删除此知识库吗?"></app-dialog-delete>
161
-	
173
+
162
 	<!-- 停用模态框 -->
174
 	<!-- 停用模态框 -->
163
 	<app-dialog-delete [delModal]="pauseModal" (hideDelModalEvent)="hideDelModal2()" [btnLoading]="btnLoading"
175
 	<app-dialog-delete [delModal]="pauseModal" (hideDelModalEvent)="hideDelModal2()" [btnLoading]="btnLoading"
164
 	  (confirmDelEvent)="confirmDel2()" content="您确认要停用此知识库吗?"></app-dialog-delete>
176
 	  (confirmDelEvent)="confirmDel2()" content="您确认要停用此知识库吗?"></app-dialog-delete>
165
-		
177
+
166
 	<!-- 恢复模态框 -->
178
 	<!-- 恢复模态框 -->
167
 	<app-dialog-delete [delModal]="renewModal" (hideDelModalEvent)="hideDelModal3()" [btnLoading]="btnLoading"
179
 	<app-dialog-delete [delModal]="renewModal" (hideDelModalEvent)="hideDelModal3()" [btnLoading]="btnLoading"
168
 		(confirmDelEvent)="confirmDel3()" content="您确认要恢复此知识库吗?"></app-dialog-delete>
180
 		(confirmDelEvent)="confirmDel3()" content="您确认要恢复此知识库吗?"></app-dialog-delete>
169
-		
181
+
170
 	<!-- 审核通过模态框 -->
182
 	<!-- 审核通过模态框 -->
171
 	<app-dialog-delete [delModal]="auditModal" (hideDelModalEvent)="hideDelModal4()" [btnLoading]="btnLoading"
183
 	<app-dialog-delete [delModal]="auditModal" (hideDelModalEvent)="hideDelModal4()" [btnLoading]="btnLoading"
172
 		(confirmDelEvent)="confirmDel4()" content="您确认通过此知识库的审核吗?"></app-dialog-delete>
184
 		(confirmDelEvent)="confirmDel4()" content="您确认通过此知识库的审核吗?"></app-dialog-delete>
173
-	
185
+
174
 	<!-- 审核驳回模态框 -->
186
 	<!-- 审核驳回模态框 -->
175
 	<nz-modal [(nzVisible)]="rejectModal" nzTitle="您确认驳回此知识库吗?" (nzOnCancel)="rejectCancel()" (nzOnOk)="rejectOk()">
187
 	<nz-modal [(nzVisible)]="rejectModal" nzTitle="您确认驳回此知识库吗?" (nzOnCancel)="rejectCancel()" (nzOnOk)="rejectOk()">
176
 		<textarea
188
 		<textarea
@@ -178,10 +190,10 @@
178
 			[(ngModel)]="rejectData"
190
 			[(ngModel)]="rejectData"
179
 			placeholder="请输入整改意见"
191
 			placeholder="请输入整改意见"
180
 			[nzAutosize]="{ minRows: 2, maxRows: 6 }"
192
 			[nzAutosize]="{ minRows: 2, maxRows: 6 }"
181
-			
193
+
182
 		></textarea>
194
 		></textarea>
183
 	</nz-modal>
195
 	</nz-modal>
184
-			
196
+
185
   <!-- 编辑模态框 -->
197
   <!-- 编辑模态框 -->
186
   <app-dialog-delete [delModal]="editModal" (hideDelModalEvent)="hideDelModal1()" [btnLoading]="saveLoading"
198
   <app-dialog-delete [delModal]="editModal" (hideDelModalEvent)="hideDelModal1()" [btnLoading]="saveLoading"
187
     (confirmDelEvent)="confirmDel1()" [content]="'保存后会重置您的发药科室的药品信息,您确认吗?'"></app-dialog-delete>
199
     (confirmDelEvent)="confirmDel1()" [content]="'保存后会重置您的发药科室的药品信息,您确认吗?'"></app-dialog-delete>

+ 44 - 2
src/app/views/repository-manage/repository-manage.component.ts

@@ -39,10 +39,15 @@ export class RepositoryManageComponent implements OnInit {
39
     private http: HttpClient,
39
     private http: HttpClient,
40
 		private sanitizer: DomSanitizer
40
 		private sanitizer: DomSanitizer
41
   ) {}
41
   ) {}
42
+  searchTimerSubject = new Subject();
42
   ngOnInit() {
43
   ngOnInit() {
43
     this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
44
     this.searchParentDeptSubject.pipe(debounceTime(500)).subscribe((e) => {
44
 
45
 
45
     });
46
     });
47
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
48
+      let fun = v[0];
49
+      fun.call(this, v[1], v[2]);
50
+    });
46
 		this.hosId = this.tool.getCurrentHospital().id;
51
 		this.hosId = this.tool.getCurrentHospital().id;
47
     this.coopBtns = this.tool.initCoopBtns(this.route);
52
     this.coopBtns = this.tool.initCoopBtns(this.route);
48
 		this.maintainDept = this.tool.getUserInfoPermission().dutyList
53
 		this.maintainDept = this.tool.getUserInfoPermission().dutyList
@@ -50,7 +55,9 @@ export class RepositoryManageComponent implements OnInit {
50
 			this.defaDept()
55
 			this.defaDept()
51
 		}
56
 		}
52
 		this.getList();
57
 		this.getList();
58
+    this.getUsers();
53
   }
59
   }
60
+  createUserList: any = []; //创建人列表
54
 	maintainDept:any = []; //维修科室
61
 	maintainDept:any = []; //维修科室
55
 	maintainDepartment:any;
62
 	maintainDepartment:any;
56
 	hosIds:any; //当前院区
63
 	hosIds:any; //当前院区
@@ -68,6 +75,7 @@ export class RepositoryManageComponent implements OnInit {
68
 	hosId: number;
75
 	hosId: number;
69
 	loadAllConsumeDept: boolean = true;//是否加载所有消耗科室
76
 	loadAllConsumeDept: boolean = true;//是否加载所有消耗科室
70
   solutionNumber; //编号
77
   solutionNumber; //编号
78
+  createUserId; //创建人
71
 	title; //标题
79
 	title; //标题
72
   num; //编码
80
   num; //编码
73
   deptalias; //别名
81
   deptalias; //别名
@@ -115,7 +123,7 @@ export class RepositoryManageComponent implements OnInit {
115
     this.coopData = data;
123
     this.coopData = data;
116
     this.showDelModal1();
124
     this.showDelModal1();
117
   }
125
   }
118
-	
126
+
119
 	// 默认科室
127
 	// 默认科室
120
 	defaDept(){
128
 	defaDept(){
121
 		let itemDept = this.maintainDept.find(i=>i.id == this.hosId)
129
 		let itemDept = this.maintainDept.find(i=>i.id == this.hosId)
@@ -123,7 +131,7 @@ export class RepositoryManageComponent implements OnInit {
123
 			this.maintainDepartment = itemDept.id
131
 			this.maintainDepartment = itemDept.id
124
 		}
132
 		}
125
 	}
133
 	}
126
-	
134
+
127
   showDelModal1() {
135
   showDelModal1() {
128
     this.editModal = true;
136
     this.editModal = true;
129
   }
137
   }
@@ -170,6 +178,7 @@ export class RepositoryManageComponent implements OnInit {
170
     this.pageIndex = 1;
178
     this.pageIndex = 1;
171
 		this.solutionNumber = null;
179
 		this.solutionNumber = null;
172
 		this.title = null;
180
 		this.title = null;
181
+    this.createUserId = undefined;
173
 		if(this.coopBtns.strideLook){
182
 		if(this.coopBtns.strideLook){
174
 			this.defaDept()
183
 			this.defaDept()
175
 		}
184
 		}
@@ -185,6 +194,7 @@ export class RepositoryManageComponent implements OnInit {
185
       solution: {
194
       solution: {
186
     		title:this.title,
195
     		title:this.title,
187
 				solutionNumber:this.solutionNumber,
196
 				solutionNumber:this.solutionNumber,
197
+        createUserId: this.createUserId || undefined,
188
     		hosId: this.hosId,
198
     		hosId: this.hosId,
189
       },
199
       },
190
     };
200
     };
@@ -533,4 +543,36 @@ export class RepositoryManageComponent implements OnInit {
533
 		this.router.navigateByUrl(`/dispensingDetail/${data.id}`);
543
 		this.router.navigateByUrl(`/dispensingDetail/${data.id}`);
534
   }
544
   }
535
 
545
 
546
+  // 人员边输边搜节流阀
547
+  changeUser(e) {
548
+    this.searchTimer(this.getUsers, e);
549
+  }
550
+
551
+  // 边输入边搜索节流阀
552
+  searchTimer(fun, e) {
553
+    this.isLoading = true;
554
+    this.searchTimerSubject.next([fun, e]);
555
+  }
556
+
557
+  // 获取创建人
558
+  isLoading:boolean = false;
559
+  getUsers(e?) {
560
+    let postData = {
561
+      user: {
562
+        name: e,
563
+        hospital: { id: this.hosId },
564
+        simpleQuery: true,
565
+      },
566
+      idx: 0,
567
+      sum: 20,
568
+    };
569
+    this.isLoading = true;
570
+    this.mainService
571
+      .getFetchDataList("data", "user", postData)
572
+      .subscribe((data) => {
573
+        this.isLoading = false;
574
+        this.createUserList = data.list;
575
+      });
576
+  }
577
+
536
 }
578
 }