| <!DOCTYPE html> | 
| <html lang="en"> | 
| <head> | 
|     <meta 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="../../static/layui/css/layui.css" media="all"> | 
|     <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> | 
|     <link rel="stylesheet" href="../../static/css/cool.css" media="all"> | 
|   | 
|     <!--<style> | 
|         /* ------------------------- 打印表格 -----------------------  */ | 
|         .contain { | 
|             border-collapse: collapse; | 
|             width: 280px; | 
|             font-size: x-small; | 
|             table-layout: fixed; | 
|             color: black; | 
|         } | 
|         .contain img.template-qrcode { | 
|             width: 80%; | 
|         } | 
|         .contain td, .contain th { | 
|             border: 1px solid black; | 
|             text-align: center; | 
|             overflow: hidden; | 
|             text-overflow: ellipsis; | 
|             white-space: nowrap; | 
|             padding: 5px; | 
|         } | 
|         .contain th { | 
|             font-weight: bold; | 
|             color: black; | 
|             background-color: #f2f2f2; | 
|         } | 
|         .contain tr:nth-child(even){background-color: #f9f9f9;} | 
|         .contain strong { | 
|             font-weight: bold; | 
|             line-height: 20px; | 
|             vertical-align: middle; | 
|             display: -webkit-box; | 
|             -webkit-line-clamp: 3; | 
|             -webkit-box-orient: vertical; | 
|         } | 
|         .barcode-section { | 
|             text-align: center; | 
|         } | 
|         .barcode-section span { | 
|             letter-spacing: 1px; | 
|             font-weight: bold; | 
|             color: black; | 
|         } | 
|   | 
|         #templatePreview3 { | 
|             color: black; | 
|             border-color: black; | 
|             border-collapse: collapse; /* 折叠边框 */ | 
|         } | 
|   | 
|         /* 将样式只应用到具有特定id的table、th、td */ | 
|         #templatePreview3, #myTable th, #myTable td { | 
|             color: black; | 
|             border: 2px solid black; /* 2像素黑色边框 */ | 
|         } | 
|   | 
|         #templatePreview3 th, #myTable td { | 
|             color: black; | 
|             border-color: black; | 
|             text-align: left; | 
|             padding: 8px; | 
|         } | 
|   | 
|         .template-preview { | 
|             height: 200px; | 
|             display: inline-block; | 
|         } | 
|   | 
|         /*----------------------------------*/ | 
|         .function-area { | 
|             padding: 20px 50px; | 
|         } | 
|         .function-btn:hover { | 
|             background-color: #2b425b; | 
|             color: #fff; | 
|         } | 
|   | 
|         #mat-query { | 
|             display: none; | 
|         } | 
|         #btn-outbound { | 
|             display: none; | 
|         } | 
|     </style>--> | 
|     <style> | 
|         body { | 
|             color: #595959; | 
|             background-color: #f5f7f9; | 
|         } | 
|   | 
|         .layui-fluid { | 
|             padding: 15px; | 
|         } | 
|   | 
|         .layui-form.layui-border-box.layui-table-view { | 
|             /*margin: 15px 0 35px 0;*/ | 
|             width: 100%; | 
|             border-width: 1px; | 
|         } | 
|   | 
|         .layui-form.layui-border-box.layui-table-view { | 
|             height: calc(100vh - 160px); | 
|         } | 
|   | 
|         .layui-form.layui-border-box.layui-table-view { | 
|             margin: 0; | 
|         } | 
|   | 
|         #search-box { | 
|             padding: 30px 30px 10px 0px; | 
|             margin-left: 0px; | 
|         } | 
|   | 
|         .layui-form.layui-border-box.layui-table-view { | 
|             height: 100%; | 
|         } | 
|   | 
|         .admin-form { | 
|             padding: 25px 30px 0 0 !important; | 
|             margin: 0 !important; | 
|         } | 
|   | 
|         /* ------------------------- 打印表格 -----------------------  */ | 
|         .template-preview { | 
|             height: 200px; | 
|             display: inline-block; | 
|         } | 
|   | 
|         .contain td { | 
|             border: 1px solid #000; | 
|             /*font-family: 黑体;*/ | 
|             /*font-weight: bold;*/ | 
|             /*color: #000000;*/ | 
|         } | 
|     </style> | 
| </head> | 
| <body> | 
|   | 
| <div class="layui-fluid"> | 
|     <div class="layui-card"> | 
|         <div class="layui-card-body"> | 
|             <div class="layui-form toolbar" id="search-box"> | 
|                 <div class="layui-form-item"> | 
|                     <!--                    <div class="layui-inline">--> | 
|                     <!--                        <label class="layui-form-label">编号:</label>--> | 
|                     <!--                        <div class="layui-input-inline">--> | 
|                     <!--                            <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">--> | 
|                     <!--                        </div>--> | 
|                     <!--                    </div>--> | 
|                     <div class="layui-inline"> | 
|                         <label class="layui-form-label">打印情况: </label> | 
|                         <div class="layui-input-block"> | 
|                             <select name="status"> | 
|                                 <option value="">请选择打印情况</option> | 
|                                 <option value="1">未打印</option> | 
|                                 <option value="2">已打印</option> | 
|                             </select> | 
|                         </div> | 
|                     </div> | 
|                     <!--                    <div class="layui-inline">--> | 
|                     <!--                        <div class="layui-input-inline">--> | 
|                     <!--                            <input class="layui-input" type="text" name="ownerId" placeholder="货主" autocomplete="off">--> | 
|                     <!--                        </div>--> | 
|                     <!--                    </div>--> | 
|                     <div class="layui-inline">  | 
|                         <button class="layui-btn icon-btn" lay-filter="search" lay-submit> | 
|                             <i class="layui-icon"></i>搜索 | 
|                         </button> | 
|                         <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> | 
|                             <i class="layui-icon"></i>重置 | 
|                         </button> | 
|                         <!-- 功能区 --> | 
|                     </div> | 
|                     <div class="layui-inline"> | 
|                         <button class="function-btn layui-btn icon-btn" style="width: auto;float:right;" onclick="excelMouldDownload()">导入待打印物料模板下载</button> | 
|                     </div> | 
|                 </div> | 
|             </div> | 
|             <table class="layui-hide" id="locInPrintMat" lay-filter="locInPrintMat"></table> | 
|         </div> | 
|     </div> | 
| </div> | 
|   | 
|   | 
|   | 
| <script type="text/html" id="toolbar"> | 
|     <div class="layui-btn-container"> | 
|         <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> | 
|         <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> | 
|         <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="btnPrintBatch">批量打印</button> | 
|         <button class="layui-btn layui-btn-lg" onclick="importExcel()" style="font-size: 12px;width: auto;">导入物料打印</button> | 
|         <span style="display: none"><input id="importExcel" type="file" onchange="upload(this)">导入物料信息</span> | 
|         <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> | 
|     </div> | 
| </script> | 
|   | 
| <!-- 表格 --> | 
| <div style="padding-bottom: 5px; margin-bottom: 45px"> | 
|   | 
|     <!-- 头部 --> | 
|     <script type="text/html" id="operate"> | 
|         <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> | 
|         <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> | 
|         <!-- 3.导入箱号出库 --> | 
|         <!--    <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="btnPrint">打印</a>--> | 
|   | 
|     </script> | 
|   | 
|     <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> | 
| </div> | 
|   | 
| <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 type="text/javascript" src="../../static/js/locInPrintMat/locInPrintMat.js" charset="utf-8"></script> | 
| </body> | 
| <!-- 表单弹窗 --> | 
| <script type="text/html" id="editDialog"> | 
|     <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> | 
|         <input name="id" type="hidden"> | 
|         <div class="layui-row"> | 
|             <div class="layui-col-md12"> | 
|                 <div class="layui-form-item"> | 
|                     <label class="layui-form-label">打印情况: </label> | 
|                     <div class="layui-input-block"> | 
|                         <select name="status"> | 
|                             <option value="">请选择打印情况</option> | 
|                             <option value="1">未打印</option> | 
|                             <option value="2">已打印</option> | 
|                         </select> | 
|                     </div> | 
|                 </div> | 
| <!--                <div class="layui-form-item">--> | 
| <!--                    <label class="layui-form-label">货主编号: </label>--> | 
| <!--                    <div class="layui-input-block">--> | 
| <!--                        <input class="layui-input" name="owner" placeholder="请输入货主编号">--> | 
| <!--                    </div>--> | 
| <!--                </div>--> | 
|                 <div class="layui-form-item"> | 
|                     <label class="layui-form-label">品号: </label> | 
|                     <div class="layui-input-block"> | 
|                         <input class="layui-input" name="matnr" placeholder="请输入品号"> | 
|                     </div> | 
|                 </div> | 
| <!--                <div class="layui-form-item">--> | 
| <!--                    <label class="layui-form-label">批次: </label>--> | 
| <!--                    <div class="layui-input-block">--> | 
| <!--                        <input class="layui-input" name="batch" placeholder="请输入批次">--> | 
| <!--                    </div>--> | 
| <!--                </div>--> | 
| <!--                <div class="layui-form-item">--> | 
| <!--                    <label class="layui-form-label">重量: </label>--> | 
| <!--                    <div class="layui-input-block">--> | 
| <!--                        <input class="layui-input" name="anfme" placeholder="请输入重量">--> | 
| <!--                    </div>--> | 
| <!--                </div>--> | 
| <!--                <div class="layui-form-item">--> | 
| <!--                    <label class="layui-form-label">库位号: </label>--> | 
| <!--                    <div class="layui-input-block">--> | 
| <!--                        <input class="layui-input" name="locNo" placeholder="请输入库位号">--> | 
| <!--                    </div>--> | 
| <!--                </div>--> | 
|                 <div class="layui-form-item"> | 
|                     <label class="layui-form-label">品名: </label> | 
|                     <div class="layui-input-block"> | 
|                         <input class="layui-input" name="maktx" placeholder="请输入品名"> | 
|                     </div> | 
|                 </div> | 
|                 <div class="layui-form-item"> | 
|                     <label class="layui-form-label">备注: </label> | 
|                     <div class="layui-input-block"> | 
|                         <input class="layui-input" name="memo" placeholder="请输入备注"> | 
|                     </div> | 
|                 </div> | 
|             </div> | 
|         </div> | 
|         <hr class="layui-bg-gray"> | 
|         <div class="layui-form-item text-right"> | 
|             <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> | 
|             <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> | 
|         </div> | 
|     </form> | 
| </script> | 
|   | 
|   | 
| <!-- 打印操作弹窗 --> | 
| <div id="printDataDiv" style="display: none;padding: 20px"> | 
|     <div class="layui-form" style="text-align: center"> | 
|         <hr> | 
|         <!--单选框--> | 
|         <div class="layui-form-item" style="display: inline-block; margin-bottom: 10px"> | 
|             <input type="radio" name="selectTemplate" value="1" title="模板一"  lay-filter="selectTemplateRadio" checked=""> | 
|             <!--            <input type="radio" name="selectTemplate" value="2" title="模板二" lay-filter="selectTemplateRadio">--> | 
|             <input type="radio" name="selectTemplate" value="3" title="模板" lay-filter="selectTemplateRadio"> | 
|         </div> | 
|         <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;text-align: left;"> | 
|             <legend>打印预览</legend> | 
|             <div id="template-container" style="margin: 20px;text-align: center"> | 
|   | 
|                 <!-- 预览图 1 --> | 
|                 <div id="template-preview-1" class="template-preview" style="display: inline-block"> | 
|                     <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> | 
|                         <tr style="height: 74px"> | 
|                             <td colspan="3" align="center" scope="col">品号</td> | 
|                             <td class="barcode" colspan="9" align="center" scope="col"> | 
|                                 <img class="template-code template-barcode" src="" width="90%;"> | 
|                                 <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;"> | 
|                                     <span>xxxxxx</span> | 
|                                 </div> | 
|                             </td> | 
|                         </tr> | 
|                         <tr style="height: 74px"> | 
|                             <td align="center" colspan="3">商品</td> | 
|                             <td align="center" colspan="5">xxxxxx-xx/xx</td> | 
|                             <td align="center" colspan="2">备注</td> | 
|                             <td align="center" colspan="2">xx</td> | 
|                         </tr> | 
|                     </table> | 
|                 </div> | 
|   | 
|                 <!-- 预览图 2 --> | 
|                 <div id="template-preview-2" class="template-preview" style="display: none"> | 
|                     <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> | 
|                         <tr style="height: 30px"> | 
|                             <td align="center" width="20%">商品</td> | 
|                             <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td> | 
|                         </tr> | 
|                         <tr style="height: 30px"> | 
|                             <td align="center" width="20%">备注</td> | 
|                             <td align="center" width="80%">xxxxxxxx</td> | 
|                         </tr> | 
|                         <tr style="height: 75px;"> | 
|                             <td align="center" colspan="2" width="100%" style="border: none"> | 
|                                 <img class="template-code template-barcode" src="" width="80%"> | 
|                                 <div style="letter-spacing: 2px;margin-top: 1px; text-align: center"> | 
|                                     <span>xxxxxx</span> | 
|                                 </div> | 
|                             </td> | 
|                         </tr> | 
|                     </table> | 
|                 </div> | 
|   | 
|                 <!-- 预览图 3 --> | 
|                 <div id="template-preview-3" class="template-preview" style="display: none"> | 
|                     <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> | 
|                         <tr style="height: 74px"> | 
|                             <td align="center" scope="col" colspan="1">商品</td> | 
|                             <td align="center" scope="col" colspan="1" style="">xxxxxx-xx/xx</td> | 
|                             <td align="center" scope="col" colspan="2" rowspan="2"> | 
|                                 <img class="template-code template-qrcode" src="" width="80%"> | 
|                                 <div style="letter-spacing: 1px;margin-top: 1px; text-align: center"> | 
|                                     <span>xxxxxx</span> | 
|                                 </div> | 
|                             </td> | 
|                         </tr> | 
|                         <tr style="height: 74px"> | 
|                             <td align="center" colspan="1">备注</td> | 
|                             <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td> | 
|                         </tr> | 
|                     </table> | 
|                 </div> | 
|             </div> | 
|         </fieldset> | 
|   | 
|         <button class="layui-btn" id="doPrint" lay-submit lay-filter="doPrint" style="margin-top: 20px">确定</button> | 
|     </div> | 
| </div> | 
|   | 
| <div id="box" style="display: block"></div> | 
|   | 
| <!-- 初始化打印模板的条形码 --> | 
| <script type="text/javascript"> | 
|     $('.template-barcode').attr("src", baseUrl+"/mac/code/auth?type=1¶m=123"); | 
|     $('.template-qrcode').attr("src", baseUrl+"/mac/code/auth?type=2¶m=123"); | 
| </script> | 
|   | 
| <!-- 模板引擎 --> | 
| <!-- 模板1 --> | 
| <script type="text/template" id="templatePreview1" class="template-qrcode"> | 
|     {{#each data}} | 
|     <table class="contain" width="300" | 
|            style="overflow: hidden;font-size: xx-small;table-layout: fixed;margin-top: 20px;"> | 
|         <tr style="height: 15px"> | 
|             <td align="center" scope="col" colspan="1" style="font-size: 10px;">名称</td> | 
|             <td align="center" scope="col" colspan="2" style="font-size: 10px;">{{this.maktx}}</td> | 
|             <td align="center" scope="col" colspan="3" rowspan="4"> | 
|                 <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="50%"> | 
|                 <div style="letter-spacing: 1px;margin-top: 1px; text-align: center"> | 
|                     <span>{{this.matnr}}</span> | 
|                 </div> | 
|             </td> | 
|         </tr> | 
|         <tr style="height: 15px"> | 
|             <td align="center" colspan="1" style="font-size: 10px;">制令</td> | 
|             <td align="center" colspan="2" | 
|                 style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;font-size: 10px;">{{this.decrees}} | 
|             </td> | 
|         </tr> | 
|         <tr style="height: 15px"> | 
|             <td align="center" colspan="1" style="font-size: 10px;">机型</td> | 
|             <td align="center" colspan="2" | 
|                 style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;font-size: 10px;">{{this.model}} | 
|             </td> | 
|         </tr> | 
|         <tr style="height: 15px"> | 
|             <td align="center" colspan="1" style="font-size: 10px;">图号</td> | 
|             <td align="center" colspan="2" | 
|                 style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;font-size: 10px;">{{this.imgNum}} | 
|             </td> | 
|         </tr> | 
|         <tr style="height: 20px"> | 
|             <td align="center" colspan="1" style="font-size: 10px;">规格</td> | 
|             <td align="center" colspan="2" | 
|                 style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;font-size: 10px;">{{this.specs}} | 
|             </td> | 
|             <td align="center" colspan="1" style="font-size: 10px;">材质</td> | 
|             <td align="center" colspan="2" | 
|                 style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;font-size: 10px;">{{this.material}} | 
|             </td> | 
|         </tr> | 
|         <tr style="height: 10px"> | 
|             <td align="center" colspan="1" style="font-size: 10px;">重量</td> | 
|             <td align="center" colspan="2" | 
|                 style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;font-size: 10px;">{{this.weight}} | 
|             </td> | 
|             <td align="center" colspan="1" style="font-size: 10px;">长宽高</td> | 
|             <td align="center" colspan="2" style="font-size: 10px;">{{this.length}}x{{this.width}}x{{this.height}} | 
|             </td> | 
|         </tr> | 
|     </table> | 
|     {{/each}} | 
| </script> | 
| <!-- 模板2 --> | 
| <script type="text/template" id="templatePreview2" class="template-barcode"> | 
|     {{#each data}} | 
|     <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> | 
|         <tr style="height: 35px"> | 
|             <td align="center" width="20%">商品</td> | 
|             <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.maktx}}</td> | 
|         </tr> | 
|         <tr style="height: 35px"> | 
|             <td align="center" width="20%">备注</td> | 
|             <td align="center" width="80%">{{this.memo}}</td> | 
|         </tr> | 
|         <tr style="height: 79px;"> | 
|             <td align="center" colspan="2" width="100%" style="border: none"> | 
|                 <img class="template-code" src="{{this.barcodeUrl}}" width="80%"> | 
|                 <div style="letter-spacing: 2px;margin-top: 1px; text-align: center"> | 
|                     <span>{{this.matnr}}</span> | 
|                 </div> | 
|             </td> | 
|         </tr> | 
|     </table> | 
|     {{/each}} | 
| </script> | 
| <!-- 模板3 --> | 
| <script type="text/template" id="templatePreview3" class="template-qrcode"> | 
|     {{#each data}} | 
|     <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> | 
|         <tr> | 
|             <th>商品</th> | 
|             <td colspan="2"><strong>{{this.maktx}}</strong></td> | 
|             <td colspan="3" rowspan="4" class="barcode-section" style="white-space: normal; "> | 
|                 <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" alt="Barcode Image"> | 
|                 <div><span >{{this.owner}}</span></div> | 
|             </td> | 
|         </tr> | 
|         <tr> | 
|             <th>批次</th> | 
|             <td colspan="2"><strong>{{this.batch}}</strong></td> | 
|         </tr> | 
|         <tr> | 
|             <th>重量</th> | 
|             <td colspan="2"><strong>{{this.anfme}}kg</strong></td> | 
|         </tr> | 
|         <tr> | 
|             <th>库位</th> | 
|             <td colspan="2"><strong>{{this.locNo}}</strong></td> | 
|         </tr> | 
|         <tr> | 
|             <th>品号</th> | 
|             <td colspan="5"><strong>{{this.matnr}}</strong></td> | 
|         </tr> | 
|     </table> | 
|     {{/each}} | 
| </script> | 
| </html> |