$('.prints').click(function (tablelayid) {
var v = document.createElement("div");
var f = ["<head>", "<style>", "body{font-size: 12px; color: #666;}", "table{width: 100%; border-collapse: collapse; border-spacing: 0;}", "th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #666;}", "a{color: #666; text-decoration:none;}", "*.layui-hide{display: none}", ".picture{ }", "</style>", "</head>"].join("");
$(v).append($(".layui-table-box").find(".layui-table-header").html());
$('.layui-table-box .laytable-cell-checkbox').each(function () {
if ($(this).children().hasClass("layui-form-checked")) {
$(v).find('thead').append($(this).parents('tr'))
}
})
var h = window.open("打印窗口", "_blank");
h.document.write(f + $(v).prop("outerHTML"));
h.document.close();
h.print();
h.close();
table.reload("ReceiptIssueDetails", {
data: tableData // 将新数据重新载入表格
})
})
layui打印
最新推荐文章于 2022-12-01 13:24:49 发布