Browse Source

首页 派工单 所有总计

chenc 4 years ago
parent
commit
5f00b310fc

+ 3 - 0
src/app/entity/fbs/fbs-workshop-dispatch-list.ts

@@ -57,5 +57,8 @@ export class FbsWorkshopDispatchList extends Page{
   workingHoursEfficiency?:string;
   workingHoursEfficiency?:string;
 	
 	
 	fbsWorkshopDispatchListList?:FbsWorkshopDispatchList[]
 	fbsWorkshopDispatchListList?:FbsWorkshopDispatchList[]
+	stateList?:any[];//多选状态
+	year?:string;
+	month?:string;
 	
 	
 }
 }

+ 21 - 21
src/app/routes/dashboard/analysis/analysis.component.html

@@ -80,6 +80,24 @@
             </nz-select>
             </nz-select>
           </nz-form-control>
           </nz-form-control>
         </nz-form-item>
         </nz-form-item>
+      </div>
+      <div nz-col nzXs="24" nzSm="4" nzLg="4">
+        <nz-form-item class="nz-form-item">
+          <nz-form-label [nzSpan]="8">年份</nz-form-label>
+          <nz-form-control [nzSpan]="16">
+            <input [(ngModel)]="fbsWorkshopDispatchList.year" name="year" nz-input
+            placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col nzXs="24" nzSm="4" nzLg="4">
+        <nz-form-item class="nz-form-item">
+          <nz-form-label [nzSpan]="8">月份</nz-form-label>
+          <nz-form-control [nzSpan]="16">
+            <input [(ngModel)]="fbsWorkshopDispatchList.month" name="month" nz-input
+            placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
       </div>
       </div>
        <!-- 按钮 -->
        <!-- 按钮 -->
        <div nz-col nzXs="24" nzSm="4" nzLg="2">
        <div nz-col nzXs="24" nzSm="4" nzLg="2">
@@ -91,10 +109,10 @@
           </nz-form-control>
           </nz-form-control>
         </nz-form-item>
         </nz-form-item>
       </div>
       </div>
-      <div nz-col nzXs="24" nzSm="4" nzLg="8">
+      <div nz-col nzXs="24" nzSm="4" nzLg="6">
         <nz-form-item class="nz-form-item">
         <nz-form-item class="nz-form-item">
-          <nz-form-label [nzSpan]="8" >是否显示已完成订单</nz-form-label>
-          <nz-form-control [nzSpan]="16">
+          <nz-form-label [nzSpan]="16" >是否显示已完成订单</nz-form-label>
+          <nz-form-control [nzSpan]="8">
             <!-- 查询 -->
             <!-- 查询 -->
             <nz-switch [(ngModel)]="isSwitch" name="isSwitch"
             <nz-switch [(ngModel)]="isSwitch" name="isSwitch"
                           nzCheckedChildren="是"
                           nzCheckedChildren="是"
@@ -370,24 +388,6 @@
 </div>
 </div>
 <form nz-form>
 <form nz-form>
   <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
   <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
-    <div nz-col nzXs="24" nzSm="4" nzLg="4">
-      <nz-form-item class="nz-form-item">
-        <nz-form-label [nzSpan]="8">年份</nz-form-label>
-        <nz-form-control [nzSpan]="16">
-          <input [(ngModel)]="year" name="year" nz-input
-          placeholder="请输入" />
-        </nz-form-control>
-      </nz-form-item>
-    </div>
-    <div nz-col nzXs="24" nzSm="4" nzLg="4">
-      <nz-form-item class="nz-form-item">
-        <nz-form-label [nzSpan]="8">月份</nz-form-label>
-        <nz-form-control [nzSpan]="16">
-          <input [(ngModel)]="month" name="month" nz-input
-          placeholder="请输入" />
-        </nz-form-control>
-      </nz-form-item>
-    </div>
      <!-- 按钮 -->
      <!-- 按钮 -->
      <div nz-col nzXs="24" nzSm="4" nzLg="4">
      <div nz-col nzXs="24" nzSm="4" nzLg="4">
       <nz-form-item class="nz-form-item">
       <nz-form-item class="nz-form-item">

+ 14 - 11
src/app/routes/dashboard/analysis/analysis.component.ts

