<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<title>打印</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script type="text/javascript" language="javascript" src="../LodopFuncs.js"></script>
|
<object id="LODOP_OB"
|
classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
|
height="0">
|
<embed id="LODOP_EM" type="application/x-print-lodop" width="0"
|
height="0"></embed>
|
</object>
|
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<button type="button" lay-submit="" lay-filter="designTemplate" class="layui-btn layui-btn-radius">模板设计<</button>
|
<button type="button" lay-submit="" lay-filter="handlePrint" class="layui-btn layui-btn-radius">模板打印</button>
|
<button type="button" lay-submit="" onclick="prn_preview()" class="layui-btn layui-btn-radius">打印预览<</button>
|
<button type="button" lay-submit="" onclick="prn_print()" class="layui-btn layui-btn-radius">直接打印</button>
|
<button type="button" lay-submit="" onclick="prn_printA()" class="layui-btn layui-btn-radius">选择打印</button>
|
进入<a href="javascript:;" onclick="javascript:CreatePrintPage();LODOP.PRINT_DESIGN();">模板设计</a><br><br>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
</div>
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script src="../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../layuiadmin/Scripts/webConfig2.js"></script>
|
<script>
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['index', 'form', 'table', 'element', 'laypage','laydate'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element
|
, laypage = layui.laypage
|
, laydate = layui.laydate
|
var sWhere = "";
|
|
var option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, height: 'full-50'
|
, page: true
|
, cols: [[
|
{ field: '唯一条码', title: '唯一条码', sort: true, width: 170 }
|
, { field: '扫码日期', title: '扫码日期', sort: true, width: 200 }
|
, { field: '条码', title: '条码', sort: true, width: 170 }
|
, { field: '条码类型', title: '条码类型', width: 90 }
|
, { field: '生产任务单单号', title: '生产任务单单号', width: 140 }
|
, { field: '物料编码', title: '物料编码', width: 100 }
|
, { field: '打包数量', title: '打包数量', width: 90 }
|
, { field: '规格型号', title: '规格型号', width: 90 }
|
, { field: '物料名称', title: '物料名称', width: 90 }
|
, { field: '数量制单人', title: '数量制单人', width: 110 }
|
, { field: '制单日期', title: '制单日期', width: 200 }
|
]]
|
};
|
|
//进入页面显示的缓存列表
|
layer.load(3);
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
|
url: GetWEBURL1() + '/LEMS/MES_ProductionLinePackagingList_Json',
|
type: "GET",
|
data: { "sWhere": sWhere },
|
success: function (data1) {
|
if (data1.count == 1) {
|
option.data = data1.data;
|
table.render(option);
|
layer.closeAll("loading");
|
} else {
|
layer.closeAll("loading");
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口失效!", { icon: 5 });
|
}
|
});
|
|
form.on('submit(designTemplate)', function (data) {
|
var head =
|
document.head ||
|
document.getElementsByTagName("head")[0] ||
|
document.documentElement;
|
var oscript = document.createElement("script");
|
oscript.src = "http://localhost:8000/CLodopfuncs.js?priority=1";
|
head.insertBefore(oscript, head.firstChild);
|
});
|
|
//查询按钮
|
form.on('submit(handlePrint)', function (data) {//选择仓位
|
let LODOP = getCLodop();
|
let _self = this;
|
const tid = LODOP.PRINT_DESIGN();
|
LODOP.On_Return = function (taskID, value) {
|
_self.templateCode = value;
|
};
|
});
|
|
//以上是layui模块
|
});
|
|
var LODOP;
|
function prn_preview() {
|
alert("prn_preview");
|
var data = "2020-12-3";
|
CreatOneFormPage(data);
|
LODOP.PREVIEW();
|
}
|
|
function prn_print() {
|
alert("prn_print");
|
CreatOneFormPage();
|
LODOP.PRINT();
|
}
|
|
function prn_printA() {
|
alert("prn_printA");
|
CreatOneFormPage();
|
LODOP.PRINTA();
|
}
|
|
function CreatOneFormPage(data) {
|
alert("CreatOneFormPage");
|
LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
|
LODOP.PRINT_INIT("套打EMS的模板");
|
LODOP.ADD_PRINT_RECT(20, 25, 401, 377, 0, 1);
|
LODOP.ADD_PRINT_LINE(54, 302, 228, 302, 0, 1);
|
LODOP.ADD_PRINT_LINE(21, 115, 396, 116, 0, 1);
|
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
|
LODOP.ADD_PRINT_TEXT(27, 29, 75, 30, "生产日期");
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
|
LODOP.ADD_PRINT_TEXT(27, 125, 100, 30, data);
|
}
|
|
function CreatePrintPage() {
|
LODOP.PRINT_INIT("套打EMS的模板");
|
};
|
|
</script>
|
|
</body>
|
</html>
|