|
@@ -49,7 +49,7 @@ export class SpecimenSearchComponent implements OnInit {
|
49
|
49
|
// 表格筛选
|
50
|
50
|
log(value: object[]): void {
|
51
|
51
|
console.log(value);
|
52
|
|
- this.getList(1);
|
|
52
|
+ this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
|
53
|
53
|
}
|
54
|
54
|
// 搜索类型
|
55
|
55
|
isLoading1 = false;
|
|
@@ -100,7 +100,7 @@ export class SpecimenSearchComponent implements OnInit {
|
100
|
100
|
setTimeout(() => {
|
101
|
101
|
this.promptModalShow = true;
|
102
|
102
|
}, 100);
|
103
|
|
- this.getList(0);
|
|
103
|
+ this.getList(0, this.sortCurrentKey, this.sortCurrentValue);
|
104
|
104
|
}
|
105
|
105
|
// 查看标本历史记录
|
106
|
106
|
historyPromptModalShow = false; //标本历史记录弹窗开关
|
|
@@ -151,7 +151,12 @@ export class SpecimenSearchComponent implements OnInit {
|
151
|
151
|
dateRange: [],
|
152
|
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
|
162
|
changeHospital(id, type) {
|
|
@@ -265,13 +270,13 @@ export class SpecimenSearchComponent implements OnInit {
|
265
|
270
|
getAllHospital() {
|
266
|
271
|
this.allHospital = [this.tool.getCurrentHospital()];
|
267
|
272
|
this.searchCriteria.hospital = this.tool.getCurrentHospital().id + "";
|
268
|
|
- this.getList(1);
|
|
273
|
+ this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
|
269
|
274
|
this.changeHospital(this.searchCriteria.hospital, "search");
|
270
|
275
|
}
|
271
|
276
|
|
272
|
277
|
// 表格数据
|
273
|
278
|
loading1 = false;
|
274
|
|
- getList(type) {
|
|
279
|
+ getList(type, field?: string, sort?: string) {
|
275
|
280
|
console.log(this.searchCriteria.dateRange);
|
276
|
281
|
if (type == 1) {
|
277
|
282
|
this.pageIndex = 1;
|
|
@@ -306,6 +311,9 @@ export class SpecimenSearchComponent implements OnInit {
|
306
|
311
|
: undefined,
|
307
|
312
|
},
|
308
|
313
|
};
|
|
314
|
+ if (field && sort) {
|
|
315
|
+ postData.specimen.orderBy = sort === "ascend" ? field : `${field} desc`;
|
|
316
|
+ }
|
309
|
317
|
if (this.searchCriteria.dateRange.length) {
|
310
|
318
|
postData.specimen.startArriveTime =
|
311
|
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
|
}
|