@@ -9,7 +9,7 @@ import { ProjectFileService } from 'app/services/projectFile/project-file.servic
 import { FbsWorkshopDispatchListService } from 'app/services/fbs/fbs-workshop-dispatch-list.service';
 import { FbsWorkshopDispatchListService } from 'app/services/fbs/fbs-workshop-dispatch-list.service';
 import { FbsAbnormalWorkingHoursService } from 'app/services/fbs/fbs-abnormal-working-hours.service';
 import { FbsAbnormalWorkingHoursService } from 'app/services/fbs/fbs-abnormal-working-hours.service';
 import { FbsWorkshopDispatchList } from 'app/entity/fbs/fbs-workshop-dispatch-list';
 import { FbsWorkshopDispatchList } from 'app/entity/fbs/fbs-workshop-dispatch-list';
-
+import { convertingNumbers } from '@shared/utils/shared';
 @Component({
 @Component({
   selector: 'app-dashboard-analysis',
   selector: 'app-dashboard-analysis',
   templateUrl: './analysis.component.html',
   templateUrl: './analysis.component.html',
@@ -105,12 +105,14 @@ export class DashboardAnalysisComponent implements OnInit {
     //   this.data = res;
     //   this.data = res;
     //   this.loading = false;
     //   this.loading = false;
     // });
     // });
+    
     this.getCircleChartData();
     this.getCircleChartData();
     this.feeTotal = `&yen ${this.feeData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
     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.alertTotal = `&yen ${this.feeData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
+    this.getNow();
     this.getSumDispatchReport();
     this.getSumDispatchReport();
     this.getAbnormalWorkingHoursReport();
     this.getAbnormalWorkingHoursReport();
-    this.getNow();
+    
   }
   }
 
 
   /**
   /**
@@ -301,6 +303,7 @@ export class DashboardAnalysisComponent implements OnInit {
     this.fbsWorkshopDispatchListService.getSumDispatchReport(this.fbsWorkshopDispatchList).then((response)=>{
     this.fbsWorkshopDispatchListService.getSumDispatchReport(this.fbsWorkshopDispatchList).then((response)=>{
       this.listOfData=response.result;
       this.listOfData=response.result;
       this.defaultSwitch();
       this.defaultSwitch();
+      this.isSwitchChange();
       if(this.listOfDataSelect===null){
       if(this.listOfDataSelect===null){
         this.listOfDataSelect=JSON.parse(JSON.stringify(response.result));
         this.listOfDataSelect=JSON.parse(JSON.stringify(response.result));
       }
       }
@@ -379,10 +382,10 @@ export class DashboardAnalysisComponent implements OnInit {
   listOfData=[]
   listOfData=[]
 
 
   isSwitch=false;//是否显示已完成订单
   isSwitch=false;//是否显示已完成订单
-  isSwitchChange(event){
+  isSwitchChange(){
       this.listOfData.forEach(element => {
       this.listOfData.forEach(element => {
         if(element.status===4){
         if(element.status===4){
-          if(event===false){
+          if(this.isSwitch===false){
             element.isSwitch=false;
             element.isSwitch=false;
           }else{
           }else{
             element.isSwitch=true;
             element.isSwitch=true;
@@ -409,11 +412,11 @@ export class DashboardAnalysisComponent implements OnInit {
    //初始化年月 默认当前年月
    //初始化年月 默认当前年月
    getNow(){
    getNow(){
     let date = new Date();
     let date = new Date();
-    this.year=date.getFullYear()+"";
+    this.fbsWorkshopDispatchList.year=date.getFullYear()+"";
     if(date.getMonth()<10){
     if(date.getMonth()<10){
-      this.month="0"+(date.getMonth()+1)
+      this.fbsWorkshopDispatchList.month="0"+(date.getMonth()+1)
     }else{
     }else{
-      this.month=(date.getMonth()+1)+"";
+      this.fbsWorkshopDispatchList.month=(date.getMonth()+1)+"";
     }
     }
     
     
    }
    }
@@ -444,10 +447,10 @@ export class DashboardAnalysisComponent implements OnInit {
       row.push(element.productionOrderNumberName)
       row.push(element.productionOrderNumberName)
       row.push(element.productId)
       row.push(element.productId)
       row.push(element.product)
       row.push(element.product)
-      row.push(element.numberOfTasksTotal)
-      row.push(element.standardWorkingHoursTotal)
-      row.push(element.latestCompletedQuantity)//quantityCompletedTotal
-      row.push(element.manHoursCompletedTotal)
+      row.push(convertingNumbers(element.numberOfTasksTotal))
+      row.push(convertingNumbers(element.standardWorkingHoursTotal))
+      row.push(element.quantityCompletedTotal)//quantityCompletedTotal//latestCompletedQuantity
+      row.push(convertingNumbers(element.manHoursCompletedTotal))
       data.push(row);
       data.push(row);
     });
     });
     let efficiencyTotal=[
     let efficiencyTotal=[

+ 24 - 4
src/app/routes/fbs-abnormal-working-hours/list/list.component.ts

@@ -25,6 +25,7 @@ export class FbsAbnormalWorkingHoursListComponent implements OnInit {
 
 
   ngOnInit() {
   ngOnInit() {
     this.getList();
     this.getList();
+    this.getTotalList();
   }
   }
 
 
   dataList = []; //表格数据
   dataList = []; //表格数据
@@ -55,12 +56,13 @@ export class FbsAbnormalWorkingHoursListComponent implements OnInit {
       if(response.success){//查询成功
       if(response.success){//查询成功
         this.dataList=response.result.records;//表格数据
         this.dataList=response.result.records;//表格数据
         this.page=response.result;//分页数据
         this.page=response.result;//分页数据
-        this.getTotal();//统计合计
+        // this.getTotal();//统计合计
         this.isLoading=false;
         this.isLoading=false;
       }
       }
     })
     })
   }
   }
 
 
+
   /**
   /**
    * 查询按钮
    * 查询按钮
    */
    */
@@ -68,6 +70,7 @@ export class FbsAbnormalWorkingHoursListComponent implements OnInit {
     this.fbsAbnormalWorkingHours.pageNo=1;
     this.fbsAbnormalWorkingHours.pageNo=1;
     //主数据刷新
     //主数据刷新
     this.getList();
     this.getList();
+    this.getTotalList();//计算各个数量的总计
   }
   }
 
 
 
 
@@ -177,13 +180,30 @@ export class FbsAbnormalWorkingHoursListComponent implements OnInit {
     };
     };
   }
   }
 
 
