chenc 4 anni fa
parent
commit
28badadca9
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      js/service/product.js

+ 11 - 2
js/service/product.js

@@ -244,10 +244,19 @@ var ServiceProduct = {
     // 生产效率
     getProduceRate: function () {
         // const rate = 95;
-        rate=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductionEfficiency");
+        // rate=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductionEfficiency");
+        var listOfData=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getSumDispatchReport");
+        var productivityTotal=0
+        listOfData.forEach(element => {
+            let standardWorkingHoursTotal=element.standardWorkingHoursTotal;//标准工时
+            let manHoursCompletedTotal=element.manHoursCompletedTotal;//完成工时
+            if(element.projectName==="统计"){
+              productivityTotal=((Number(standardWorkingHoursTotal)/Number(manHoursCompletedTotal))*100).toFixed(1)
+            }
+          });
         return {
             name: "当月生产效率",
-            value: rate
+            value: productivityTotal
         };
 
     },