|
@@ -1,6 +1,6 @@
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
|
import { _HttpClient, ModalHelper } from '@delon/theme';
|
|
|
-import { STColumn, STComponent } from '@delon/abc';
|
|
|
+import { STColumn, STComponent, XlsxService } from '@delon/abc';
|
|
|
import { SFSchema } from '@delon/form';
|
|
|
import { FbsWarehouse } from 'app/entity/fbs/fbs-warehouse';
|
|
|
import { DatePipe } from '@angular/common';
|
|
@@ -9,6 +9,7 @@ import { NzDrawerService, NzNotificationService } from 'ng-zorro-antd';
|
|
|
import { FbsWarehouseAddComponent } from '../add/add.component';
|
|
|
import { FbsWarehouseUpdateComponent } from '../update/update.component';
|
|
|
import { FbsWarehouseViewComponent } from '../view/view.component';
|
|
|
+import { convertingNumbers } from '@shared';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-fbs-warehouse-list',
|
|
@@ -20,11 +21,13 @@ export class FbsWarehouseListComponent implements OnInit {
|
|
|
private datePipe:DatePipe,
|
|
|
private fbsWarehouseService:FbsWarehouseService,
|
|
|
private nzDrawerService:NzDrawerService,
|
|
|
- private nzNotificationService:NzNotificationService
|
|
|
+ private nzNotificationService:NzNotificationService,
|
|
|
+ private xlsx: XlsxService
|
|
|
) { }
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.getList();
|
|
|
+ this.getTotalList()
|
|
|
}
|
|
|
|
|
|
dataList = [];
|
|
@@ -69,6 +72,8 @@ export class FbsWarehouseListComponent implements OnInit {
|
|
|
this.fbsWarehouse.pageNo=1;
|
|
|
|
|
|
this.getList();
|
|
|
+
|
|
|
+ this.getTotalList()
|
|
|
}
|
|
|
|
|
|
add() {
|
|
@@ -145,4 +150,165 @@ export class FbsWarehouseListComponent implements OnInit {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 初始化总计
|
|
|
+ */
|
|
|
+ totalList: any = {};
|
|
|
+ initializationTotal() {
|
|
|
+ this.totalList = {
|
|
|
+ overtimeHours: 0,
|
|
|
+ workOrderBatching: 0,
|
|
|
+ storageFinishedProducts: 0,
|
|
|
+ storageRawMaterials: 0,
|
|
|
+ researchAndDevelopment: 0,
|
|
|
+ projectIngredients: 0,
|
|
|
+ projectDelivery: 0,
|
|
|
+ packProject: 0,
|
|
|
+ loading: 0,
|
|
|
+ inventory: 0,
|
|
|
+ train: 0,
|
|
|
+ meeting: 0,
|
|
|
+ fiveS: 0,
|
|
|
+ other: 0
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取各个数量的总计
|
|
|
+ */
|
|
|
+ getTotalList(){
|
|
|
+ this.fbsWarehouse.start = this.datePipe.transform(this.fbsWarehouse.start, 'yyyy-MM-dd');
|
|
|
+ this.fbsWarehouse.end = this.datePipe.transform(this.fbsWarehouse.end, 'yyyy-MM-dd');
|
|
|
+ let fbsWarehouse=JSON.parse(JSON.stringify(this.fbsWarehouse));
|
|
|
+ fbsWarehouse.pageSize=10000;
|
|
|
+ this.fbsWarehouseService.list(fbsWarehouse).then((response)=>{
|
|
|
+ if(response.success){
|
|
|
+ let dataList=response.result.records;
|
|
|
+ this.getTotal(dataList);
|
|
|
+ this.isLoading=false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 计算当页的总计数据
|
|
|
+ */
|
|
|
+ getTotal(dataList) {
|
|
|
+ this.initializationTotal();
|
|
|
+ if (dataList) {
|
|
|
+ dataList.forEach(element => {
|
|
|
+ this.totalList.overtimeHours = (Number(this.totalList.overtimeHours) + Number(element.overtimeHours)).toFixed(1);
|
|
|
+ this.totalList.workOrderBatching = (Number(this.totalList.workOrderBatching) + Number(element.workOrderBatching)).toFixed(1);
|
|
|
+ this.totalList.storageFinishedProducts = (Number(this.totalList.storageFinishedProducts) + Number(element.storageFinishedProducts)).toFixed(1);
|
|
|
+ this.totalList.storageRawMaterials = (Number(this.totalList.storageRawMaterials) + Number(element.storageRawMaterials)).toFixed(1);
|
|
|
+ this.totalList.researchAndDevelopment = (Number(this.totalList.researchAndDevelopment) + Number(element.researchAndDevelopment)).toFixed(1);
|
|
|
+ this.totalList.projectIngredients = (Number(this.totalList.projectIngredients) + Number(element.projectIngredients)).toFixed(1);
|
|
|
+ this.totalList.projectDelivery = (Number(this.totalList.projectDelivery) + Number(element.projectDelivery)).toFixed(1);
|
|
|
+ this.totalList.packProject = (Number(this.totalList.packProject) + Number(element.packProject)).toFixed(1);
|
|
|
+ this.totalList.loading = (Number(this.totalList.loading) + Number(element.loading)).toFixed(1);
|
|
|
+ this.totalList.inventory = (Number(this.totalList.inventory) + Number(element.inventory)).toFixed(1);
|
|
|
+ this.totalList.train = (Number(this.totalList.train) + Number(element.train)).toFixed(1);
|
|
|
+ this.totalList.meeting = (Number(this.totalList.meeting) + Number(element.meeting)).toFixed(1);
|
|
|
+ this.totalList.fiveS = (Number(this.totalList.fiveS) + Number(element.fiveS)).toFixed(1);
|
|
|
+ this.totalList.other = (Number(this.totalList.other) + Number(element.other)).toFixed(1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 导出
|
|
|
+ */
|
|
|
+ exportLoading=false;
|
|
|
+ export() {
|
|
|
+ this.exportLoading=true;
|
|
|
+
|
|
|
+ let fbsWarehouse = new FbsWarehouse();
|
|
|
+ fbsWarehouse.pageSize = 20000;
|
|
|
+ fbsWarehouse.start = this.datePipe.transform(this.fbsWarehouse.start, 'yyyy-MM-dd');
|
|
|
+ fbsWarehouse.end = this.datePipe.transform(this.fbsWarehouse.end, 'yyyy-MM-dd');
|
|
|
+ this.fbsWarehouseService.list(fbsWarehouse).then(response => {
|
|
|
+ if (response.success) {
|
|
|
+
|
|
|
+ let dataList= response.result.records;
|
|
|
+ let data = [];
|
|
|
+ let title = [
|
|
|
+ ['日期'],
|
|
|
+ ['应到人数'],
|
|
|
+ ['实到人数'],
|
|
|
+ ['请假'],
|
|
|
+ ['旷工'],
|
|
|
+ ['离职'],
|
|
|
+ ['出勤工时'],
|
|
|
+ ['加班人数'],
|
|
|
+ ['加班工时'],
|
|
|
+ ['加班原因'],
|
|
|
+ ['工单配料'],
|
|
|
+ ['成品收存'],
|
|
|
+ ['原材料收存'],
|
|
|
+ ['研发领用'],
|
|
|
+ ['项目配料'],
|
|
|
+ ['项目发货'],
|
|
|
+ ['项目打包'],
|
|
|
+ ['装车'],
|
|
|
+ ['盘点'],
|
|
|
+ ['培训'],
|
|
|
+
|
|
|
+ ['会议'],
|
|
|
+ ['5S'],
|
|
|
+ ['其他'],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ];
|
|
|
+ data.push(title);
|
|
|
+ dataList.forEach(element => {
|
|
|
+ let row = [];
|
|
|
+ row.push(element.date);
|
|
|
+ row.push(convertingNumbers(element.numberOfPeopleToArrive));
|
|
|
+ row.push(convertingNumbers(element.actualNumberOfPeople));
|
|
|
+ row.push(convertingNumbers(element.lleave));
|
|
|
+ row.push(convertingNumbers(element.absenteeism));
|
|
|
+ row.push(convertingNumbers(element.quit));
|
|
|
+ row.push(convertingNumbers(element.attendanceHours));
|
|
|
+ row.push(convertingNumbers(element.overtimePeople));
|
|
|
+ row.push(convertingNumbers(element.overtimeHours));
|
|
|
+ row.push(element.overtimeReason);
|
|
|
+ row.push(convertingNumbers(element.workOrderBatching));
|
|
|
+ row.push(convertingNumbers(element.storageFinishedProducts));
|
|
|
+ row.push(convertingNumbers(element.storageRawMaterials));
|
|
|
+ row.push(convertingNumbers(element.researchAndDevelopment));
|
|
|
+ row.push(convertingNumbers(element.projectIngredients));
|
|
|
+ row.push(convertingNumbers(element.projectDelivery));
|
|
|
+ row.push(convertingNumbers(element.packProject));
|
|
|
+ row.push(convertingNumbers(element.loading));
|
|
|
+ row.push(convertingNumbers(element.inventory));
|
|
|
+
|
|
|
+ row.push(convertingNumbers(element.train));
|
|
|
+ row.push(convertingNumbers(element.meeting));
|
|
|
+ row.push(convertingNumbers(element.fiveS));
|
|
|
+ row.push(convertingNumbers(element.other));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ data.push(row);
|
|
|
+ });
|
|
|
+
|
|
|
+ this.xlsx.export({
|
|
|
+ sheets: [
|
|
|
+ {
|
|
|
+ data: data,
|
|
|
+ name: '仓库报表',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ filename: '仓库报表.xlsx',
|
|
|
+ });
|
|
|
+ this.exportLoading=false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|