reeor4.jsp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <%@ page contentType="text/html; charset=utf-8" session="false" %>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <script type="text/javascript">
  4. var mydataP4,grid4Height;
  5. $(document).ready( function() {
  6. grid4Height = document.body.clientHeight-110;
  7. loadR4List(); //加载jqgrid
  8. });
  9. //jqgrid初始化
  10. function loadR4List(){
  11. jQuery("#r4list").jqGrid({
  12. datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
  13. height: grid4Height, //高度
  14. colNames:["饲料名称","班次","车号","驾驶员","计划添加次数", "已添加次数", "添加执行率", "计划添加重量", "已添加重量", "平均添加误差率", "最大添加误差率", "最小添加误差率"], //列名
  15. colModel:[
  16. {
  17. name: "FNAME",
  18. index: "FNAME",
  19. width: 100,
  20. align: "center",
  21. sorttype: "string"
  22. },
  23. {
  24. name: "Times",
  25. index: "Times",
  26. width: 70,
  27. align: "center",
  28. sorttype: "string"
  29. },
  30. {
  31. name: "DataCaptureNo",
  32. index: "DataCaptureNo",
  33. width: 70,
  34. align: "center",
  35. sorttype: "string"
  36. },
  37. {
  38. name: "DNAME",
  39. index: "DNAME",
  40. width: 70,
  41. align: "center",
  42. sorttype: "string"
  43. },
  44. {
  45. name: "AllCount_ID",
  46. index: "AllCount_ID",
  47. width: 100,
  48. align: "center",
  49. sorttype: "string"
  50. },
  51. {
  52. name: "Count_ID",
  53. index: "Count_ID",
  54. width: 100,
  55. align: "center",
  56. sorttype: "string"
  57. },
  58. {
  59. name: "zxl",
  60. index: "zxl",
  61. width: 100,
  62. align: "center",
  63. sorttype: "string"
  64. },
  65. {
  66. name: "Sum_LWEIGHT",
  67. index: "Sum_LWEIGHT",
  68. width: 100,
  69. align: "center",
  70. sorttype: "string"
  71. },
  72. {
  73. name: "Sum_Weight",
  74. index: "Sum_Weight",
  75. width: 100,
  76. align: "center",
  77. sorttype: "string"
  78. },
  79. {
  80. name: "Avg_Err",
  81. index: "Avg_Err",
  82. width: 100,
  83. align: "center",
  84. sorttype: "string"
  85. },
  86. {
  87. name: "Max_Err",
  88. index: "Max_Err",
  89. width: 100,
  90. align: "center",
  91. sorttype: "string"
  92. },
  93. {
  94. name: "Min_Err",
  95. index: "Min_Err",
  96. width: 100,
  97. align: "center",
  98. sorttype: "string"
  99. }
  100. ],
  101. /**
  102. * 设置水平滚动条 begin
  103. **/
  104. shrinkToFit: true,
  105. autoScroll: true,
  106. rowNum: 10000, //每页显示条数
  107. autowidth: true //自动调节宽度
  108. /**
  109. * 设置水平滚动条 end
  110. **/
  111. });
  112. //获取数据集
  113. mydataP4 = getR4Lists();
  114. if(mydataP4!=null){
  115. for(var i=0;i<=mydataP4.length;i++){
  116. jQuery("#r4list").jqGrid('addRowData',i+1,mydataP4[i]);
  117. }
  118. }
  119. }
  120. //获取服务器数据
  121. function getR4Lists(){
  122. var reeorno = "${reeorno}";
  123. var beginDate = $("#beginDate").val();
  124. var endDate = $("#endDate").val();
  125. $.ajax({
  126. async: false,
  127. type: "POST",
  128. dataType: "json", //返回类型json
  129. data: "beginDate="+beginDate+"&endDate="+endDate+"&reeorno="+reeorno,
  130. url: "${contextPath }/admin/statistics/reeorlist.html",
  131. error: function(){alert("系统错误");},
  132. success: function(json){
  133. mydataP4 = json;
  134. }
  135. });
  136. return mydataP4;
  137. }
  138. </script>
  139. <table id="r4list"></table>