123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 |
- <%@ 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/themes/easyui.css" />
- <script type="text/javascript" src="${contextPath }/js/jquery.easyui.min.js"></script>
- <script type="text/javascript">
- var mydata,currentId="",isEnableSupplyFeed=0,isMorningPart=0,isNoonPart=0,isNightPart=0,selCurrentId=0,
- colName,Calculation = 0,northType=0,southType=1,isSelTr = 0,isShowAvgAgeAndDay=0,Reserved6 = 0,Reserved7 = 0,isLocking = 0,oldUpdateValue = 0;
- $(document).ready( function() {
- getDefaultConfig();//获取系统默认参数是否启用补料模版,各班比例
- loadList(); //加载jqgrid
-
- setTimeout(function(){
- $('body').layout('collapse','north');
- },0);
-
- $("body").layout("panel","south").panel({
- onClose: function(){
- panelC = $("body").layout("panel","center").panel();
- $("#list").jqGrid("setGridHeight",panelC.height()-60);
- southType = 0;
- },
- onExpand: function(){
- if(northType == 0){
- panelS = $("body").layout("panel","south").panel();
- panelCHeight = document.body.clientHeight - panelS.height();
- $("#list").jqGrid("setGridHeight",panelCHeight-160);
- }else{
- panelS = $("body").layout("panel","south").panel();
- panelN = $("body").layout("panel","north").panel();
- panelCHeight = document.body.clientHeight - panelS.height() - panelN.height();
- $("#list").jqGrid("setGridHeight",panelCHeight-170);
- }
- southType = 1;
- },
- onResize: function(){
- panelS = $("body").layout("panel","south").panel();
- panelN = $("body").layout("panel","north").panel();
- if(northType == 0){
- panelCHeight = document.body.clientHeight - panelS.height();
- }else{
- panelCHeight = document.body.clientHeight - panelS.height() - panelN.height() - 10;
- }
- $("#list").jqGrid("setGridHeight",panelCHeight-160);
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 30);
- $("#fpdetaillist").jqGrid("setGridHeight",panelS.height()-55);
- $("#fpdetaillist").jqGrid("setGridWidth",document.body.clientWidth - 30);
- }
- });
-
- $("body").layout("panel","north").panel({
- onClose: function(){
- panelC = $("body").layout("panel","center").panel();
- $("#list").jqGrid("setGridHeight",panelC.height()-55);
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 30);
- northType = 0;
- },
- onExpand: function(){
- panelC = $("body").layout("panel","center").panel();
- $("#list").jqGrid("setGridHeight",panelC.height()-55);
- northType = 1;
- }
- });
-
- //如果是重量模式、添加按钮
- if(Calculation == 0){
- $("#rgBtn").hide();
- }else{
- $("#rgBtn").show();
- }
-
- });
- $(window).resize(function(){
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 10);
- $("#fpdetaillist").jqGrid("setGridWidth",document.body.clientWidth - 10);
- });
-
-
- //jqgrid初始化
- function loadList(){
- jQuery("#list").jqGrid({
- datatype: "local", //从服务器端返回的数据类型,(表格期望接收的数据类型)。可选类型:xml,xmlstring,json,local,function
- height: 170, //高度
- colNames: colName,
- colModel:[
- {
- name: "ID",
- index: "ID",
- align: "center",
- sorttype: "string",
- editable: true,
- hidden: true
- //editoptions:{readonly:true} 如果要显示该列可以设置只读
- },
- {
- name: "BNAME",
- index: "BNAME",
- align: "center",
- sorttype: "string",
- editable: false
- },
- {
- name: "lpplanDry",
- index: "lpplanDry",
- width: 150,
- align: "center",
- sorttype: "string",
- editable: false
- },
- {
- name: "CCountRatioRtime",
- index: "CCountRatioRtime",
- width: 150,
- align: "center",
- sorttype: "string",
- editable: true
- },
- {
- name: "beginTime",
- index: "beginTime",
- width: 150,
- align: "center",
- sorttype: "string",
- editable: true,
- hidden: true
- },
- {
- name: "CCOUNT",
- index: "CCOUNT",
- align: "center",
- sorttype: "string",
- editable: true,
- editrules: {integer: true}
- },
- {
- name: "softCowCount",
- index: "softCowCount",
- width: 150,
- align: "center",
- sorttype: "string",
- editable: false
- },
- {
- name: "CCountRatio",
- index: "CCountRatio",
- align: "center",
- sorttype: "string",
- editable: true,
- editrules: {number: true}
- },
- {
- name: "CCountRatioCCOUNT",
- index: "CCountRatioCCOUNT",
- align: "center",
- sorttype: "string",
- editable: true
- },
- {
- name: "AvgDim",
- index: "AvgDim",
- width: 150,
- align: "center",
- sorttype: "string",
- editable: false
- },
- {
- name: "AvgMonthAge",
- index: "AvgMonthAge",
- width: 150,
- align: "center",
- sorttype: "string",
- editable: false
- },
- {
- name: "PFMB",
- index: "PFMB",
- align: "center",
- sorttype: "int",
- editable: true,
- edittype: "select",
- editoptions:{
- dataUrl: "${contextPath }/admin/recipeplan/feedp1select.html"
- }
- },
- {
- name: "BLMB",
- index: "BLMB",
- align: "center",
- sorttype: "int",
- editable: true,
- edittype: "select",
- editoptions:{
- dataUrl: "${contextPath }/admin/recipeplan/feedp2select.html"
- },hidden: true
- },
- {
- name: "ztFeedpName",
- index: "ztFeedpName",
- align: "center",
- sorttype: "int",
- editable: true,
- edittype: "select",
- editoptions:{
- dataUrl: "${contextPath }/admin/produce/produceselect.html",
- }
- },
- {
- name: "ztRtime",
- index: "ztRtime",
- align: "center",
- sorttype: "string",
- editable: true,
- edittype:"select",
- editoptions:{value:{"":"","早班1":"早班1","早班2":"早班2","中班1":"中班1","中班2":"中班2","晚班1":"晚班1","晚班2":"晚班2"}}
- },
- {
- name: "Rtime1",
- index: "Rtime1",
- align: "center",
- sorttype: "int",
- editable: true,
- editrules: {number: true}
- },
- {
- name: "Rtime2",
- index: "Rtime2",
- align: "center",
- sorttype: "int",
- editable: true,
- editrules: {number: true},hidden: true
- },
- {
- name: "Rtime3",
- index: "Rtime3",
- align: "center",
- sorttype: "int",
- editable: true,
- editrules: {number: true}
- },
- {
- name: "Rtime4",
- index: "Rtime4",
- align: "center",
- sorttype: "int",
- editable: true,
- editrules: {number: true},hidden: true
- },
- {
- name: "Rtime5",
- index: "Rtime5",
- align: "center",
- sorttype: "int",
- editable: true,
- editrules: {number: true}
- },
- {
- name: "Rtime6",
- index: "Rtime6",
- align: "center",
- sorttype: "int",
- editable: true,
- editrules: {number: true},hidden: true
- },
- {name: "sel1",index: "sel1",align: "center",sorttype: "int",editrules: {number: true},hidden: true},
- {name: "sel2",index: "sel2",align: "center",sorttype: "int",editrules: {number: true},hidden: true},
- {name: "sel3",index: "sel3",align: "center",sorttype: "int",editrules: {number: true},hidden: true},
- {name: "sel4",index: "sel4",align: "center",sorttype: "int",editrules: {number: true},hidden: true},
- {name: "sel5",index: "sel5",align: "center",sorttype: "int",editrules: {number: true},hidden: true},
- {name: "sel6",index: "sel6",align: "center",sorttype: "int",editrules: {number: true},hidden: true}
-
- ],
- //当表格所有数据都加载完成而且其他的处理也都完成时触发此事件,排序,翻页同样也会触发此事件
- gridComplete:function(){
- //根据栏舍发料班次为班次比例添加背景色
- var ids = $("#list").jqGrid("getDataIDs");
- for ( var i = 0; i < ids.length; i++) {
- var rowData = $("#list").jqGrid("getRowData",ids[i]);
- if(rowData.sel1==1){
- $("#list").setCell(ids[i],"Rtime1","",{background:'#CCEC9D'});
- }
- if(rowData.sel2==1){
- $("#list").setCell(ids[i],"Rtime2","",{background:'#CCEC9D'});
- }
- if(rowData.sel3==1){
- $("#list").setCell(ids[i],"Rtime3","",{background:'#CCEC9D'});
- }
- if(rowData.sel4==1){
- $("#list").setCell(ids[i],"Rtime4","",{background:'#CCEC9D'});
- }
- if(rowData.sel5==1){
- $("#list").setCell(ids[i],"Rtime5","",{background:'#CCEC9D'});
- }
- if(rowData.sel6==1){
- $("#list").setCell(ids[i],"Rtime6","",{background:'#CCEC9D'});
- }
- }
- },
- onSelectCell: function(rowid){
- $("#flistState").val(1);
- var rowData = $("#list").jqGrid("getRowData",rowid); //获取当前选中行真实对象
- if(currentId != rowData.ID){
- currentId = rowData.ID;
- $("#fpdetailResult").load("${contextPath }/admin/recipeplan/fpdetail.html?currentFpId="+rowData.ID+"&isEnableSupplyFeed="+isEnableSupplyFeed+"&isMorningPart="+isMorningPart+"&isNoonPart="+isNoonPart+"&isNightPart="+isNightPart);
- }
- },
- cellEdit: true,
- cellsubmit: "clientArray", //当单元格发生变化后不直接发送请求、"remote"默认直接发送请求
-
- afterEditCell: function(rowid,name,val,iRow,iCol){
-
- oldUpdateValue = val;
-
- $("#list").jqGrid("setGridWidth",document.body.clientWidth - 25);
- $("#flistState").val(1);
- var rowData = $("#list").jqGrid("getRowData",rowid);
-
- if(currentId != rowData.ID){
- currentId = rowData.ID;
- $("#fpdetailResult").load("${contextPath }/admin/recipeplan/fpdetail.html?currentFpId="+rowData.ID+"&isEnableSupplyFeed="+isEnableSupplyFeed+"&isMorningPart="+isMorningPart+"&isNoonPart="+isNoonPart+"&isNightPart="+isNightPart);
- }
- },
-
- afterSaveCell: function(rowid,name,val,iRow,iCol) {
-
- var isFlag = 0;
- if(name == "PFMB" || name == "BLMB" || name == "ztFeedpName" || name == "ztRtime" || name == "beginTime"){
- isFlag = 1;
- }else{
- if(val != ""){
- isFlag = 1;
- }else{
- isFlag = 0;
- }
- }
-
- if(isFlag == 1){
- var rowData = $("#list").jqGrid("getRowData",rowid);
- isSelTr = rowid;
- var mor,noon,nig;
- var mor1 = rowData.Rtime1;
- var mor2 = rowData.Rtime2;
- var noon1 = rowData.Rtime3;
- var noon2 = rowData.Rtime4;
- var nig1 = rowData.Rtime5;
- var nig2 = rowData.Rtime6;
-
- var CCountRatioCCOUNT = rowData.CCountRatioCCOUNT;
-
- //早班分班
- if(isMorningPart == 1){
- mor = Number(mor1) + Number(mor2);
- }else{
- mor = Number(mor1);
- }
- //中班分班
- if(isNoonPart == 1){
- noon = Number(noon1) + Number(noon2);
- }else{
- noon = Number(noon1);
- }
- //晚班分班
- if(isNightPart == 1){
- nig = Number(nig1) + Number(nig2);
- }else{
- nig = Number(nig1);
- }
-
- var newsmnn = mor + noon;
- var smnn = mor + noon + nig;
- isLocking = Reserved7;
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型jsond
- data: "ID="+rowData.ID+"&colName="+name+"&colValue="+val+"&Calculation="+Calculation+"&CCOUNT="+rowData.CCOUNT+"&CCountRatioCCOUNT="+rowData.CCountRatioCCOUNT+"&isNightPart="+smnn+"&isLocking="+isLocking,
- url: "${contextPath }/admin/recipeplan/feedpupdate.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- if(Calculation == 0){
- //如果按比例计算时修改一下内容刷新
- if(name == "PFMB" || name == "CCOUNT" || name == "CCountRatio" || name == "CCountRatioCCOUNT"){
- //清空主表数据重新加载一次
- $("#list").clearGridData();
- loadList();
- }
- }else{
- //如果按重量计算时修改一下内容刷新
- if(name == "PFMB" || name == "CCOUNT" || name == "CCountRatioRtime" || name == "Rtime1" || name == "Rtime2" || name == "Rtime3" || name == "Rtime4" || name == "Rtime5" || name == "Rtime6"){
- //清空主表数据重新加载一次
- $("#list").clearGridData();
- loadList();
- }
- }
-
- //后台数据保存成功后加载子表视图
- $("#fpdetailResult").load("${contextPath }/admin/recipeplan/fpdetail.html?currentFpId="+rowData.ID+"&isEnableSupplyFeed="+isEnableSupplyFeed+"&isMorningPart="+isMorningPart+"&isNoonPart="+isNoonPart+"&isNightPart="+isNightPart);
- }
- }
- });
-
- if(Calculation == 0){
- //如果按比例计算时
-
- //计算系数比例(系数*(班次比例合(50+35)/100))------“计划干物质”(系数比例*(该配方模版里的包含每个饲料的量*该饲料在饲料表中的干物质量(相加总和)))
- if(name == "CCountRatio" || name == "Rtime1" || name == "Rtime2" || name == "Rtime3" || name == "Rtime4" || name == "Rtime5" || name == "Rtime6"){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型jsond
- data: "ID="+rowData.ID+"&colName="+name+"&colValue="+val,
- url: "${contextPath }/admin/recipeplan/feedpcompute.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- //清空主表数据重新加载一次
- $("#list").clearGridData();
- loadList();
- //后台数据保存成功后加载子表视图
- $("#fpdetailResult").load("${contextPath }/admin/recipeplan/fpdetail.html?currentFpId="+rowData.ID+"&isEnableSupplyFeed="+isEnableSupplyFeed+"&isMorningPart="+isMorningPart+"&isNoonPart="+isNoonPart+"&isNightPart="+isNightPart);
- }
- }
- });
- }
- }else{
- //如果按重量计算时
- //if(name == "Rtime1" || name == "Rtime2" || name == "Rtime3" || name == "Rtime4" || name == "Rtime5" || name == "Rtime6"){
- // if(newsmnn > CCountRatioCCOUNT && nig > 0){
- // alert("该记录操作数据有错误!");
- // }
- //}
-
- if(isLocking > 0){
- //在重量模式下,编辑其中一个牛舍的所有班次的重量后,把(原重量-新重量)的值加到最后一个可见班次里,如果导致最后一个可见班次为负值,则置其为0
- // 30 20 20 总重量70 如果30改成40了 最后一个班次20就要减10 保持总重量70不变 如果最后一个班次为负值,则置其为0
- if(name == "Rtime1" || name == "Rtime2" || name == "Rtime3" || name == "Rtime4" || name == "Rtime5" || name == "Rtime6"){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型jsond
- data: "ID="+rowData.ID+"&oldUpdateValue="+oldUpdateValue+"&newUpdateValue="+val+"&RTime="+name.charAt(name.length-1),
- url: "${contextPath }/admin/recipeplan/updatelastrtime.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- //清空主表数据重新加载一次
- $("#list").clearGridData();
- loadList();
- //后台数据保存成功后加载子表视图
- $("#fpdetailResult").load("${contextPath }/admin/recipeplan/fpdetail.html?currentFpId="+rowData.ID+"&isEnableSupplyFeed="+isEnableSupplyFeed+"&isMorningPart="+isMorningPart+"&isNoonPart="+isNoonPart+"&isNightPart="+isNightPart);
- }
- }
- });
- }
- }
- }
-
- }else{
- alert("不能为空");
- }
- },
-
- pager: "#page", //#page分页控件绑定的位置对象
- pginput: false, //不显示分页文本框
- pgbuttons: false, //不显示翻页按钮
- rowNum: 1000, //每页显示条数
- autowidth: true, //自动调节宽度
- 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"); //添加完数据后客户端自动刷新一次、实现客户端数据与服务器数据的完全分离
- }
- //绑定、设置工具栏
- jQuery("#list").jqGrid("navGrid","#page",{add: false,edit: false,del: false,search: false,refresh: false,searchtext: "搜索",refreshtext: "刷新"});
-
- //栏舍配方合并表头begin
- //栏舍配方合并表头end
-
- if(isEnableSupplyFeed == 1){
- $("#list").jqGrid("showCol","BLMB");
- }
- if(isMorningPart == 1){
- $("#list").jqGrid("showCol","Rtime2");
- }
- if(isNoonPart == 1){
- $("#list").jqGrid("showCol","Rtime4");
- }
- if(isNightPart == 1){
- $("#list").jqGrid("showCol","Rtime6");
- }
-
- if(isSelTr>0){
- $("#list").jqGrid("setSelection",isSelTr);
- }
-
- //是否显示泌乳天数与平均月龄
- if(isShowAvgAgeAndDay == 0){
- $("#list").jqGrid("hideCol","AvgDim");
- $("#list").jqGrid("hideCol","AvgMonthAge");
- }else{
- $("#list").jqGrid("showCol","AvgDim");
- $("#list").jqGrid("showCol","AvgMonthAge");
- }
-
- if(Reserved6 == 0){
- //禁用剩料时、隐藏对应两列
- $("#list").jqGrid("hideCol","ztFeedpName");
- $("#list").jqGrid("hideCol","ztRtime");
- }else{
- //启用剩料时、显示对应两列
- $("#list").jqGrid("showCol","ztFeedpName");
- $("#list").jqGrid("showCol","ztRtime");
- }
-
- //如果按重量计算、设置总重量\采食量不可被修改
- if(Calculation == 1){
- $("#list").jqGrid("setColProp", "CCountRatio", {editable: false});
- $("#list").jqGrid("setColProp", "CCountRatioCCOUNT", {editable: false});
- $("#list").jqGrid("hideCol","lpplanDry");
- }
-
-
- }
-
- //获取服务器数据
- function getLists(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/recipeplan/feedplist.html?Calculation="+Calculation,
- error: function(){alert("系统错误");},
- success: function(json){
- mydata = json;
- }
- });
- return mydata;
- }
-
- function ImportExcel(){
- var file = $("#file").val();
- var uploadEntityFrm = document.getElementById("uploadEntityFrm");
- if(file != ""){
- var ext = file.substring(file.lastIndexOf(".")+1);
- if(ext == "xls" || ext == "xlsx"){
- uploadEntityFrm.action = "${contextPath }/admin/recipeplan/ImportExcel.html?Calculation="+Calculation;
- uploadEntityFrm.submit();
- return true;
- }else{
- alert("请选择Excel导入");
- return false;
- }
- }else{
- alert("请选择Excel导入");
- return false;
- }
- }
-
- //获取系统默认参数是否启用补料模版,各班比例
- function getDefaultConfig(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型json
- url: "${contextPath }/admin/basicdata/getdefaultconfig.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- if(json.isEnableSupplyFeed){
- isEnableSupplyFeed = 1;
- }
- if(json.isMorningPart){
- isMorningPart = 1;
- }
- if(json.isNoonPart){
- isNoonPart = 1;
- }
- if(json.isNightPart){
- isNightPart = 1;
- }
- if(json.Calculation==0){
- colName = ["主键","栏舍名称","计划干物质","日系数比例(%)","时间","实际头数","软件牛头数","系数(%)", "系数头数","泌乳天数","平均月龄", "配方模版", "补料模版", "转投栏舍", "转投班次", "早班1比例(%)", "早班2比例(%)", "中班1比例(%)", "中班2比例(%)", "晚班1比例(%)", "晚班2比例(%)", "sel1", "sel2", "sel3", "sel4", "sel5", "sel6"];
- }else{
- colName = ["主键","栏舍名称","计划干物质","日系数比例(%)","时间","实际头数","软件牛头数", "采食量(kg/天)", "总重量(kg)","泌乳天数","平均月龄", "配方模版", "补料模版", "转投栏舍", "转投班次", "早班1(kg)", "早班2(kg)", "中班1(kg)", "中班2(kg)", "晚班1(kg)", "晚班2(kg)", "sel1", "sel2", "sel3", "sel4", "sel5", "sel6"];
- }
- Calculation = json.Calculation;//记录是按比例计算、还是按重量计算
- isShowAvgAgeAndDay=json.isShowAvgAgeAndDay;
- Reserved6 = json.Reserved6;//记录是否启用剩料 0禁用时隐藏栏舍配方中的【转投栏舍、转投班次】。 1显示
- Reserved7 = json.Reserved7;//锁定两班以上的首班重量:0、否,1是、选是时、栏舍配方中计算时锁定
- isLocking = Reserved7;
- if(json.Calculation==1){
- $("#showInfo").html("导入的Excel总列数为16列:【日期、栏舍名称、软件牛头数、实际牛头数、产奶量、泌乳天数、平均月龄、转投剩料量、日系数比例(%)、1班(kg)、2班(kg)、3班(kg)、4班(kg)、5班(kg)、6班(kg)、转投栏舍】<br/>其中【日期、栏舍名称、转投栏舍】三列格式为文本格式,其他列都是常规格式!");
- }else{
- $("#showInfo").html("导入的Excel总列数为16列:【日期、栏舍名称、软件牛头数、实际牛头数、产奶量、泌乳天数、平均月龄、转投剩料量、牛头系数、1班比例、2班比例、3班比例、4班比例、5班比例、6班比例、转投栏舍】<br/>其中【日期、栏舍名称、转投栏舍】三列格式为文本格式,其他列都是常规格式!");
- }
- }
- }
- });
- }
-
- //全部计算
- function reCheck(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型jsond
- data: "Calculation="+Calculation,
- url: "${contextPath }/admin/recipeplan/reCheck.html",
- error: function(){alert("系统错误");},
- success: function(json){
- location.reload();
- }
- });
- }
-
- //导出配方
- function exportExcel(){
- document.location.href="${contextPath}/admin/recipeplan/feedpExportExcel.html?Calculation="+Calculation;
- }
-
- //重量生成
- //设置每个牛舍的每个班次里的重量为,牛头数*配方里所有原料总重*默认参数设置里的对应班次重量的值/100
- function ResetGenerate(){
- $.ajax({
- async: false,
- type: 'POST',
- dataType:'json', //返回类型jsond
- data: "Calculation="+Calculation,
- url: "${contextPath }/admin/recipeplan/resetGenerate.html",
- error: function(){alert("系统错误");},
- success: function(json){
- location.reload();
- }
- });
- }
- </script>
- </head>
- <body class="easyui-layout">
- <div region="north" title="导入Excel" style="height:100px;padding:5px;">
- <font color="red"> <text id="showInfo"></text></font>
- <form id="uploadEntityFrm" method="post" action="" enctype="multipart/form-data">
- <input id="file" type="file" name="file" />
- <input type="button" value="导入Excel" onclick="ImportExcel();" class="sysub" />
- <font color="red"><c:if test="${message eq 1 }">导入成功</c:if></font>
- <input type="button" value="全部计算" onclick="reCheck();" class="sysub" />
- <input type="button" value="导出配方" onclick="exportExcel();" class="sysub" />
- <input id="rgBtn" type="button" value="重量生成" onclick="ResetGenerate();" class="sysub" />
- </form>
- </div>
- <div region="center" title="栏舍配方" style="padding:5px;background:#eee;">
- <table id="list"></table>
- <div id="page"></div>
- </div>
- <div region="south" split="true" title="重量" style="padding:5px;height:230px;">
- <div id="fpdetailResult"></div>
- </div>
- </body>
- </html>
|