Browse Source

业务信息标本排序

seimin 1 year ago
parent
commit
f9a97d7ff9

+ 4 - 4
src/app/views/specimen-search/specimen-search.component.html

@@ -123,13 +123,13 @@
123
           <span class="label">收取时间:</span>
123
           <span class="label">收取时间:</span>
124
           <nz-range-picker [(ngModel)]="searchCriteria.dateRange" (ngModelChange)="changeDate($event)"></nz-range-picker>
124
           <nz-range-picker [(ngModel)]="searchCriteria.dateRange" (ngModelChange)="changeDate($event)"></nz-range-picker>
125
         </div>
125
         </div>
126
-        
126
+
127
       </div>
127
       </div>
128
       <div nz-col nzXl="6" class="list-template__btns">
128
       <div nz-col nzXl="6" class="list-template__btns">
129
         <button
129
         <button
130
           nz-button
130
           nz-button
131
           class="btn default"
131
           class="btn default"
132
-          (click)="showDelModal('您确认要清空标本吗?')"  
132
+          (click)="showDelModal('您确认要清空标本吗?')"
133
           *ngIf="currentUserAccount == 'dsadmin'"
133
           *ngIf="currentUserAccount == 'dsadmin'"
134
         >
134
         >
135
           清空标本
135
           清空标本
@@ -155,7 +155,7 @@
155
         [nzShowPagination]="false"
155
         [nzShowPagination]="false"
156
         [nzLoading]="loading1"
156
         [nzLoading]="loading1"
157
       >
157
       >
158
-        <thead>
158
+        <thead (nzSortChange)="sort($event)" nzSingleSort>
159
           <tr class="thead">
159
           <tr class="thead">
160
             <th nzWidth="4%">序号</th>
160
             <th nzWidth="4%">序号</th>
161
             <th nzWidth="8%">申请科室</th>
161
             <th nzWidth="8%">申请科室</th>
@@ -164,7 +164,7 @@
164
             <th nzWidth="8%">检验项目</th>
164
             <th nzWidth="8%">检验项目</th>
165
             <th nzWidth="8%">标本类型</th>
165
             <th nzWidth="8%">标本类型</th>
166
             <th nzWidth="5%">状态</th>
166
             <th nzWidth="5%">状态</th>
167
-            <th nzWidth="8%">收取时间</th>
167
+            <th nzWidth="8%" nzShowSort nzSortKey="arriveTime" [(nzSort)]="sortCurrent.arriveTime">收取时间</th>
168
             <th nzWidth="8%">收取人</th>
168
             <th nzWidth="8%">收取人</th>
169
             <th nzWidth="8%">中转时间</th>
169
             <th nzWidth="8%">中转时间</th>
170
             <th nzWidth="8%">送达时间</th>
170
             <th nzWidth="8%">送达时间</th>

+ 3 - 0
src/app/views/specimen-search/specimen-search.component.less

@@ -1,4 +1,7 @@
1
 @import "../../../../src/theme.less";
1
 @import "../../../../src/theme.less";
2
+:host ::ng-deep .on {
3
+  color: #fff !important;
4
+}
2
 .list-template__checkBoxes{
5
 .list-template__checkBoxes{
3
   display: flex;
6
   display: flex;
4
   justify-content: space-between;
7
   justify-content: space-between;

+ 26 - 5
src/app/views/specimen-search/specimen-search.component.ts

@@ -49,7 +49,7 @@ export class SpecimenSearchComponent implements OnInit {
49
   // 表格筛选
49
   // 表格筛选
50
   log(value: object[]): void {
50
   log(value: object[]): void {
51
     console.log(value);
51
     console.log(value);
52
-    this.getList(1);
52
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
53
   }
53
   }
54
   // 搜索类型
54
   // 搜索类型
55
   isLoading1 = false;
55
   isLoading1 = false;
@@ -100,7 +100,7 @@ export class SpecimenSearchComponent implements OnInit {
100
     setTimeout(() => {
100
     setTimeout(() => {
101
       this.promptModalShow = true;
101
       this.promptModalShow = true;
102
     }, 100);
102
     }, 100);
103
-    this.getList(0);
103
+    this.getList(0, this.sortCurrentKey, this.sortCurrentValue);
104
   }
104
   }
105
   // 查看标本历史记录
105
   // 查看标本历史记录
106
   historyPromptModalShow = false; //标本历史记录弹窗开关
106
   historyPromptModalShow = false; //标本历史记录弹窗开关
@@ -151,7 +151,12 @@ export class SpecimenSearchComponent implements OnInit {
151
       dateRange: [],
151
       dateRange: [],
152
       checkDept: null,
152
       checkDept: null,
153
     };
153
     };
154
-    this.getList(1);
154
+    this.sortCurrentKey = "";
155
+    this.sortCurrentValue = "";
156
+    this.sortCurrent = {
157
+      arriveTime: null,
158
+    };
159
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
155
   }
160
   }
156
   // 选择院区
161
   // 选择院区
157
   changeHospital(id, type) {
162
   changeHospital(id, type) {
@@ -265,13 +270,13 @@ export class SpecimenSearchComponent implements OnInit {
265
   getAllHospital() {
270
   getAllHospital() {
266
     this.allHospital = [this.tool.getCurrentHospital()];
271
     this.allHospital = [this.tool.getCurrentHospital()];
267
     this.searchCriteria.hospital = this.tool.getCurrentHospital().id + "";
272
     this.searchCriteria.hospital = this.tool.getCurrentHospital().id + "";
268
-    this.getList(1);
273
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
269
     this.changeHospital(this.searchCriteria.hospital, "search");
274
     this.changeHospital(this.searchCriteria.hospital, "search");
270
   }
275
   }
271
 
276
 
272
   // 表格数据
277
   // 表格数据
273
   loading1 = false;
278
   loading1 = false;
274
-  getList(type) {
279
+  getList(type, field?: string, sort?: string) {
275
     console.log(this.searchCriteria.dateRange);
280
     console.log(this.searchCriteria.dateRange);
276
     if (type == 1) {
281
     if (type == 1) {
277
       this.pageIndex = 1;
282
       this.pageIndex = 1;
@@ -306,6 +311,9 @@ export class SpecimenSearchComponent implements OnInit {
306
           : undefined,
311
           : undefined,
307
       },
312
       },
308
     };
313
     };
314
+    if (field && sort) {
315
+      postData.specimen.orderBy = sort === "ascend" ? field : `${field} desc`;
316
+    }
309
     if (this.searchCriteria.dateRange.length) {
317
     if (this.searchCriteria.dateRange.length) {
310
       postData.specimen.startArriveTime =
318
       postData.specimen.startArriveTime =
311
         format(this.searchCriteria.dateRange[0], "yyyy-MM-dd ") + "00:00:00";
319
         format(this.searchCriteria.dateRange[0], "yyyy-MM-dd ") + "00:00:00";
@@ -323,4 +331,17 @@ export class SpecimenSearchComponent implements OnInit {
323
         }
331
         }
324
       });
332
       });
325
   }
333
   }
334
+
335
+  // 列表排序
336
+  sortCurrent = {
337
+    arriveTime: null,
338
+  };
339
+  sortCurrentKey: string = "";
340
+  sortCurrentValue: string | null = "";
341
+  sort(e) {
342
+    const { key, value } = e;
343
+    this.sortCurrentKey = key;
344
+    this.sortCurrentValue = value;
345
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
346
+  }
326
 }
347
 }