|
@@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from "@angular/router";
|
4
|
4
|
import { MainService } from "../../services/main.service";
|
5
|
5
|
import { ToolService } from "../../services/tool.service";
|
6
|
6
|
import { NzMessageService } from 'ng-zorro-antd';
|
|
7
|
+import { subDays, startOfHour, format } from 'date-fns';
|
7
|
8
|
@Component({
|
8
|
9
|
selector: "app-form-management",
|
9
|
10
|
templateUrl: "./form-management.component.html",
|
|
@@ -26,11 +27,12 @@ export class FormManagementComponent implements OnInit {
|
26
|
27
|
pageSize: number = 10; //表格每页展示条数
|
27
|
28
|
listLength: number = 10; //表格总数据量
|
28
|
29
|
|
|
30
|
+ dateRange: any = [startOfHour(subDays(new Date().setHours(9), 1)), startOfHour(new Date().setHours(9))]; //日期选择
|
|
31
|
+
|
29
|
32
|
ngOnInit() {
|
30
|
33
|
this.hosId = this.tool.getCurrentHospital().id;
|
31
|
34
|
this.getList();
|
32
|
35
|
this.coopBtns = this.tool.initCoopBtns(this.route);
|
33
|
|
- this.moveMenu();
|
34
|
36
|
this.getTaskTypes();
|
35
|
37
|
}
|
36
|
38
|
|
|
@@ -54,6 +56,9 @@ export class FormManagementComponent implements OnInit {
|
54
|
56
|
gdState: {id: "433"},
|
55
|
57
|
serTaskTypes: this.tasktypeId,
|
56
|
58
|
time: 0,
|
|
59
|
+ reserveDate: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
60
|
+ startTime1: this.dateRange[0] ? format(this.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
|
|
61
|
+ endTime1: this.dateRange[1] ? format(this.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
|
57
|
62
|
},
|
58
|
63
|
};
|
59
|
64
|
this.mainService.getFetchDataList("simple/data", "workOrder", postData).subscribe((data:any) => {
|
|
@@ -112,35 +117,9 @@ export class FormManagementComponent implements OnInit {
|
112
|
117
|
// 切换右侧菜单Tab
|
113
|
118
|
fixedTab: string = "";
|
114
|
119
|
checkFixedTab(type: string) {
|
115
|
|
- if (this.fixedTab == type) {
|
116
|
|
- this.fixedTab = "";
|
117
|
|
- } else {
|
118
|
|
- this.fixedTab = type;
|
119
|
|
- }
|
120
|
|
- }
|
121
|
|
-
|
122
|
|
- // 菜单拖拽
|
123
|
|
- moveMenu() {
|
124
|
|
- let fixedMenu = document.getElementById("fixedMenu");
|
125
|
|
- if (!fixedMenu) return;
|
126
|
|
- fixedMenu.onmousedown = function (e) {
|
127
|
|
- fixedMenu.style.cursor = "move";
|
128
|
|
- let y = e.clientY - fixedMenu.offsetTop;
|
129
|
|
- document.onmousemove = function (ev) {
|
130
|
|
- var _y = ev.clientY - y > 0 ? ev.clientY - y : 0;
|
131
|
|
- var wh = window.innerHeight;
|
132
|
|
- if (_y > wh - fixedMenu.clientHeight) {
|
133
|
|
- _y = wh - fixedMenu.clientHeight;
|
134
|
|
- }
|
135
|
|
- fixedMenu.style.top = _y + "px";
|
136
|
|
- };
|
137
|
|
- document.onmouseup = function () {
|
138
|
|
- fixedMenu.style.cursor = "default";
|
139
|
|
- this.onmousemove = null;
|
140
|
|
- this.onmouseup = null;
|
141
|
|
- };
|
142
|
|
- // return false;
|
143
|
|
- };
|
|
120
|
+ this.dateRange = [startOfHour(subDays(new Date().setHours(9), 1)), startOfHour(new Date().setHours(9))];
|
|
121
|
+ this.tasktypeId = undefined;
|
|
122
|
+ this.fixedTab = type;
|
144
|
123
|
}
|
145
|
124
|
|
146
|
125
|
// 表格数据
|
|
@@ -173,6 +152,8 @@ export class FormManagementComponent implements OnInit {
|
173
|
152
|
taskType: this.tasktypeId,
|
174
|
153
|
hosId: this.hosId,
|
175
|
154
|
deleteFlag: 0,
|
|
155
|
+ startTime: this.dateRange[0] ? format(this.dateRange[0], 'yyyy-MM-dd HH:mm:ss') : undefined,
|
|
156
|
+ endTime: this.dateRange[1] ? format(this.dateRange[1], 'yyyy-MM-dd HH:mm:ss') : undefined,
|
176
|
157
|
};
|
177
|
158
|
this.isOkLoading = true;
|
178
|
159
|
this.mainService
|