| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <!DOCTYPE html>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <c:set var="ctx" value="<%=request.getContextPath()%>"/>
- <html xml:lang="en" lang="en">
-
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- <link rel="stylesheet" type="text/css" media="screen" href="plug-in/jqgrid/css/css/cupertino/jquery-ui-1.8.16.custom.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="plug-in/ace/css/ui.jqgrid.css" />
- <!-- <link rel="stylesheet" type="text/css" media="screen" href="plug-in/jqgrid/js/src/css/jquery.searchFilter.css" /> -->
- <%--<script type="text/javascript" src="plug-in/jqgrid/js/jquery-1.7.1.js"></script> --%>
- <%--<script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.min.js"></script>--%>
- <script type="text/javascript" src="${ctx}/plug-in/jquery/jquery-1.11.3.min.js"></script>
- <script type="text/javascript" src="plug-in/jquery/jquery.jqprint.js"></script>
- <script type="text/javascript" src="plug-in/jqgrid/js/jquery.jqGrid.src.js"></script>
- <script type="text/javascript" src="plug-in/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
- <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
- <script type="text/javascript" src="${ctx}/plug-in/tableExport/libs/FileSaver/FileSaver.min.js"></script>
- <script type="text/javascript" src="${ctx}/plug-in/tableExport/libs/js-xlsx/xlsx.core.min.js"></script>
- <script type="text/javascript" src="${ctx}/plug-in/tableExport/tableExport.min.js"></script>
- <script type="text/javascript" src="plug-in/tools/money.js"></script>
- <style>
- .ui-jqgrid {
- font-size: 14px;
- }
- .ui-jqgrid-view {
- font-size: 14px;
- }
- .ui-jqgrid .ui-jqgrid-htable th {
- height: 28px;
- font-size: 14px; /* 14 */
- }
- .ui-jqgrid .ui-jqgrid-btable {
- height: 28px;
- font-size: 12px;
- }
- .ui-jqgrid .ui-jqgrid-ftable {
- font-size: 13px;
- }
- .ui-jqgrid .ui-jqgrid-pager {
- height: 28px;
- font-size: 14px; /* 14 */
- }
- .ui-jqgrid .ui-pg-input {
- font-size: 1em;
- height: 20px;
- }
- .ui-jqgrid .i-pg-selbox {
- font-size: 0.9em;
- height: 20px;
- }
- .ui-jqgrid tr.ui-row-ltr td {
- text-align: center;
- }
- .ui-jqgrid tr.footrow-ltr td {
- text-align: center;
- }
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default
- {
- background: #5187c9 ;
- color: #fffbf8;
- }
- .ui-widget-content
- {
- background:#fff;
- }
- /*.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: 1; filter:Alpha(Opacity=100); font-weight: normal; background-color: #F5F5F5;}*/
- .ui-jqgrid tr.jqgrow td { white-space: normal !important; height:auto; } /**内容自动换行 */
- th.ui-th-column div{
- white-space: normal !important;
- height: auto !important;
- }
- </style>
- </head>
-
- <body style="background:#FFFFFF">
- <!-- <form id="form1" runat="server"> -->
- <div>
- <div id="div2">
- <%--查询框begin --%>
- <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;top:5px;"> <!-- bottom -->
- <tr >
- <%-- <td align="right" width="100px">
- <label class="Validform_label">领料点: </label>
- </td>
- <td class="value" nowrap>
- <input id="warehouseId" name="warehouseId" type="hidden" >
- <input name="warehouseName" type="text" class="inputxt" style="width: 150px" id="warehouseName" readonly="readonly" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">领料点</label>
- <t:choose hiddenName="warehouseId" hiddenid="id" url="pOrdersController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName" name="list"
- left="40%" width="450px" height="700px" icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
- </td> --%>
- <td align="right">
- <label class="Validform_label"> 截止日期: </label>
- </td>
- <td class="value">
- <input id="period" name="period" type="text" style="width: 150px" class="Wdate" readonly="readonly" value="${period}"
- onClick='WdatePicker({readOnly:true,enableKeyboard:false,enableInputMask:false,dateFmt: "yyyy-MM-dd"})' datatype="*" ignore="ignore" />
- <%-- <t:dictSelect id="period" field="period" type="list" extendJson="{class:'form-control',style:'width:136px'}"
- typeGroupCode="busperiod" hasLabel="false" title="采购期间" ></t:dictSelect> --%>
- <label class="Validform_label" style="display: none;"> 截止日期: </label>
- </td>
- <td align="right">
- <label class="Validform_label"> 项目名称: </label>
- </td>
- <td class="value">
- <input id="projectname" name="projectname" type="text" style="width: 150px" class="text" >
- </td>
- <td width="200px"><label class="Validform_label" style="display: none;"> </label></td>
- <td height="50px" align="right" colspan="8">
- <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-search" onclick="btn_query()">查询</a>
- <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-putout" onclick="btn_output()">导出excel</a>
- <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-print" onclick="btn_print()">打印</a>
- </td>
- </tr>
- <tr>
- <!-- <table id="jqGrid"></table>
- <div id="pager2"></div> -->
- </tr>
- </table>
- <%--查询框end --%>
- <form id="HideFrm" method="post" target="_blank" action="contractReportsController.do?expexcel">
-
- </div>
- <br/><br/><br/>
- <div id="divgrid">
- <!-- <div id="pager2"></div>
- --> <div id="div1">
- <table id="jqGrid"></table>
- <div id="pager2"></div>
- </div>
- </div>
- </iframe>
- <!-- </form>
- -->
-
- <script>
- $(function() {
- $('#projectname').bind('keyup', function(event) {
- if (event.keyCode == "13") {
- //回车执行查询
- btn_query();
- }
- });
- });
- function btn_query()
- {
- showGridTable();
- $("#jqGrid").jqGrid('setGroupHeaders',{
- useColSpanStyle: true,
- groupHeaders:[
- {startColumnName : 'currentperiodinvoice',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内开票</span></div>'},
- {startColumnName : 'currentperiodincome',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内收款</span></div>'},
- {startColumnName : 'nowtolastincome',numberOfColumns : 2,titleText : '<div style="text-align:center;"><span>收款</span></div>'}
- ]
- });
- }
- var _hasSearch=false;
- function showGridTable() {
- var period = $("#period").val();
- var projectname = $("#projectname").val();
- // var warehouseid = $("#warehouseId").val();
- var requrl='contractReportsController.do?propertyfeeliveData';
- if(period != null)
- requrl+=('&period='+period);
- if(projectname != null)
- requrl+=('&projectname='+projectname);
-
- $("#div1").empty();
- $("#div1").html("<table class='jqgrid' id='jqGrid'></table><div class='jqgridpager' id='pager2'></div>");
- $("#jqGrid").jqGrid({
- url: requrl,
- datatype: "json",
- caption:'<div style="text-align:center;font-size: 14px;"><span>物业费实时进程表<br>统计截止日期:</span></div>',
- colModel: [
- /* { label: '编号', name: 'index', width: 160,sortable:false}, */
- { label: '项目', name: 'projectname', width: 130 ,sortable:false,align:'left'},
- { label: '支付方式', name: 'paytype', width: 60 ,sortable:false},
- { label: '物业合同应收<br>(大合同)', name: 'contractreceivable', width: 120 ,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '上年开今年', name: 'lasttonow', width: 80 , formatter:numFmatter ,sortable:false,align:'right'},
-
- { label: '金额', name: 'currentperiodinvoice', width: 120,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '开至日期', name: 'currentinvoiceEndDate', width: 80 ,formatter:nullFormatter, sortable:false},
- { label: '开票时间', name: 'currentinvoicedate', width: 80 ,formatter:nullFormatter, sortable:false},
-
- { label: '已收上年开今年', name: 'lasttonowincome', width: 80 ,formatter:numFmatter ,sortable:false,align:'right'},
-
- { label: '期内收款金额', name: 'currentperiodincome', width: 120 ,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '收至日期', name: 'currentincomeEndDate', width: 80,formatter:nullFormatter, sortable:false},
- { label: '收到日期', name: 'currentincomedate', width: 80 ,formatter:nullFormatter, sortable:false},
-
- { label: '期内未开票', name: 'periodnoinvoice', width: 80 ,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '期内未收款', name: 'periodnoincome', width: 80 ,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '上年未开票', name: 'lastyearnoinvoice', width: 100 ,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '今年开上年', name: 'nowtolastinvoice', width: 100 ,formatter:numFmatter ,sortable:false,align:'right'},
- { label: '上年开上年', name: 'lasttolastinvoice', width: 100 ,formatter:numFmatter ,sortable:false,align:'right'},
-
- { label: '今年开上年', name: 'nowtolastincome', width: 100 , formatter:numFmatter ,sortable:false,align:'right'},
- { label: '上年开上年', name: 'lasttolastincome', width: 100 , formatter:numFmatter ,sortable:false,align:'right'},
- { label: '未收上年', name: 'lastyearnoincome', width: 100 , formatter:numFmatter ,sortable:false,align:'right'}
- ],
- viewrecords: true,
- height: 500,
- rowNum: -1,
- rownumbers: true,
- rownumWidth: 25,
- autowidth:false,
- multiselect: false,
- frozen:true,
- /* autoScroll: true,//当autoScroll和shrinkToFit均为false时,会出现行滚动条
- shrinkToFit: false,//是否列宽度自适应。true=适应 false=不适应 */
- //分组
- /* viewrecords: true,
- sortname: 'projectName', //需要分组的列
- grouping:true,
- groupingView : {
- groupField : ['projectName'], //需要分组的列
- groupSummary : [true], //是否显示汇总 如果为true需要在colModel中进行配置 如: summaryType:'sum', summaryTpl:'<b>小计: {0}</b>''
- groupColumnShow : [true], //是否显示分组列
- groupText : ['<b>{0}</b>'], //在分组的头部显示的信息
- groupCollapse : false, //该属性表示在加载数据的时候是否只显示分组信息,false表示既显示分组信息也显示每个分组里面的详细信息,true则只显示分组信息
- }, */
- //统计
- footerrow:true, //开启统计
- userDataOnFooter : true, //在页脚显示统计
- altRows : true ,
- pager: "#jqGridPager",
- jsonReader : {
- root: "page.list",
- page: "page.currPage",
- total: "page.totalPage",
- records: "page.totalCount"
- },
- prmNames : {
- page:"page",
- rows:"limit",
- order: "order"
- },
- gridComplete:function(){
- var rowNum=parseInt($(this).getGridParam("records"),10);
- if(rowNum>0){
- $(".ui-jqgrid-sdiv").show();
- var sum_currentperiodinvoice = $(this).getCol("currentperiodinvoice",false,"sum");
- var sum_lasttonowincome = $(this).getCol("lasttonowincome",false,"sum");
- var sum_currentperiodincome = $(this).getCol("currentperiodincome",false,"sum");
- var sum_periodnoinvoice = $(this).getCol("periodnoinvoice",false,"sum");
- var sum_periodnoincome = $(this).getCol("periodnoincome",false,"sum");
- var sum_lastyearnoinvoice = $(this).getCol("lastyearnoinvoice",false,"sum");
- var sum_nowtolastinvoice = $(this).getCol("nowtolastinvoice",false,"sum");
- var sum_lasttolastinvoice = $(this).getCol("lasttolastinvoice",false,"sum");
- var sum_nowtolastincome = $(this).getCol("nowtolastincome",false,"sum");
- var sum_lasttolastincome = $(this).getCol("lasttolastincome",false,"sum");
- var sum_lastyearnoincome = $(this).getCol("lastyearnoincome",false,"sum");
- var sum_contractreceivable = $(this).getCol("contractreceivable",false,"sum");
-
- $(this).footerData("set",{"projectname" : "合计:",
- "contractreceivable" : formatterNum(sum_contractreceivable),
- "currentperiodinvoice" : formatterNum(sum_currentperiodinvoice),
- "lasttonowincome" : formatterNum(sum_lasttonowincome),
- "currentperiodincome" : formatterNum(sum_currentperiodincome),
- "periodnoinvoice" : formatterNum(sum_periodnoinvoice),
- "periodnoincome" : formatterNum(sum_periodnoincome),
- "lastyearnoinvoice" : formatterNum(sum_lastyearnoinvoice),
- "nowtolastinvoice" : formatterNum(sum_nowtolastinvoice),
- "lasttolastinvoice" : formatterNum(sum_lasttolastinvoice),
- "nowtolastincome" : formatterNum(sum_nowtolastincome),
- "lasttolastincome" : formatterNum(sum_lasttolastincome),
- "lastyearnoincome" : formatterNum(sum_lastyearnoincome)}); //将合计值显示出来
- }else{
- $(".ui-jqgrid-sdiv").hide();
- }
- $("#jqGrid").closest("div.ui-jqgrid-view")
- .children("div.ui-jqgrid-titlebar")
- .css("text-align", "center")
- .children("span.ui-jqgrid-title")
- .css("float", "none").css("font-size","14px");
- $(this).setCaption('物业费实时进程表 <br><span style="font-weight:normal;">统计截止日期:'+period+'</span>');
- _hasSearch = true;
- /* } */
- }
- });
- }
- $("#jqGrid").jqGrid({
- url :'contractReportsController.do?propertyfeeliveData&load=false',
- datatype: "json",
- caption:'物业费实时进程表<br><span style="font-weight:normal;">统计截止日期:</span>',
- colModel: [
- /* { label: '编号', name: 'index', width: 40,sortable:false}, */
- { label: '项目', name: 'projectname', width: 130 ,sortable:false,frozen: true},
- { label: '支付方式', name: 'paytype', width: 60 ,sortable:false},
- { label: '物业合同应收<br>(大合同)', name: 'contractreceivable', width: 80 ,sortable:false},
- { label: '上年开今年', name: 'lasttonow', width: 80 ,sortable:false},
-
- { label: '金额', name: 'currentperiodinvoice', width: 80,sortable:false},
- { label: '开至日期', name: 'currentinvoiceEndDate', width: 80 ,sortable:false},
- { label: '开票时间', name: 'currentinvoicedate', width: 80 ,sortable:false},
-
- { label: '已收上年开今年', name: 'lasttonowincome', width: 80 ,sortable:false},
-
- { label: '期内收款金额', name: 'currentperiodincome', width: 80 ,sortable:false},
- { label: '收至日期', name: 'currentincomeEndDate', width: 80,sortable:false},
- { label: '收到日期', name: 'currentincomedate', width: 80 ,sortable:false},
-
- { label: '期内未开票', name: 'periodnoinvoice', width: 80 ,sortable:false},
- { label: '期内未收款', name: 'periodnoincome', width: 80 ,sortable:false},
- { label: '上年未开票', name: 'lastyearnoinvoice', width: 80 ,sortable:false},
- { label: '今年开上年', name: 'nowtolastinvoice', width: 80 ,sortable:false},
- { label: '上年开上年', name: 'lasttolastinvoice', width: 80 ,sortable:false},
-
- { label: '今年开上年', name: 'nowtolastincome', width: 80 , sortable:false},
- { label: '上年开上年', name: 'lasttolastincome', width: 80 , sortable:false},
- { label: '未收上年', name: 'lastyearnoincome', width: 80 , sortable:false}
- ],
-
- viewrecords: true,
- height: 500,
- rowNum: -1,
- rownumbers: true,
- rownumWidth: 25,
- autowidth:false,
- multiselect: false,
- //统计
- footerrow:true, //开启统计
- userDataOnFooter : true, //在页脚显示统计
- altRows : true ,
- pager: "#jqGridPager",
- jsonReader : {
- root: "page.list",
- page: "page.currPage",
- total: "page.totalPage",
- records: "page.totalCount"
- },
- prmNames : {
- page:"page",
- rows:"limit",
- order: "order"
- },
- gridComplete:function(){
- //隐藏grid底部滚动条
- $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
- var rowNum=parseInt($(this).getGridParam("records"),10);
- if(rowNum>0){
- $(".ui-jqgrid-sdiv").show();
- var sum_inAmount = $(this).getCol("amount",false,"sum");
- var sum_balance = $(this).getCol("quantity",false,"sum");
- $(this).footerData("set",{"projectName" : "合计:",
- "amount" : sum_inAmount,
- "quantity" : sum_balance}); //将合计值显示出来
- }else{
- $(".ui-jqgrid-sdiv").hide();
- }
- $("#jqGrid").closest("div.ui-jqgrid-view")
- .children("div.ui-jqgrid-titlebar")
- .css("text-align", "center")
- .children("span.ui-jqgrid-title")
- .css("float", "none").css("font-size","14px");
- $("#jqGrid").jqGrid('setGroupHeaders',{
- useColSpanStyle: true,
- groupHeaders:[
- {startColumnName : 'currentperiodinvoice',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内开票</span></div>'},
- {startColumnName : 'currentperiodincome',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内收款</span></div>'},
- {startColumnName : 'nowtolastincome',numberOfColumns : 2,titleText : '<div style="text-align:center;"><span>收款</span></div>'}
- ]
- });
- }/*,
- autowidth:true,
- height: 500 ,
- datatype:"local" */
- });
- /* $("#jqGrid").jqGrid('setFrozenColumns');//设置冻结列生效 */
- function btn_output(){
- if(!_hasSearch){
- alert('请先查询数据');
- return;
- }
- var opt = {
- type:'excel'
- ,fileName:'物业费实时进程表'+$("#period").val()
- ,escape:'false'
- ,mso:{
- fileFormat: 'xlshtml'
- ,onMsoNumberFormat: null
- ,pageFormat: 'a4'
- ,pageOrientation: 'portrait'
- ,rtl: false
- ,styles: ['background-color',
- 'color',
- 'font-family',
- 'font-size',
- 'font-weight',
- 'text-align',
- 'height',
- 'padding',
- ,'border-bottom', 'border-top', 'border-left', 'border-right'
- ]
- // ,worksheetName: 'abc'
- }
- };
- // $('#jqGrid').tableExport(opt);
- var ex = $('#jqGrid').clone();
- var tbody = ex.find('tbody');
- var tds = tbody.find('tr:eq(0)').find('td');
- var thead = $("#gbox_jqGrid .ui-jqgrid-htable thead").clone();
- tbody.before(thead);
- var titleTr =$('<tr></tr>');
- var titleTh = $('<th></th>');
- titleTr.append(titleTh);
- titleTh.append($('.ui-jqgrid-title').clone());
- titleTh.attr('colspan',tds.length);
- thead.prepend(titleTr);
- thead.css('text-align','center');
- var footer = $('table.ui-jqgrid-ftable tbody tr');
- tbody.append(footer);
- // ex.hide();
- $('body').append(ex);
- ex.tableExport(opt);
- ex.remove();
- }
- function btn_print(){
- $("#divgrid").jqprint({
- debug: false,
- importCSS: true,
- printContainer: true,
- operaSupport: false
- });
- }
- function formatNumberNull(num, precision, separator) {
- var parts;
- // 判断是否为数字
- if (!isNaN(parseFloat(num)) && isFinite(num)) {
- // 把类似 .5, 5. 之类的数据转化成0.5, 5, 为数据精度处理做准, 至于为什么
- // 不在判断中直接写 if (!isNaN(num = parseFloat(num)) && isFinite(num))
- // 是因为parseFloat有一个奇怪的精度问题, 比如 parseFloat(12312312.1234567119)
- // 的值变成了 12312312.123456713
- num = Number(num);
- // 处理小数点位数
- num = (typeof precision !== 'undefined' ? (Math.round(num * Math.pow(10,precision)) / Math.pow(10,precision)).toFixed(precision) : num).toString();
- // 分离数字的小数部分和整数部分
- parts = num.split('.');
- // 整数部分加[separator]分隔, 借用一个著名的正则表达式
- // parts[0] = parts[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + (separator || ','));
-
- return parts.join('.');
- }
- return '0.00';
- }
- function numFmatter(cellvalue, options, rowObject){
- return formatNumberNull(cellvalue,2);
- };
- function nullFormatter(cellvalue, options, rowObject){
- if(cellvalue == null || cellvalue.trim() == '')
- return '--';
- else
- return cellvalue;
- }
- </script>
-
- </body>
-
- </html>
|