123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- /**
- * 工时服务
- * 冯海夫
- * 20201008
- */
- var ServiceWorkhour={
- // 根据物料统计
- getByMaterial:function(){
- var byMaterial=MethodGetService.methodGet("/workingStatistics/fbsWorkingStatistics/getByMaterial");
- if(!byMaterial){
- byMaterial={
- "生产":0
- }
- }
- return byMaterial;
- // return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductHoursMonthReport");
- // return {
- // "物料A 20*30":250,
- // "物料B 20*35":250,
- // "物料C 20*35":200,
- // "物料D 20*35":400,
- // };
- },
- // 当天根据物料统计
- getDayByMaterial:function(){
- // return {
- // "物料A":150,
- // "物料B":250,
- // "物料C":200,
- // "物料D":400,
- // };
- var map=MethodGetService.methodGet("/workingStatistics/fbsWorkingStatistics/getByMaterial?type=1");
- if(!map||Object.keys(map).length<=0){
- map={
- "生产":0
- }
- }
- return map;
- // return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getByMaterial?type=1");
- },
- // 获取物料的标准工时和实际工时
- getStandAndRealByMaterial:function(){
- var list = [];
- // list.push({productName:"产品A",standHour:15,realHour:20});
- // list.push({productName:"产品B",standHour:14,realHour:10});
- // list.push({productName:"产品C",standHour:18,realHour:17});
- // list.push({productName:"产品D",standHour:16,realHour:19});
- // list.push({productName:"产品E",standHour:13,realHour:12});
- // list.push({productName:"产品F",standHour:12,realHour:12});
- // list.push({productName:"产品G",standHour:17,realHour:20});
- list=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getWorkingHoursContrast");
- $.each(list, function(index,item){
- item.label = item.product;
- item.label1 = "标准工时";
- item.sum1 = item.standardWorkingHours;
- item.label2 = "实际工时";
- item.sum2 = item.manHoursCompleted;
- });
- return list;
- },
- // 获取当日物料的标准工时和实际工时
- getDayStandAndRealByMaterial:function(){
- // const list = [];
- // list.push({productName:"产品A",standHour:15,realHour:20});
- // list.push({productName:"产品B",standHour:14,realHour:10});
- // list.push({productName:"产品C",standHour:18,realHour:17});
- // list.push({productName:"产品D",standHour:16,realHour:19});
- // list.push({productName:"产品E",standHour:13,realHour:12});
- // list.push({productName:"产品F",standHour:12,realHour:12});
- // list.push({productName:"产品G",standHour:17,realHour:20});
- // $.each(list, function(index,item){
- // item.label = item.productName;
- // item.label1 = "标准工时";
- // item.sum1 = item.standHour;
- // item.label2 = "实际工时";
- // item.sum2 = item.realHour;
- // });
- var list=[];
- list=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getWorkingHoursContrast");
-
- $.each(list, function(index,item){
- item.label = item.product;
- item.label1 = "标准工时";
- item.sum1 = item.standardWorkingHours;
- item.label2 = "实际工时";
- item.sum2 = item.manHoursCompleted;
- });
- if(list&&list.length>0){
- var remainingQuantity=3-(list.length%3);
- if(remainingQuantity!=3){
- for(var i=0;i<remainingQuantity;i++){
- var bu="补"+i
- list.push({label:"",label1:"标准工时",sum1:0,label2:"实际工时",sum2:0})
- }
- }
- }else{
- list.push({label:"",label1:"标准工时",sum1:0,label2:"实际工时",sum2:0});
- list.push({label:"",label1:"标准工时",sum1:0,label2:"实际工时",sum2:0});
- list.push({label:"",label1:"标准工时",sum1:0,label2:"实际工时",sum2:0});
- }
- return list;
- }
- }
|