|
@@ -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 { FbsTechnologicalProcess } from 'app/entity/fbs/fbs-technological-process';
|
|
|
import { FbsTechnologicalProcessService } from 'app/services/fbs/fbs-technological-process.service';
|
|
@@ -17,7 +17,8 @@ export class FbsTechnologicalProcessListComponent implements OnInit {
|
|
|
constructor(
|
|
|
private fbsTechnologicalProcessService:FbsTechnologicalProcessService,
|
|
|
private nzModalService:NzModalService,
|
|
|
- private nzNotificationService:NzNotificationService
|
|
|
+ private nzNotificationService:NzNotificationService,
|
|
|
+ private xlsx: XlsxService
|
|
|
) { }
|
|
|
|
|
|
ngOnInit() {
|
|
@@ -137,4 +138,52 @@ export class FbsTechnologicalProcessListComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 导出
|
|
|
+ */
|
|
|
+ exportLoading=false;
|
|
|
+ getExport(){
|
|
|
+ this.exportLoading = true;
|
|
|
+ let fbsTechnologicalProcess=JSON.parse(JSON.stringify(this.fbsTechnologicalProcess));
|
|
|
+ fbsTechnologicalProcess.pageNo=1
|
|
|
+ fbsTechnologicalProcess.pageSize=200000;
|
|
|
+ this.fbsTechnologicalProcessService.getExport(fbsTechnologicalProcess).then((response)=>{
|
|
|
+ if(response.success){//查询成功
|
|
|
+ let dataList=response.result;//表格数据
|
|
|
+ let data = [];
|
|
|
+ let title = [
|
|
|
+ ["工作中心"],
|
|
|
+ ["物料编码"],
|
|
|
+ ["物料名称"],
|
|
|
+ ["工艺"],
|
|
|
+ ["标准工时"]
|
|
|
+ ]
|
|
|
+ data.push(title);
|
|
|
+ if(dataList){
|
|
|
+ dataList.forEach(element => {
|
|
|
+ let row = [];
|
|
|
+ row.push(element.memo)
|
|
|
+ row.push(element.name)
|
|
|
+ row.push(element.cinvCName)
|
|
|
+ row.push(element.itemName)
|
|
|
+ row.push(element.standardWorkingHours)
|
|
|
+ data.push(row);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 导出
|
|
|
+ this.xlsx.export({
|
|
|
+ sheets: [
|
|
|
+ {
|
|
|
+ data: data,
|
|
|
+ name: '工艺流程',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ filename: '工艺流程.xlsx',
|
|
|
+ });
|
|
|
+ this.exportLoading=false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|