123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667 |
- <%@ 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" %>
- <link type="text/css" rel="stylesheet" href="${contextPath}/css/style.css" />
- <script type="text/javascript" src="${contextPath}/js/redips-drag-min.js"></script>
- <script type="text/javascript" src="${contextPath}/js/script.js"></script>
- <script type="text/javascript">
- var mydata,operCount=0,flCount=2,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,feedpSize = "${feedpSize}",lastrow,lastcell,UserFeedp = 0;
- $(document).ready( function() {
- getUserFeedp();//查询该登录用户是否有关联栏舍
- loadList(); //加载jqgrid
- var count = feedpSize / 15;
-
- if(count <= 1){
- $("#list").jqGrid("setGridHeight",$(window).height() - 70);
- }else if(count > 1 && count <= 2){
- $("#list").jqGrid("setGridHeight",$(window).height() - 110);
- }else if(count > 2 && count <= 3){
- $("#list").jqGrid("setGridHeight",$(window).height() - 140);
- }else if(count > 3 && count <= 4){
- $("#list").jqGrid("setGridHeight",$(window).height() - 180);
- }else if(count > 4 && count <= 5){
- $("#list").jqGrid("setGridHeight",$(window).height() - 210);
- }else if(count > 5 && count <= 6){
- $("#list").jqGrid("setGridHeight",$(window).height() - 250);
- }else if(count > 6 && count <= 7){
- $("#list").jqGrid("setGridHeight",$(window).height() - 280);
- }else if(count > 7 && count <= 8){
- $("#list").jqGrid("setGridHeight",$(window).height() - 320);
- }else if(count > 8 && count <= 9){
- $("#list").jqGrid("setGridHeight",$(window).height() - 350);
- }else if(count > 9 && count <= 10){
- $("#list").jqGrid("setGridHeight",$(window).height() - 390);
- }
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 5);
-
- });
-
- $(window).resize(function(){
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 5);
- var count = feedpSize / 15;
- if(count <= 1){
- $("#list").jqGrid("setGridHeight",$(window).height() - 90);
- }else if(count > 1 && count <= 2){
- $("#list").jqGrid("setGridHeight",$(window).height() - 120);
- }else if(count > 2 && count <= 3){
- $("#list").jqGrid("setGridHeight",$(window).height() - 160);
- }else if(count > 3 && count <= 4){
- $("#list").jqGrid("setGridHeight",$(window).height() - 190);
- }else if(count > 4 && count <= 5){
- $("#list").jqGrid("setGridHeight",$(window).height() - 220);
- }else if(count > 5 && count <= 6){
- $("#list").jqGrid("setGridHeight",$(window).height() - 260);
- }else if(count > 6 && count <= 7){
- $("#list").jqGrid("setGridHeight",$(window).height() - 290);
- }else if(count > 7 && count <= 8){
- $("#list").jqGrid("setGridHeight",$(window).height() - 330);
- }else if(count > 8 && count <= 9){
- $("#list").jqGrid("setGridHeight",$(window).height() - 360);
- }else if(count > 9 && count <= 10){
- $("#list").jqGrid("setGridHeight",$(window).height() - 400);
- }
- });
-
- //jqgrid初始化
- function loadList(){
-
- jQuery("#list").jqGrid({
- datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
- height: "50%", //高度
- colNames:["主键","生效","选择班次","时间","发料1","发料2","发料3","发料4","发料5","发料6","发料7","发料8","发料9","发料10","发料11","发料12","发料13","发料14","发料15","发料16","isTNSame","isSelFeedpSame"], //列名
- colModel:[
- {name: "ID",index: "ID",width: 1,align: "center",sorttype: "string",hidden: true},
- {name: "Sel",index: "Sel",width: 50,align: "center",sorttype: "string",editable: true,editrules: {required:true},formatter: "checkbox",formatoptions: {disabled:false},edittype: "checkbox",editoptions: {value:"Yes:No"}},
- {name: "selTimes",index: "selTimes",width: 70,align: "center",sorttype: "int",editable: true,edittype: "select",editoptions:{dataUrl: "${contextPath }/admin/recipeplan/selselect.html"}},
- {name: "beginTime",index: "beginTime",width: 70,align: "center",sorttype: "string",editable: true},
- {name: "FL1",index: "FL1",width: 80,align: "center"},
- {name: "FL2",index: "FL2",width: 80,align: "center",sorttype: "string"},
- {name: "FL3",index: "FL3",width: 80,align: "center",sorttype: "string"},
- {name: "FL4",index: "FL4",width: 80,align: "center",sorttype: "string"},
- {name: "FL5",index: "FL5",width: 80,align: "center"},
- {name: "FL6",index: "FL6",width: 80,align: "center",sorttype: "string"},
- {name: "FL7",index: "FL7",width: 80,align: "center",sorttype: "string"},
- {name: "FL8",index: "FL8",width: 80,align: "center",sorttype: "string"},
- {name: "FL9",index: "FL9",width: 80,align: "center",sorttype: "string"},
- {name: "FL10",index: "FL10",width: 80,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"},
- {name: "isTNSame",index: "isTNSame",align: "center",sorttype: "string",hidden: true},
- {name: "isSelFeedpSame",index: "isSelFeedpSame",align: "center",sorttype: "string",hidden: true}
- ],
- cellEdit: true,
- cellsubmit: "clientArray", //当单元格发生变化后不直接发送请求、"remote"默认直接发送请求
- /**
- * 设置水平滚动条 begin
- **/
- shrinkToFit:false,
- autoScroll: true,
- autowidth: true, //自动调节宽度
- rowNum: 1000, //每页显示条数
- /**
- * 设置水平滚动条 end
- **/
-
- toolbar: [true,"top"],
-
- beforeEditCell:function(rowid,cellname,v,iRow,iCol){
- lastrow = iRow;
- lastcell = iCol;
- },
-
- afterInsertRow: function(rowid,rowdata,rowelem){
- //配方模版是否相同:1、不相同,0相同。不相同加标注
- if(rowdata.isTNSame == 1){
- $("#list").setCell(rowid,16,"",{background:'#FFE66F'});
- }
- //不同车次有相同班次相同栏舍提示:0不提示,1、班次1有相同栏舍,2、班次2有相同栏舍……。相同加标注
- if(rowdata.isSelFeedpSame > 0){
- if(rowdata.isSelFeedpSame == 1){
- $("#list").setCell(rowid,8,"",{background:'#FFB5B5'});
- }else if(rowdata.isSelFeedpSame == 2){
- $("#list").setCell(rowid,9,"",{background:'#FFB5B5'});
- }else if(rowdata.isSelFeedpSame == 3){
- $("#list").setCell(rowid,10,"",{background:'#FFB5B5'});
- }else if(rowdata.isSelFeedpSame == 4){
- $("#list").setCell(rowid,11,"",{background:'#FFB5B5'});
- }else if(rowdata.isSelFeedpSame == 5){
- $("#list").setCell(rowid,12,"",{background:'#FFB5B5'});
- }else if(rowdata.isSelFeedpSame == 6){
- $("#list").setCell(rowid,13,"",{background:'#FFB5B5'});
- }
- }
- }
-
- });
-
- //获取数据集
- 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"); //添加完数据后客户端自动刷新一次、实现客户端数据与服务器数据的完全分离
- }
-
- if(operCount == 0){
- if(UserFeedp == 0){
- $("#t_list").append("<input class='sysub' type='button' value='新增车次' onClick='addLpplan()' style='font-size:-2'/> ");
- $("#t_list").append("<input class='sysub' type='button' value='删除车次' onClick='delLpplan()' style='font-size:-2'/> ");
- }
- $("#t_list").append("<input class='sysub' type='button' value='添加发料' onClick='addFL()' style='font-size:-2'/> ");
- $("#t_list").append("<input class='sysub' type='button' value='减少发料' onClick='delFL()' style='font-size:-2'/> ");
- $("#t_list").append("<input class='sysub' type='button' value='确认保存' onClick='saveLpplan()' style='font-size:-2'/>");
- $("#t_list").append(" 名称:<input id='lpplanName' name='lpplanName' style='width:60px;font-size:12px;' value='' /> ");
- $("#t_list").append("<input class='sysub' type='button' value='备份' onClick='backLpplan()' style='font-size:-2'/>");
- $("#t_list").append(" 提取:<select id='tqLpplanId'><c:forEach items='${lpplanbacklist }' var='lpplanback'><option value='${lpplanback.lpplandatebackId }'><c:out value='${lpplanback.ProjName }' /></option></c:forEach></select> ");
- $("#t_list").append("<input class='sysub' type='button' value='提取' onClick='tqLpplan()' style='font-size:-2'/>");
- operCount++;
- }
-
- var ids = $("#list").jqGrid("getDataIDs");
- for ( var i = 0; i < ids.length; i++) {
- var rowData = $("#list").jqGrid("getRowData",ids[i]);
-
- var FL2 = rowData.FL2.indexOf("</div>");
- var FL3 = rowData.FL3.indexOf("</div>");
- var FL4 = rowData.FL4.indexOf("</div>");
- var FL5 = rowData.FL5.indexOf("</div>");
- var FL6 = rowData.FL6.indexOf("</div>");
- var FL7 = rowData.FL7.indexOf("</div>");
- var FL8 = rowData.FL8.indexOf("</div>");
- var FL9 = rowData.FL9.indexOf("</div>");
- var FL10 = rowData.FL10.indexOf("</div>");
- var FL11 = rowData.FL11.indexOf("</div>");
- var FL12 = rowData.FL12.indexOf("</div>");
- var FL13 = rowData.FL13.indexOf("</div>");
- var FL14 = rowData.FL14.indexOf("</div>");
- var FL15 = rowData.FL15.indexOf("</div>");
- var FL16 = rowData.FL16.indexOf("</div>");
-
- if(FL2 > 0){
- loadfl2++;
- flCount = 3;
- }
- if(FL3 > 0){
- loadfl3++;
- flCount = 4;
- }
- if(FL4 > 0){
- loadfl4++;
- flCount = 5;
- }
- if(FL5 > 0){
- loadfl5++;
- flCount = 6;
- }
- if(FL6 > 0){
- loadfl6++;
- flCount = 7;
- }
- if(FL7 > 0){
- loadfl7++;
- flCount = 8;
- }
- if(FL8 > 0){
- loadfl8++;
- flCount = 9;
- }
- if(FL9 > 0){
- loadfl9++;
- flCount = 10;
- }
- if(FL10 > 0){
- loadfl10++;
- flCount = 11;
- }
- if(FL11 > 0){
- loadfl11++;
- flCount = 12;
- }
- if(FL12 > 0){
- loadfl12++;
- flCount = 13;
- }
- if(FL13 > 0){
- loadfl13++;
- flCount = 14;
- }
- if(FL14 > 0){
- loadfl14++;
- flCount = 15;
- }
- if(FL15 > 0){
- loadfl15++;
- flCount = 16;
- }
- if(FL16 > 0){
- loadfl16++;
- }
- }
-
- if(loadfl2 == 0){
- $("#list").jqGrid("hideCol","FL2");
- }
- if(loadfl3 == 0){
- $("#list").jqGrid("hideCol","FL3");
- }
- if(loadfl4 == 0){
- $("#list").jqGrid("hideCol","FL4");
- }
- if(loadfl5 == 0){
- $("#list").jqGrid("hideCol","FL5");
- }
- if(loadfl6 == 0){
- $("#list").jqGrid("hideCol","FL6");
- }
- if(loadfl7 == 0){
- $("#list").jqGrid("hideCol","FL7");
- }
- if(loadfl8 == 0){
- $("#list").jqGrid("hideCol","FL8");
- }
- if(loadfl9 == 0){
- $("#list").jqGrid("hideCol","FL9");
- }
- if(loadfl10 == 0){
- $("#list").jqGrid("hideCol","FL10");
- }
- if(loadfl11 == 0){
- $("#list").jqGrid("hideCol","FL11");
- }
- if(loadfl12 == 0){
- $("#list").jqGrid("hideCol","FL12");
- }
- if(loadfl13 == 0){
- $("#list").jqGrid("hideCol","FL13");
- }
- if(loadfl14 == 0){
- $("#list").jqGrid("hideCol","FL14");
- }
- if(loadfl15 == 0){
- $("#list").jqGrid("hideCol","FL15");
- }
- if(loadfl16 == 0){
- $("#list").jqGrid("hideCol","FL16");
- }
-
- }
-
- //获取服务器数据
- function getLists(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/lpplandatelist.html",
- error: function(){alert("系统错误");},
- success: function(json){
- mydata = json;
- }
- });
- return mydata;
- }
-
- //自定义添加方法
- function addLpplan(){
- var ids = $("#list").jqGrid("getDataIDs");
- $("#list").jqGrid("addRowData",ids.length+1,{},"first");
- $.ajax({
- async: false,
- type: "POST",
- dataType:"json", //返回类型jsond
- data: "oper=add&selId=",
- url: "${contextPath }/admin/recipeplan/lpplandateupdate.html",
- error: function(){alert("系统错误");},
- success: function(json){
- $("#list").clearGridData(); //清空原grid数据
- loadList(); //重新载入服务器数据
- }
- });
- }
-
- //自定义删除方法
- function delLpplan(){
- var row = $("#list").jqGrid("getGridParam","selrow");
- if(row!=null){
- var flag = confirm("您确定要删除吗?");
- if(flag){
- var selRow = $("#list").jqGrid("getRowData",row);
- $.ajax({
- async: false,
- type: "POST",
- dataType:"json", //返回类型jsond
- data: "oper=del&selId="+selRow.ID,
- url: "${contextPath }/admin/recipeplan/lpplandateupdate.html",
- error: function(){alert("系统错误");},
- success: function(json){
- $("#list").clearGridData(); //清空原grid数据
- loadList(); //重新载入服务器数据
- }
- });
- }
- }else{
- alert("请选择记录");
- }
- }
-
- //自定义添加发料
- function addFL(){
- $("#list").jqGrid("showCol","FL"+flCount);
- if(flCount < 17){
- flCount++;
- }
- }
- //自定义减少发料
- function delFL(){
- if(flCount > 2){
- flCount--;
- }
- if(flCount == 2){
- if(loadfl2 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 3){
- if(loadfl3 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 4){
- if(loadfl4 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 5){
- if(loadfl5 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 6){
- if(loadfl6 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 7){
- if(loadfl7 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 8){
- if(loadfl8 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 9){
- if(loadfl9 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 10){
- if(loadfl10 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 11){
- if(loadfl11 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 12){
- if(loadfl12 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 13){
- if(loadfl13 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 14){
- if(loadfl14 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 15){
- if(loadfl15 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }else if(flCount == 16){
- if(loadfl16 == 0){
- $("#list").jqGrid("hideCol","FL"+flCount);
- }else{
- flCount++;
- }
- }
- }
-
- //确认保存
- function saveLpplan(){
- $("#list").jqGrid("saveCell",lastrow,lastcell);
- //编辑后按过回车状态、可以保存
-
- var lpplanStr = "";
- var ids = $("#list").jqGrid("getDataIDs");
- for ( var i = 0; i < ids.length; i++) {
- var rowData = $("#list").jqGrid("getRowData",ids[i]);
-
- var ID = rowData.ID;
- var Sel = rowData.Sel;
- var selTimes = $.trim(rowData.selTimes);
- var beginTime = rowData.beginTime;
- var FL1 = rowData.FL1.substring(rowData.FL1.indexOf('>')+1,rowData.FL1.lastIndexOf('<'));
- var FL2 = rowData.FL2.substring(rowData.FL2.indexOf('>')+1,rowData.FL2.lastIndexOf('<'));
- var FL3 = rowData.FL3.substring(rowData.FL3.indexOf('>')+1,rowData.FL3.lastIndexOf('<'));
- var FL4 = rowData.FL4.substring(rowData.FL4.indexOf('>')+1,rowData.FL4.lastIndexOf('<'));
- var FL5 = rowData.FL5.substring(rowData.FL5.indexOf('>')+1,rowData.FL5.lastIndexOf('<'));
- var FL6 = rowData.FL6.substring(rowData.FL6.indexOf('>')+1,rowData.FL6.lastIndexOf('<'));
- var FL7 = rowData.FL7.substring(rowData.FL7.indexOf('>')+1,rowData.FL7.lastIndexOf('<'));
- var FL8 = rowData.FL8.substring(rowData.FL8.indexOf('>')+1,rowData.FL8.lastIndexOf('<'));
- var FL9 = rowData.FL9.substring(rowData.FL9.indexOf('>')+1,rowData.FL9.lastIndexOf('<'));
- var FL10 = rowData.FL10.substring(rowData.FL10.indexOf('>')+1,rowData.FL10.lastIndexOf('<'));
- var FL11 = rowData.FL11.substring(rowData.FL11.indexOf('>')+1,rowData.FL11.lastIndexOf('<'));
- var FL12 = rowData.FL12.substring(rowData.FL12.indexOf('>')+1,rowData.FL12.lastIndexOf('<'));
- var FL13 = rowData.FL13.substring(rowData.FL13.indexOf('>')+1,rowData.FL13.lastIndexOf('<'));
- var FL14 = rowData.FL14.substring(rowData.FL14.indexOf('>')+1,rowData.FL14.lastIndexOf('<'));
- var FL15 = rowData.FL15.substring(rowData.FL15.indexOf('>')+1,rowData.FL15.lastIndexOf('<'));
- var FL16 = rowData.FL16.substring(rowData.FL16.indexOf('>')+1,rowData.FL16.lastIndexOf('<'));
- if(lpplanStr == ""){
- lpplanStr = "ID:"+ID+",Sel:"+Sel+",selTimes:"+selTimes+",beginTime:"+beginTime+",FL1:"+FL1+",FL2:"+FL2+",FL3:"+FL3+",FL4:"+FL4+",FL5:"+FL5+",FL6:"+FL6+",FL7:"+FL7+",FL8:"+FL8+",FL9:"+FL9+",FL10:"+FL10+",FL11:"+FL11+",FL12:"+FL12+",FL13:"+FL13+",FL14:"+FL14+",FL15:"+FL15+",FL16:"+FL16;
- }else{
- lpplanStr += ";" + "ID:"+ID+",Sel:"+Sel+",selTimes:"+selTimes+",beginTime:"+beginTime+",FL1:"+FL1+",FL2:"+FL2+",FL3:"+FL3+",FL4:"+FL4+",FL5:"+FL5+",FL6:"+FL6+",FL7:"+FL7+",FL8:"+FL8+",FL9:"+FL9+",FL10:"+FL10+",FL11:"+FL11+",FL12:"+FL12+",FL13:"+FL13+",FL14:"+FL14+",FL15:"+FL15+",FL16:"+FL16;
- }
- }
-
- $.ajax({
- async: false,
- type: 'POST',
- data: "lpplanStr="+lpplanStr,
- dataType: 'json',
- url: "${contextPath}/admin/recipeplan/updatelpplandateall.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- if(json.str != ""){
- alert(json.str);
- }
- $("#list").clearGridData(); //清空原grid数据
- window.location.reload();
- }
- }
- });
- }
-
- //记录移动
- function moveLpplan(moveType){
- $("#list").jqGrid("saveCell",lastrow,lastcell);
- var selId = $("#list").jqGrid("getGridParam","selrow"); //获取当前选中行号
- var rowData = $("#list").jqGrid("getRowData",selId); //获取当前选中行真实对象
- if(selId != null){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/movelpplan.html?planId="+rowData.ID+"&moveType="+moveType+"&Sort="+rowData.SORT,
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- if(moveType == "top"){
- selId = Number(selId) - 1;
- }else{
- selId = Number(selId) + 1;
- }
- $("#list").clearGridData(); //清空原grid数据
- loadList(); //加载jqgrid
- }else{
- alert("请正确移动");
- }
- }
- });
- $("#list").jqGrid("setSelection",selId);
- }else{
- alert("请选择记录");
- }
- }
-
- //查询该登录用户是否有关联栏舍
- function getUserFeedp(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/getUserFeedp.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- UserFeedp = json.count;
- }
- }
- });
- }
-
- //备份
- function backLpplan(){
- var lpplanName = $("#lpplanName").val();
- if(lpplanName == ""){
- alert("请输入本次备份的计划名称");
- $("#lpplanName").focus();
- }else{
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/backLpplandate.html?lpplanName="+lpplanName,
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- if(json.lnamecount == "0"){
- alert("备份完成");
- }else{
- alert("计划名称不能重复");
- $("#lpplanName").focus();
- $("#lpplanName").select();
- }
- }
- }
- });
- }
-
- }
-
- //提取
- function tqLpplan(){
- var tqLpplanId = $("#tqLpplanId").val();
- var flag = confirm("提取时,当前页面计划将被清空,您确定提取备份计划吗?");
- if (flag){
- $.ajax({
- async: false,
- type: 'POST',
- data: "tqLpplanId="+tqLpplanId,
- dataType: 'json',
- url: "${contextPath}/admin/recipeplan/tqlpplandate.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- location.reload();
- }
- }
- });
- }
- }
-
- //自动计划
- function autoLpplan(){
- var flag = confirm("自动计划时,当前页面计划将被清空,您确定自动计划吗?");
- if (flag){
- $.ajax({
- async: false,
- type: 'POST',
- dataType: 'json',
- url: "${contextPath}/admin/recipeplan/autoLpplan.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- location.reload();
- }
- }
- });
- }
- }
-
- </script>
- </head>
- <body style="background-color: #E0E0E0">
- <div>
- <div id="drag">
- <table width="200px">
- <tr style="background-color: #eee">
- <c:forEach var="feedp" items="${feedplists}" varStatus="status">
- <c:if test="${(status.index+1) mod 15 !=1}">
- <td>
- <div class="drag t1" style="background-color: #${feedp.tColor };"><c:out value="${feedp.BNAME }" /></div>
- </td>
- </c:if>
-
- <c:if test="${(status.index+1) mod 15==1}">
- </tr>
- <tr>
- <td>
- <div class="drag t1" style="background-color: #${feedp.tColor };"><c:out value="${feedp.BNAME }" /></div>
- </td>
- </c:if>
- </c:forEach>
- </tr>
- <tr>
- </table>
- <table id="list"></table>
- </div>
- <input type="hidden" id="message"/>
- <input type="hidden" id="colorValue" value="" />
- </div>
- </body>
- </html>
|