|
@@ -1,12 +1,13 @@
|
|
|
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 { FbsWorkingStatisticsService } from 'app/services/fbs/fbs-working-statistics.service';
|
|
|
import { FbsPersonnelService } from 'app/services/fbs/fbs-personnel.service';
|
|
|
import { DatePipe } from '@angular/common';
|
|
|
import { NzNotificationService, NzModalService } from 'ng-zorro-antd';
|
|
|
import { FbsWorkingStatistics } from 'app/entity/fbs/fbs-working-statistics';
|
|
|
+import { convertingNumbers } from '@shared';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-efficiency-report-list',
|
|
@@ -20,7 +21,8 @@ export class EfficiencyReportListComponent implements OnInit {
|
|
|
private fbsPersonnelService: FbsPersonnelService,
|
|
|
private datePipe: DatePipe,
|
|
|
private nzNotificationService: NzNotificationService,
|
|
|
- private nzModalService: NzModalService
|
|
|
+ private nzModalService: NzModalService,
|
|
|
+ private xlsx: XlsxService
|
|
|
) { }
|
|
|
|
|
|
ngOnInit() {
|
|
@@ -141,6 +143,77 @@ export class EfficiencyReportListComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 导出
|
|
|
+ */
|
|
|
+ exportLoading=false;
|
|
|
+ export() {
|
|
|
+ this.exportLoading=true;
|
|
|
+ let fbsWorkingStatistics =JSON.parse(JSON.stringify(this.fbsWorkingStatistics));
|
|
|
+ fbsWorkingStatistics.pageSize = 20000;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.fbsWorkingStatisticsService.getEfficiencyReport(fbsWorkingStatistics).then(response => {
|
|
|
+ if (response.success) {
|
|
|
+
|
|
|
+ let dataList = response.result.records;
|
|
|
+ let data=[];
|
|
|
+
|
|
|
+ let title=[
|
|
|
+ ['项目编号'],
|
|
|
+ ['项目名称'],
|
|
|
+ ['工作中心'],
|
|
|
+ ['生产订单号'],
|
|
|
+ ['物料编码'],
|
|
|
+ ['物料名称'],
|
|
|
+ ['工艺流程'],
|
|
|
+ ['人员编码'],
|
|
|
+ ['姓名'],
|
|
|
+ ['上岗时间'],
|
|
|
+ ['下岗时间'],
|
|
|
+ ['工时'],
|
|
|
+ ['效率']
|
|
|
+ ]
|
|
|
+ data.push(title);
|
|
|
+
|
|
|
+ if(dataList){
|
|
|
+ dataList.forEach(element => {
|
|
|
+ let row=[];
|
|
|
+ row.push(element.costItemCode)
|
|
|
+ row.push(element.projectName)
|
|
|
+ row.push(element.workCenter)
|
|
|
+ row.push(element.orderNumber)
|
|
|
+ row.push(element.materielCode)
|
|
|
+ row.push(element.materielName)
|
|
|
+ row.push(element.fbsTechnologicalProcessItemName)
|
|
|
+ row.push(element.personnelCode)
|
|
|
+ row.push(element.personnelName)
|
|
|
+ row.push(element.firstTime)
|
|
|
+ row.push(element.finalTime)
|
|
|
+ row.push(element.workingHours)
|
|
|
+ if(element.efficiency){
|
|
|
+ row.push(element.efficiency+"%")
|
|
|
+ }else{
|
|
|
+ row.push("")
|
|
|
+ }
|
|
|
+ data.push(row)
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.xlsx.export({
|
|
|
+ sheets: [
|
|
|
+ {
|
|
|
+ data: data,
|
|
|
+ name: '效率报表',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ filename: '效率报表.xlsx',
|
|
|
+ });
|
|
|
+ this.exportLoading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
view() {}
|
|
|
}
|