123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <%@ 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 mydataP4,grid4Height;
- $(document).ready( function() {
- grid4Height = document.body.clientHeight-110;
- loadR4List(); //加载jqgrid
- });
-
- //jqgrid初始化
- function loadR4List(){
- jQuery("#r4list").jqGrid({
- datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
- height: grid4Height, //高度
- colNames:["饲料名称","班次","车号","驾驶员","计划添加次数", "已添加次数", "添加执行率", "计划添加重量", "已添加重量", "平均添加误差率", "最大添加误差率", "最小添加误差率"], //列名
- colModel:[
- {
- name: "FNAME",
- index: "FNAME",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Times",
- index: "Times",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "DataCaptureNo",
- index: "DataCaptureNo",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "DNAME",
- index: "DNAME",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "AllCount_ID",
- index: "AllCount_ID",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Count_ID",
- index: "Count_ID",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "zxl",
- index: "zxl",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Sum_LWEIGHT",
- index: "Sum_LWEIGHT",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Sum_Weight",
- index: "Sum_Weight",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Avg_Err",
- index: "Avg_Err",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Max_Err",
- index: "Max_Err",
- width: 100,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Min_Err",
- index: "Min_Err",
- width: 100,
- align: "center",
- sorttype: "string"
- }
- ],
- /**
- * 设置水平滚动条 begin
- **/
- shrinkToFit: true,
- autoScroll: true,
- rowNum: 10000, //每页显示条数
- autowidth: true //自动调节宽度
- /**
- * 设置水平滚动条 end
- **/
- });
-
- //获取数据集
- mydataP4 = getR4Lists();
-
- if(mydataP4!=null){
- for(var i=0;i<=mydataP4.length;i++){
- jQuery("#r4list").jqGrid('addRowData',i+1,mydataP4[i]);
- }
- }
- }
-
- //获取服务器数据
- function getR4Lists(){
- 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){
- mydataP4 = json;
- }
- });
- return mydataP4;
- }
- </script>
- <table id="r4list"></table>
|