|
@@ -1,4 +1,4 @@
|
1
|
|
-import { Component, OnInit, AfterViewInit, HostListener } from "@angular/core";
|
|
1
|
+import { Component, OnInit, AfterViewInit, HostListener, ElementRef, ViewChild } from "@angular/core";
|
2
|
2
|
import { ToolService } from 'src/app/services/tool.service';
|
3
|
3
|
import { MainService } from 'src/app/services/main.service';
|
4
|
4
|
import { ActivatedRoute } from '@angular/router';
|
|
@@ -10,6 +10,7 @@ import { FormGroup, Validators, FormBuilder } from '@angular/forms';
|
10
|
10
|
styleUrls: ["./washing-batch-view.component.less"],
|
11
|
11
|
})
|
12
|
12
|
export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
|
13
|
+ @ViewChild('printBtn', { static: false }) printBtn: ElementRef<HTMLElement>;
|
13
|
14
|
constructor(
|
14
|
15
|
public tool: ToolService,
|
15
|
16
|
private mainService: MainService,
|
|
@@ -50,7 +51,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
50
|
51
|
}
|
51
|
52
|
parentList: Array<any> = []; //父级分类数据字典信息
|
52
|
53
|
childList: Array<any> = []; //分类数据字典信息
|
53
|
|
- rows:any[] = [];
|
|
54
|
+ rows:any[] = [['id', 'clothesState', ''], [], ['','件数', '费用/元']];
|
54
|
55
|
totalData:any = {};
|
55
|
56
|
|
56
|
57
|
// 查看业务数据
|
|
@@ -66,7 +67,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
66
|
67
|
// 全选
|
67
|
68
|
checkAll(value: boolean): void {
|
68
|
69
|
this.listOfData.forEach((item) => {
|
69
|
|
- if (item[0][1] != 5) {
|
|
70
|
+ if (item[0][1] == 4) {
|
70
|
71
|
this.mapOfCheckedId[item[0][0]] = value;
|
71
|
72
|
}
|
72
|
73
|
});
|
|
@@ -76,7 +77,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
76
|
77
|
// 单选
|
77
|
78
|
refreshStatus(): void {
|
78
|
79
|
let listOfData = this.listOfData.filter(
|
79
|
|
- (item) => item[0][1] != 5
|
|
80
|
+ (item) => item[0][1] == 4
|
80
|
81
|
);
|
81
|
82
|
this.isAllDisplayDataChecked = listOfData.every(
|
82
|
83
|
(item) => this.mapOfCheckedId[item[0][0]]
|
|
@@ -92,7 +93,7 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
92
|
93
|
|
93
|
94
|
// 整行操作
|
94
|
95
|
selectedListData(data) {
|
95
|
|
- if (data[0][1] == 5) {
|
|
96
|
+ if (data[0][1] != 4) {
|
96
|
97
|
return;
|
97
|
98
|
}
|
98
|
99
|
this.mapOfCheckedId[data[0][0]] = !this.mapOfCheckedId[data[0][0]];
|
|
@@ -133,15 +134,12 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
133
|
134
|
let postData = {
|
134
|
135
|
idx: 0,
|
135
|
136
|
sum: 9999,
|
136
|
|
- dictionaryTree: {
|
|
137
|
+ clothesDept: {
|
137
|
138
|
hosId: this.hosId,
|
138
|
|
- level: 2,
|
139
|
|
- key: 'clothes_type',
|
140
|
|
- deleted: 0,
|
141
|
139
|
},
|
142
|
140
|
};
|
143
|
141
|
this.mainService
|
144
|
|
- .getFetchDataList("simple/data", "dictionaryTree", postData)
|
|
142
|
+ .getFetchDataList("simple/data", "clothesDept", postData)
|
145
|
143
|
.subscribe((result) => {
|
146
|
144
|
if(result.status == 200){
|
147
|
145
|
this.childList = result.list || [];
|
|
@@ -257,15 +255,31 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
257
|
255
|
})
|
258
|
256
|
}
|
259
|
257
|
|
|
258
|
+ // 打印
|
|
259
|
+ printAll(){
|
|
260
|
+ setTimeout(()=>{
|
|
261
|
+ this.printBtn.nativeElement.click();
|
|
262
|
+ },0)
|
|
263
|
+ }
|
|
264
|
+
|
260
|
265
|
// 表格数据
|
261
|
266
|
getList() {
|
|
267
|
+ if(!this.searchDto.parent && !this.searchDto.child){
|
|
268
|
+ this.rows = [['id', 'clothesState', ''], [], ['','件数', '费用/元']];
|
|
269
|
+ this.listOfData = [];
|
|
270
|
+ this.totalData = {};
|
|
271
|
+ return;
|
|
272
|
+ }
|
262
|
273
|
let postData: any = {
|
263
|
274
|
hosId: this.hosId,
|
264
|
275
|
batchId: this.route.snapshot.paramMap.get("id"),
|
265
|
276
|
clothesTypeParent: this.searchDto.parent,
|
266
|
|
- clothesType: this.searchDto.child,
|
|
277
|
+ clothesDeptId: this.searchDto.child,
|
267
|
278
|
};
|
268
|
279
|
this.loading = true;
|
|
280
|
+ this.mapOfCheckedId = {};
|
|
281
|
+ this.checkedDepIds = [];
|
|
282
|
+ this.isAllDisplayDataChecked = false;
|
269
|
283
|
this.mainService
|
270
|
284
|
.clothesWashing(postData, 'view')
|
271
|
285
|
.subscribe((result) => {
|
|
@@ -274,6 +288,32 @@ export class WashingBatchViewComponent implements OnInit, AfterViewInit {
|
274
|
288
|
let rows = result.head || [];
|
275
|
289
|
this.rows = [['id', 'clothesState', ''], rows.map(v => v.name), ['','件数', '费用/元']];
|
276
|
290
|
let listOfData_res = result.data || [];
|
|
291
|
+ listOfData_res = [
|
|
292
|
+ ...listOfData_res,
|
|
293
|
+ ...listOfData_res,
|
|
294
|
+ ...listOfData_res,
|
|
295
|
+ ...listOfData_res,
|
|
296
|
+ ...listOfData_res,
|
|
297
|
+ ...listOfData_res,
|
|
298
|
+ ...listOfData_res,
|
|
299
|
+ ...listOfData_res,
|
|
300
|
+ ...listOfData_res,
|
|
301
|
+ ...listOfData_res,
|
|
302
|
+ ...listOfData_res,
|
|
303
|
+ ...listOfData_res,
|
|
304
|
+ ...listOfData_res,
|
|
305
|
+ ...listOfData_res,
|
|
306
|
+ ...listOfData_res,
|
|
307
|
+ ...listOfData_res,
|
|
308
|
+ ...listOfData_res,
|
|
309
|
+ ...listOfData_res,
|
|
310
|
+ ...listOfData_res,
|
|
311
|
+ ...listOfData_res,
|
|
312
|
+ ...listOfData_res,
|
|
313
|
+ ...listOfData_res,
|
|
314
|
+ ...listOfData_res,
|
|
315
|
+ ...listOfData_res,
|
|
316
|
+ ]
|
277
|
317
|
this.listOfData = listOfData_res.map(v => ([
|
278
|
318
|
[v.id, v.clothesState.value, v.dept],
|
279
|
319
|
v.clothesWashingDTOS,
|