|
@@ -0,0 +1,928 @@
|
|
1
|
+import { Component, OnInit, ViewChild, OnDestroy } from "@angular/core";
|
|
2
|
+import { MainService } from "../../services/main.service";
|
|
3
|
+import { Router } from "@angular/router";
|
|
4
|
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
|
|
5
|
+import { startOfDay, format, endOfDay } from "date-fns";
|
|
6
|
+import { ToolService } from 'src/app/services/tool.service';
|
|
7
|
+import { NzMessageService } from "ng-zorro-antd";
|
|
8
|
+import { debounceTime } from 'rxjs/operators';
|
|
9
|
+import { Subject } from 'rxjs';
|
|
10
|
+
|
|
11
|
+import {
|
|
12
|
+ FormBuilder,
|
|
13
|
+ Validators,
|
|
14
|
+ FormGroup,
|
|
15
|
+ FormControl,
|
|
16
|
+} from "@angular/forms";
|
|
17
|
+
|
|
18
|
+@Component({
|
|
19
|
+ selector: "app-pathology-sample",
|
|
20
|
+ templateUrl: "./pathology-sample.component.html",
|
|
21
|
+ styleUrls: ["./pathology-sample.component.less"],
|
|
22
|
+})
|
|
23
|
+export class PathologySampleComponent implements OnInit, OnDestroy {
|
|
24
|
+ @ViewChild("osComponentRef1", {
|
|
25
|
+ read: OverlayScrollbarsComponent,
|
|
26
|
+ static: false,
|
|
27
|
+ })
|
|
28
|
+ osComponentRef1: OverlayScrollbarsComponent;
|
|
29
|
+ @ViewChild("osComponentRef2", {
|
|
30
|
+ read: OverlayScrollbarsComponent,
|
|
31
|
+ static: false,
|
|
32
|
+ })
|
|
33
|
+ osComponentRef2: OverlayScrollbarsComponent;
|
|
34
|
+ @ViewChild("osComponentRef3", {
|
|
35
|
+ read: OverlayScrollbarsComponent,
|
|
36
|
+ static: false,
|
|
37
|
+ })
|
|
38
|
+ osComponentRef3: OverlayScrollbarsComponent;
|
|
39
|
+ @ViewChild("osComponentRef4", {
|
|
40
|
+ read: OverlayScrollbarsComponent,
|
|
41
|
+ static: false,
|
|
42
|
+ })
|
|
43
|
+ osComponentRef4: OverlayScrollbarsComponent;
|
|
44
|
+ @ViewChild("osComponentRef5", {
|
|
45
|
+ read: OverlayScrollbarsComponent,
|
|
46
|
+ static: false,
|
|
47
|
+ })
|
|
48
|
+ osComponentRef5: OverlayScrollbarsComponent;
|
|
49
|
+ constructor(
|
|
50
|
+ private mainService: MainService,
|
|
51
|
+ public router: Router,
|
|
52
|
+ public tool: ToolService,
|
|
53
|
+ private fb: FormBuilder,
|
|
54
|
+ private message: NzMessageService,
|
|
55
|
+ ) {}
|
|
56
|
+ // 今日药单量
|
|
57
|
+ todayTotal: undefined;
|
|
58
|
+ // 今日已完成
|
|
59
|
+ todayComplete: undefined;
|
|
60
|
+ //手术间数据
|
|
61
|
+ printPharmacyList = []; //数据列表
|
|
62
|
+ printPharmacyIdx = 0; //页码
|
|
63
|
+ printPharmacyTotal = 0; //总数
|
|
64
|
+ printPharmacyFlag = false; //是否查看更多
|
|
65
|
+ printPharmacySearchKey = ""; //搜索的内容
|
|
66
|
+ printPharmacyLoad = false; //按钮的loading
|
|
67
|
+ // 标本间列表
|
|
68
|
+ waitPharmacyList = [];
|
|
69
|
+ waitPharmacyIdx = 0;
|
|
70
|
+ waitPharmacyTotal = 0;
|
|
71
|
+ waitPharmacyFlag = false;
|
|
72
|
+ waitPharmacySearchKey = "";
|
|
73
|
+ waitPharmacyLoad = false;
|
|
74
|
+ // 今日离科列表
|
|
75
|
+ pharmacyList = [];
|
|
76
|
+ pharmacyIdx = 0;
|
|
77
|
+ pharmacyTotal = 0;
|
|
78
|
+ pharmacyFlag = false;
|
|
79
|
+ pharmacySearchKey = "";
|
|
80
|
+ pharmacyLoad = false;
|
|
81
|
+ // 配送中列表
|
|
82
|
+ distributionList = [];
|
|
83
|
+ distributionIdx = 0;
|
|
84
|
+ distributionTotal = 0;
|
|
85
|
+ distributionFlag = false;
|
|
86
|
+ distributionSearchKey = "";
|
|
87
|
+ distributionLoad = false;
|
|
88
|
+ // 已完成列表
|
|
89
|
+ completedList = [];
|
|
90
|
+ completedIdx = 0;
|
|
91
|
+ completedTotal = 0;
|
|
92
|
+ completedFlag = false;
|
|
93
|
+ completedSearchKey = "";
|
|
94
|
+ completedLoad = false;
|
|
95
|
+
|
|
96
|
+ barCode:any; //条码搜索
|
|
97
|
+ // other
|
|
98
|
+ loginUser: any = localStorage.getItem("user")
|
|
99
|
+ ? JSON.parse(localStorage.getItem("user")).user
|
|
100
|
+ : null; //登录人信息
|
|
101
|
+
|
|
102
|
+ logTimer = null; //定时器
|
|
103
|
+ logTime = 0; //自动刷新秒数
|
|
104
|
+ logTimeConst = 60; //自动刷新秒数
|
|
105
|
+
|
|
106
|
+ time = new Date().getTime(); // 时间戳
|
|
107
|
+ timer = null; // 时间定时器
|
|
108
|
+ relevanceModal:boolean = false //关联标本和手术室
|
|
109
|
+ validateForm: FormGroup; //关联标本和手术室表单
|
|
110
|
+ validateVerificationForm: FormGroup; //核验标本
|
|
111
|
+ specimenData:any = []; //标本间数据
|
|
112
|
+ operationData:any = []; //手术间数据
|
|
113
|
+ fixationModal:boolean = false //标本接收固定
|
|
114
|
+ verificationMoadl:boolean = false //标本核验
|
|
115
|
+ specimenCode:any; //标本条码
|
|
116
|
+ listOfData:any=[];
|
|
117
|
+ fixativeData:any = []; //固体液类型
|
|
118
|
+ hosId:any;
|
|
119
|
+ userId:any;
|
|
120
|
+ detailsData:any;
|
|
121
|
+ isSpinning:boolean = false; //全屏加载状态
|
|
122
|
+ codeData:any; //标本条码数据
|
|
123
|
+ btnInfoLoading :boolean = false; //标本加固加载
|
|
124
|
+ searchMsg:any = null;
|
|
125
|
+ changeInpSubject = new Subject(); //防抖
|
|
126
|
+ changeInpSubjectSpecimen = new Subject(); //防抖
|
|
127
|
+ ngOnDestroy() {
|
|
128
|
+ clearTimeout(this.timer);
|
|
129
|
+ clearTimeout(this.logTimer);
|
|
130
|
+ }
|
|
131
|
+
|
|
132
|
+ ngOnInit() {
|
|
133
|
+ this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
|
|
134
|
+ this.searchSpecimenData(v[0])
|
|
135
|
+ });
|
|
136
|
+ this.changeInpSubjectSpecimen.pipe(debounceTime(500)).subscribe((v) => {
|
|
137
|
+ this.searchSpecimen(v[0])
|
|
138
|
+ });
|
|
139
|
+ this.hosId = this.tool.getCurrentHospital().id;
|
|
140
|
+ this.userId = this.tool.getCurrentUserId()
|
|
141
|
+ this.runTime();
|
|
142
|
+
|
|
143
|
+ // this.getDept()
|
|
144
|
+
|
|
145
|
+ this.initRole();
|
|
146
|
+ // 自动刷新倒计时 start
|
|
147
|
+ this.autoUpdate();
|
|
148
|
+ // 自动刷新倒计时 end
|
|
149
|
+ setTimeout(_=>{
|
|
150
|
+ document.getElementById('Binput').focus();
|
|
151
|
+ },200)
|
|
152
|
+ }
|
|
153
|
+ // 当前时间日期
|
|
154
|
+ runTime() {
|
|
155
|
+ clearTimeout(this.timer);
|
|
156
|
+ this.timer = setTimeout(() => {
|
|
157
|
+ this.time = Date.now();
|
|
158
|
+ this.runTime();
|
|
159
|
+ }, 500);
|
|
160
|
+ }
|
|
161
|
+
|
|
162
|
+ // 标本条码搜索
|
|
163
|
+ searchSpecimen(e){
|
|
164
|
+ if(!this.barCode){
|
|
165
|
+ return
|
|
166
|
+ }
|
|
167
|
+ if(this.barCode.length < 10) {
|
|
168
|
+ return
|
|
169
|
+ }
|
|
170
|
+ let data={
|
|
171
|
+ barcode:e
|
|
172
|
+ }
|
|
173
|
+ this.isSpinning = true
|
|
174
|
+ clearInterval(this.logTimer);
|
|
175
|
+ this.mainService.pathologyScanCode(data)
|
|
176
|
+ .subscribe((res:any) => {
|
|
177
|
+ this.isSpinning = false
|
|
178
|
+ if(res.status==200){
|
|
179
|
+ this.codeData = res.data[0]
|
|
180
|
+ let item = this.codeData.pathologySpecimenDTOList.find(i=>i.specimenCode == e)
|
|
181
|
+ console.log(7,item)
|
|
182
|
+ if(!item.fixationTime && this.codeData.pathologyFormType==0){
|
|
183
|
+ if(this.codeData.status.value==2 || this.codeData.status.value==3 ||
|
|
184
|
+ this.codeData.status.value==4){
|
|
185
|
+ if(this.codeData.pathologyInspectDTOS){
|
|
186
|
+ this.project = this.codeData.pathologyInspectDTOS.map(i=>{
|
|
187
|
+ return i.inspectProject.name
|
|
188
|
+ })
|
|
189
|
+ this.project = this.project.join('、')
|
|
190
|
+ }
|
|
191
|
+ this.getFixationNum(this.codeData.id)
|
|
192
|
+ }else{
|
|
193
|
+ this.viewDetail(this.codeData,'4')
|
|
194
|
+ }
|
|
195
|
+ this.fixationError = null
|
|
196
|
+ this.searchMsg = null
|
|
197
|
+ }else if(item.fixationTime && this.codeData.pathologyFormType==0){
|
|
198
|
+ this.viewDetail(this.codeData,'4')
|
|
199
|
+ this.barCode = null
|
|
200
|
+ this.fixationError = null
|
|
201
|
+ this.searchMsg = null
|
|
202
|
+ }else{
|
|
203
|
+ this.barCode = null
|
|
204
|
+ this.fixationError = null
|
|
205
|
+ this.searchMsg = '该申请单类型不是病理检查申请单'
|
|
206
|
+ }
|
|
207
|
+
|
|
208
|
+ }else{
|
|
209
|
+ this.barCode = null
|
|
210
|
+ this.searchMsg = res.msg
|
|
211
|
+ }
|
|
212
|
+ })
|
|
213
|
+ }
|
|
214
|
+
|
|
215
|
+ // 获取申请单扫标本信息
|
|
216
|
+ fixationNum:any;
|
|
217
|
+ specimenNum:any;
|
|
218
|
+ totalNum:any
|
|
219
|
+ getFixationNum(id){
|
|
220
|
+ this.mainService.pathologyCheckPrint('pathologyForm',id,{
|
|
221
|
+ operationType:'fixation'
|
|
222
|
+ }).subscribe((res:any)=>{
|
|
223
|
+ this.fixationModal = true
|
|
224
|
+ this.fixationNum = res.fixationNum
|
|
225
|
+ this.specimenNum = res.specimenNum
|
|
226
|
+ this.totalNum = res.totalNum
|
|
227
|
+ setTimeout(_=>{
|
|
228
|
+ document.getElementById('specimen').focus();
|
|
229
|
+ },200)
|
|
230
|
+ })
|
|
231
|
+ }
|
|
232
|
+
|
|
233
|
+ // 选择固定时间
|
|
234
|
+ formChangeDate(result){
|
|
235
|
+ this.startDate = format(result, 'yyyy-MM-dd HH:mm:ss');
|
|
236
|
+ }
|
|
237
|
+
|
|
238
|
+ // 确定接受固定标本
|
|
239
|
+ startDate:any;
|
|
240
|
+ submitFixationForm(){
|
|
241
|
+ this.validateVerificationForm = this.fb.group({
|
|
242
|
+ fixationTime: [null, [Validators.required]],
|
|
243
|
+ jobNumber: [null, [Validators.required]],
|
|
244
|
+ name:[null, [Validators.required]],
|
|
245
|
+ fixative:[null, [Validators.required]],
|
|
246
|
+ });
|
|
247
|
+ let date = new Date();
|
|
248
|
+ this.startDate = format(date, "yyyy-MM-dd HH:mm:ss")
|
|
249
|
+ this.validateVerificationForm.controls.fixationTime.setValue(this.startDate);
|
|
250
|
+ this.btnLoading = true
|
|
251
|
+ this.mainService.getDictionary("list", "fixing_liquid_type").subscribe((res) => {
|
|
252
|
+ this.fixativeData = res
|
|
253
|
+ this.btnLoading = false
|
|
254
|
+ this.verificationMoadl = true
|
|
255
|
+ });
|
|
256
|
+ }
|
|
257
|
+
|
|
258
|
+ // 关闭接受固定标本
|
|
259
|
+ hideSpecimenModal(){
|
|
260
|
+ this.autoUpdate()
|
|
261
|
+ this.cancelSpecimenModal()
|
|
262
|
+ this.barCode = null;
|
|
263
|
+ this.specimenCode = null;
|
|
264
|
+ this.fixationError = null
|
|
265
|
+ this.fixationModal = false;
|
|
266
|
+ setTimeout(_=>{
|
|
267
|
+ document.getElementById('Binput').focus();
|
|
268
|
+ },200)
|
|
269
|
+ }
|
|
270
|
+
|
|
271
|
+ cancelSpecimenModal(){
|
|
272
|
+ let ids = []
|
|
273
|
+ for(let i of this.codeData.pathologySpecimenDTOList){
|
|
274
|
+ ids.push(i.id)
|
|
275
|
+ }
|
|
276
|
+ let data = {
|
|
277
|
+ pathologySpecimenIds:ids.join(',')
|
|
278
|
+ }
|
|
279
|
+ this.mainService.pathologyOperation(data,'cancel').subscribe((res) =>{
|
|
280
|
+
|
|
281
|
+ })
|
|
282
|
+ }
|
|
283
|
+
|
|
284
|
+ // 获取标本详情
|
|
285
|
+ project:any = [];
|
|
286
|
+ getSampleData(item){
|
|
287
|
+ this.mainService.getFetchData("data", "pathologyForm", item.id)
|
|
288
|
+ .subscribe((data) => {
|
|
289
|
+ this.isSpinning = false
|
|
290
|
+ this.detailsData = data.data
|
|
291
|
+ this.specimenList = data.data.pathologySpecimenDTOList||[]
|
|
292
|
+ this.pathologyLogs = data.data.formLogDTOS
|
|
293
|
+ this.stepLength = this.pathologyLogs.length
|
|
294
|
+ if(this.detailsData.pathologyInspectDTOS){
|
|
295
|
+ this.project = this.detailsData.pathologyInspectDTOS.map(i=>{
|
|
296
|
+ return i.inspectProject.name
|
|
297
|
+ })
|
|
298
|
+ this.project = this.project.join('、')
|
|
299
|
+ }
|
|
300
|
+ this.detailMoadl = true
|
|
301
|
+ });
|
|
302
|
+ }
|
|
303
|
+
|
|
304
|
+ // 关闭查看标本
|
|
305
|
+ closeSpecimenModal(){
|
|
306
|
+ this.specimenViewDialog = false
|
|
307
|
+ }
|
|
308
|
+
|
|
309
|
+ // 查看标本
|
|
310
|
+ specimenViewDialog:any = false;
|
|
311
|
+ viewData:any = [];
|
|
312
|
+ specimenItem:any;
|
|
313
|
+ specimenView(item){
|
|
314
|
+ this.viewData = []
|
|
315
|
+ this.specimenViewDialog = true
|
|
316
|
+ this.specimenItem = item;
|
|
317
|
+ this.viewData.push(item)
|
|
318
|
+ }
|
|
319
|
+
|
|
320
|
+ // 获取科室
|
|
321
|
+ getDept(){
|
|
322
|
+ this.setSpecimen()
|
|
323
|
+ var that = this;
|
|
324
|
+ that.mainService.getDictionary("list", "dept_type").subscribe((res2) => {
|
|
325
|
+ let item1 = res2.find(i=>i.name=='手术室科室')
|
|
326
|
+ let item2 = res2.find(i=>i.name=='标本间科室')
|
|
327
|
+ let data1 = {
|
|
328
|
+ idx: 0,
|
|
329
|
+ sum: 9999,
|
|
330
|
+ department: {
|
|
331
|
+ hospital: { id: that.hosId || "" },
|
|
332
|
+ type: { id: item1.id || "" },
|
|
333
|
+ },
|
|
334
|
+ };
|
|
335
|
+ let data2 = {
|
|
336
|
+ idx: 0,
|
|
337
|
+ sum: 9999,
|
|
338
|
+ department: {
|
|
339
|
+ hospital: { id: that.hosId || "" },
|
|
340
|
+ type: { id: item2.id || "" },
|
|
341
|
+ },
|
|
342
|
+ };
|
|
343
|
+ that.mainService
|
|
344
|
+ .getFetchDataList("data", "department", data1)
|
|
345
|
+ .subscribe((res) => {
|
|
346
|
+ that.operationData = res.list;
|
|
347
|
+ });
|
|
348
|
+
|
|
349
|
+ that.mainService
|
|
350
|
+ .getFetchDataList("data", "department", data2)
|
|
351
|
+ .subscribe((res) => {
|
|
352
|
+ that.specimenData = res.list
|
|
353
|
+ this.getDeptDetail()
|
|
354
|
+ });
|
|
355
|
+ });
|
|
356
|
+ }
|
|
357
|
+
|
|
358
|
+ // 获取关联科室详情
|
|
359
|
+ getDeptDetail(){
|
|
360
|
+ this.mainService
|
|
361
|
+ .transfusionPrint("user", this.userId)
|
|
362
|
+ .subscribe((res) => {
|
|
363
|
+ let data = res.data;
|
|
364
|
+ if(data.surgeryDepts){
|
|
365
|
+ let deptArr = []
|
|
366
|
+ for(let i of data.surgeryDepts){
|
|
367
|
+ deptArr.push(i.id)
|
|
368
|
+ }
|
|
369
|
+ this.validateForm.controls.operation.setValue(deptArr);
|
|
370
|
+ }
|
|
371
|
+ this.validateForm.controls.specimen.setValue(data.dept.id);
|
|
372
|
+ if(data.autoCreateOrder){
|
|
373
|
+ this.validateForm.controls.generate.setValue(data.autoCreateOrder);
|
|
374
|
+ }
|
|
375
|
+ });
|
|
376
|
+ }
|
|
377
|
+
|
|
378
|
+ // 获取是否关联标本间
|
|
379
|
+ setSpecimen(){
|
|
380
|
+ if(this.validateForm){
|
|
381
|
+ this.validateForm = this.fb.group({
|
|
382
|
+ specimen: [this.validateForm.value.specimen, [Validators.required]],
|
|
383
|
+ operation: [this.validateForm.value.operation, [Validators.required]],
|
|
384
|
+ generate:[this.validateForm.value.generate, [Validators.required]],
|
|
385
|
+ });
|
|
386
|
+ }else{
|
|
387
|
+ this.validateForm = this.fb.group({
|
|
388
|
+ specimen: [null, [Validators.required]],
|
|
389
|
+ operation: [null, [Validators.required]],
|
|
390
|
+ generate:[1, [Validators.required]],
|
|
391
|
+ });
|
|
392
|
+ }
|
|
393
|
+ this.relevanceModal = true
|
|
394
|
+ }
|
|
395
|
+
|
|
396
|
+ // 确定关联科室
|
|
397
|
+ btnLoading:boolean = false;
|
|
398
|
+ submitForm(){
|
|
399
|
+ for (const i in this.validateForm.controls) {
|
|
400
|
+ this.validateForm.controls[i].markAsDirty();
|
|
401
|
+ this.validateForm.controls[i].updateValueAndValidity();
|
|
402
|
+ }
|
|
403
|
+ if (this.validateForm.invalid) return;
|
|
404
|
+ let deptArr = this.validateForm.value.operation.join(',')
|
|
405
|
+ let data = {
|
|
406
|
+ user: {
|
|
407
|
+ autoCreateOrder: this.validateForm.value.generate,
|
|
408
|
+ dept:{
|
|
409
|
+ id:this.validateForm.value.specimen
|
|
410
|
+ },
|
|
411
|
+ surgeryDeptIds:deptArr,
|
|
412
|
+ id:this.userId
|
|
413
|
+ },
|
|
414
|
+ };
|
|
415
|
+ this.btnLoading = true
|
|
416
|
+ this.mainService
|
|
417
|
+ .coopData("updData", "user", data)
|
|
418
|
+ .subscribe((data) => {
|
|
419
|
+ this.getNewDept()
|
|
420
|
+ // 手术间列表
|
|
421
|
+ this.getPharmacyList(this.printPharmacyIdx, 'surgeryDept', this.printPharmacySearchKey);
|
|
422
|
+ // 标本间列表
|
|
423
|
+ this.getPharmacyList(this.waitPharmacyIdx, 'specimenDept', this.waitPharmacySearchKey);
|
|
424
|
+ // 今日离科标本列表
|
|
425
|
+ this.getPharmacyList(this.pharmacyIdx, 'leavedDept', this.pharmacySearchKey);
|
|
426
|
+ this.btnLoading = false
|
|
427
|
+ this.relevanceModal = false
|
|
428
|
+ if (data.status == 200) {
|
|
429
|
+ this.showPromptModal("操作", true, "");
|
|
430
|
+ } else {
|
|
431
|
+ this.showPromptModal("操作", false, data.msg);
|
|
432
|
+ }
|
|
433
|
+ });
|
|
434
|
+ }
|
|
435
|
+
|
|
436
|
+ getNewDept(){
|
|
437
|
+ let postData = {
|
|
438
|
+ currentHosId: this.hosId,
|
|
439
|
+ loginType: "PC",
|
|
440
|
+ };
|
|
441
|
+ this.mainService.changeHospital(postData).subscribe((result) => {
|
|
442
|
+ if (result.status == 200) {
|
|
443
|
+ let dataObj = {
|
|
444
|
+ user: {
|
|
445
|
+ dept: {
|
|
446
|
+ id: this.validateForm.value.specimen,
|
|
447
|
+ },
|
|
448
|
+ id: JSON.parse(localStorage.getItem("user")).user.id,
|
|
449
|
+ },
|
|
450
|
+ };
|
|
451
|
+ this.mainService
|
|
452
|
+ .coopData("updData", "user", dataObj)
|
|
453
|
+ .subscribe((data) => {
|
|
454
|
+ if (data.status == 200) {
|
|
455
|
+ this.getCurrentUserNow();
|
|
456
|
+ }
|
|
457
|
+ });
|
|
458
|
+ }
|
|
459
|
+ });
|
|
460
|
+ }
|
|
461
|
+
|
|
462
|
+ // 获取当前用户信息
|
|
463
|
+ getCurrentUserNow() {
|
|
464
|
+ this.mainService.getCurrentUser1().subscribe((data:any) => {
|
|
465
|
+ if (data["status"] == 200) {
|
|
466
|
+ this.loginUser = data.data
|
|
467
|
+ let user = JSON.parse(localStorage.getItem("user"));
|
|
468
|
+ user.user.dept = data["data"].dept;
|
|
469
|
+ user.user.currentHospital = data["data"].currentHospital;
|
|
470
|
+ localStorage.setItem("user", JSON.stringify(user));
|
|
471
|
+ }
|
|
472
|
+ });
|
|
473
|
+ }
|
|
474
|
+
|
|
475
|
+ // 输入工号查询姓名
|
|
476
|
+ handoverUserId:any = null;
|
|
477
|
+ numberChange(e){
|
|
478
|
+ if(e.length < 3) {
|
|
479
|
+ this.validateVerificationForm.controls.name.setValue('');
|
|
480
|
+ return
|
|
481
|
+ }
|
|
482
|
+ let query = {
|
|
483
|
+ account: e
|
|
484
|
+ };
|
|
485
|
+ this.mainService
|
|
486
|
+ .jobSearch(query)
|
|
487
|
+ .subscribe((data:any) => {
|
|
488
|
+ if(data.status==200){
|
|
489
|
+ this.validateVerificationForm.controls.name.setValue(data.userName);
|
|
490
|
+ this.handoverUserId = data.userId
|
|
491
|
+ }else{
|
|
492
|
+ this.validateVerificationForm.controls.name.setValue('');
|
|
493
|
+ this.handoverUserId =null
|
|
494
|
+ // this.message.error(data.data)
|
|
495
|
+ }
|
|
496
|
+ });
|
|
497
|
+ }
|
|
498
|
+
|
|
499
|
+ // 提交固定标本接收
|
|
500
|
+ submitVerificationForm(){
|
|
501
|
+ for (const i in this.validateVerificationForm.controls) {
|
|
502
|
+ this.validateVerificationForm.controls[i].markAsDirty();
|
|
503
|
+ this.validateVerificationForm.controls[i].updateValueAndValidity();
|
|
504
|
+ }
|
|
505
|
+ if (this.validateVerificationForm.invalid) return;
|
|
506
|
+ let str = this.codeData.pathologySpecimenDTOList.map(i=>{
|
|
507
|
+ return i.specimenCode
|
|
508
|
+ })
|
|
509
|
+ let data: any = {
|
|
510
|
+ id:this.codeData.id,
|
|
511
|
+ specimenDeptId:this.validateForm.value.specimen,
|
|
512
|
+ specimenFixingLiquid:{
|
|
513
|
+ id:this.validateVerificationForm.value.fixative
|
|
514
|
+ },
|
|
515
|
+ specimenCodes:str.join(','),
|
|
516
|
+ fixationTime:this.startDate,
|
|
517
|
+ hosId: this.hosId || "" ,
|
|
518
|
+ handoverUserId:this.handoverUserId
|
|
519
|
+ };
|
|
520
|
+ this.btnInfoLoading = true;
|
|
521
|
+ this.mainService
|
|
522
|
+ .simplePost("addData", "pathologyForm", data)
|
|
523
|
+ .subscribe((res) => {
|
|
524
|
+ this.autoUpdate(false)
|
|
525
|
+ this.btnInfoLoading = false;
|
|
526
|
+ this.barCode = null;
|
|
527
|
+ // 手术间列表
|
|
528
|
+ this.getPharmacyList(this.printPharmacyIdx, 'surgeryDept', this.printPharmacySearchKey);
|
|
529
|
+ // 标本间列表
|
|
530
|
+ this.getPharmacyList(this.waitPharmacyIdx, 'specimenDept', this.waitPharmacySearchKey);
|
|
531
|
+ // 今日离科标本列表
|
|
532
|
+ this.getPharmacyList(this.pharmacyIdx, 'leavedDept', this.pharmacySearchKey);
|
|
533
|
+ if (res.status == 200) {
|
|
534
|
+ this.showPromptModal("操作", true, "");
|
|
535
|
+ } else {
|
|
536
|
+ this.showPromptModal("操作", false, res.msg);
|
|
537
|
+ }
|
|
538
|
+ });
|
|
539
|
+ }
|
|
540
|
+
|
|
541
|
+ closeModel(){
|
|
542
|
+ this.verificationMoadl = false
|
|
543
|
+ this.fixationModal = false
|
|
544
|
+ setTimeout(_=>{
|
|
545
|
+ document.getElementById('Binput').focus();
|
|
546
|
+ },200)
|
|
547
|
+ }
|
|
548
|
+
|
|
549
|
+ // 关闭固定接受标本
|
|
550
|
+ hideVerificationModal(){
|
|
551
|
+ this.verificationMoadl = false
|
|
552
|
+ setTimeout(_=>{
|
|
553
|
+ document.getElementById('Binput').focus();
|
|
554
|
+ },200)
|
|
555
|
+ }
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+ // 监听标本条码
|
|
559
|
+ specimenCodeChange(e){
|
|
560
|
+ this.changeInpSubjectSpecimen.next([e]);
|
|
561
|
+ }
|
|
562
|
+
|
|
563
|
+ // 监听接受固定标本条码
|
|
564
|
+ tableLoading:boolean = false;
|
|
565
|
+ codeChange(e){
|
|
566
|
+ this.changeInpSubject.next([e]);
|
|
567
|
+ }
|
|
568
|
+
|
|
569
|
+ fixationError:any;
|
|
570
|
+ searchSpecimenData(e){
|
|
571
|
+ if(!e){
|
|
572
|
+ return
|
|
573
|
+ }
|
|
574
|
+ if(e.length < 10) {
|
|
575
|
+ return
|
|
576
|
+ }
|
|
577
|
+ this.tableLoading = true
|
|
578
|
+ this.mainService.pathologyScanCode({
|
|
579
|
+ barcode:e,
|
|
580
|
+ pathologyFormId:this.codeData.id
|
|
581
|
+ })
|
|
582
|
+ .subscribe((res:any) => {
|
|
583
|
+ this.autoUpdate(false)
|
|
584
|
+ this.tableLoading = false
|
|
585
|
+ this.specimenCode = null
|
|
586
|
+ if(res.status==200){
|
|
587
|
+ let item = res.data[0].pathologySpecimenDTOList.find(i=>i.specimenCode == e)
|
|
588
|
+ if(item.fixationTime){
|
|
589
|
+ this.fixationError = '该标本已经固定过'
|
|
590
|
+ }else{
|
|
591
|
+ this.getFixationNum(res.data[0].id)
|
|
592
|
+ this.codeData = res.data[0]
|
|
593
|
+ this.fixationError = null
|
|
594
|
+ }
|
|
595
|
+ }else{
|
|
596
|
+ this.fixationError = res.msg
|
|
597
|
+ }
|
|
598
|
+ })
|
|
599
|
+ }
|
|
600
|
+
|
|
601
|
+ // 查看详情
|
|
602
|
+ detailMoadl:boolean = false;
|
|
603
|
+ pathologyLogs:any=[];
|
|
604
|
+ specimenList:any=[]
|
|
605
|
+ stepLength:any = 0;
|
|
606
|
+ viewDetail(item,type){
|
|
607
|
+ this.isSpinning = true
|
|
608
|
+ this.getSampleData(item)
|
|
609
|
+ clearInterval(this.logTimer);
|
|
610
|
+ }
|
|
611
|
+
|
|
612
|
+ closeDetailMoadl(){
|
|
613
|
+ setTimeout(_=>{
|
|
614
|
+ document.getElementById('Binput').focus();
|
|
615
|
+ },200)
|
|
616
|
+ this.detailMoadl = false
|
|
617
|
+ this.autoUpdate(false);
|
|
618
|
+ }
|
|
619
|
+
|
|
620
|
+ // 自动刷新倒计时
|
|
621
|
+ autoUpdate(flag = true) {
|
|
622
|
+ if (flag) {
|
|
623
|
+ this.logTime = this.logTimeConst;
|
|
624
|
+ }
|
|
625
|
+ clearInterval(this.logTimer);
|
|
626
|
+ this.logTimer = setInterval(() => {
|
|
627
|
+ this.logTime--;
|
|
628
|
+ if (this.logTime === 0) {
|
|
629
|
+ this.logTime = this.logTimeConst;
|
|
630
|
+ // 代收急查标本(标本信息)列表
|
|
631
|
+ this.getPharmacyList(0, 'surgeryDept', this.printPharmacySearchKey);
|
|
632
|
+ // 已收取(工单信息)列表
|
|
633
|
+ this.getPharmacyList(0, 'specimenDept', this.waitPharmacySearchKey);
|
|
634
|
+ // 中转标本(标本统计信息)列表
|
|
635
|
+ this.getPharmacyList(0, 'leavedDept', this.pharmacySearchKey);
|
|
636
|
+
|
|
637
|
+ }
|
|
638
|
+ }, 1000);
|
|
639
|
+ }
|
|
640
|
+ // 药房端药房列表查询、搜索
|
|
641
|
+ // 1为pc待打印状态、2为pc配药中、3为pc核对中、4为pc配送中
|
|
642
|
+ // searchKey 为搜索的关键字,没有就不传
|
|
643
|
+ loading1 = false;
|
|
644
|
+ loading2 = false;
|
|
645
|
+ loading3 = false;
|
|
646
|
+ loading4 = false;
|
|
647
|
+ loading5 = false;
|
|
648
|
+ getPharmacyList(idx, type, searchKey) {
|
|
649
|
+ let hosId = JSON.parse(localStorage.getItem("user")).user.currentHospital.id;
|
|
650
|
+ switch (type) {
|
|
651
|
+ case 'surgeryDept':
|
|
652
|
+ this.loading1 = true;
|
|
653
|
+ break;
|
|
654
|
+ case 'specimenDept':
|
|
655
|
+ this.loading2 = true;
|
|
656
|
+ break;
|
|
657
|
+ case 'leavedDept':
|
|
658
|
+ this.loading3 = true;
|
|
659
|
+ break;
|
|
660
|
+ }
|
|
661
|
+ let postData = {
|
|
662
|
+ idx: 0,
|
|
663
|
+ sum: 50,
|
|
664
|
+ pathologyForm:{
|
|
665
|
+ detailsType: type,
|
|
666
|
+ keyWords:searchKey,
|
|
667
|
+ hosId,
|
|
668
|
+ }
|
|
669
|
+ };
|
|
670
|
+ this.mainService
|
|
671
|
+ .getFetchDataList("data", "pathologyForm", postData)
|
|
672
|
+ .subscribe((result) => {
|
|
673
|
+ switch (type) {
|
|
674
|
+ case 'surgeryDept':
|
|
675
|
+ this.loading1 = false;
|
|
676
|
+ break;
|
|
677
|
+ case 'specimenDept':
|
|
678
|
+ this.loading2 = false;
|
|
679
|
+ break;
|
|
680
|
+ case 'leavedDept':
|
|
681
|
+ this.loading3 = false;
|
|
682
|
+ break;
|
|
683
|
+ }
|
|
684
|
+ if (result["status"] == 200) {
|
|
685
|
+ switch (type) {
|
|
686
|
+ case 'surgeryDept':
|
|
687
|
+ // 总数
|
|
688
|
+ this.printPharmacyTotal = result.totalNum;
|
|
689
|
+ // 隐藏按钮的loading
|
|
690
|
+ this.printPharmacyLoad = false;
|
|
691
|
+ // 查看更多,是否显示
|
|
692
|
+ if (result["list"].length < 10) {
|
|
693
|
+ this.printPharmacyFlag = false;
|
|
694
|
+ } else if (result["list"].length === 0 && idx === 0) {
|
|
695
|
+ this.printPharmacyFlag = false;
|
|
696
|
+ } else {
|
|
697
|
+ this.printPharmacyFlag = true;
|
|
698
|
+ }
|
|
699
|
+ // 列表数据合并
|
|
700
|
+ if (idx === 0) {
|
|
701
|
+ this.printPharmacyList = result["list"];
|
|
702
|
+ } else {
|
|
703
|
+ this.printPharmacyList = [
|
|
704
|
+ ...this.printPharmacyList,
|
|
705
|
+ ...result["list"],
|
|
706
|
+ ];
|
|
707
|
+ }
|
|
708
|
+ break;
|
|
709
|
+ case 'specimenDept':
|
|
710
|
+ this.waitPharmacyTotal = result.totalNum;
|
|
711
|
+ this.waitPharmacyLoad = false;
|
|
712
|
+ if (result["list"].length < 10) {
|
|
713
|
+ this.waitPharmacyFlag = false;
|
|
714
|
+ } else if (result["list"].length === 0 && idx === 0) {
|
|
715
|
+ this.waitPharmacyFlag = false;
|
|
716
|
+ } else {
|
|
717
|
+ this.waitPharmacyFlag = true;
|
|
718
|
+ }
|
|
719
|
+ if (idx === 0) {
|
|
720
|
+ this.waitPharmacyList = result["list"];
|
|
721
|
+ } else {
|
|
722
|
+ this.waitPharmacyList = [
|
|
723
|
+ ...this.waitPharmacyList,
|
|
724
|
+ ...result["list"],
|
|
725
|
+ ];
|
|
726
|
+ }
|
|
727
|
+ break;
|
|
728
|
+ case 'leavedDept':
|
|
729
|
+ this.pharmacyTotal = result.totalNum;
|
|
730
|
+ this.pharmacyLoad = false;
|
|
731
|
+ if (result["list"].length < 10) {
|
|
732
|
+ this.pharmacyFlag = false;
|
|
733
|
+ } else if (result["list"].length === 0 && idx === 0) {
|
|
734
|
+ this.pharmacyFlag = false;
|
|
735
|
+ } else {
|
|
736
|
+ this.pharmacyFlag = true;
|
|
737
|
+ }
|
|
738
|
+ if (idx === 0) {
|
|
739
|
+ this.pharmacyList = result["list"];
|
|
740
|
+ } else {
|
|
741
|
+ this.pharmacyList = [...this.pharmacyList, ...result["list"]];
|
|
742
|
+ }
|
|
743
|
+ break;
|
|
744
|
+ }
|
|
745
|
+ }
|
|
746
|
+ });
|
|
747
|
+ }
|
|
748
|
+ // 加载更多
|
|
749
|
+ // loadMore(type) {
|
|
750
|
+ // switch (type) {
|
|
751
|
+ // case 'surgeryDept':
|
|
752
|
+ // this.printPharmacyIdx++;
|
|
753
|
+ // this.printPharmacyLoad = true;
|
|
754
|
+ // this.getPharmacyList(
|
|
755
|
+ // this.printPharmacyIdx,
|
|
756
|
+ // type,
|
|
757
|
+ // this.printPharmacySearchKey
|
|
758
|
+ // );
|
|
759
|
+ // break;
|
|
760
|
+ // case 'specimenDept':
|
|
761
|
+ // this.waitPharmacyIdx++;
|
|
762
|
+ // this.waitPharmacyLoad = true;
|
|
763
|
+ // this.getPharmacyList(
|
|
764
|
+ // this.waitPharmacyIdx,
|
|
765
|
+ // type,
|
|
766
|
+ // this.waitPharmacySearchKey
|
|
767
|
+ // );
|
|
768
|
+ // break;
|
|
769
|
+ // case 'leavedDept':
|
|
770
|
+ // this.pharmacyIdx++;
|
|
771
|
+ // this.pharmacyLoad = true;
|
|
772
|
+ // this.getPharmacyList(this.pharmacyIdx, type, this.pharmacySearchKey);
|
|
773
|
+ // break;
|
|
774
|
+ // }
|
|
775
|
+ // }
|
|
776
|
+ // 搜索关键词
|
|
777
|
+ searchKeyHandle(type) {
|
|
778
|
+ switch (type) {
|
|
779
|
+ case 'surgeryDept':
|
|
780
|
+ this.printPharmacyIdx = 0; //页码重置
|
|
781
|
+ this.printPharmacyList = []; //列表重置
|
|
782
|
+ this.getPharmacyList(
|
|
783
|
+ this.printPharmacyIdx,
|
|
784
|
+ type,
|
|
785
|
+ this.printPharmacySearchKey
|
|
786
|
+ );
|
|
787
|
+ break;
|
|
788
|
+ case 'specimenDept':
|
|
789
|
+ this.waitPharmacyIdx = 0; //页码重置
|
|
790
|
+ this.waitPharmacyList = []; //列表重置
|
|
791
|
+ this.getPharmacyList(
|
|
792
|
+ this.waitPharmacyIdx,
|
|
793
|
+ type,
|
|
794
|
+ this.waitPharmacySearchKey
|
|
795
|
+ );
|
|
796
|
+ break;
|
|
797
|
+ case 'leavedDept':
|
|
798
|
+ this.pharmacyIdx = 0; //页码重置
|
|
799
|
+ this.pharmacyList = []; //列表重置
|
|
800
|
+ this.getPharmacyList(this.pharmacyIdx, type, this.pharmacySearchKey);
|
|
801
|
+ break;
|
|
802
|
+ }
|
|
803
|
+ }
|
|
804
|
+ // 退出
|
|
805
|
+ logOut(): void {
|
|
806
|
+ // 假退出
|
|
807
|
+ let hospital = this.tool.getCurrentHospital();
|
|
808
|
+ if(hospital){
|
|
809
|
+ this.router.navigate(["login", hospital.id]);
|
|
810
|
+ }else{
|
|
811
|
+ this.router.navigateByUrl("login");
|
|
812
|
+ }
|
|
813
|
+ localStorage.removeItem("user");
|
|
814
|
+ localStorage.removeItem("menu");
|
|
815
|
+ localStorage.removeItem("index");
|
|
816
|
+ // 假退出
|
|
817
|
+ this.mainService.logOut().subscribe((data) => {
|
|
818
|
+ if (data.status == 200) {
|
|
819
|
+ if(hospital){
|
|
820
|
+ this.router.navigate(["login", hospital.id]);
|
|
821
|
+ }else{
|
|
822
|
+ this.router.navigateByUrl("login");
|
|
823
|
+ }
|
|
824
|
+ localStorage.removeItem("user");
|
|
825
|
+ localStorage.removeItem("menu");
|
|
826
|
+ localStorage.removeItem("index");
|
|
827
|
+ }
|
|
828
|
+ });
|
|
829
|
+
|
|
830
|
+ }
|
|
831
|
+
|
|
832
|
+ // 右侧菜单
|
|
833
|
+ showLastItems: boolean = false;
|
|
834
|
+ // 下拉
|
|
835
|
+ fixedMenuXiala() {
|
|
836
|
+ this.showLastItems = true;
|
|
837
|
+ }
|
|
838
|
+
|
|
839
|
+ // 上拉
|
|
840
|
+ fixedMenuShangla() {
|
|
841
|
+ this.showLastItems = false;
|
|
842
|
+ }
|
|
843
|
+
|
|
844
|
+ mainRole: boolean = false; //回到系统管理权限
|
|
845
|
+ initRole() {
|
|
846
|
+ let menus = JSON.parse(localStorage.getItem("menu"));
|
|
847
|
+ console.log("菜单数量" + menus.length);
|
|
848
|
+ if (menus.length >= 2) {
|
|
849
|
+ this.mainRole = true;
|
|
850
|
+ return;
|
|
851
|
+ }
|
|
852
|
+ }
|
|
853
|
+
|
|
854
|
+ // 切换右侧菜单Tab
|
|
855
|
+ fixedTab: string = "";
|
|
856
|
+ checkFixedTab(type: string) {
|
|
857
|
+ if (type == "toSystem") {
|
|
858
|
+ this.router.navigateByUrl("main");
|
|
859
|
+ }
|
|
860
|
+ if (this.fixedTab == type) {
|
|
861
|
+ this.fixedTab = "";
|
|
862
|
+ } else {
|
|
863
|
+ this.fixedTab = type;
|
|
864
|
+ }
|
|
865
|
+ }
|
|
866
|
+ //药房端科室切换
|
|
867
|
+ changeShow = true;
|
|
868
|
+ closeTime = 3;
|
|
869
|
+ closeTimeFlag = 0;
|
|
870
|
+ hsPromptModalShow: boolean = false; //科室切换提示框是否展示
|
|
871
|
+ timerCloseTime = null;
|
|
872
|
+ deptDisplay = 1; //护士端是否显示可以别名,1是显示科室名称,2是显示科室别名
|
|
873
|
+ //子传父接收
|
|
874
|
+ closeModelHs(e) {
|
|
875
|
+ this.hsPromptModalShow = JSON.parse(e).show;
|
|
876
|
+ this.changeShow = JSON.parse(e).changeShow;
|
|
877
|
+ }
|
|
878
|
+ //子传父接收
|
|
879
|
+ clearModelHs(e) {
|
|
880
|
+ if (JSON.parse(e).clear === true) {
|
|
881
|
+ clearInterval(this.timerCloseTime);
|
|
882
|
+ }
|
|
883
|
+ this.changeShow = JSON.parse(e).changeShow;
|
|
884
|
+ }
|
|
885
|
+ // 头部切换科室
|
|
886
|
+ changeKsNow() {
|
|
887
|
+ this.hsPromptModalShow = true;
|
|
888
|
+ clearInterval(this.timerCloseTime);
|
|
889
|
+ this.changeShow = false;
|
|
890
|
+ }
|
|
891
|
+ // 切换科室
|
|
892
|
+ changeKs() {
|
|
893
|
+ this.hsPromptModalShow = true;
|
|
894
|
+ // (1) 当用户设置为正数时,用户必须查看此窗体指定秒数。
|
|
895
|
+ // (2) 当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
|
|
896
|
+ // (3) 如果用户填写0则为无自动关闭和强制查看时间。
|
|
897
|
+ if (this.closeTimeFlag === 0) {
|
|
898
|
+ return;
|
|
899
|
+ }
|
|
900
|
+ this.closeTime = Math.abs(this.closeTimeFlag);
|
|
901
|
+ clearInterval(this.timerCloseTime);
|
|
902
|
+ this.timerCloseTime = setInterval(() => {
|
|
903
|
+ this.closeTime = Math.max(--this.closeTime, 0);
|
|
904
|
+ if (this.closeTime === 0) {
|
|
905
|
+ if (this.closeTimeFlag <= 0) {
|
|
906
|
+ this.hsPromptModalShow = false;
|
|
907
|
+ }
|
|
908
|
+ clearInterval(this.timerCloseTime);
|
|
909
|
+ }
|
|
910
|
+ }, 1000);
|
|
911
|
+ }
|
|
912
|
+
|
|
913
|
+ promptModalShow:boolean = false;
|
|
914
|
+ promptContent:any = null;
|
|
915
|
+ ifSuccess:any = null;
|
|
916
|
+ promptInfo:any = null;
|
|
917
|
+ // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
|
|
918
|
+ showPromptModal(con, success, promptInfo?) {
|
|
919
|
+ this.promptModalShow = false;
|
|
920
|
+ this.promptContent = con;
|
|
921
|
+ this.ifSuccess = success;
|
|
922
|
+ this.promptInfo = promptInfo;
|
|
923
|
+ setTimeout(() => {
|
|
924
|
+ this.promptModalShow = true;
|
|
925
|
+ }, 100);
|
|
926
|
+ }
|
|
927
|
+}
|
|
928
|
+
|