瀏覽代碼

知识库增加创建人筛选

seimin 4 月之前
父節點
當前提交
49331bdc85

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

@@ -11,7 +11,7 @@
11 11
 				    </ng-container>
12 12
 				  </nz-select>
13 13
 				</div>
14
-				
14
+
15 15
         <div class="list-template__searchItem">
16 16
           <span class="label">标题:</span>
17 17
           <input nz-input class="formItem" [(ngModel)]="title" placeholder="请输入标题" nzSize="default" />
@@ -20,6 +20,18 @@
20 20
           <span class="label">编号:</span>
21 21
           <input nz-input class="formItem" [(ngModel)]="solutionNumber" placeholder="请输入编号" nzSize="default" />
22 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 35
       </div>
24 36
       <div nz-col nzLg="6" class="list-template__btns">
25 37
         <button class="btn default" (click)='search()'>搜索</button>
@@ -49,11 +61,11 @@
49 61
 						<td>
50 62
 							<div>V{{ data.versionNumber }}</div>
51 63
 							<div>{{ data.type ? data.type.name : '-' }}</div>
52
-						</td>	
64
+						</td>
53 65
 						<td>
54 66
 							<div>{{ data.createUser.name }}</div>
55 67
 							<div>{{ data.createTime|date:'yyyy-MM-dd HH:mm' }}</div>
56
-						</td>	
68
+						</td>
57 69
 						<td>{{ data.status ? data.status.name : '-' }}</td>
58 70
             <td>
59 71
               <div class="coop">
@@ -84,7 +96,7 @@
84 96
       <!-- <overlay-scrollbars #osComponentRef1 class="content"> -->
85 97
        <div class="view-box">
86 98
 				 <div class="view-item left-box">
87
-					 <div class="item-left-list" 
99
+					 <div class="item-left-list"
88 100
 					 [ngClass]="{'activeClass': index == vIndex}"
89 101
 					 *ngFor="let item of detailData let index=index;" (click)="versionsClick(item, index)">V{{item.versionNumber}}</div>
90 102
 				 </div>
@@ -111,7 +123,7 @@
111 123
 						 </div>
112 124
 					 </div>
113 125
 				 </div>
114
-				 <div class="view-item right-box" *ngIf="solutionLogs"> 
126
+				 <div class="view-item right-box" *ngIf="solutionLogs">
115 127
 					 <nz-steps [nzCurrent]="stepLength" nzDirection="vertical" nzSize="small">
116 128
 						<ng-container *ngFor="let item of solutionLogs; let index = index">
117 129
 						    <nz-step
@@ -148,7 +160,7 @@
148 160
 				<button class="btn" *ngIf="optType=='audit' && vIndex==0" nz-button nzType="primary" (click)="submitForm(2)" [nzLoading]="btnLoading2">驳回</button>
149 161
 				<button class="btn cancel" *ngIf="optType=='audit'" nz-button nzType="default" (click)="hideModal()">取消</button>
150 162
 				<button class="btn" *ngIf="optType=='look'" nz-button nzType="primary" (click)="hideModal()">知道了</button>
151
-				
163
+
152 164
 			</div>
153 165
 			<div class="mask-style" *ngIf="isSpinning">
154 166
 				<nz-spin nzSimple class="spin-style"></nz-spin>
@@ -158,19 +170,19 @@
158 170
   <!-- 删除模态框 -->
159 171
   <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
160 172
     (confirmDelEvent)="confirmDel()" content="您确认要删除此知识库吗?"></app-dialog-delete>
161
-	
173
+
162 174
 	<!-- 停用模态框 -->
163 175
 	<app-dialog-delete [delModal]="pauseModal" (hideDelModalEvent)="hideDelModal2()" [btnLoading]="btnLoading"
164 176
 	  (confirmDelEvent)="confirmDel2()" content="您确认要停用此知识库吗?"></app-dialog-delete>
165
-		
177
+
166 178
 	<!-- 恢复模态框 -->
167 179
 	<app-dialog-delete [delModal]="renewModal" (hideDelModalEvent)="hideDelModal3()" [btnLoading]="btnLoading"
