From a21a403a57d9133d954cbe8040499539a284d5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 3 Sep 2017 13:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E5=A2=9E=E5=8A=A04=E5=BC=A0?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E7=9A=84=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/js/print/print.js | 12 +++++++++--- .../webapp/pages/reports/account_report.jsp | 10 ++++++++++ src/main/webapp/pages/reports/buy_in_report.jsp | 10 ++++++++++ .../pages/reports/in_out_stock_report.jsp | 17 ++++++++++++++--- .../webapp/pages/reports/sale_out_report.jsp | 12 +++++++++++- 5 files changed, 54 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/js/print/print.js b/src/main/webapp/js/print/print.js index 1833b173..7d4f1697 100644 --- a/src/main/webapp/js/print/print.js +++ b/src/main/webapp/js/print/print.js @@ -3,9 +3,15 @@ function CreateFormPage(strPrintName, printDatagrid) { var beginDate= $("#searchBeginTime").val(); var endDate= $("#searchEndTime").val(); - var tableString = '
上海某某某某有限责任公司\n
' + - '\n
日期:' + beginDate + ' 至 ' + endDate + ' \n
' + - '\n'; + var getMonth= $("#searchMonth").val(); + var tableString = '
上海某某某某有限责任公司\n
'; + if(beginDate && endDate) { + tableString+='\n
日期:' + beginDate + ' 至 ' + endDate + ' \n
'; + } + if(getMonth) { + tableString += '\n
月份:' + getMonth + ' \n
'; + } + tableString+='\n
'; var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象 var columns = printDatagrid.datagrid("options").columns; // 得到columns对象 var nameList = ''; diff --git a/src/main/webapp/pages/reports/account_report.jsp b/src/main/webapp/pages/reports/account_report.jsp index 4c741fc5..c52a5c2d 100644 --- a/src/main/webapp/pages/reports/account_report.jsp +++ b/src/main/webapp/pages/reports/account_report.jsp @@ -13,6 +13,7 @@ + @@ -39,6 +40,8 @@
  查询 +    + 打印
@@ -55,6 +58,7 @@ { initTableData(); ininPager(); + print(); }); //初始化表格数据 @@ -180,6 +184,12 @@ } }); } + //报表打印 + function print() { + $("#printBtn").off("click").on("click",function(){ + CreateFormPage('打印报表', $('#tableData')); + }); + } \ No newline at end of file diff --git a/src/main/webapp/pages/reports/buy_in_report.jsp b/src/main/webapp/pages/reports/buy_in_report.jsp index e243ff48..dab00a83 100644 --- a/src/main/webapp/pages/reports/buy_in_report.jsp +++ b/src/main/webapp/pages/reports/buy_in_report.jsp @@ -13,6 +13,7 @@ + @@ -34,6 +35,8 @@   查询 +    + 打印 @@ -53,6 +56,7 @@ initTableData(); ininPager(); search(); + print(); }); //初始化表格数据 @@ -226,6 +230,12 @@ } }); } + //报表打印 + function print() { + $("#printBtn").off("click").on("click",function(){ + CreateFormPage('打印报表', $('#tableData')); + }); + } \ No newline at end of file diff --git a/src/main/webapp/pages/reports/in_out_stock_report.jsp b/src/main/webapp/pages/reports/in_out_stock_report.jsp index f2bc9a5d..bc81f544 100644 --- a/src/main/webapp/pages/reports/in_out_stock_report.jsp +++ b/src/main/webapp/pages/reports/in_out_stock_report.jsp @@ -13,6 +13,7 @@ + @@ -40,8 +41,11 @@   - 查询   - 导出 + 查询 +    + 导出 +    + 打印    @@ -71,6 +75,7 @@ ininPager(); search(); exportExcel(); + print(); }); //导出EXCEL @@ -401,7 +406,13 @@ return; } }); - } + } + //报表打印 + function print() { + $("#printBtn").off("click").on("click",function(){ + CreateFormPage('打印报表', $('#tableData')); + }); + } \ No newline at end of file diff --git a/src/main/webapp/pages/reports/sale_out_report.jsp b/src/main/webapp/pages/reports/sale_out_report.jsp index 8b44d58a..ccf31515 100644 --- a/src/main/webapp/pages/reports/sale_out_report.jsp +++ b/src/main/webapp/pages/reports/sale_out_report.jsp @@ -13,6 +13,7 @@ + @@ -34,6 +35,8 @@   查询 +    + 打印 注:此处包含零售+批发销售 @@ -55,6 +58,7 @@ initTableData(); ininPager(); search(); + print(); }); //初始化表格数据 @@ -227,7 +231,13 @@ return; } }); - } + } + //报表打印 + function print() { + $("#printBtn").off("click").on("click",function(){ + CreateFormPage('打印报表', $('#tableData')); + }); + } \ No newline at end of file