123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- <%@ page contentType="text/html; charset=utf-8" session="false" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
- <head>
- <title>我的工作台</title>
- <%@ include file="../common/header.jsp" %>
- <script type="text/javascript" src="${contextPath }/js/calendar/WdatePicker.js"></script>
- <link type="text/css" rel="stylesheet" href="${contextPath}/css/themes/easyui.css" />
- <script type="text/javascript" src="${contextPath }/js/jquery.easyui.min.js"></script>
- <script type="text/javascript" language="javascript" src="${contextPath}/js/highslide.js"></script>
- <script type="text/javascript">
- var mydata,currentId="",loadfl2=0,loadfl3=0,loadfl4=0,loadfl5=0,loadfl6=0,loadfl7=0,loadfl8=0,loadfl9=0,loadfl10=0,loadfl11=0,loadfl12=0,loadfl13=0,loadfl14=0,loadfl15=0,loadfl16=0,panelCHeight=0,panelSHeight=0;
- $(document).ready( function() {
- loadList(); //加载jqgrid
- $("#list").jqGrid("setGridHeight",$(window).height() - 80);
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 5);
- });
- $(window).resize(function(){
- $("#list").jqGrid("setGridHeight",$(window).height() - 80);
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 5);
- });
-
- //jqgrid初始化
- function loadList(){
- jQuery("#list").jqGrid({
- datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
- height: 150, //高度
- colNames:["主键","日期","计划名称","TMR", "驾驶员", "已执行", "班次", "发料顺序", "理论量","发料1","发料2","发料3","发料4","发料5","发料6","发料7","发料8","发料9","发料10","发料11","发料12","发料13","发料14","发料15","发料16"], //列名
- colModel:[
- {
- name: "ID",
- index: "ID",
- width: 1,
- align: "center",
- sorttype: "string",
- hidden: true
- },
- {
- name: "Mydate",
- index: "Mydate",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "ProjName",
- index: "ProjName",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "TNAME",
- index: "TNAME",
- width: 70,
- align: "center",
- sorttype: "int"
- },
- {
- name: "DNAME",
- index: "DNAME",
- width: 70,
- align: "center",
- sorttype: "int",
- editable: false,
- edittype: "select",
- editoptions:{
- dataUrl: "${contextPath }/admin/basicdata/tmrselect.html"
- }
- },
- {
- name: "HaveButton", //对应数据库字段
- index: "HaveButton", //按照哪个字段进行排序
- width: 70,
- align: "center", //显示位置
- sorttype: "string", //字段类型
- formatter: "checkbox",
- formatoptions: {disabled:true},
- edittype: "checkbox", //可以编辑的类型。可选值:text, textarea, select, checkbox, password, button, image and file.
- editoptions: {value:"Yes:No"} //默认值 和下拉框的默认值不同
- },
- {
- name: "Times",
- index: "Times",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "Sort",
- index: "Sort",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {
- name: "LWEIGHT",
- index: "LWEIGHT",
- width: 70,
- align: "center",
- sorttype: "string"
- },
- {name: "FL1",index: "FL1",width: 70,align: "center",sorttype: "string"},
- {name: "FL2",index: "FL2",width: 70,align: "center",sorttype: "string"},
- {name: "FL3",index: "FL3",width: 70,align: "center",sorttype: "string"},
- {name: "FL4",index: "FL4",width: 70,align: "center",sorttype: "string"},
- {name: "FL5",index: "FL5",width: 70,align: "center",sorttype: "string"},
- {name: "FL6",index: "FL6",width: 70,align: "center",sorttype: "string"},
- {name: "FL7",index: "FL7",width: 70,align: "center",sorttype: "string"},
- {name: "FL8",index: "FL8",width: 70,align: "center",sorttype: "string"},
- {name: "FL9",index: "FL9",width: 70,align: "center",sorttype: "string"},
- {name: "FL10",index: "FL10",width: 70,align: "center",sorttype: "string"},
- {name: "FL11",index: "FL11",width: 80,align: "center",sorttype: "string"},
- {name: "FL12",index: "FL12",width: 80,align: "center",sorttype: "string"},
- {name: "FL13",index: "FL13",width: 80,align: "center",sorttype: "string"},
- {name: "FL14",index: "FL14",width: 80,align: "center",sorttype: "string"},
- {name: "FL15",index: "FL15",width: 80,align: "center",sorttype: "string"},
- {name: "FL16",index: "FL16",width: 80,align: "center",sorttype: "string"}
- ],
- caption: "日执行计划垃圾箱", //标题
- cellEdit: false,
- pginput: false, //不显示分页文本框
- pgbuttons: false, //不显示翻页按钮
- autowidth: true, //自动调节宽度
- rowNum: 1000, //每页显示条数
- sortname: "SORT" //按SORT进行排序 默认asc
-
- });
-
- //获取数据集
- mydata = getLists();
-
- if(mydata!=null){
- for(var i=0;i<=mydata.length;i++){
- jQuery("#list").jqGrid('addRowData',i+1,mydata[i]);
- }
- jQuery("#list").jqGrid().trigger("reloadGrid"); //添加完数据后客户端自动刷新一次、实现客户端数据与服务器数据的完全分离
- }
-
- var ids = $("#list").jqGrid("getDataIDs");
- for ( var i = 0; i < ids.length; i++) {
- var rowData = $("#list").jqGrid("getRowData",ids[i]);
-
- var FL2 = rowData.FL2.length;
- var FL3 = rowData.FL3.length;
- var FL4 = rowData.FL4.length;
- var FL5 = rowData.FL5.length;
- var FL6 = rowData.FL6.length;
- var FL7 = rowData.FL7.length;
- var FL8 = rowData.FL8.length;
- var FL9 = rowData.FL9.length;
- var FL10 = rowData.FL10.length;
- var FL11 = rowData.FL11.length;
- var FL12 = rowData.FL12.length;
- var FL13 = rowData.FL13.length;
- var FL14 = rowData.FL14.length;
- var FL15 = rowData.FL15.length;
- var FL16 = rowData.FL16.length;
-
- if(FL2 > 0){
- loadfl2++;
- }
- if(FL3 > 0){
- loadfl3++;
- }
- if(FL4 > 0){
- loadfl4++;
- }
- if(FL5 > 0){
- loadfl5++;
- }
- if(FL6 > 0){
- loadfl6++;
- }
- if(FL7 > 0){
- loadfl7++;
- }
- if(FL8 > 0){
- loadfl8++;
- }
- if(FL9 > 0){
- loadfl9++;
- }
- if(FL10 > 0){
- loadfl10++;
- }
- if(FL11 > 0){
- loadfl11++;
- }
- if(FL12 > 0){
- loadfl12++;
- }
- if(FL13 > 0){
- loadfl13++;
- }
- if(FL14 > 0){
- loadfl14++;
- }
- if(FL15 > 0){
- loadfl15++;
- }
- if(FL16 > 0){
- loadfl16++;
- }
- }
-
- if(loadfl2 == 0){
- $("#list").jqGrid("hideCol","FL2");
- }else{
- $("#list").jqGrid("showCol","FL2");
- }
- if(loadfl3 == 0){
- $("#list").jqGrid("hideCol","FL3");
- }else{
- $("#list").jqGrid("showCol","FL3");
- }
- if(loadfl4 == 0){
- $("#list").jqGrid("hideCol","FL4");
- }else{
- $("#list").jqGrid("showCol","FL4");
- }
- if(loadfl5 == 0){
- $("#list").jqGrid("hideCol","FL5");
- }else{
- $("#list").jqGrid("showCol","FL5");
- }
- if(loadfl6 == 0){
- $("#list").jqGrid("hideCol","FL6");
- }else{
- $("#list").jqGrid("showCol","FL6");
- }
- if(loadfl7 == 0){
- $("#list").jqGrid("hideCol","FL7");
- }else{
- $("#list").jqGrid("showCol","FL7");
- }
- if(loadfl8 == 0){
- $("#list").jqGrid("hideCol","FL8");
- }else{
- $("#list").jqGrid("showCol","FL8");
- }
- if(loadfl9 == 0){
- $("#list").jqGrid("hideCol","FL9");
- }else{
- $("#list").jqGrid("showCol","FL9");
- }
- if(loadfl10 == 0){
- $("#list").jqGrid("hideCol","FL10");
- }else{
- $("#list").jqGrid("showCol","FL10");
- }
- if(loadfl11 == 0){
- $("#list").jqGrid("hideCol","FL11");
- }else{
- $("#list").jqGrid("showCol","FL11");
- }
- if(loadfl12 == 0){
- $("#list").jqGrid("hideCol","FL12");
- }else{
- $("#list").jqGrid("showCol","FL12");
- }
- if(loadfl13 == 0){
- $("#list").jqGrid("hideCol","FL13");
- }else{
- $("#list").jqGrid("showCol","FL13");
- }
- if(loadfl14 == 0){
- $("#list").jqGrid("hideCol","FL14");
- }else{
- $("#list").jqGrid("showCol","FL14");
- }
- if(loadfl15 == 0){
- $("#list").jqGrid("hideCol","FL15");
- }else{
- $("#list").jqGrid("showCol","FL15");
- }
- if(loadfl16 == 0){
- $("#list").jqGrid("hideCol","FL16");
- }else{
- $("#list").jqGrid("showCol","FL16");
- }
-
- }
-
- //获取服务器数据
- function getLists(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/lpplandellists.html",
- error: function(){alert("系统错误");},
- success: function(json){
- mydata = json;
- }
- });
- return mydata;
- }
-
- function clearLpplan(){
- if (confirm("确定清空吗?")){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/cleardplandel.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- parent.hsClose();
- }
- }
- });
- }
- }
- </script>
- </head>
- <body style="background-color: #E0E0E0">
- <div>
- <input type="button" value="清空" onclick="clearLpplan()" class="sysub" />
- <table id="list"></table>
- </div>
- </body>
- </html>
|