workhour.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * 工时服务
  3. * 冯海夫
  4. * 20201008
  5. */
  6. var ServiceWorkhour={
  7. // 根据物料统计
  8. getByMaterial:function(){
  9. return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductHoursMonthReport");
  10. // return {
  11. // "物料A 20*30":250,
  12. // "物料B 20*35":250,
  13. // "物料C 20*35":200,
  14. // "物料D 20*35":400,
  15. // };
  16. },
  17. // 当天根据物料统计
  18. getDayByMaterial:function(){
  19. // return {
  20. // "物料A":150,
  21. // "物料B":250,
  22. // "物料C":200,
  23. // "物料D":400,
  24. // };
  25. return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductHoursMonthReport?type=1");
  26. },
  27. // 获取物料的标准工时和实际工时
  28. getStandAndRealByMaterial:function(){
  29. var list = [];
  30. // list.push({productName:"产品A",standHour:15,realHour:20});
  31. // list.push({productName:"产品B",standHour:14,realHour:10});
  32. // list.push({productName:"产品C",standHour:18,realHour:17});
  33. // list.push({productName:"产品D",standHour:16,realHour:19});
  34. // list.push({productName:"产品E",standHour:13,realHour:12});
  35. // list.push({productName:"产品F",standHour:12,realHour:12});
  36. // list.push({productName:"产品G",standHour:17,realHour:20});
  37. list=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getWorkingHoursContrast");
  38. $.each(list, function(index,item){
  39. item.label = item.product;
  40. item.label1 = "标准工时";
  41. item.sum1 = item.standardWorkingHours;
  42. item.label2 = "实际工时";
  43. item.sum2 = item.manHoursCompleted;
  44. });
  45. return list;
  46. },
  47. // 获取当日物料的标准工时和实际工时
  48. getDayStandAndRealByMaterial:function(){
  49. // const list = [];
  50. // list.push({productName:"产品A",standHour:15,realHour:20});
  51. // list.push({productName:"产品B",standHour:14,realHour:10});
  52. // list.push({productName:"产品C",standHour:18,realHour:17});
  53. // list.push({productName:"产品D",standHour:16,realHour:19});
  54. // list.push({productName:"产品E",standHour:13,realHour:12});
  55. // list.push({productName:"产品F",standHour:12,realHour:12});
  56. // list.push({productName:"产品G",standHour:17,realHour:20});
  57. // $.each(list, function(index,item){
  58. // item.label = item.productName;
  59. // item.label1 = "标准工时";
  60. // item.sum1 = item.standHour;
  61. // item.label2 = "实际工时";
  62. // item.sum2 = item.realHour;
  63. // });
  64. var list=[];
  65. list=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getWorkingHoursContrast");
  66. $.each(list, function(index,item){
  67. item.label = item.product;
  68. item.label1 = "标准工时";
  69. item.sum1 = item.standardWorkingHours;
  70. item.label2 = "实际工时";
  71. item.sum2 = item.manHoursCompleted;
  72. });
  73. return list;
  74. }
  75. }