标签:
在使用之前请记得先下载lodop-----js文件
var LODOP; //声明为全局变量
function prn1_preview() {
LODOP.PRINT_INIT("打印生产单");
LODOP.SET_PRINT_PAGESIZE(0,2100,1390,"");
var pageNum = ${pageNum?c};//pageNum为当前页码
for(var i =1; i<pageNum+1;i++){
LODOP.NewPage();
LODOP.ADD_PRINT_HTM("0", "0", "100%", "100%",$("#form"+i).html());
}
LODOP.PREVIEW();
}
function prn2_preview() {
LODOP.PRINT_INIT("打印生产单");
LODOP.SET_PRINT_PAGESIZE(0,2100,1390,"");
var pageNo = $(‘#pageNo option:selected‘).val();
var num = $(‘#num option:selected‘).val();
var content = "";
if(pageNo==0){
var pageNum = ${pageNum?c};
for(var i =1; i<pageNum+1;i++){
for(var j = 0; j<num;j++){
LODOP.NewPage();
LODOP.ADD_PRINT_HTM("0", "0", "100%", "100%",$("#form"+i).html());
}
}
}else if(pageNo>0){
for(var i = 0; i<num;i++){
LODOP.NewPage();
LODOP.ADD_PRINT_HTM("0", "0", "100%", "100%",$("#form"+pageNo).html());//$("#form"+pageNo).html()表是你要打印的form的内容
}
}
LODOP.PREVIEW();
}
标签:
原文地址:http://www.cnblogs.com/my-blocg/p/5848236.html