168 180
 		(confirmDelEvent)="confirmDel3()" content="您确认要恢复此知识库吗?"></app-dialog-delete>
169
-		
181
+
170 182
 	<!-- 审核通过模态框 -->
171 183
 	<app-dialog-delete [delModal]="auditModal" (hideDelModalEvent)="hideDelModal4()" [btnLoading]="btnLoading"
172 184
 		(confirmDelEvent)="confirmDel4()" content="您确认通过此知识库的审核吗?"></app-dialog-delete>
173
-	
185
+
174 186
 	<!-- 审核驳回模态框 -->
175 187
 	<nz-modal [(nzVisible)]="rejectModal" nzTitle="您确认驳回此知识库吗?" (nzOnCancel)="rejectCancel()" (nzOnOk)="rejectOk()">
176 188
 		<textarea
@@ -178,10 +190,10 @@
178 190
 			[(ngModel)]="rejectData"
179 191
 			placeholder="请输入整改意见"
180 192
 			[nzAutosize]="{ minRows: 2, maxRows: 6 }"
181
-			
193
+
182 194
 		></textarea>
183 195
 	</nz-modal>
184
-			
196
+
185 197
   <!-- 编辑模态框 -->
186 198
   <app-dialog-delete [delModal]="editModal" (hideDelModalEvent)="hideDelModal1()" [btnLoading]="saveLoading"
187 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 39
     private http: HttpClient,
40 40
 		private sanitizer: DomSanitizer
41 41
   ) {}
42
+  searchTimerSubject = new Subject();
42 43
   ngOnInit() {
43 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 51
 		this.hosId = this.tool.getCurrentHospital().id;
47 52
     this.coopBtns = this.tool.initCoopBtns(this.route);
48 53
 		this.maintainDept = this.tool.getUserInfoPermission().dutyList
@@ -50,7 +55,9 @@ export class RepositoryManageComponent implements OnInit {
50 55
 			this.defaDept()
51 56
 		}
52 57
 		this.getList();
58
+    this.getUsers();
53 59
   }
60
+  createUserList: any = []; //创建人列表
54 61
 	maintainDept:any = []; //维修科室
55 62
 	maintainDepartment:any;
56 63
 	hosIds:any; //当前院区
@@ -68,6 +75,7 @@ export class RepositoryManageComponent implements OnInit {
68 75
 	hosId: number;
69 76
 	loadAllConsumeDept: boolean = true;//是否加载所有消耗科室
70 77
   solutionNumber; //编号
78
+  createUserId; //创建人
71 79
 	title; //标题
72 80
   num; //编码
73 81
   deptalias; //别名
@@ -115,7 +123,7 @@ export class RepositoryManageComponent implements OnInit {
115 123
     this.coopData = data;
116 124
     this.showDelModal1();
117 125
   }
118
-	
126
+
119 127
 	// 默认科室
120 128
 	defaDept(){
121 129
 		let itemDept = this.maintainDept.find(i=>i.id == this.hosId)
@@ -123,7 +131,7 @@ export class RepositoryManageComponent implements OnInit {
123 131
 			this.maintainDepartment = itemDept.id
124 132
 		}
125 133
 	}
126
-	
134
+
127 135
   showDelModal1() {
128 136
     this.editModal = true;
129 137
   }
@@ -170,6 +178,7 @@ export class RepositoryManageComponent implements OnInit {
170 178
     this.pageIndex = 1;
171 179
 		this.solutionNumber = null;
172 180
 		this.title = null;
181
+    this.createUserId = undefined;
173 182
 		if(this.coopBtns.strideLook){
174 183
 			this.defaDept()
175 184
 		}
@@ -185,6 +194,7 @@ export class RepositoryManageComponent implements OnInit {
185 194
       solution: {
186 195
     		title:this.title,
187 196
 				solutionNumber:this.solutionNumber,
197
+        createUserId: this.createUserId || undefined,
188 198
     		hosId: this.hosId,
189 199
       },
190 200
     };
@@ -533,4 +543,36 @@ export class RepositoryManageComponent implements OnInit {
533 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
 }