+  /**
+   * 获取各个数量的总计
+   */
+  getTotalList(){
+    this.fbsAbnormalWorkingHours.start = this.datePipe.transform(this.fbsAbnormalWorkingHours.start, 'yyyy-MM-dd');
+    this.fbsAbnormalWorkingHours.end = this.datePipe.transform(this.fbsAbnormalWorkingHours.end, 'yyyy-MM-dd');
+    let fbsAbnormalWorkingHours=JSON.parse(JSON.stringify(this.fbsAbnormalWorkingHours));
+    fbsAbnormalWorkingHours.pageSize=10000;
+    this.fbsAbnormalWorkingHoursService.list(fbsAbnormalWorkingHours).then((response)=>{
+      if(response.success){//查询成功
+        let dataList=response.result.records;//表格数据
+        this.getTotal(dataList);//统计合计
+        this.isLoading=false;
+      }
+    })
+  }
+
   /**
   /**
    * 计算当页的总计数据
    * 计算当页的总计数据
    */
    */
-  getTotal() {
+  getTotal(dataList) {
     this.initializationTotal();
     this.initializationTotal();
-    if (this.dataList) {
-      this.dataList.forEach(element => {
+    if (dataList) {
+      dataList.forEach(element => {
         this.totalList.overtimeHours = (Number(this.totalList.overtimeHours) + Number(element.overtimeHours)).toFixed(1);
         this.totalList.overtimeHours = (Number(this.totalList.overtimeHours) + Number(element.overtimeHours)).toFixed(1);
         this.totalList.train = (Number(this.totalList.train) + Number(element.train)).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.meeting = (Number(this.totalList.meeting) + Number(element.meeting)).toFixed(1);

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

@@ -59,6 +59,16 @@
           </nz-form-control>
           </nz-form-control>
         </nz-form-item>
         </nz-form-item>
       </div>
       </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.orderNumber" name="orderNumber" nz-input
+              placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
+      </div>
     </div>
     </div>
   </form>
   </form>
   <!-- 数据表 -->
   <!-- 数据表 -->
@@ -69,7 +79,8 @@
       <tr>
       <tr>
         <th>人员编码</th>
         <th>人员编码</th>
         <th>人员名称</th>
         <th>人员名称</th>
-        <th>订单号</th>
+        <th>	
+          生产订单号</th>
         <th>物料编码</th>
         <th>物料编码</th>
         <th>物料名称</th>
         <th>物料名称</th>
         <th>上岗日期</th>
         <th>上岗日期</th>

+ 25 - 3
src/app/routes/fbs-scan-code/list/list.component.ts

@@ -23,6 +23,7 @@ export class FbsScanCodeListComponent implements OnInit {
   ngOnInit() {
   ngOnInit() {
     this.getList();
     this.getList();
     this.getProperList();
     this.getProperList();
+    this.getTotalList();
    }
    }
 
 
 
 
@@ -43,6 +44,8 @@ export class FbsScanCodeListComponent implements OnInit {
     this.fbsWorkingStatistics.pageNo = 1;
     this.fbsWorkingStatistics.pageNo = 1;
     //主数据刷新
     //主数据刷新
     this.getList();
     this.getList();
+    //计算各个合计
+    this.getTotalList();
   }
   }
 
 
   // 按页码查询
   // 按页码查询
@@ -65,7 +68,26 @@ export class FbsScanCodeListComponent implements OnInit {
         //查询成功
         //查询成功
         this.dataList = response.result.records; //表格数据
         this.dataList = response.result.records; //表格数据
         this.page = response.result; //分页数据
         this.page = response.result; //分页数据
-        this.getTotal();//查询总计
+        // this.getTotal();//查询总计
+        this.isLoading = false;
+
+      }
+    });
+  }
+
+  /**
+   * 计算各个总计
+   */
+  getTotalList(){
+    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.pageSize=10000;
+    this.fbsWorkingStatisticsService.list(fbsWorkingStatistics).then(response => {
+      if (response.success) {
+        //查询成功
+        let dataList = response.result.records; //表格数据
+        this.getTotal(dataList);//查询总计
         this.isLoading = false;
         this.isLoading = false;
 
 
       }
       }
@@ -85,9 +107,9 @@ export class FbsScanCodeListComponent implements OnInit {
   /**
   /**
    * 计算工时、数量总计
    * 计算工时、数量总计
    */
    */
-  getTotal(){
+  getTotal(dataList){
     this.initializationTotal();
     this.initializationTotal();
-    this.dataList.forEach(element => {
+    dataList.forEach(element => {
       this.totalList.workingHoursTotal+=Number(element.workingHours);
       this.totalList.workingHoursTotal+=Number(element.workingHours);
       this.totalList.qualifiedNumberTotal+=Number(element.qualifiedNumber);
       this.totalList.qualifiedNumberTotal+=Number(element.qualifiedNumber);
     });
     });

+ 23 - 7
src/app/routes/fbs-workshop-dispatch-list/list/list.component.html

@@ -72,7 +72,7 @@
         <nz-form-item class="nz-form-item">
         <nz-form-item class="nz-form-item">
           <nz-form-label [nzSpan]="8">状态</nz-form-label>
           <nz-form-label [nzSpan]="8">状态</nz-form-label>
           <nz-form-control [nzSpan]="16">
           <nz-form-control [nzSpan]="16">
-            <nz-select [(ngModel)]="fbsWorkshopDispatchList.state" name="state" style="width: 100%" nzShowSearch nzAllowClear
+            <nz-select nzMode="multiple" [(ngModel)]="fbsWorkshopDispatchList.stateList" name="state" style="width: 100%" nzShowSearch nzAllowClear
               nzPlaceHolder="请选择" [nzDropdownMatchSelectWidth]="false">
               nzPlaceHolder="请选择" [nzDropdownMatchSelectWidth]="false">
               <nz-option nzLabel="派工" nzValue="0"> </nz-option>
               <nz-option nzLabel="派工" nzValue="0"> </nz-option>
               <nz-option nzLabel="上岗" nzValue="1"> </nz-option>
               <nz-option nzLabel="上岗" nzValue="1"> </nz-option>
@@ -84,6 +84,18 @@
         </nz-form-item>
         </nz-form-item>
       </div>
       </div>
     </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)]="fbsWorkshopDispatchList.product" name="product" nz-input
+              placeholder="请输入" />
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
   </form>
   </form>
   <!-- 数据表 -->
   <!-- 数据表 -->
   <nz-table nzSize="small" class="buttonDistance" [nzData]="dataList" [nzLoading]="isLoading"
   <nz-table nzSize="small" class="buttonDistance" [nzData]="dataList" [nzLoading]="isLoading"
@@ -91,10 +103,10 @@
     (nzPageIndexChange)="pageIndexChange($event)">
     (nzPageIndexChange)="pageIndexChange($event)">
     <thead>
     <thead>
       <tr>
       <tr>
-        <th>姓名</th>
+        <th  style="width:10%">姓名</th>
         <th>日期</th>
         <th>日期</th>
         <th>生产订单号</th>
         <th>生产订单号</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>
         <th nzAlign="center">标准工时</th>
@@ -105,14 +117,18 @@
         <th>状态</th>
         <th>状态</th>
         <!-- <th>计划开工时间</th>
         <!-- <th>计划开工时间</th>
         <th>计划完工时间</th> -->
         <th>计划完工时间</th> -->
-        <th style="width:15%">{{ 'table.operation' | translate }}</th>
+        <th style="width:10%">{{ 'table.operation' | translate }}</th>
       </tr>
       </tr>
     </thead>
     </thead>
     <tbody>
     <tbody>
       <tr *ngFor="let item of  borderedTable.data">
       <tr *ngFor="let item of  borderedTable.data">
         <!-- <td >{{item.milestoneCode}}</td> -->
         <!-- <td >{{item.milestoneCode}}</td> -->
         <td>{{item.name}}</td>
         <td>{{item.name}}</td>
-        <td>{{item.date}}</td>
+        <td>
+          <ng-container *ngIf="item.firstTime||item.finalTime">
+            {{item.firstTime}}至{{item.finalTime}}
+          </ng-container>
+        </td>
         <td>{{item.productionOrderNumberName}}</td>
         <td>{{item.productionOrderNumberName}}</td>
         <td style="width: 15%;">{{item.product}}</td>
         <td style="width: 15%;">{{item.product}}</td>
         <td  nzAlign="center" >{{item.plannedQuantity}}</td>
         <td  nzAlign="center" >{{item.plannedQuantity}}</td>
@@ -154,8 +170,8 @@
         <td nzAlign="center">{{totalList.standardWorkingHours}}</td>
         <td nzAlign="center">{{totalList.standardWorkingHours}}</td>
         <td nzAlign="center">{{totalList.latestCompletedQuantity}}</td>
         <td nzAlign="center">{{totalList.latestCompletedQuantity}}</td>
         <td nzAlign="center">{{totalList.manHoursCompleted}}</td>
         <td nzAlign="center">{{totalList.manHoursCompleted}}</td>
-        <td></td>
-        <td></td>
+        <td nzAlign="center">{{totalList.numberEfficiency}}%</td>
+        <td nzAlign="center">{{totalList.workingHoursEfficiency}}%</td>
         <td></td>
         <td></td>
       </tr>
       </tr>
     </tbody>
     </tbody>

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

@@ -28,6 +28,7 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
   ngOnInit() {
   ngOnInit() {
     this.getList();
     this.getList();
     this.getProperList();
     this.getProperList();
+    this.getTotleList();//计算当页的总计数量
   }
   }
 
 
   dataList = []; //表格数据
   dataList = []; //表格数据
@@ -47,6 +48,7 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
     this.fbsWorkshopDispatchList.pageNo = 1;
     this.fbsWorkshopDispatchList.pageNo = 1;
     //主数据刷新
     //主数据刷新
     this.getList();
     this.getList();
+    this.getTotleList();//计算当页的总计数量
   }
   }
 
 
   // 按页码查询
   // 按页码查询
@@ -71,13 +73,32 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
         this.getEfficiency(this.dataList); //计算效率
         this.getEfficiency(this.dataList); //计算效率
         this.page = response.result; //分页数据
         this.page = response.result; //分页数据
         this.isLoading = false;
         this.isLoading = false;
-        this.getTotal(); //计算当页的总计数量
+        // this.getTotal(); //计算当页的总计数量
+        
       }
       }
     });
     });
   }
   }
 
 
   /**
   /**
-   * 初始化总计
+   * 计算合计
+   */
+  getTotleList(){
+    this.fbsWorkshopDispatchList.start = this.datePipe.transform(this.fbsWorkshopDispatchList.start, 'yyyy-MM-dd');
+    this.fbsWorkshopDispatchList.end = this.datePipe.transform(this.fbsWorkshopDispatchList.end, 'yyyy-MM-dd');
+    let fbsWorkshopDispatchList=JSON.parse(JSON.stringify(this.fbsWorkshopDispatchList));
+    fbsWorkshopDispatchList.pageSize=10000;
+    this.fbsWorkshopDispatchListService.list(fbsWorkshopDispatchList).then(response => {
+      if (response.success) {
+        //查询成功
+        let dataList = response.result.records; //表格数据
+        this.isLoading = false;
+        this.getTotal(dataList); //计算当页的总计数量
+      }
+    });
+  }
+
+  /**
+   * 初始化各个数量的总计
    */
    */
   totalList: any = {};
   totalList: any = {};
   initializationTotal() {
   initializationTotal() {
@@ -87,16 +108,20 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
       standardWorkingHours: 0,
       standardWorkingHours: 0,
       latestCompletedQuantity: 0,
       latestCompletedQuantity: 0,
       manHoursCompleted: 0,
       manHoursCompleted: 0,
+      numberEfficiency:0,
+      workingHoursEfficiency:0
     };
     };
   }
   }
 
 
   /**
   /**
    * 计算当页的总计数据
    * 计算当页的总计数据
    */
    */
