|
@@ -51,6 +51,10 @@ export class PharmacyComponent implements OnInit {
|
51
|
51
|
? JSON.parse(localStorage.getItem("user")).user
|
52
|
52
|
: null; //登录人信息
|
53
|
53
|
|
|
54
|
+ logTimer = null; //定时器
|
|
55
|
+ logTime = 0; //自动刷新秒数
|
|
56
|
+ logTimeConst = 60; //自动刷新秒数
|
|
57
|
+
|
54
|
58
|
ngOnInit() {
|
55
|
59
|
this.changeKs();
|
56
|
60
|
// 待配药列表
|
|
@@ -60,6 +64,26 @@ export class PharmacyComponent implements OnInit {
|
60
|
64
|
// 核对中列表
|
61
|
65
|
this.getPharmacyList(this.pharmacyIdx, 3, this.pharmacySearchKey);
|
62
|
66
|
this.initRole();
|
|
67
|
+ // 自动刷新倒计时 start
|
|
68
|
+ this.autoUpdate();
|
|
69
|
+ // 自动刷新倒计时 end
|
|
70
|
+ }
|
|
71
|
+ // 自动刷新倒计时
|
|
72
|
+ autoUpdate(){
|
|
73
|
+ this.logTime = this.logTimeConst;
|
|
74
|
+ clearInterval(this.logTimer);
|
|
75
|
+ this.logTimer = setInterval(() => {
|
|
76
|
+ this.logTime--;
|
|
77
|
+ if (this.logTime === 0) {
|
|
78
|
+ this.logTime = this.logTimeConst;
|
|
79
|
+ // 待配药列表
|
|
80
|
+ this.getPharmacyList(0, 1, this.printPharmacySearchKey);
|
|
81
|
+ // 配药中列表
|
|
82
|
+ this.getPharmacyList(0, 2, this.waitPharmacySearchKey);
|
|
83
|
+ // 核对中列表
|
|
84
|
+ this.getPharmacyList(0, 3, this.pharmacySearchKey);
|
|
85
|
+ }
|
|
86
|
+ }, 1000);
|
63
|
87
|
}
|
64
|
88
|
// 药房端药房列表查询、搜索
|
65
|
89
|
// 1为pc待打印状态、2为pc配药中、3为pc核对中
|