reeor2.jsp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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 mydataP2,grid2Height;
  5. $(document).ready( function() {
  6. grid2Height = document.body.clientHeight-110;
  7. loadR2List(); //加载jqgrid
  8. });
  9. //jqgrid初始化
  10. function loadR2List(){
  11. jQuery("#r2list").jqGrid({
  12. datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
  13. height: grid2Height, //高度
  14. colNames:["ID","车号代码","车号","驾驶员","加工车次","理论加工量(kg)","实际加工量(kg)","计划投料操作数", "已投料操作数", "投料操作率", "投料误差数", "投料误差率", "计划发料操作数", "已发料操作数", "发料操作率", "发料误差数", "发料误差率"], //列名
  15. colModel:[
  16. {
  17. name: "DriverID",
  18. index: "DriverID",
  19. width: 40,
  20. align: "center",
  21. sorttype: "string",
  22. hidden: true
  23. },
  24. {
  25. name: "DNo",
  26. index: "DNo",
  27. sorttype: "string",
  28. hidden: true
  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: 40,
  41. align: "center",
  42. sorttype: "string"
  43. },
  44. {
  45. name: "countd",
  46. index: "countd",
  47. width: 70,
  48. align: "center",
  49. sorttype: "string"
  50. },
  51. {
  52. name: "lw",
  53. index: "lw",
  54. width: 100,
  55. align: "center",
  56. sorttype: "string"
  57. },
  58. {
  59. name: "sjjgl",
  60. index: "sjjgl",
  61. width: 100,
  62. align: "center",
  63. sorttype: "string"
  64. },
  65. {
  66. name: "Count_All1",
  67. index: "Count_All1",
  68. width: 100,
  69. align: "center",
  70. sorttype: "string"
  71. },
  72. {
  73. name: "Count_Succ1",
  74. index: "Count_Succ1",
  75. width: 100,
  76. align: "center",
  77. sorttype: "string"
  78. },
  79. {
  80. name: "tlczl",
  81. index: "tlczl",
  82. width: 70,
  83. align: "center",
  84. sorttype: "string"
  85. },
  86. {
  87. name: "Count_Over1",
  88. index: "Count_Over1",
  89. width: 100,
  90. align: "center",
  91. sorttype: "string"
  92. },
  93. {
  94. name: "tlwcl",
  95. index: "tlwcl",
  96. width: 70,
  97. align: "center",
  98. sorttype: "string"
  99. },
  100. {
  101. name: "Count_All2",
  102. index: "Count_All2",
  103. width: 100,
  104. align: "center",
  105. sorttype: "string"
  106. },
  107. {
  108. name: "Count_Succ2",
  109. index: "Count_Succ2",
  110. width: 100,
  111. align: "center",
  112. sorttype: "string"
  113. },
  114. {
  115. name: "flczl",
  116. index: "flczl",
  117. width: 70,
  118. align: "center",
  119. sorttype: "string"
  120. },
  121. {
  122. name: "Count_Over2",
  123. index: "Count_Over2",
  124. width: 100,
  125. align: "center",
  126. sorttype: "string"
  127. },
  128. {
  129. name: "flwcl",
  130. index: "flwcl",
  131. width: 70,
  132. align: "center",
  133. sorttype: "string"
  134. }
  135. ],
  136. ondblClickRow: function(){
  137. var selId = $("#r2list").jqGrid("getGridParam","selrow"); //获取当前选中行号
  138. var rowData = $("#r2list").jqGrid("getRowData",selId); //获取当前选中行真实对象
  139. if(rowData.DriverID != 10000){
  140. $("#DriverID").val(rowData.DriverID);
  141. $("#DataCaptureNo").val(rowData.DNo);
  142. var id_reeorchart = window.top.document.getElementById("id_reeorchart");
  143. id_reeorchart.click();
  144. }
  145. },
  146. /**
  147. * 设置水平滚动条 begin
  148. **/
  149. shrinkToFit: true,
  150. autoScroll: true,
  151. rowNum: 10000, //每页显示条数
  152. autowidth: true //自动调节宽度
  153. /**
  154. * 设置水平滚动条 end
  155. **/
  156. });
  157. //获取数据集
  158. mydataP2 = getR2Lists();
  159. if(mydataP2!=null){
  160. for(var i=0;i<=mydataP2.length;i++){
  161. jQuery("#r2list").jqGrid('addRowData',i+1,mydataP2[i]);
  162. }
  163. }
  164. }
  165. //获取服务器数据
  166. function getR2Lists(){
  167. var reeorno = "${reeorno}";
  168. var beginDate = $("#beginDate").val();
  169. var endDate = $("#endDate").val();
  170. $.ajax({
  171. async: false,
  172. type: "POST",
  173. dataType: "json", //返回类型json
  174. data: "beginDate="+beginDate+"&endDate="+endDate+"&reeorno="+reeorno,
  175. url: "${contextPath }/admin/statistics/reeorlist.html",
  176. error: function(){alert("系统错误");},
  177. success: function(json){
  178. mydataP2 = json;
  179. }
  180. });
  181. return mydataP2;
  182. }
  183. </script>
  184. <table id="r2list"></table>