1
wtt
2024-05-24 1d46d1f94851c843813961c0fc0ac61d60596e9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!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>