浏览代码

标本信息增加筛选条件

seimin 2 年之前
父节点
当前提交
87366e02f9

+ 59 - 3
src/app/views/specimen-search/specimen-search.component.html

@@ -1,7 +1,7 @@
1
 <div class="list-template">
1
 <div class="list-template">
2
   <div class="list-template__content">
2
   <div class="list-template__content">
3
     <div class="list-template__top" nz-row>
3
     <div class="list-template__top" nz-row>
4
-      <div nz-col nzXl="16" class="list-template__searchBox">
4
+      <div nz-col nzXl="18" class="list-template__searchBox">
5
         <div class="list-template__searchItem">
5
         <div class="list-template__searchItem">
6
           <span class="label">收取科室:</span>
6
           <span class="label">收取科室:</span>
7
           <nz-select
7
           <nz-select
@@ -28,6 +28,31 @@
28
           </nz-select>
28
           </nz-select>
29
         </div>
29
         </div>
30
         <div class="list-template__searchItem">
30
         <div class="list-template__searchItem">
31
+          <span class="label">终点科室:</span>
32
+          <nz-select
33
+            [nzDropdownMatchSelectWidth]="false"
34
+            class="formItem"
35
+            nzServerSearch
36
+            nzShowSearch
37
+            nzAllowClear
38
+            nzPlaceHolder="请选择终点科室"
39
+            [(ngModel)]="searchCriteria.checkDept"
40
+            (nzOnSearch)="changeInp($event, 'search')"
41
+            (nzOpenChange)="changeSearch($event)"
42
+          >
43
+            <ng-container *ngFor="let data of departmentSearch">
44
+              <nz-option
45
+                *ngIf="!isLoading"
46
+                nzLabel="{{ data.dept }}"
47
+                nzValue="{{ data.id }}"
48
+              ></nz-option>
49
+            </ng-container>
50
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
51
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
52
+            </nz-option>
53
+          </nz-select>
54
+        </div>
55
+        <div class="list-template__searchItem">
31
           <span class="label">标本编码:</span>
56
           <span class="label">标本编码:</span>
32
           <input
57
           <input
33
             nz-input
58
             nz-input
@@ -69,8 +94,38 @@
69
             </nz-option>
94
             </nz-option>
70
           </nz-select>
95
           </nz-select>
71
         </div>
96
         </div>
97
+        <div class="list-template__searchItem">
98
+          <span class="label">收取人:</span>
99
+          <nz-select
100
+            [nzDropdownMatchSelectWidth]="false"
101
+            class="formItem"
102
+            nzServerSearch
103
+            nzShowSearch
104
+            nzAllowClear
105
+            nzPlaceHolder="请选择收取人:"
106
+            [(ngModel)]="searchCriteria.receiverName"
107
+            (nzOnSearch)="changeInp2($event, 'search')"
108
+            (nzOpenChange)="changeSearch2($event)"
109
+          >
110
+            <ng-container *ngFor="let data of userSearch">
111
+              <nz-option
112
+                *ngIf="!isLoading"
113
+                nzLabel="{{ data.name }}"
114
+                nzValue="{{ data.id }}"
115
+              ></nz-option>
116
+            </ng-container>
117
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
118
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
119
+            </nz-option>
120
+          </nz-select>
121
+        </div>
122
+        <div class="list-template__searchItem">
123
+          <span class="label">收取时间:</span>
124
+          <nz-range-picker [(ngModel)]="searchCriteria.dateRange" (ngModelChange)="changeDate($event)"></nz-range-picker>
125
+        </div>
126
+        
72
       </div>
127
       </div>
73
-      <div nz-col nzXl="8" class="list-template__btns">
128
+      <div nz-col nzXl="6" class="list-template__btns">
74
         <button
129
         <button
75
           nz-button
130
           nz-button
76
           class="btn default"
131
           class="btn default"
@@ -87,7 +142,8 @@
87
       </div>
142
       </div>
88
     </div>
143
     </div>
89
     <div class="list-template__checkBoxes">
144
     <div class="list-template__checkBoxes">
