chenchuang 3 år sedan
förälder
incheckning
b394b483e3

+ 6 - 5
src/app/routes/dashboard/analysis/analysis.component.html

@@ -142,15 +142,15 @@
           <nz-form-item class="nz-form-item">
             <nz-form-label [nzSpan]="8">订单编号</nz-form-label>
             <nz-form-control [nzSpan]="16">
-              <!-- <input [(ngModel)]="fbsWorkshopDispatchList.productionOrderNumberName" name="productionOrderNumberName" nz-input
-              placeholder="请输入" /> -->
-              <nz-select [(ngModel)]="fbsWorkshopDispatchList.productionOrderNumberName" name="productionOrderNumberName"
+              <input [(ngModel)]="fbsWorkshopDispatchList.productionOrderNumberName" name="productionOrderNumberName" nz-input
+              placeholder="请输入" />
+              <!-- <nz-select [(ngModel)]="fbsWorkshopDispatchList.productionOrderNumberName" name="productionOrderNumberName"
                 style="width: 100%" nzShowSearch nzAllowClear nzPlaceHolder="请选择">
                 <ng-container *ngFor="let list of listOfDataSelect">
                   <nz-option [nzLabel]="list.productionOrderNumberName" [nzValue]="list.productionOrderNumberName">
                   </nz-option>
                 </ng-container>
-              </nz-select>
+              </nz-select> -->
             </nz-form-control>
           </nz-form-item>
         </div>
@@ -307,7 +307,8 @@
               <!-- <td nzAlign="center">{{data.surplusStandardWorkingHoursTotal}}</td> -->
               <td nzAlign="center">{{data.standardWorkingHoursTotal}}</td>
               <td nzAlign="center">{{data.manHoursCompletedTotal}}</td>
-              <td nzAlign="center"  colSpan="3"></td>
+              <td nzAlign="center">{{achievementRateTotal}}%</td>
+              <td nzAlign="center"  colSpan="2"></td>
             </ng-container>
           </tr>
           <tr></tr>

+ 2 - 2
src/app/routes/dashboard/analysis/analysis.component.ts

