reeor1.jsp 4.8 KB

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