workhour.js 2.3 KB

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