workhour.js 3.3 KB

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