90
-      <nz-checkbox-group [(ngModel)]="checkOptionsOne" (ngModelChange)="log(checkOptionsOne)"></nz-checkbox-group>
145
+      <div><nz-checkbox-group [(ngModel)]="checkOptionsOne" (ngModelChange)="log(checkOptionsOne)"></nz-checkbox-group></div>
146
+      <div>合计:{{listLength}}</div>
91
     </div>
147
     </div>
92
     <div class="list-template__bottom">
148
     <div class="list-template__bottom">
93
       <nz-table
149
       <nz-table

+ 4 - 1
src/app/views/specimen-search/specimen-search.component.less

@@ -1,5 +1,8 @@
1
 @import "../../../../src/theme.less";
1
 @import "../../../../src/theme.less";
2
-
2
+.list-template__checkBoxes{
3
+  display: flex;
4
+  justify-content: space-between;
5
+}
3
 .save {
6
 .save {
4
   position: fixed;
7
   position: fixed;
5
   left: 0;
8
   left: 0;

+ 104 - 8
src/app/views/specimen-search/specimen-search.component.ts

@@ -3,6 +3,7 @@ import { MainService } from "../../services/main.service";
3
 import { ToolService } from "../../services/tool.service";
3
 import { ToolService } from "../../services/tool.service";
4
 import { Subject } from "rxjs";
4
 import { Subject } from "rxjs";
5
 import { debounceTime } from "rxjs/operators";
5
 import { debounceTime } from "rxjs/operators";
6
+import { format } from "date-fns";
6
 @Component({
7
 @Component({
7
   selector: "app-specimen-search",
8
   selector: "app-specimen-search",
8
   templateUrl: "./specimen-search.component.html",
9
   templateUrl: "./specimen-search.component.html",
@@ -18,22 +19,30 @@ export class SpecimenSearchComponent implements OnInit {
18
     hospital: null,
19
     hospital: null,
19
     department: null,
20
     department: null,
20
     speState: null,
21
     speState: null,
22
+    receiverName: null,
23
+    dateRange: [],
24
+    checkDept: null,
21
   };
25
   };
22
   types = []; // 类型列表(搜索框)
26
   types = []; // 类型列表(搜索框)
23
   departmentSearch = []; // 院区下的科室列表(搜索框)
27
   departmentSearch = []; // 院区下的科室列表(搜索框)
28
+  userSearch = []; // 院区下的人员列表(搜索框)
24
   allHospital: any = []; //院区下拉框
29
   allHospital: any = []; //院区下拉框
25
   listOfData: any[] = []; //表格数据
30
   listOfData: any[] = []; //表格数据
26
   pageIndex: number = 1; //表格当前页码
31
   pageIndex: number = 1; //表格当前页码
27
   pageSize: number = 10; //表格每页展示条数
32
   pageSize: number = 10; //表格每页展示条数
28
   listLength: number = 10; //表格总数据量
33
   listLength: number = 10; //表格总数据量
29
   checkOptionsOne: Array<any> = [
34
   checkOptionsOne: Array<any> = [
30
-    { label: "服务中心收取", value: "0", checked: false },
35
+    { label: "服务中心收取", value: "0", checked: true },
31
   ];
36
   ];
32
   changeInpSubject = new Subject();
37
   changeInpSubject = new Subject();
38
+  changeInp2Subject = new Subject();
33
   ngOnInit() {
39
   ngOnInit() {
34
     this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
40
     this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
35
       this.searchDepartment(v[0], v[1]);
41
       this.searchDepartment(v[0], v[1]);
36
     });
42
     });
43
+    this.changeInp2Subject.pipe(debounceTime(500)).subscribe((v) => {
44
+      this.searchUser(v[0], v[1]);
45
+    });
37
     this.getAllHospital();
46
     this.getAllHospital();
38
   }
47
   }
39
   // 表格筛选
48
   // 表格筛选
@@ -103,6 +112,31 @@ export class SpecimenSearchComponent implements OnInit {
103
   closeModelHistory(e) {
112
   closeModelHistory(e) {
104
     this.historyPromptModalShow = JSON.parse(e).show;
113
     this.historyPromptModalShow = JSON.parse(e).show;
105
   }
114
   }
115
+  // 日期选择
116
+  startDate: string; //发起时间开始
117
+  endDate: string; //发起时间结束
118
+  changeDate(result?): void {
119
+    if (!result) {
120
+      this.startDate = this.endDate = "";
121
+      return;
122
+    }
123
+    this.startDate =
124
+      result[0].getFullYear() +
125
+      "-" +
126
+      (result[0].getMonth() + 1) +
127
+      "-" +
128
+      result[0].getDate() +
129
+      " " +
130
+      "00:00:00";
131
+    this.endDate =
132
+      result[1].getFullYear() +
133
+      "-" +
134
+      (result[1].getMonth() + 1) +
135
+      "-" +
136
+      result[1].getDate() +
137
+      " " +
138
+      "23:59:59";
139
+  }
106
   // 重置
140
   // 重置
107
   reset() {
141
   reset() {
108
     this.searchCriteria = {
142
     this.searchCriteria = {
@@ -112,6 +146,9 @@ export class SpecimenSearchComponent implements OnInit {
112
       hospital: this.allHospital[0] ? this.allHospital[0]["id"] + "" : null,
146
       hospital: this.allHospital[0] ? this.allHospital[0]["id"] + "" : null,
113
       department: null,
147
       department: null,
114
       speState: null,
148
       speState: null,
149
+      receiverName: null,
150
+      dateRange: [],
151
+      checkDept: null,
115
     };
152
     };
116
     this.getList(1);
153
     this.getList(1);
117
   }
154
   }
@@ -133,8 +170,15 @@ export class SpecimenSearchComponent implements OnInit {
133
       this.changeInp("no", "search");
170
       this.changeInp("no", "search");
134
     }
171
     }
135
   }
172
   }
