|
@@ -0,0 +1,142 @@
|
|
1
|
+import { Component, OnInit, AfterViewInit, HostListener } from "@angular/core";
|
|
2
|
+import { ToolService } from 'src/app/services/tool.service';
|
|
3
|
+import { fromEvent } from 'rxjs';
|
|
4
|
+import { MainService } from 'src/app/services/main.service';
|
|
5
|
+
|
|
6
|
+@Component({
|
|
7
|
+ selector: "app-washing-batch-view",
|
|
8
|
+ templateUrl: "./washing-batch-view.component.html",
|
|
9
|
+ styleUrls: ["./washing-batch-view.component.less"],
|
|
10
|
+})
|
|
11
|
+export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
|
12
|
+ constructor(
|
|
13
|
+ public tool: ToolService,
|
|
14
|
+ private mainService: MainService,
|
|
15
|
+ ){}
|
|
16
|
+
|
|
17
|
+ ngOnInit() {
|
|
18
|
+ this.hosId = this.tool.getCurrentHospital().id;
|
|
19
|
+ this.getParentList();
|
|
20
|
+ this.getChildList();
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ ngAfterViewInit(){
|
|
24
|
+ this.resizeInit();
|
|
25
|
+ }
|
|
26
|
+ _timer = null;
|
|
27
|
+ @HostListener('window:resize')
|
|
28
|
+ resizeInit(){
|
|
29
|
+ clearTimeout(this._timer);
|
|
30
|
+ this._timer = setTimeout(() => {
|
|
31
|
+ this.scrollY = window.innerHeight - 383;
|
|
32
|
+ }, 500)
|
|
33
|
+ }
|
|
34
|
+
|
|
35
|
+ listOfData: any[] = [
|
|
36
|
+ ['眼科康复科睡', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
37
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
38
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
39
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
40
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
41
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
42
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
43
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
44
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
45
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
46
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
47
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
48
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
49
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
50
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
51
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
52
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
53
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
54
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
55
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
56
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
57
|
+ ['大势科室', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18.05],
|
|
58
|
+ ]; //表格数据
|
|
59
|
+ loading:boolean = false;
|
|
60
|
+ isAllDisplayDataChecked = false; //当前页是否全选
|
|
61
|
+ mapOfCheckedId: { [key: string]: boolean } = {};
|
|
62
|
+ checkedDepIds = []; //已选中单列id
|
|
63
|
+ scrollY:number = 0;
|
|
64
|
+ hosId:any;
|
|
65
|
+ searchDto:any = {
|
|
66
|
+ parent: null,
|
|
67
|
+ }
|
|
68
|
+ parentList: Array<any> = []; //父级分类数据字典信息
|
|
69
|
+ childList: Array<any> = []; //分类数据字典信息
|
|
70
|
+ rows:any[] = ['', '双单', '洗手衣上', '大包布', '中包布', '隔离衣', '无菌巾', '小洞巾', '大洞巾', '小毛巾', '病员服', '仪器套', '裤腿', '床套', '沙发套', '窗帘', '隔帘', '浴巾', '件数', '费用/元'];
|
|
71
|
+
|
|
72
|
+ // 全选
|
|
73
|
+ checkAll(value: boolean): void {
|
|
74
|
+ this.listOfData.forEach((item) => {
|
|
75
|
+ this.mapOfCheckedId[item.id] = value;
|
|
76
|
+ });
|
|
77
|
+ this.refreshStatus();
|
|
78
|
+ }
|
|
79
|
+
|
|
80
|
+ // 单选
|
|
81
|
+ refreshStatus(): void {
|
|
82
|
+ this.isAllDisplayDataChecked = this.listOfData.every(
|
|
83
|
+ (item) => this.mapOfCheckedId[item.id]
|
|
84
|
+ );
|
|
85
|
+ let arr = [];
|
|
86
|
+ for (var k in this.mapOfCheckedId) {
|
|
87
|
+ if (this.mapOfCheckedId[k]) {
|
|
88
|
+ arr.push(Number(k));
|
|
89
|
+ }
|
|
90
|
+ }
|
|
91
|
+ this.checkedDepIds = arr;
|
|
92
|
+ }
|
|
93
|
+
|
|
94
|
+ // 整行操作
|
|
95
|
+ selectedListData(data) {
|
|
96
|
+ this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
|
|
97
|
+ this.refreshStatus();
|
|
98
|
+ }
|
|
99
|
+
|
|
100
|
+ // 获取父级分类
|
|
101
|
+ getParentList() {
|
|
102
|
+ let postData = {
|
|
103
|
+ idx: 0,
|
|
104
|
+ sum: 9999,
|
|
105
|
+ dictionaryTree: {
|
|
106
|
+ hosId: this.hosId,
|
|
107
|
+ level: 1,
|
|
108
|
+ key: 'clothes_type_parent',
|
|
109
|
+ deleted: 0,
|
|
110
|
+ },
|
|
111
|
+ };
|
|
112
|
+ this.mainService
|
|
113
|
+ .getFetchDataList("simple/data", "dictionaryTree", postData)
|
|
114
|
+ .subscribe((result) => {
|
|
115
|
+ if(result.status == 200){
|
|
116
|
+ this.parentList = result.list || [];
|
|
117
|
+ }
|
|
118
|
+ });
|
|
119
|
+ }
|
|
120
|
+
|
|
121
|
+ // 获取分类
|
|
122
|
+ getChildList() {
|
|
123
|
+ let postData = {
|
|
124
|
+ idx: 0,
|
|
125
|
+ sum: 9999,
|
|
126
|
+ dictionaryTree: {
|
|
127
|
+ hosId: this.hosId,
|
|
128
|
+ level: 2,
|
|
129
|
+ key: 'clothes_type',
|
|
130
|
+ deleted: 0,
|
|
131
|
+ },
|
|
132
|
+ };
|
|
133
|
+ this.mainService
|
|
134
|
+ .getFetchDataList("simple/data", "dictionaryTree", postData)
|
|
135
|
+ .subscribe((result) => {
|
|
136
|
+ if(result.status == 200){
|
|
137
|
+ this.childList = result.list || [];
|
|
138
|
+ }
|
|
139
|
+ });
|
|
140
|
+ }
|
|
141
|
+}
|
|
142
|
+
|