sgdSummaryRpt.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  5. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  6. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9. <title></title>
  10. <link rel="stylesheet" type="text/css" media="screen" href="plug-in/jqgrid/css/css/cupertino/jquery-ui-1.8.16.custom.css" />
  11. <link rel="stylesheet" type="text/css" media="screen" href="plug-in/ace/css/ui.jqgrid.css" />
  12. <link rel="stylesheet" type="text/css" media="screen" href="plug-in/jqgrid/js/src/css/jquery.searchFilter.css" />
  13. <script type="text/javascript" src="plug-in/jqgrid/js/jquery-1.7.1.js"></script>
  14. <script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.min.js"></script>
  15. <script type="text/javascript" src="plug-in/jqgrid/js/jquery.jqGrid.src.js"></script>
  16. <script type="text/javascript" src="plug-in/jqgrid/js/i18n/grid.locale-cn.js"></script>
  17. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  18. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
  19. <script src = "webpage/cn/com/lzt/report/purchaseRptCommon.js"></script>
  20. <script type="text/javascript" src="plug-in/tableExport/libs/FileSaver/FileSaver.min.js"></script>
  21. <script type="text/javascript" src="plug-in/tableExport/libs/js-xlsx/xlsx.core.min.js"></script>
  22. <script type="text/javascript" src="plug-in/tableExport/tableExport.min.js"></script>
  23. <style>
  24. .ui-jqgrid {
  25. font-size: 14px;
  26. }
  27. .ui-jqgrid-view {
  28. font-size: 14px;
  29. }
  30. .ui-jqgrid .ui-jqgrid-htable th {
  31. height: 28px;
  32. font-size: 14px; /* 14 */
  33. }
  34. .ui-jqgrid .ui-jqgrid-btable {
  35. height: 28px;
  36. font-size: 12px;
  37. }
  38. .ui-jqgrid .ui-jqgrid-ftable {
  39. font-size: 13px;
  40. }
  41. .ui-jqgrid .ui-jqgrid-pager {
  42. height: 28px;
  43. font-size: 14px; /* 14 */
  44. }
  45. .ui-jqgrid .ui-pg-input {
  46. font-size: 1em;
  47. height: 20px;
  48. }
  49. .ui-jqgrid .i-pg-selbox {
  50. font-size: 0.9em;
  51. height: 20px;
  52. }
  53. .ui-jqgrid tr.ui-row-ltr td {
  54. text-align: center;
  55. }
  56. .ui-jqgrid tr.footrow-ltr td {
  57. text-align: center;
  58. }
  59. .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default
  60. {
  61. background: #5187c9 ;
  62. color: #fffbf8;
  63. }
  64. .ui-widget-content
  65. {
  66. background:#fff;
  67. }
  68. </style>
  69. </head>
  70. <body style="background:#FFFFFF">
  71. <!-- <form id="form1" runat="server"> -->
  72. <div>
  73. <div id="div2">
  74. <%--查询框begin --%>
  75. <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;top:5px;"> <!-- bottom -->
  76. <tr >
  77. <td align="right" width="100px">
  78. <label class="Validform_label">领料点: </label>
  79. </td>
  80. <td class="value" nowrap>
  81. <input id="warehouseId" name="warehouseId" type="hidden" >
  82. <input name="warehouseName" type="text" class="inputxt" style="width: 150px" id="warehouseName" readonly="readonly" />
  83. <span class="Validform_checktip"></span>
  84. <label class="Validform_label" style="display: none;">领料点</label>
  85. <t:choose hiddenName="warehouseId" hiddenid="id" url="pOrdersController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName" name="list"
  86. left="40%" width="450px" height="700px" icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
  87. </td>
  88. <td align="right">
  89. <label class="Validform_label"> 申购月份: </label>
  90. </td>
  91. <td class="value">
  92. <!-- <t:dictSelect id="period" field="period" type="list" extendJson="{class:'form-control',style:'width:136px'}"
  93. typeGroupCode="orderMonths" hasLabel="false" title="采购期间" ></t:dictSelect>
  94. <label class="Validform_label" style="display: none;"> 提交申购月份: </label>-->
  95. <t:dictSelect field="period" id="period" type="list"
  96. dictTable="t_b_ordermonths" dictField="id"
  97. dictCondition="where 1=1"
  98. dictText="ordermonths_name" datatype="*"
  99. defaultVal="${ordersPage.orderMonths}"
  100. hasLabel="false" title="申购月份"></t:dictSelect>
  101. <span class="Validform_checktip"></span>
  102. <label class="Validform_label" style="display: none;">申购月份</label>
  103. </td>
  104. <td width="65px"><label class="Validform_label" style="display: none;"> </label></td>
  105. <td height="50px" align="right" colspan="8">
  106. <!-- <a style="margin-left:80px" href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
  107. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div> -->
  108. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-search" onclick="btn_query()">查询</a>
  109. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-putout" onclick="btn_output()">导出excel</a>
  110. </td>
  111. </tr>
  112. <tr>
  113. <!-- <table id="jqGrid"></table>
  114. <div id="pager2"></div> -->
  115. </tr>
  116. </table>
  117. <%--查询框end --%>
  118. </div>
  119. <br/><br/><br/>
  120. <div id="div1">
  121. <table id="jqGrid"></table>
  122. <div id="pager2"></div>
  123. </div>
  124. </div>
  125. <!-- </form>
  126. -->
  127. <script>
  128. $(function(){
  129. setDefault();
  130. _rpttitle='物料申购汇总表';
  131. });
  132. function btn_query()
  133. {
  134. showGridTable();
  135. }
  136. function showGridTable() {
  137. var period = $("#period").val();
  138. var warehouseid = $("#warehouseId").val();
  139. var requrl='purchaseRptController.do?SGDSummaryRptData';
  140. if(period != null)
  141. requrl+=('&period='+period);
  142. if(warehouseid != null)
  143. requrl+=('&warehouseid='+warehouseid);
  144. $("#div1").empty();
  145. $("#div1").html("<table class='jqgrid' id='jqGrid'></table><div class='jqgridpager' id='pager2'></div>");
  146. $("#jqGrid").jqGrid({
  147. url: requrl,
  148. datatype: "json",
  149. colModel: [
  150. { label: '领料点名称', name: 'projectName', width: 240 ,sortable:false},
  151. { label: '申购月份', name: 'period', width: 200 ,sortable:false},
  152. { label: '货品分类名称', name: 'rootclassname', width: 200 ,sortable:false},
  153. /* { label: '存货型号', name: 'specType', width: 80 }, */
  154. { label: '金 额', name: 'amount', width: 160 , align : 'right',
  155. formatter : "number", summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false}/* ,
  156. { label: '上月成本金额', name: 'preamount', width: 160 , summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false} */
  157. ],
  158. viewrecords: true,
  159. height: 500,
  160. rowNum: -1,
  161. rownumbers: true,
  162. rownumWidth: 25,
  163. autowidth:false,
  164. multiselect: false,
  165. //分组
  166. viewrecords: true,
  167. sortname: 'projectName', //需要分组的列
  168. grouping:true,
  169. groupingView : {
  170. groupField : ['projectName'], //需要分组的列
  171. groupSummary : [true], //是否显示汇总 如果为true需要在colModel中进行配置 如: summaryType:'sum', summaryTpl:'<b>小计: {0}</b>''
  172. groupColumnShow : [true], //是否显示分组列
  173. groupText : ['<b>{0}</b>'], //在分组的头部显示的信息
  174. groupCollapse : false, //该属性表示在加载数据的时候是否只显示分组信息,false表示既显示分组信息也显示每个分组里面的详细信息,true则只显示分组信息
  175. },
  176. //统计
  177. footerrow:true, //开启统计
  178. userDataOnFooter : true, //在页脚显示统计
  179. altRows : true ,
  180. pager: "#jqGridPager",
  181. jsonReader : {
  182. root: "page.list",
  183. page: "page.currPage",
  184. total: "page.totalPage",
  185. records: "page.totalCount"
  186. },
  187. prmNames : {
  188. page:"page",
  189. rows:"limit",
  190. order: "order"
  191. },
  192. gridComplete:function(){
  193. //隐藏grid底部滚动条
  194. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  195. var rowNum=parseInt($(this).getGridParam("records"),10);
  196. if(rowNum>0){
  197. $(".ui-jqgrid-sdiv").show();
  198. var sum_inAmount = $(this).getCol("amount",false,"sum");
  199. /* var sum_preamount = $(this).getCol("preamount",false,"sum"); */
  200. $(this).footerData("set",{"projectName" : "合计:",
  201. "amount" : sum_inAmount/* ,
  202. "preamount" : sum_preamount */ }); //将合计值显示出来
  203. }else{
  204. $(".ui-jqgrid-sdiv").hide();
  205. }
  206. _hasSearch=true;
  207. }
  208. });
  209. }
  210. $("#jqGrid").jqGrid({
  211. url :'purchaseRptController.do?SGDSummaryRptData&load=false',
  212. datatype: "json",
  213. colModel: [
  214. { label: '领料点名称', name: 'projectName', width: 240 ,sortable:false},
  215. { label: '申购月份', name: 'period', width: 200 ,sortable:false},
  216. { label: '货品分类名称', name: 'rootclassname', width: 200 ,sortable:false},
  217. /* { label: '存货型号', name: 'specType', width: 80 }, */
  218. { label: '金 额', name: 'amount', width: 160 , align : 'right',
  219. formatter : "number", summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false} /* ,
  220. { label: '上月成本金额', name: 'preamount', width: 160 , summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false} */
  221. ],
  222. viewrecords: true,
  223. height: 500,
  224. rowNum: -1,
  225. rownumbers: false,
  226. rownumWidth: 25,
  227. autowidth:false,
  228. multiselect: false,
  229. //统计
  230. footerrow:true, //开启统计
  231. userDataOnFooter : true, //在页脚显示统计
  232. altRows : true ,
  233. pager: "#jqGridPager",
  234. jsonReader : {
  235. root: "page.list",
  236. page: "page.currPage",
  237. total: "page.totalPage",
  238. records: "page.totalCount"
  239. },
  240. prmNames : {
  241. page:"page",
  242. rows:"limit",
  243. order: "order"
  244. },
  245. gridComplete:function(){
  246. //隐藏grid底部滚动条
  247. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  248. var rowNum=parseInt($(this).getGridParam("records"),10);
  249. if(rowNum>0){
  250. $(".ui-jqgrid-sdiv").show();
  251. var sum_inAmount = $(this).getCol("amount",false,"sum");
  252. /* var sum_preamount = $(this).getCol("preamount",false,"sum"); */
  253. $(this).footerData("set",{"projectName" : "合计:",
  254. "amount" : sum_inAmount /* ,
  255. "preamount" : sum_preamount */ }); //将合计值显示出来
  256. }else{
  257. $(".ui-jqgrid-sdiv").hide();
  258. }
  259. }/*,
  260. autowidth:true,
  261. height: 500 ,
  262. datatype:"local" */
  263. });
  264. </script>
  265. </body>
  266. </html>