|
@@ -102,6 +102,7 @@ export class HushijiandanComponent implements OnInit {
|
102
|
102
|
otherSearchChangeSubject = new Subject(); //其他建单搜索防抖
|
103
|
103
|
incidentSearchChangeSubject = new Subject(); //故障现象搜索防抖
|
104
|
104
|
isYyInspect = false; //需要预约检查
|
|
105
|
+ inspectAndPatientTransportConfig:any = {timeMod: 30};
|
105
|
106
|
constructor(
|
106
|
107
|
private message: NzMessageService,
|
107
|
108
|
private fb: FormBuilder,
|
|
@@ -155,6 +156,7 @@ export class HushijiandanComponent implements OnInit {
|
155
|
156
|
}
|
156
|
157
|
});
|
157
|
158
|
this.getItsmIncident();
|
|
159
|
+ this.getInspectAndPatientTransportConfigTasktype();
|
158
|
160
|
this.getUpdateTipsForNurses();
|
159
|
161
|
this.getCloseTimeFlag();
|
160
|
162
|
this.currentDept = this.tool.getCurrentUserDept();
|
|
@@ -427,6 +429,69 @@ export class HushijiandanComponent implements OnInit {
|
427
|
429
|
}
|
428
|
430
|
});
|
429
|
431
|
}
|
|
432
|
+ //获取检查页面任务类型
|
|
433
|
+ getInspectAndPatientTransportConfigTasktype() {
|
|
434
|
+ let postData = {
|
|
435
|
+ idx: 0,
|
|
436
|
+ sum: 10,
|
|
437
|
+ taskType: {
|
|
438
|
+ simpleQuery: true,
|
|
439
|
+ hosId: {
|
|
440
|
+ id: this.currentHospital.id
|
|
441
|
+ },
|
|
442
|
+ associationType: {
|
|
443
|
+ key:"association_types",
|
|
444
|
+ value: 'inspect'
|
|
445
|
+ }
|
|
446
|
+ }
|
|
447
|
+ };
|
|
448
|
+ this.mainService
|
|
449
|
+ .getFetchDataList("simple/data", "taskType", postData)
|
|
450
|
+ .subscribe((result) => {
|
|
451
|
+ if (result.status == 200) {
|
|
452
|
+ let tasktype:any = result.list[0] || {};
|
|
453
|
+ this.getInspectAndPatientTransportConfig(tasktype);
|
|
454
|
+ }
|
|
455
|
+ });
|
|
456
|
+ }
|
|
457
|
+ // 获取检查页面信息配置
|
|
458
|
+ getInspectAndPatientTransportConfig(tasktype) {
|
|
459
|
+ let postData = {
|
|
460
|
+ idx: 0,
|
|
461
|
+ sum: 10,
|
|
462
|
+ taskTypeConfig: {
|
|
463
|
+ taskTypeDTO: {
|
|
464
|
+ hosId: {
|
|
465
|
+ id: this.currentHospital.id
|
|
466
|
+ },
|
|
467
|
+ associationType: tasktype.associationType
|
|
468
|
+ }
|
|
469
|
+ }
|
|
470
|
+ };
|
|
471
|
+ this.mainService
|
|
472
|
+ .getFetchDataList("simple/data", "taskTypeConfig", postData)
|
|
473
|
+ .subscribe((result) => {
|
|
474
|
+ if (result.status == 200) {
|
|
475
|
+ this.inspectAndPatientTransportConfig = result.list[0] || {};
|
|
476
|
+
|
|
477
|
+ // 是否显示排队信息
|
|
478
|
+ if(this.inspectAndPatientTransportConfig.queuingInformation == 1){
|
|
479
|
+ this.getQueuingInformation();
|
|
480
|
+ }
|
|
481
|
+ }
|
|
482
|
+ });
|
|
483
|
+ }
|
|
484
|
+ // 获取排队信息
|
|
485
|
+ queuingInformationList:any[] = [];
|
|
486
|
+ getQueuingInformation() {
|
|
487
|
+ this.mainService
|
|
488
|
+ .coopWorkerOrder("queuingInformation", {})
|
|
489
|
+ .subscribe((result) => {
|
|
490
|
+ if(result.status == 200){
|
|
491
|
+ this.queuingInformationList = result.datalist || [];
|
|
492
|
+ }
|
|
493
|
+ });
|
|
494
|
+ }
|
430
|
495
|
// 获取护士端更新提示
|
431
|
496
|
updateTipsForNurses = "";
|
432
|
497
|
getUpdateTipsForNurses() {
|
|
@@ -443,7 +508,7 @@ export class HushijiandanComponent implements OnInit {
|
443
|
508
|
}
|
444
|
509
|
});
|
445
|
510
|
}
|
446
|
|
- // 获取护士端更新提示
|
|
511
|
+ // 获取标本按钮
|
447
|
512
|
specimenButton = "";
|
448
|
513
|
getSpecimenButton() {
|
449
|
514
|
if(this.currentDept.typeValue == 'surgery'){
|
|
@@ -597,7 +662,7 @@ export class HushijiandanComponent implements OnInit {
|
597
|
662
|
let now = new Date();
|
598
|
663
|
let nHour = now.getHours();
|
599
|
664
|
let nMinute = now.getMinutes();
|
600
|
|
- if (nMinute > 30) {
|
|
665
|
+ if (nMinute > (60 - this.inspectAndPatientTransportConfig.timeMod)) {
|
601
|
666
|
return range(0, nHour + 1);
|
602
|
667
|
} else {
|
603
|
668
|
return range(0, nHour);
|
|
@@ -609,13 +674,7 @@ export class HushijiandanComponent implements OnInit {
|
609
|
674
|
let nHour = now.getHours();
|
610
|
675
|
let nMinute = now.getMinutes();
|
611
|
676
|
if (hour === nHour || hour === undefined) {
|
612
|
|
- if (nMinute == 0) {
|
613
|
|
- return [];
|
614
|
|
- } else if (nMinute <= 30 && nMinute > 0) {
|
615
|
|
- return [0];
|
616
|
|
- } else {
|
617
|
|
- return [0, 30];
|
618
|
|
- }
|
|
677
|
+ return this.integralDivision(0, nMinute, this.inspectAndPatientTransportConfig.timeMod);
|
619
|
678
|
} else {
|
620
|
679
|
return [];
|
621
|
680
|
}
|
|
@@ -1675,11 +1734,8 @@ export class HushijiandanComponent implements OnInit {
|
1675
|
1734
|
return differenceInCalendarDays(current, new Date()) < 0;
|
1676
|
1735
|
};
|
1677
|
1736
|
}
|
1678
|
|
- if (getMinutes(this.yyTime) > 0 && getMinutes(this.yyTime) < 30) {
|
1679
|
|
- this.yyTime = setMinutes(this.yyTime, 30);
|
1680
|
|
- } else if (getMinutes(this.yyTime) > 30 && getMinutes(this.yyTime) < 60) {
|
1681
|
|
- this.yyTime = setMinutes(this.yyTime, 0);
|
1682
|
|
- }
|
|
1737
|
+ let end = this.getLgNumber(getMinutes(this.yyTime), this.inspectAndPatientTransportConfig.timeMod);
|
|
1738
|
+ this.yyTime = setMinutes(this.yyTime, end);
|
1683
|
1739
|
}
|
1684
|
1740
|
this.clickYYFlag = false;
|
1685
|
1741
|
}
|
|
@@ -1696,17 +1752,22 @@ export class HushijiandanComponent implements OnInit {
|
1696
|
1752
|
return differenceInCalendarDays(current, new Date()) < 0;
|
1697
|
1753
|
};
|
1698
|
1754
|
}
|
1699
|
|
- if (getMinutes(this.yyTimeZy) > 0 && getMinutes(this.yyTimeZy) < 30) {
|
1700
|
|
- this.yyTimeZy = setMinutes(this.yyTimeZy, 30);
|
1701
|
|
- } else if (
|
1702
|
|
- getMinutes(this.yyTimeZy) > 30 &&
|
1703
|
|
- getMinutes(this.yyTimeZy) < 60
|
1704
|
|
- ) {
|
1705
|
|
- this.yyTimeZy = setMinutes(this.yyTimeZy, 0);
|
1706
|
|
- }
|
|
1755
|
+ let end = this.getLgNumber(getMinutes(this.yyTimeZy), this.inspectAndPatientTransportConfig.timeMod);
|
|
1756
|
+ this.yyTimeZy = setMinutes(this.yyTimeZy, end);
|
1707
|
1757
|
}
|
1708
|
1758
|
this.clickYYZyFlag = false;
|
1709
|
1759
|
}
|
|
1760
|
+
|
|
1761
|
+ // 获取大于x,并且是n的倍数的数字
|
|
1762
|
+ getLgNumber(x: number, n:number): number{
|
|
1763
|
+ for(let i = x; i < 60; i++){
|
|
1764
|
+ if(i % n === 0){
|
|
1765
|
+ return i;
|
|
1766
|
+ }
|
|
1767
|
+ }
|
|
1768
|
+ return 0;
|
|
1769
|
+ }
|
|
1770
|
+
|
1710
|
1771
|
hidePatientOrder() {
|
1711
|
1772
|
this.patientModal = false;
|
1712
|
1773
|
this.clickYYFlag = false;
|
|
@@ -2124,13 +2185,9 @@ export class HushijiandanComponent implements OnInit {
|
2124
|
2185
|
console.log(this.appointmentZyBuildFlag, "seimin");
|
2125
|
2186
|
this.yyDateZy = new Date();
|
2126
|
2187
|
this.yyTimeZy = new Date();
|
2127
|
|
- if (this.yyTimeZy.getMinutes() >= 0 && this.yyTimeZy.getMinutes() <= 30) {
|
2128
|
|
- this.yyTimeZy.setMinutes(30);
|
2129
|
|
- } else if (
|
2130
|
|
- this.yyTimeZy.getMinutes() > 30 &&
|
2131
|
|
- this.yyTimeZy.getMinutes() < 60
|
2132
|
|
- ) {
|
2133
|
|
- this.yyTimeZy.setMinutes(0);
|
|
2188
|
+ let end = this.getLgNumber(this.yyTimeZy.getMinutes(), this.inspectAndPatientTransportConfig.timeMod);
|
|
2189
|
+ this.yyTimeZy.setMinutes(end);
|
|
2190
|
+ if(end === 0){
|
2134
|
2191
|
this.yyTimeZy.setHours(this.yyTimeZy.getHours() + 1);
|
2135
|
2192
|
}
|
2136
|
2193
|
} else {
|
|
@@ -2371,34 +2428,39 @@ export class HushijiandanComponent implements OnInit {
|
2371
|
2428
|
}
|
2372
|
2429
|
}
|
2373
|
2430
|
// 禁用小时
|
2374
|
|
- disabledHours(): number[] {
|
|
2431
|
+ disabledHours = (): number[] => {
|
2375
|
2432
|
let now = new Date();
|
2376
|
2433
|
let nHour = now.getHours();
|
2377
|
2434
|
let nMinute = now.getMinutes();
|
2378
|
|
- if (nMinute > 30) {
|
|
2435
|
+ if (nMinute > (60 - this.inspectAndPatientTransportConfig.timeMod)) {
|
2379
|
2436
|
return range(0, nHour + 1);
|
2380
|
2437
|
} else {
|
2381
|
2438
|
return range(0, nHour);
|
2382
|
2439
|
}
|
2383
|
2440
|
}
|
2384
|
2441
|
// 禁用分钟
|
2385
|
|
- disabledMinutes(hour: number): number[] {
|
|
2442
|
+ disabledMinutes = (hour: number): number[] => {
|
2386
|
2443
|
let now = new Date();
|
2387
|
2444
|
let nHour = now.getHours();
|
2388
|
2445
|
let nMinute = now.getMinutes();
|
2389
|
2446
|
if (hour === nHour || hour === undefined) {
|
2390
|
|
- if (nMinute == 0) {
|
2391
|
|
- return [];
|
2392
|
|
- } else if (nMinute <= 30 && nMinute > 0) {
|
2393
|
|
- return [0];
|
2394
|
|
- } else {
|
2395
|
|
- return [0, 30];
|
2396
|
|
- }
|
|
2447
|
+ return this.integralDivision(0, nMinute, this.inspectAndPatientTransportConfig.timeMod);
|
2397
|
2448
|
} else {
|
2398
|
2449
|
return [];
|
2399
|
2450
|
}
|
2400
|
2451
|
}
|
2401
|
2452
|
|
|
2453
|
+ // start和end之间能被n整除的所有数字集合
|
|
2454
|
+ integralDivision(start:number, end:number, n:number): number[]{
|
|
2455
|
+ let arr = [];
|
|
2456
|
+ for(let i = start; i <= end; i++){
|
|
2457
|
+ if(i % n === 0){
|
|
2458
|
+ arr.push(i);
|
|
2459
|
+ }
|
|
2460
|
+ }
|
|
2461
|
+ return arr;
|
|
2462
|
+ }
|
|
2463
|
+
|
2402
|
2464
|
// 快捷一键发起建单
|
2403
|
2465
|
shortcutMsg; //一键发起信息
|
2404
|
2466
|
buildMsg: any = {}; //一键发起返回信息
|