projectPurchaseSumRpt.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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/jquery/jquery-1.11.3.min.js"></script>
  16. <script type="text/javascript" src="plug-in/jquery/jquery.jqprint.js"></script>
  17. <script type="text/javascript" src="plug-in/jqgrid/js/jquery.jqGrid.src.js"></script>
  18. <script type="text/javascript" src="plug-in/jqgrid/js/i18n/grid.locale-cn.js"></script>
  19. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  20. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
  21. <script src = "webpage/cn/com/lzt/report/purchaseRptCommon.js"></script>
  22. <script type="text/javascript" src="plug-in/tableExport/libs/FileSaver/FileSaver.min.js"></script>
  23. <script type="text/javascript" src="plug-in/tableExport/libs/js-xlsx/xlsx.core.min.js"></script>
  24. <script type="text/javascript" src="plug-in/tableExport/tableExport.min.js"></script>
  25. <style>
  26. .ui-jqgrid {
  27. font-size: 14px;
  28. }
  29. .ui-jqgrid-view {
  30. font-size: 14px;
  31. }
  32. .ui-jqgrid .ui-jqgrid-htable th {
  33. height: 28px;
  34. font-size: 14px; /* 14 */
  35. }
  36. .ui-jqgrid .ui-jqgrid-btable {
  37. height: 28px;
  38. font-size: 12px;
  39. }
  40. .ui-jqgrid .ui-jqgrid-ftable {
  41. font-size: 13px;
  42. }
  43. .ui-jqgrid .ui-jqgrid-pager {
  44. height: 28px;
  45. font-size: 14px; /* 14 */
  46. }
  47. .ui-jqgrid .ui-pg-input {
  48. font-size: 1em;
  49. height: 20px;
  50. }
  51. .ui-jqgrid .i-pg-selbox {
  52. font-size: 0.9em;
  53. height: 20px;
  54. }
  55. .ui-jqgrid tr.ui-row-ltr td {
  56. text-align: center;
  57. }
  58. .ui-jqgrid tr.footrow-ltr td {
  59. text-align: center;
  60. }
  61. .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default
  62. {
  63. background: #5187c9 ;
  64. color: #fffbf8;
  65. }
  66. .ui-widget-content
  67. {
  68. background:#fff;
  69. }
  70. </style>
  71. </head>
  72. <body style="background:#FFFFFF">
  73. <!-- <form id="form1" runat="server"> -->
  74. <div>
  75. <div id="div2">
  76. <%--查询框begin --%>
  77. <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;top:5px;"> <!-- bottom -->
  78. <tr >
  79. <td align="right" width="600px" style="text-align: left;">
  80. <label class="Validform_label">领料点: </label>
  81. <!-- </td>
  82. <td class="value" nowrap> -->
  83. <input id="warehouseId" name="warehouseId" type="hidden" >
  84. <input name="warehouseName" type="text" class="inputxt" style="width: 150px" id="warehouseName" readonly="readonly" />
  85. <span class="Validform_checktip"></span>
  86. <label class="Validform_label" style="display: none;">领料点</label>
  87. <t:choose hiddenName="warehouseId" hiddenid="id" url="pOrdersController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName" name="list"
  88. left="40%" width="450px" height="700px" icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="value">
  93. <span class="spancon" title="attType">统计频度:</span>
  94. <select name="attType" id="attType" width="100" onchange="tyepChange()" style="width: 134px">
  95. <option value="0" selected="selected">月度</option>
  96. <option value="1">季度</option>
  97. <option value="2">年度</option>
  98. </select>
  99. </span>
  100. <input type="text" id="attYear" name="attYear" style="width: 94px;" class="Wdate" onclick="WdatePicker({readOnly:true,enableKeyboard:false,enableInputMask:false,lang:'zh-cn',dateFmt:'yyyy'})">
  101. <span style="display:-moz-inline-box;display:inline-block;width: 20px;text-align:center;">年</span>
  102. <input type="text" id="attMonth" name="period" style="width: 94px;" class="Wdate" onclick="WdatePicker({readOnly:true,enableKeyboard:false,enableInputMask:false,lang:'zh-cn',dateFmt:'MM'})">
  103. <span style="display:-moz-inline-box;display:inline-block;width: 20px;text-align:center;">月</span>
  104. <select style="width: 104px;background: #f0f0f0;" id="attQuarters" disabled="disabled" name="attQuarters">
  105. <option value="1">1</option>
  106. <option value="2">2</option>
  107. <option value="3">3</option>
  108. <option value="4">4</option>
  109. </select>
  110. <span style="display:-moz-inline-box;display:inline-block;width: 40px;text-align:center;">季度</span>
  111. </td>
  112. <%-- <td align="right">
  113. <label class="Validform_label"> 月度: </label>
  114. </td>
  115. <td class="value">
  116. <input id="period" name="period" type="text" style="width: 150px" class="Wdate" readonly="readonly" value="${period}"
  117. onClick='WdatePicker({readOnly:true,enableKeyboard:false,enableInputMask:false,dateFmt: "yyyyMM"})' datatype="*" ignore="ignore" />
  118. <label class="Validform_label" style="display: none;"> 采购期间: </label>
  119. </td> --%>
  120. <span style="float: left;padding-left: 750px;padding-top: 34px;" >
  121. <td height="50px" align="right" colspan="8" valign="top">
  122. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-search" onclick="btn_query()">查询</a>
  123. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-putout" onclick="btn_output()">导出excel</a>
  124. </td>
  125. <!-- <td height="50px" align="left" colspan="8"> -->
  126. <!-- <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-search" style="width: 100px;" onclick="btn_query()">&nbsp; &nbsp; 查 询&nbsp; &nbsp;&nbsp; </a> -->
  127. <!-- </td> -->
  128. </span>
  129. </tr>
  130. <tr>
  131. <!-- <table id="jqGrid"></table>
  132. <div id="pager2"></div> -->
  133. </tr>
  134. </table>
  135. <%--查询框end --%>
  136. </div>
  137. <br/><br/><br/>
  138. <div id="div1">
  139. <table id="jqGrid"></table>
  140. <div id="pager2"></div>
  141. </div>
  142. </div>
  143. <!-- </form>
  144. -->
  145. <script>
  146. $(function(){
  147. setDefault();
  148. _rpttitle='物料采购汇总表';
  149. });
  150. function btn_query()
  151. {
  152. showGridTable();
  153. }
  154. function showGridTable() {
  155. var attType = $("#attType").val();
  156. var attYear = $("#attYear").val();
  157. var attMonth = $("#attMonth").val();
  158. var attQuarters = $("#attQuarters").val();
  159. var warehouseid = $("#warehouseId").val();
  160. var requrl='purchaseRptController.do?projectPurchaseSumRptData';
  161. requrl+=('&attType='+attType);
  162. requrl+=('&attYear='+attYear);
  163. requrl+=('&attMonth='+attMonth);
  164. requrl+=('&attQuarters='+attQuarters);
  165. if(warehouseid != null)
  166. requrl+=('&warehouseid='+warehouseid);
  167. $("#div1").empty();
  168. $("#div1").html("<table class='jqgrid' id='jqGrid'></table><div class='jqgridpager' id='pager2'></div>");
  169. $("#jqGrid").jqGrid({
  170. url: requrl,
  171. caption:'<div style="text-align:center;font-size: 14px;"><span>物料采购汇总表</span></div>',
  172. datatype: "json",
  173. colModel: [
  174. { label: '领料点名称', name: 'projectName', width: 160,sortable:false},
  175. { label: '统计月份', name: 'period', width: 130 ,sortable:false},
  176. { label: '货品名称', name: 'goodsName', width: 160 ,sortable:false},
  177. /* { label: '存货编码', name: 'goodsCode', width: 160 ,sortable:false}, */
  178. { label: '货品型号', name: 'specType', width: 160 ,sortable:false},
  179. { label: '金额', name: 'amount', width: 100 , formatter:'number',align:'right', summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false},
  180. { label: '数量', name: 'quantity', width: 100 , formatter:'number',align:'right',summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false}
  181. ],
  182. viewrecords: true,
  183. height: 500,
  184. rowNum: -1,
  185. rownumbers: true,
  186. rownumWidth: 25,
  187. autowidth:false,
  188. multiselect: false,
  189. //分组
  190. viewrecords: true,
  191. sortname: 'projectName', //需要分组的列
  192. grouping:true,
  193. groupingView : {
  194. groupField : ['projectName'], //需要分组的列
  195. groupSummary : [true], //是否显示汇总 如果为true需要在colModel中进行配置 如: summaryType:'sum', summaryTpl:'<b>小计: {0}</b>''
  196. groupColumnShow : [true], //是否显示分组列
  197. groupText : ['<b>{0}</b>'], //在分组的头部显示的信息
  198. groupCollapse : false, //该属性表示在加载数据的时候是否只显示分组信息,false表示既显示分组信息也显示每个分组里面的详细信息,true则只显示分组信息
  199. },
  200. //统计
  201. footerrow:true, //开启统计
  202. userDataOnFooter : true, //在页脚显示统计
  203. altRows : true ,
  204. pager: "#jqGridPager",
  205. jsonReader : {
  206. root: "page.list",
  207. page: "page.currPage",
  208. total: "page.totalPage",
  209. records: "page.totalCount"
  210. },
  211. prmNames : {
  212. page:"page",
  213. rows:"limit",
  214. order: "order"
  215. },
  216. gridComplete:function(){
  217. //隐藏grid底部滚动条
  218. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  219. var rowNum=parseInt($(this).getGridParam("records"),10);
  220. if(rowNum>0){
  221. $(".ui-jqgrid-sdiv").show();
  222. var sum_inAmount = $(this).getCol("amount",false,"sum");
  223. var sum_balance = $(this).getCol("quantity",false,"sum");
  224. $(this).footerData("set",{"projectName" : "合计:",
  225. "amount" : sum_inAmount,
  226. "quantity" : sum_balance}); //将合计值显示出来
  227. _hasSearch=true;
  228. }else{
  229. $(".ui-jqgrid-sdiv").hide();
  230. }
  231. }
  232. });
  233. }
  234. $("#jqGrid").jqGrid({
  235. url :'purchaseRptController.do?projectPurchaseSumRptData&load=false',
  236. caption:'<div style="text-align:center;font-size: 14px;"><span>物料采购汇总表</span></div>',
  237. datatype: "json",
  238. colModel: [
  239. { label: '项目名称', name: 'projectName', width: 160 ,sortable:false},
  240. { label: '统计月份', name: 'period', width: 130 ,sortable:false},
  241. { label: '货品名称', name: 'goodsName', width: 160 ,sortable:false},
  242. /* { label: '存货编码', name: 'goodsCode', width: 160 ,sortable:false}, */
  243. { label: '货品型号', name: 'specType', width: 160 ,sortable:false},
  244. { label: '金额', name: 'amount', width: 100 , summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false},
  245. { label: '数量', name: 'quantity', width: 100 , summaryType:'sum', summaryTpl:'<b>小计: {0}</b>',sortable:false}
  246. ],
  247. viewrecords: true,
  248. height: 500,
  249. rowNum: -1,
  250. rownumbers: false,
  251. rownumWidth: 25,
  252. autowidth:false,
  253. multiselect: false,
  254. //统计
  255. footerrow:true, //开启统计
  256. userDataOnFooter : true, //在页脚显示统计
  257. altRows : true ,
  258. pager: "#jqGridPager",
  259. jsonReader : {
  260. root: "page.list",
  261. page: "page.currPage",
  262. total: "page.totalPage",
  263. records: "page.totalCount"
  264. },
  265. prmNames : {
  266. page:"page",
  267. rows:"limit",
  268. order: "order"
  269. },
  270. gridComplete:function(){
  271. //隐藏grid底部滚动条
  272. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  273. var rowNum=parseInt($(this).getGridParam("records"),10);
  274. if(rowNum>0){
  275. $(".ui-jqgrid-sdiv").show();
  276. var sum_inAmount = $(this).getCol("amount",false,"sum");
  277. var sum_balance = $(this).getCol("quantity",false,"sum");
  278. $(this).footerData("set",{"projectName" : "合计:",
  279. "amount" : sum_inAmount,
  280. "quantity" : sum_balance}); //将合计值显示出来
  281. }else{
  282. $(".ui-jqgrid-sdiv").hide();
  283. }
  284. }/*,
  285. autowidth:true,
  286. height: 500 ,
  287. datatype:"local" */
  288. });
  289. </script>
  290. </body>
  291. </html>