-  getTotal() {
+  getTotal(dataList) {
     this.initializationTotal();
     this.initializationTotal();
-    if (this.dataList) {
-      this.dataList.forEach(element => {
+    let completeStandardWorkingHours=0;//完成数量标准工时
+    let manHoursCompletedHide=0;//之累计完成数量不为0的
+    if (dataList) {
+      dataList.forEach(element => {
         element.standardWorkingHours=Number(element.standardWorkingHours).toFixed(1)
         element.standardWorkingHours=Number(element.standardWorkingHours).toFixed(1)
         this.totalList.plannedQuantity = this.totalList.plannedQuantity + Number(element.plannedQuantity);
         this.totalList.plannedQuantity = this.totalList.plannedQuantity + Number(element.plannedQuantity);
         this.totalList.numberOfTasks = this.totalList.numberOfTasks + Number(element.numberOfTasks);
         this.totalList.numberOfTasks = this.totalList.numberOfTasks + Number(element.numberOfTasks);
@@ -105,10 +130,15 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
         this.totalList.latestCompletedQuantity =
         this.totalList.latestCompletedQuantity =
           this.totalList.latestCompletedQuantity + Number(element.latestCompletedQuantity);
           this.totalList.latestCompletedQuantity + Number(element.latestCompletedQuantity);
         this.totalList.manHoursCompleted = this.totalList.manHoursCompleted + Number(element.manHoursCompleted);
         this.totalList.manHoursCompleted = this.totalList.manHoursCompleted + Number(element.manHoursCompleted);
-
+        if(Number(element.latestCompletedQuantity)>0){
+          completeStandardWorkingHours=completeStandardWorkingHours+(Number(element.standardWorkingHoursZ)*Number(element.latestCompletedQuantity))
+          manHoursCompletedHide=manHoursCompletedHide+(Number(element.manHoursCompleted))
+        }
       });
       });
       this.totalList.standardWorkingHours = this.totalList.standardWorkingHours.toFixed(1);
       this.totalList.standardWorkingHours = this.totalList.standardWorkingHours.toFixed(1);
       this.totalList.manHoursCompleted = this.totalList.manHoursCompleted.toFixed(1);
       this.totalList.manHoursCompleted = this.totalList.manHoursCompleted.toFixed(1);
+      this.totalList.numberEfficiency=((this.totalList.latestCompletedQuantity/this.totalList.numberOfTasks)*100).toFixed(1);
+      this.totalList.workingHoursEfficiency=((completeStandardWorkingHours/manHoursCompletedHide)*100).toFixed(1);
     }
     }
   }
   }
 
 

+ 5 - 0
src/app/routes/fbs-workshop-dispatch-list/update/update.component.html

@@ -63,6 +63,11 @@
         <td>标准工时</td>
         <td>标准工时</td>
         <td><nz-input-number [(ngModel)]="fbsWorkshopDispatchList.standardWorkingHours" [nzMin]="0" [nzStep]="1"></nz-input-number></td>
         <td><nz-input-number [(ngModel)]="fbsWorkshopDispatchList.standardWorkingHours" [nzMin]="0" [nzStep]="1"></nz-input-number></td>
       </tr>
       </tr>
+      <tr>
+        <td>完成工时</td>
+        <td><nz-input-number [(ngModel)]="fbsWorkshopDispatchList.manHoursCompleted" [nzMin]="0" [nzStep]="1"></nz-input-number></td>
+        <td colSpan="2"></td>
+      </tr>
       <tr>
       <tr>
         <td>计划开工时间</td>
         <td>计划开工时间</td>
         <td>
         <td>