chenchuang há 2 anos atrás
pai
commit
2def9415d0

+ 17 - 0
src/app/entity/fbs/fbs-working-statistics.ts

@@ -64,4 +64,21 @@ export class FbsWorkingStatistics extends Page{
 	efficiency?:number;//效率
 	numberOfTasks?:number;//订单数
 	standardWorkingHoursProcess?:number;//标准总工时
+	originalPriceCode?:string;//原价代码
+	
+	wbsElement?:string;//WBS元素
+
+	
+	wbsElementDescription?:string;//WBS元素描述
+
+	
+	workReportWbs?:string;//报工WBS
+
+	
+	workReportNetwork?:string;//报工网络
+
+	
+	workReportingActivities?:string;//报工活动
+
+	speedOfProgress?:number;//完成进度
 }

+ 27 - 0
src/app/routes/fbs-scan-code/list/list.component.html

@@ -2,6 +2,7 @@
   <ng-template #phActionTpl>
     <!-- <button (click)="add()" nz-button nzType="primary">新建</button> -->
     <button (click)="export()" nz-button nzType="primary" [nzLoading]="exportLoading">导出</button>
+    <button (click)="reportExport()" nz-button nzType="primary" [nzLoading]="reportExportLoading">报表导出</button>
   </ng-template>
 </page-header>
 <nz-card>
@@ -84,6 +85,32 @@
         </nz-form-item>
       </div>
     </div>
+    <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
+      <div nz-col nzXs="24" nzSm="4" nzLg="8">
+        <nz-form-item class="nz-form-item">
+          <nz-form-label [nzSpan]="8">项目编码</nz-form-label>
+          <nz-form-control [nzSpan]="16">
+            <input [(ngModel)]="fbsWorkingStatistics.costItemCode" name="costItemCode" nz-input placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col nzXs="24" nzSm="4" nzLg="8">
+        <nz-form-item class="nz-form-item">
+          <nz-form-label [nzSpan]="8">项目名称</nz-form-label>
+          <nz-form-control [nzSpan]="16">
+            <input [(ngModel)]="fbsWorkingStatistics.projectName" name="projectName" nz-input placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col nzXs="24" nzSm="4" nzLg="8">
+        <nz-form-item class="nz-form-item">
+          <nz-form-label [nzSpan]="8">原价代码</nz-form-label>
+          <nz-form-control [nzSpan]="16">
+            <input [(ngModel)]="fbsWorkingStatistics.originalPriceCode" name="originalPriceCode" nz-input placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
   </form>
   <!-- 数据表 -->
   <nz-table nzSize="small" class="buttonDistance" [nzData]="dataList" [nzLoading]="isLoading"

+ 64 - 0
src/app/routes/fbs-scan-code/list/list.component.ts

@@ -280,5 +280,69 @@ export class FbsScanCodeListComponent implements OnInit {
       }
     });
   }
+
+  reportExportLoading=false
+  reportExport(){
+    this.reportExportLoading=true;
+    let fbsWorkingStatistics =JSON.parse(JSON.stringify(this.fbsWorkingStatistics));
+    this.fbsWorkingStatisticsService.getReportExport(fbsWorkingStatistics).then(response => {
+      if (response.success) {
+        //查询成功
+        let dataList = response.result; //表格数据
+        let data=[];
+        //设置导出头
+        let title=[
+          ['项目编号'],
+          ['项目名称'],
+          ['原价代码'],
+          ['WBS元素'],
+          ['WBS元素描述'],
+          ['报工WBS'],
+          ['报工网络'],
+          ['报工活动'],
+          ['过账日期'],
+          ['完工数量'],
+          ['正常工时'],
+          ['单位'],
+          ['完工成度']
+        ]
+        data.push(title);
+        //添加导出行数据
+        if(dataList){
+          dataList.forEach(element => {
+            let row=[];
+            row.push(element.costItemCode)
+            row.push(element.projectName)
+            row.push(element.originalPriceCode)
+            row.push(element.wbsElement)
+            row.push(element.wbsElementDescription)
+            row.push(element.workReportWbs)
+            row.push(element.workReportNetwork)
+            row.push(element.workReportingActivities)
+            row.push(fbsWorkingStatistics.end)
+            row.push(element.qualifiedNumber)
+            row.push(element.workingHours)
+            row.push('H')
+            row.push(element.speedOfProgress)
+            data.push(row)
+          });
+        }
+        // 导出
+        this.xlsx.export({
+          sheets: [
+            {
+              data: data,
+              name: '报表导出',
+            },
+          ],
+          filename: '报表导出.xlsx',
+        });
+        this.reportExportLoading = false;
+      }else{
+        this.nzNotificationService.error('导出失败', response.message);
+        this.reportExportLoading = false;
+      }
+    })
+  }
   
 }

+ 6 - 0
src/app/routes/fbs-workshop-dispatch-list/add/add.component.ts

@@ -366,6 +366,12 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
                 data.plannedQuantity=element.qty;
                 data.standardWorkingHoursZ=element.cinvDefine13;
                 data.sapState=element.sapstatus;
+                data.originalPriceCode=element.originalPriceCode;
+                data.wbsElement=element.wbsElement;
+                data.wbsElementDescription=element.wbsElementDescription;
+                data.workReportWbs=element.workReportWbs;
+                data.workReportNetwork=element.workReportNetwork;
+                data.workReportingActivities=element.workReportingActivities;
                 //计算总单据剩余派工数量
                 this.getDispatchNumberByOrderIdProductId(data);
                 data.fbsTechnologicalProcessId=element.fbsTechnologicalProcessId;

+ 5 - 0
src/app/services/fbs/fbs-working-statistics.service.ts

@@ -21,6 +21,11 @@ export class FbsWorkingStatisticsService {
     return await this.http.get<BaseResponse<Result<FbsWorkingStatistics[]>>>('/workingStatistics/fbsWorkingStatistics/getEfficiencyReport',{params:body}).toPromise();
   }
 
+  // 报表导出
+  async getReportExport(body:any): Promise<BaseResponse<FbsWorkingStatistics[]>> {
+    return await this.http.get<BaseResponse<FbsWorkingStatistics[]>>('/workingStatistics/fbsWorkingStatistics/getReportExport',{params:body}).toPromise();
+  }
+
   //修改扫码时间
   async updateTime(body:any): Promise<BaseResponse<Result<FbsWorkingStatistics>>> {
     return await this.http.put<BaseResponse<Result<FbsWorkingStatistics>>>('/workingStatistics/fbsWorkingStatistics/updateTime',body).toPromise();