@@ -112,7 +112,7 @@ export class DashboardAnalysisComponent implements OnInit {
     this.feeTotal = `&yen ${this.feeData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
     this.alertTotal = `&yen ${this.feeData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
     this.getNow();
-    this.getSumDispatchReport();
+    // this.getSumDispatchReport();
     this.getAbnormalWorkingHoursReport();
     this.getPlanningReport();
     this.getAbnormalWorkingHoursTotal();
@@ -331,7 +331,7 @@ export class DashboardAnalysisComponent implements OnInit {
       let quantityCompletedTotal=element.quantityCompletedTotal;//完成数量
       let manHoursCompletedTotal=element.manHoursCompletedTotal;//完成工时
       if(element.projectName==="统计"){
-        this.achievementRateTotal=((Number(quantityCompletedTotal)/Number(numberOfTasksTotal))*100).toFixed(1);
+        this.achievementRateTotal=((Number(quantityCompletedTotal)/Number(numberOfTasksTotal))*100).toFixed(0);
         console.log("标准工时",standardWorkingHoursActualTotal)
         this.productivityTotal=((Number(standardWorkingHoursActualTotal)/Number(manHoursCompletedTotal))*100).toFixed(1)
       }

+ 3 - 3
src/app/routes/efficiency-report/list/list.component.html

@@ -142,11 +142,11 @@
         <th>工序</th>
        
         <!-- <th>人员编码</th> -->
-        <th>姓名</th>
+        <th style="width: 15%;">姓名</th>
         <!-- <th>上岗时间</th>
         <th>下岗时间</th> -->
-         <th nzAlign="center">工艺标准工时</th>
-        <th nzAlign="center">实际工时</th>
+         <th nzAlign="center">标准工时</th>
+        <th nzAlign="center">实际工时</th>
         <th nzAlign="center">效率</th>
       </tr>
     </thead>

+ 14 - 2
src/app/routes/efficiency-report/list/list.component.ts

@@ -124,8 +124,20 @@ export class EfficiencyReportListComponent implements OnInit {
      this.totalList.standardWorkingHoursProcess=this.totalList.standardWorkingHoursProcess.toFixed(2)
      this.totalList.workingHoursTotal = this.totalList.workingHoursTotal.toFixed(2);
      this.totalList.qualifiedNumberTotal = this.totalList.qualifiedNumberTotal.toFixed(1);
-     this.totalList.efficiency=Number((this.totalList.standardWorkingHoursProcess/this.totalList.workingHoursTotal).toFixed(2))*100
+     this.totalList.efficiency=Number(((this.totalList.standardWorkingHoursProcess/this.totalList.workingHoursTotal)*100).toFixed(0))
+    //  this.totalList.efficiency=Number(this.keepTwoDecimal(this.totalList.standardWorkingHoursProcess/this.totalList.workingHoursTotal))*100
+
    }
+
+  //  keepTwoDecimal(num) {
+  //   var result = parseFloat(num);
+  //   if (isNaN(result)) {
+  //     alert('传递参数错误,请检查!');
+  //     return false;
+  //   }
+  //   result = Math.round(num * 100) / 100;
+  //   return result;
+  // }
  
    /**
     * 初始化人员下拉数据集合
@@ -158,7 +170,7 @@ export class EfficiencyReportListComponent implements OnInit {
     this.exportLoading=true;
     let fbsWorkingStatistics =JSON.parse(JSON.stringify(this.fbsWorkingStatistics));
     fbsWorkingStatistics.pageNo=1
-    fbsWorkingStatistics.pageSize = 20000;
+    fbsWorkingStatistics.pageSize = -1;
     //时间格式化
     // fbsWorkingStatistics.start = this.datePipe.transform(this.fbsWorkingStatistics.start, 'yyyy-MM-dd');
     // fbsWorkingStatistics.end = this.datePipe.transform(this.fbsWorkingStatistics.end, 'yyyy-MM-dd');

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

@@ -1,6 +1,7 @@
 <page-header [action]="phActionTpl">
   <ng-template #phActionTpl>
     <!-- <button (click)="add()" nz-button nzType="primary">新建</button> -->
+    <button (click)="export()" nz-button nzType="primary" [nzLoading]="exportLoading">导出</button>
   </ng-template>
 </page-header>
 <nz-card>

+ 85 - 1
src/app/routes/fbs-scan-code/list/list.component.ts

@@ -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 { FbsWorkingStatistics } from 'app/entity/fbs/fbs-working-statistics';
 import { FbsWorkingStatisticsService } from 'app/services/fbs/fbs-working-statistics.service';
@@ -20,6 +20,7 @@ export class FbsScanCodeListComponent implements OnInit {
     private datePipe: DatePipe,
     private nzNotificationService: NzNotificationService,
     private nzModalService: NzModalService,
+    private xlsx: XlsxService
   ) {}
 
   ngOnInit() {
@@ -196,5 +197,88 @@ export class FbsScanCodeListComponent implements OnInit {
   }
 
   view() {}
+
+  /**
+   * 导出
+   */
+   exportLoading=false;
+  export() {
+    this.exportLoading=true;
+    //时间格式化
+    // this.fbsWorkingStatistics.start = this.datePipe.transform(this.fbsWorkingStatistics.start, 'yyyy-MM-dd');
+    // this.fbsWorkingStatistics.end = this.datePipe.transform(this.fbsWorkingStatistics.end, 'yyyy-MM-dd');
+    let fbsWorkingStatistics =JSON.parse(JSON.stringify(this.fbsWorkingStatistics));
+    fbsWorkingStatistics.pageNo=1
+    fbsWorkingStatistics.pageSize = -1;
+    this.fbsWorkingStatisticsService.list(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.personnelCode)
+            row.push(element.personnelName)
+            row.push(element.orderNumber)
+            row.push(element.materielCode)
+            row.push(element.materielName)
+            row.push(element.fbsTechnologicalProcessItemName)
+            row.push(element.firstTime)
+            row.push(element.finalTime)
+            row.push(element.finalInfo)
+            row.push(element.workingHours)
+            row.push(element.qualifiedNumber)
+            data.push(row)
+          });
+          data.push([
+            '总计',
+            '',
+            '',
+            '',
+            '',
+            '',
+            '',
+            '',
+            '',
+            '',
+            this.totalList.workingHoursTotal,
+            this.totalList.qualifiedNumberTotal
+          ])
+        }
+        // 导出
+        this.xlsx.export({
+          sheets: [
+            {
+              data: data,
+              name: '扫码记录',
+            },
+          ],
+          filename: '扫码记录.xlsx',
+        });
+        this.exportLoading = false;
+      }
+    });
+  }
   
 }