| | |
| | | [ |
| | | new hiprint.PrintElementTypeGroup("打印标签", datalist), |
| | | new hiprint.PrintElementTypeGroup("辅助", [ |
| | | // { |
| | | // tid: 'testModule.tableCustom', |
| | | // title: '自定义表格', |
| | | // type: 'tableCustom' |
| | | // }, |
| | | { |
| | | tid: 'testModule.tableCustom', |
| | | title: '自定义表格', |
| | | type: 'tableCustom' |
| | | }, |
| | | { tid: 'configModule.customText', title: '自定义文本', customText: '自定义文本', custom: true, type: 'text' }, |
| | | { tid: 'configModule.image', title: '图片', data: '../../js/hiprint/hi.png', type: 'image' }, |
| | | { |
| | |
| | | } |
| | | } |
| | | return target; |
| | | } |
| | | } |
| | | |
| | | //调用打印 |
| | | function openPrintDialog(printData){ |
| | | layer.open({ |
| | | type: 2, |
| | | title: '打印', |
| | | content: '/views/SystemSettings/PrintModule.html', |
| | | maxmin: true, |
| | | area: ['100%', '100%'], |
| | | data: printData, |
| | | success: function (layero, index) { |
| | | var body = layer.getChildFrame('body',index); |
| | | body.find('#printData').val(JSON.stringify(printData)); |
| | | } |
| | | }); |
| | | } |
| | |
| | | <link rel="stylesheet" type="text/css" href="../../js/HiPrint/css/hiprint.css?t=' + Math.random() + '" /> |
| | | <link rel="stylesheet" type="text/css" href="../../js/HiPrint/css/print-lock.css" /> |
| | | <!-- <link rel="stylesheet" type="text/css" href="../../js/HiPrint/css/bootstrap.min.css" > --> |
| | | <script src="../../js/jquery-3.5.1.min.js"></script> |
| | | <script src="../../js/hiprint/content/bootstrap.min.js"></script> |
| | | <script src="../../js/HiPrint/hiprint.bundle.js?t=' + Math.random() + '"></script> |
| | | <script src="../../js/HiPrint/polyfill.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jquery.minicolors.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/JsBarcode.all.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/qrcode.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jquery.hiwprint.js"></script> |
| | | <script src="../../js/HiPrint/plugins/config-etype-provider.js"></script> |
| | | <style> |
| | | .layui-form-label { |
| | | padding: 5px 1px; |
| | |
| | | |
| | | <body> |
| | | <div class="layui-card"> |
| | | <input type="hidden" id="printData" name="printData"> |
| | | <div class="row"> |
| | | |
| | | <!--左侧div--> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <script src="../../js/jquery-3.5.1.min.js"></script> |
| | | <script src="../../js/jquery.cookie.js"></script> |
| | | <script src="../../js/hiprint/content/bootstrap.min.js"></script> |
| | | <script src="../../js/HiPrint/hiprint.bundle.js?t=' + Math.random() + '"></script> |
| | | <script src="../../js/HiPrint/polyfill.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jquery.minicolors.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/JsBarcode.all.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/qrcode.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jquery.hiwprint.js"></script> |
| | | <script src="../../js/HiPrint/plugins/config-etype-provider.js"></script> |
| | | <script src="../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../js/public.js"></script> |
| | | <script src="../../js/jquery.cookie.js"></script> |
| | | <script> |
| | | //这里获取上级页面的printData数据打印 |
| | | // var printData = [{ |
| | | // SkuNo: '000001', |
| | | // SkuName: '测试物料1', |
| | | // Standard:'xxxxxx', |
| | | // LotNo:'20230801' |
| | | // },{ |
| | | // SkuNo: '000002', |
| | | // SkuName: '测试物料2', |
| | | // Standard:'xxxxxx', |
| | | // LotNo:'20230801' |
| | | // }]; |
| | | debugger; |
| | | var printData = deepClone(parent.printData); |
| | | var configPrintJson; |
| | | |
| | | //初始化打印插件渲染 |
| | |
| | | hiprintTemplate.design('#hiprint-printTemplate'); |
| | | |
| | | //打印 |
| | | hiprintTemplate.print(printData); |
| | | setTimeout(function () { |
| | | //这里获取上级页面的printData数据打印 |
| | | // var printData = deepClone(parent.printData); |
| | | var printData = JSON.parse($("#printData").val()); |
| | | hiprintTemplate.print(printData); |
| | | parent.layer.closeAll(); |
| | | }, 2000); |
| | | }, 100); |
| | | } |
| | | else //不成功 |
| | | { |
| | |
| | | active = { |
| | | //新增 |
| | | add: function () { |
| | | objRowsData = {}; |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加模板信息', |
| | |
| | | SkuNo: '000001', |
| | | SkuName: '测试物料1', |
| | | Standard: 'xxxxxx', |
| | | LotNo: '20230801' |
| | | LotNo: '20230801', |
| | | Qty: 100 |
| | | }, { |
| | | SkuNo: '000002', |
| | | SkuName: '测试物料2', |
| | | Standard: 'xxxxxx', |
| | | LotNo: '20230801' |
| | | LotNo: '20230801', |
| | | Qty: 100 |
| | | }]; |
| | | layer.open({ |
| | | type: 2, |
| | | title: '打印', |
| | | content: '/views/SystemSettings/PrintModule.html', |
| | | maxmin: true, |
| | | area: ['100%', '100%'], |
| | | data: printData, |
| | | end: function () { |
| | | |
| | | } |
| | | }); |
| | | openPrintDialog(printData) |
| | | }); |
| | | </script> |
| | | </body> |
| | |
| | | //修改 |
| | | var id = getQueryString('id'); |
| | | if (!id) { |
| | | $('#Id').val(''); |
| | | id = 0; |
| | | } |
| | | else { |
| | |
| | | hiprint.PrintElementTypeManager.build('.hiprintEpContainer', |
| | | 'testModule'); |
| | | |
| | | |
| | | var hiprintTemplate; |
| | | var JsonData = JSON.parse(window.parent.objRowsData.PositionJson) |
| | | if (JsonData != '') { |
| | | let hiprintTemplate; |
| | | if (window.parent.objRowsData.PositionJson) |
| | | var JsonData = JSON.parse(window.parent.objRowsData.PositionJson) |
| | | if (JsonData) { |
| | | $("#customWidth").val(JsonData.panels[0].width); |
| | | $("#customHeight").val(JsonData.panels[0].height); |
| | | hiprintTemplate = new hiprint.PrintTemplate({ |