| | |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/print.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jQuery.print.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <style> |
| | | .layui-form { |
| | | padding: 25px 30px 0 0; |
| | | } |
| | | .layui-form-label { |
| | | padding: 8px 15px; |
| | | box-sizing: content-box; |
| | | -webkit-box-sizing: content-box; |
| | | } |
| | | .layui-form-required:before { |
| | | content: "*"; |
| | | display: inline-block; |
| | | font-family: SimSun,serif; |
| | | margin-right: 4px; |
| | | font-size: 14px; |
| | | line-height: 1; |
| | | color: #ed4014; |
| | | } |
| | | .layui-input { |
| | | height: 36px; |
| | | border-radius: 4px; |
| | | } |
| | | .cool-button-contain { |
| | | text-align: right; |
| | | margin: 20px 0; |
| | | } |
| | | .layui-form-radio>i:hover, .layui-form-radioed>i { |
| | | color: #007bff; |
| | | } |
| | | .layui-btn { |
| | | height: 36px; |
| | | line-height: 36px; |
| | | border-radius: 4px; |
| | | box-shadow: 0 1px 0 rgba(0,0,0,.03); |
| | | } |
| | | .layui-btn-primary:hover { |
| | | border-color: #777777; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <form class="layui-form"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">起始序列:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="startNo" placeholder="请输入起始序列号" class="layui-input" lay-verify="required|number" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="count" type="number" placeholder="请输入数量" class="layui-input" lay-verify="required|number" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">码类型:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="radio" name="type" value="1" title="条形码" checked=""> |
| | | <input type="radio" name="type" value="2" title="二维码"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item cool-button-contain"> |
| | | <button class="layui-btn layui-btn-normal" id="print" lay-filter="print" lay-submit="">打印</button> |
| | | <button class="layui-btn layui-btn-primary" id="cancel">取消</button> |
| | | </div> |
| | | </form> |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jQuery.print.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script> |
| | | layui.use(['form'], function() { |
| | | let $ = layui.jquery; |
| | | let form = layui.form; |
| | | |
| | | form.on('submit(print)', function (data) { |
| | | $.ajax({ |
| | | url: baseUrl+"/trayCode/print/preview", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (let i=0;i<res.data.length;i++){ |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/macCode/code/auth?type=1¶m="+res.data[i].item; |
| | | } |
| | | parent.printPreview(res); |
| | | // parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | $('#cancel').click(function () { |
| | | parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | }) |
| | | |
| | | }); |
| | | </script> |
| | | </html> |