123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <%@ page contentType="text/html; charset=utf-8" session="false" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <script type="text/javascript">
- var mydataP2,grid2Height;
- $(document).ready( function() {
- grid2Height = document.body.clientHeight-110;
- loadR2List(); //加载jqgrid
- });
-
- //jqgrid初始化
- function loadR2List(){
- jQuery("#r2list").jqGrid({
- datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
- height: grid2Height, //高度
- colNames:["ID","车号代码","车号","驾驶员","加工车次","理论加工量(kg)","实际加工量(kg)","计划投料操作数", "已投料操作数", "投料操作率", "投料误差数", "投料误差率", "计划发料操作数", "已发料操作数", "发料操作率", "发料误差数", "发料误差率"], //列名
- colModel:[
- {
- name: "DriverID",
- index: "DriverID",
- width: 40,
- align: "center",
- sorttype: "string",
- hidden: true
- },
- {
- name: "DNo",
- index: "DNo",
- sorttype: "string",
- hidden: true
- },
- {
- name: "DataCaptureNo",
- index: "DataCaptureNo",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "DNAME",
- index: "DNAME",
- width: 40,
- align: "center",
- sorttype: "string"
- },
- {
- name: "countd",
- index: "countd",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "lw",
- index: "lw",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "sjjgl",
- index: "sjjgl",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_All1",
- index: "Count_All1",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_Succ1",
- index: "Count_Succ1",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "tlczl",
- index: "tlczl",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_Over1",
- index: "Count_Over1",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "tlwcl",
- index: "tlwcl",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_All2",
- index: "Count_All2",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_Succ2",
- index: "Count_Succ2",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "flczl",
- index: "flczl",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_Over2",
- index: "Count_Over2",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "flwcl",
- index: "flwcl",
- width: 70,
- align: "center",
- sorttype: "string"
- }
- ],
- ondblClickRow: function(){
- var selId = $("#r2list").jqGrid("getGridParam","selrow"); //获取当前选中行号
- var rowData = $("#r2list").jqGrid("getRowData",selId); //获取当前选中行真实对象
- if(rowData.DriverID != 10000){
- $("#DriverID").val(rowData.DriverID);
- $("#DataCaptureNo").val(rowData.DNo);
- var id_reeorchart = window.top.document.getElementById("id_reeorchart");
- id_reeorchart.click();
- }
- },
- /**
- * 设置水平滚动条 begin
- **/
- shrinkToFit: true,
- autoScroll: true,
- rowNum: 10000, //每页显示条数
- autowidth: true //自动调节宽度
- /**
- * 设置水平滚动条 end
- **/
-
- });
-
- //获取数据集
- mydataP2 = getR2Lists();
-
- if(mydataP2!=null){
- for(var i=0;i<=mydataP2.length;i++){
- jQuery("#r2list").jqGrid('addRowData',i+1,mydataP2[i]);
- }
- }
- }
-
- //获取服务器数据
- function getR2Lists(){
- var reeorno = "${reeorno}";
- var beginDate = $("#beginDate").val();
- var endDate = $("#endDate").val();
- $.ajax({
- async: false,
- type: "POST",
- dataType: "json", //返回类型json
- data: "beginDate="+beginDate+"&endDate="+endDate+"&reeorno="+reeorno,
- url: "${contextPath }/admin/statistics/reeorlist.html",
- error: function(){alert("系统错误");},
- success: function(json){
- mydataP2 = json;
- }
- });
- return mydataP2;
- }
- </script>
- <table id="r2list"></table>
|