173
+  // 打开搜索框
174
+  changeSearch2(flag) {
175
+    if (flag) {
176
+      this.changeInp2("no", "search");
177
+    }
178
+  }
136
   // 边输边搜节流阀
179
   // 边输边搜节流阀
137
   isLoading = false;
180
   isLoading = false;
181
+  deptKey = "";
138
   changeInp(dept, type) {
182
   changeInp(dept, type) {
139
     if (!dept) {
183
     if (!dept) {
140
       return;
184
       return;
@@ -142,11 +186,11 @@ export class SpecimenSearchComponent implements OnInit {
142
     if (dept === "no") {
186
     if (dept === "no") {
143
       dept = "";
187
       dept = "";
144
     }
188
     }
189
+    this.deptKey = dept;
145
     this.isLoading = true;
190
     this.isLoading = true;
146
     this.changeInpSubject.next([dept, type]);
191
     this.changeInpSubject.next([dept, type]);
147
   }
192
   }
148
   // 搜索科室
193
   // 搜索科室
149
-  snum = 0;
150
   searchDepartment(dept, type) {
194
   searchDepartment(dept, type) {
151
     let data = {
195
     let data = {
152
       department: {
196
       department: {
@@ -156,19 +200,56 @@ export class SpecimenSearchComponent implements OnInit {
156
         },
200
         },
157
       },
201
       },
158
       idx: 0,
202
       idx: 0,
159
-      sum: 20,
203
+      sum: 10,
160
     };
204
     };
161
-    this.snum++;
162
     this.mainService
205
     this.mainService
163
       .getFetchDataList("data", "department", data)
206
       .getFetchDataList("data", "department", data)
164
       .subscribe((data) => {
207
       .subscribe((data) => {
165
-        this.snum--;
166
         if (data.status == 200) {
208
         if (data.status == 200) {
167
           if (type === "search") {
209
           if (type === "search") {
168
-            if (this.snum === 0) {
210
+            if (this.deptKey === dept) {
169
               this.isLoading = false;
211
               this.isLoading = false;
212
+              this.departmentSearch = data.list;
213
+            }
214
+          }
215
+        }
216
+      });
217
+  }
218
+  // 边输边搜节流阀
219
+  userKey = "";
220
+  changeInp2(keyword, type) {
221
+    if (!keyword) {
222
+      return;
223
+    }
224
+    if (keyword === "no") {
225
+      keyword = "";
226
+    }
227
+    this.userKey = keyword;
228
+    this.isLoading = true;
229
+    this.changeInp2Subject.next([keyword, type]);
230
+  }
231
+  // 搜索科室
232
+  searchUser(keyword, type) {
233
+    let data = {
234
+      user: {
235
+        usertype: { id: 106 },
236
+        name: keyword,
237
+        hospital: {
238
+          id: this.searchCriteria.hospital,
239
+        },
240
+      },
241
+      idx: 0,
242
+      sum: 10,
243
+    };
244
+    this.mainService
245
+      .getFetchDataList("data", "user", data)
246
+      .subscribe((data) => {
247
+        if (data.status == 200) {
248
+          if (type === "search") {
249
+            if (this.userKey === keyword) {
250
+              this.isLoading = false;
251
+              this.userSearch = data.list;
170
             }
252
             }
171
-            this.departmentSearch = data.list;
172
           }
253
           }
173
         }
254
         }
174
       });
255
       });
@@ -190,10 +271,11 @@ export class SpecimenSearchComponent implements OnInit {
190
   // 表格数据
271
   // 表格数据
191
   loading1 = false;
272
   loading1 = false;
192
   getList(type) {
273
   getList(type) {
274
+    console.log(this.searchCriteria.dateRange);
193
     if (type == 1) {
275
     if (type == 1) {
194
       this.pageIndex = 1;
276
       this.pageIndex = 1;
195
     }
277
     }
196
-    let postData = {
278
+    let postData: any = {
197
       idx: this.pageIndex - 1,
279
       idx: this.pageIndex - 1,
198
       sum: this.pageSize,
280
       sum: this.pageSize,
199
       specimen: {
281
       specimen: {
@@ -204,6 +286,14 @@ export class SpecimenSearchComponent implements OnInit {
204
               id: this.searchCriteria.department,
286
               id: this.searchCriteria.department,
205
             }
287
             }
206
           : undefined,
288
           : undefined,
289
+        checkDept: this.searchCriteria.checkDept
290
+          ? {
291
+              id: this.searchCriteria.checkDept,
292
+            }
293
+          : undefined,
294
+        receiverName: this.searchCriteria.receiverName
295
+          ? this.searchCriteria.receiverName
296
+          : undefined,
207
         scode: !this.searchCriteria.scode
297
         scode: !this.searchCriteria.scode
208
           ? undefined
298
           ? undefined
209
           : this.searchCriteria.scode,
299
           : this.searchCriteria.scode,
@@ -215,6 +305,12 @@ export class SpecimenSearchComponent implements OnInit {
215
           : undefined,
305
           : undefined,
216
       },
306
       },
217
     };
307
     };
308
+    if (this.searchCriteria.dateRange.length) {
309
+      postData.specimen.startArriveTime =
310
+        format(this.searchCriteria.dateRange[0], "yyyy-MM-dd ") + "00:00:00";
311
+      postData.specimen.endArriveTime =
312
+        format(this.searchCriteria.dateRange[1], "yyyy-MM-dd ") + "23:59:59";
313
+    }
218
     this.loading1 = true;
314
     this.loading1 = true;
219
     this.mainService
315
     this.mainService
220
       .getFetchDataList("simple/data", "specimen", postData)
316
       .getFetchDataList("simple/data", "specimen", postData)

+ 1 - 1
src/main.ts

@@ -8,7 +8,7 @@ if (environment.production) {
8
   enableProdMode();
8
   enableProdMode();
9
   if (window) {
9
   if (window) {
10
     window.console.log = function () { };
10
     window.console.log = function () { };
11
-    console.info('v2.4.8');
11
+    console.info('v2.4.9');
12
   }
12
   }
13
 }
13
 }
14
 platformBrowserDynamic().bootstrapModule(AppModule)
14
 platformBrowserDynamic().bootstrapModule(AppModule)