自动化立体仓库 - WMS系统
luxiaotao1123
2021-01-12 794941c21ec6a768a11e215c09ee2b0693a6fc64
src/main/webapp/views/matCode/matCode.html
@@ -6,21 +6,68 @@
    <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/cool.css" media="all">
    <link rel="stylesheet" href="/static/css/common.css" media="all">
    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
    <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">
    <style>
        #search-box {
            padding: 30px 30px 10px 30px;
        }
        #search-box .layui-inline {
            margin-right: 5px;
        }
        #data-search-btn {
            margin-top: 10px;
        }
        #data-search-btn.layui-btn-container .layui-btn {
            margin-right: 20px;
        }
        .btn-print {
            display: none;
        }
        #btn-print-batch {
            display: none;
        }
        .layui-btn-danger {
            background-color: lightsalmon;
            color: #333;
        }
        /* ------------------------- 打印表格 -----------------------  */
        .template-preview {
            height: 200px;
            display: inline-block;
        }
        .contain {
        }
        .contain td {
            border: 1px solid #000;
            /*line-height: 46px;*/
        }
    </style>
</head>
<body>
<!-- 搜索栏 -->
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <label class="layui-form-label">物料编码:</label>
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="mat_no" placeholder="请输入" autocomplete="off">
            <input class="layui-input" type="text" name="mat_no" placeholder="商品编号" autocomplete="off">
        </div>
    </div>
    <!-- 日期范围 -->
    <div class="layui-inline" style="width: 300px">
        <div class="layui-input-inline">
            <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off">
        </div>
    </div>
    <!-- 待添加 -->
    <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button>
@@ -34,21 +81,26 @@
</div>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-normal" id="btn-export" lay-event="exportData" style="float: inherit">导出</button>
        <button class="layui-btn " id="btn-into" lay-event="intoData">导入</button>
        <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-export" lay-event="exportData" style="float: inherit">导出</button>
        <button class="layui-btn layui-btn-sm" id="btn-into" lay-event="intoData">导入</button>
        <button class="layui-btn layui-btn-danger layui-btn-sm" id="btn-print-batch" lay-event="btnPrintBatch">批量打印</button>
        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>
        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>
    </div>
</script>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>
<!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a>-->
<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>-->
    <button class="layui-btn layui-btn-danger layui-btn-xs btn-print" lay-event="btnPrint">打印</button>
</script>
<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/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/matCode/matCode.js" charset="utf-8"></script>
<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/matCode/matCode.js" charset="utf-8"></script>
<iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe>
@@ -91,6 +143,178 @@
    </div>
</div>
<!-- 打印操作弹窗 -->
<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 layui-btn-danger" 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+"/macCode/code/auth?type=1&param=123");
    $('.template-qrcode').attr("src", baseUrl+"/macCode/code/auth?type=2&param=123");
</script>
<!-- 模板引擎 -->
<!-- 模板1 -->
<script type="text/template" id="templatePreview1" class="template-barcode">
    {{#each data}}
    <table class="contain" width="280" style="overflow: hidden;font-size: small;table-layout: fixed;">
        <tr style="height: 74px">
            <td align="center" colspan="3" scope="col">商品编号</td>
            <td align="center" class="barcode" colspan="9" scope="col">
                <img class="template-code" src="{{this.barcodeUrl}}" width="90%">
                <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
                    <span>{{this.matNo}}</span>
                </div>
            </td>
        </tr>
        <tr style="height: 74px">
            <td align="center" colspan="3">商品名称</td>
            <td align="center" colspan="5" style="overflow: hidden; white-space: nowrap;text-overflow: ellipsis;">{{this.matName}}</td>
            <td align="center" colspan="2">单位</td>
            <td align="center" colspan="2">{{this.str1}}</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.matName}}</td>
        </tr>
        <tr style="height: 35px">
            <td align="center" width="20%">物料单位</td>
            <td align="center" width="80%">{{this.str1}}</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.matNo}}</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 style="height: 74px" >
            <td align="center" scope="col" colspan="1">商品名称</td>
            <td align="center" scope="col" colspan="1" style="
                display: inline-block;
                line-height: 20px;
                vertical-align: middle;
                border: none;
                border-top: 1px solid #000;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 3;
                -webkit-box-orient: vertical;
                    ">
                {{this.matName}}
            </td>
            <td align="center" scope="col" colspan="2" rowspan="2">
                <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="80%">
                <div style="letter-spacing: 1px;margin-top: 1px; text-align: center">
                    <span>{{this.matNo}}</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;">{{this.str1}}</td>
        </tr>
    </table>
    {{/each}}
</script>
</body>
</html>