Commit 6efdb900 authored by 徐州's avatar 徐州

新增print接口

parent 42fea1e5
...@@ -242,25 +242,26 @@ ...@@ -242,25 +242,26 @@
</style> </style>
<script> <script>
function doPrint(type) { function doPrint(type) {
myDoc = { // myDoc = {
settings: { // settings: {
pageWidth: 2100, // pageWidth: 2100,
pageHeight: 1400, // pageHeight: 1400,
orientation: 2}, // orientation: 2},
documents: document, // documents: document,
marginIgnored:true, // marginIgnored:true,
dragDesigner: {viewSource:true}, // dragDesigner: {viewSource:true},
settingsID: 'mydoc3', // settingsID: 'mydoc3',
classesReplacedWhenPrint: new Array('.only_for_print{display:block}'), // classesReplacedWhenPrint: new Array('.only_for_print{display:block}'),
copyrights: "杰创软件拥有版权 www.jatools.com" // copyrights: "杰创软件拥有版权 www.jatools.com"
} // }
var jatoolsPrinter = document.getElementById("jatoolsPrinter"); // var jatoolsPrinter = document.getElementById("jatoolsPrinter");
if("pre"==type){ if("pre"==type){
updateZslxdbh(); updateZslxdbh();
jatoolsPrinter.printPreview(myDoc); // jatoolsPrinter.printPreview(myDoc);
alert(${paymentItemHis.zslxdbh})
}else if("print"==type){ }else if("print"==type){
updateZslxdbh(); updateZslxdbh();
jatoolsPrinter.print(myDoc,true); // jatoolsPrinter.print(myDoc,true);
} }
} }
......
...@@ -18,5 +18,10 @@ ...@@ -18,5 +18,10 @@
</action> </action>
<!-- 跳转收费信息列表页面 -->
<action name="print" class="com.jshx.jfzm.web.JfzmAction" method="print">
<result name="view">/WEB-INF/pages/jfzm/jfzm_print.jsp</result>
</action>
</package> </package>
</struts> </struts>
...@@ -130,20 +130,11 @@ public class JfzmAction extends BaseAction { ...@@ -130,20 +130,11 @@ public class JfzmAction extends BaseAction {
/** /**
* 打印缴费证明时,查询所需要的数据 * 打印缴费证明时,查询所需要的数据
*/ */
public void queryDetail() { public String print() {
rfxm = rfxmService.getById(id); rfxm = rfxmService.getById(id);
xmxxb = xmxxbService.getById(rfxm.getXmxxbId()); xmxxb = xmxxbService.getById(rfxm.getXmxxbId());
paymentItemHis = paymentItemHisService.getById(rfxm.getPaymentHisId()); paymentItemHis = paymentItemHisService.getById(rfxm.getPaymentHisId());
JSONObject jo = new JSONObject(); return VIEW;
jo.put("rfxm",rfxm);
jo.put("xmxxb",xmxxb);
jo.put("paymentItemHis",paymentItemHis);
try {
this.getResponse().getWriter().write(jo.toString());
this.getResponse().getWriter().flush();
} catch (IOException e) {
e.printStackTrace();
}
} }
public Pagination getPagination() { public Pagination getPagination() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment