| | |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/visit") |
| | | public void visit(HttpServletResponse response) { |
| | | @RequestMapping("/pda") |
| | | public void pda(HttpServletResponse response) { |
| | | try{ |
| | | response.sendRedirect(contextPath+"/views/visit/index.html"); |
| | | response.sendRedirect(contextPath+"/views/pda/login.html"); |
| | | } catch (Exception ex){ |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return R.ok(matService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matCode/auth") |
| | | @ManagerAuth |
| | | public R find(@RequestParam("matnr") String matnr) { |
| | | return R.ok(matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
New file |
| | |
| | | * { |
| | | font-family: microsoft yahei,serif; |
| | | margin: 0; |
| | | padding: 0; |
| | | box-sizing: border-box; |
| | | -webkit-box-sizing: border-box; |
| | | -moz-box-sizing: border-box; |
| | | font-size: 16px; |
| | | } |
| | | html { |
| | | height: 100%; |
| | | background-color: #f1f1f1; |
| | | padding: 5px; |
| | | } |
| | | body { |
| | | height: 100%; |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | padding: 5px; |
| | | position: relative; |
| | | } |
| | | |
| | | /* 头部 */ |
| | | header { |
| | | padding: 5px 0; |
| | | } |
| | | .layui-form-label { |
| | | width: initial; |
| | | padding: 6px 10px; |
| | | line-height: 30px; |
| | | } |
| | | #code { |
| | | width: 70%; |
| | | height: 40px; |
| | | } |
| | | header button { |
| | | height: 20px; |
| | | width: 70px; |
| | | } |
| | | #mat-btn:focus { |
| | | } |
| | | |
| | | /* layer */ |
| | | .layui-layer-title { |
| | | font-size: 11px; |
| | | height: 20px; |
| | | line-height: 20px; |
| | | } |
| | | |
| | | /* 主体 */ |
| | | main { |
| | | height: 235px; |
| | | overflow: auto; |
| | | } |
| | | .layui-table, .layui-table-view { |
| | | margin: 0; |
| | | } |
| | | .layui-table-view .layui-table td, .layui-table-view .layui-table th { |
| | | padding: 0; |
| | | } |
| | | .layui-table-cell { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | padding: 0; |
| | | } |
| | | .layui-table-grid-down { |
| | | display: none; |
| | | } |
| | | .layui-table-body .layui-none { |
| | | /*height: 144px;*/ |
| | | } |
| | | /* 尾部 */ |
| | | footer { |
| | | margin-top: 20px; |
| | | width: 100%; |
| | | } |
| | | .layui-btn-container .layui-btn { |
| | | margin-left: 10px; |
| | | margin-bottom: 2px; |
| | | } |
| | | #tips { |
| | | display: inline-block; |
| | | width: 90px; |
| | | color: #666; |
| | | margin-left: 5px; |
| | | margin-bottom: 5px; |
| | | vertical-align: middle; |
| | | overflow:hidden; |
| | | white-space:nowrap; |
| | | text-overflow:ellipsis; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .layui-btn-primary:hover { |
| | | border-color: #C9C9C9 |
| | | } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>组托</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">托盘码</label> |
| | | <input class="layui-input" type="text" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div style="margin: 5px 5px"> |
| | | <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>提取</button> |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" style="margin-left: 20px">组托</button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | var tableIns; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | window.onload = function(){document.getElementById("code").focus();} |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#mat-btn').focus(); |
| | | getMat(); |
| | | } |
| | | } |
| | | |
| | | var matCodeLayerIdx; |
| | | function getMat() { |
| | | matCodeLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '提取物料', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '80%'], |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | | }, |
| | | end: function () { |
| | | $('#mat-btn').focus(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | function addTableData(data) { |
| | | if (isEmpty(data.matName)){ |
| | | tips("提取失败", true); |
| | | return; |
| | | } |
| | | let toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data.matNo === matData[j].matNo) { |
| | | matData[j].count = Number(matData[j].count) + Number(data.count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data); |
| | | } |
| | | tips("提取成功"); |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#code').val(""); |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 组托 |
| | | function comb() { |
| | | let barcode = $('#code').val(); |
| | | if (isEmpty(barcode)) { |
| | | tips("托盘条码为空", true); |
| | | // document.getElementById("code").focus(); |
| | | return; |
| | | } |
| | | if (barcode.length !== 7) { |
| | | tips("条码必须为7位", true); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | | tips("请提取物料", true); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/mobile/comb/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | combMats: matData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | // var tips = $('#tips'); |
| | | // tips.html(msg); |
| | | // tips.css("color", warn?"red":'#666'); |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | $("#code").val(""); |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>组托</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .number-tool { |
| | | margin-left: 10px; |
| | | padding: 1px 0 1px 5px; |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | | font-size: 16px; |
| | | height: 25px; |
| | | float: left; |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | | float: left; |
| | | margin: 0 5px; |
| | | width: 50px; |
| | | padding: 0; |
| | | } |
| | | #confirm { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | font-weight: 600; |
| | | } |
| | | #remove { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | color: darkred; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline" style="margin-top: 5px"> |
| | | <label class="layui-form-label">单号</label> |
| | | <input class="layui-input" id="billNo" onkeyup="find(this)" placeholder="扫码 / 输入" autocomplete="off" style="width: 75%; height: 40px; margin-right: 0;"> |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" style="margin-left: 20px">组托</button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; text-align: center;padding-top: 10px"> |
| | | <div class="form-item"> |
| | | <span>物料</span> |
| | | <input id="matNo" type="text" disabled="disabled" style="width: 70%"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>名称</span> |
| | | <input id="matName" type="text" disabled="disabled" style="width: 70%"> |
| | | </div> |
| | | <div class="form-item" style="margin-top: 5px"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button><input id="count" type="number"><button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | </body> |
| | | <script> |
| | | window.onload = function(){document.getElementById("code").focus();} |
| | | var tableIns; |
| | | var countLayer; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', event: 'modify', style:'cursor: pointer;color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'modify': |
| | | countLayer = layer.open({ |
| | | type: 1, |
| | | offset: '20px', |
| | | title: '修改数量', |
| | | shadeClose: true, |
| | | area: ['80%', '200px'], |
| | | content: $("#modify"), |
| | | success: function (layero, index) { |
| | | $('#matNo').val(data.matNo); |
| | | $('#matName').val(data.matName); |
| | | $('#count').val(data.count); |
| | | maxCount = data.count; |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#billNo').focus(); |
| | | } |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++) { |
| | | var toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data[i].matNo === matData[j].matNo) { |
| | | matData[j].count = Number(matData[j].count) + Number(data[i].count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data[i]); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | $("#comb-btn").focus(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据通知单号查询物料详情 |
| | | */ |
| | | function find(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | billNo: el.value |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | addTableData(res.data); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /************************************* 数量 ****************************************/ |
| | | var countDom = $('#count'); |
| | | var minCount = 1; |
| | | var maxCount = 1; |
| | | function add() { |
| | | if (countDom.val() >= maxCount) { |
| | | return; |
| | | } |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | function reduce() { |
| | | if (countDom.val() <= minCount) { |
| | | return; |
| | | } |
| | | countDom.val(countDom.val() - 1); |
| | | } |
| | | |
| | | // 修改数量 |
| | | function confirm(){ |
| | | var matNo = $('#matNo').val(); |
| | | var count = $('#count').val(); |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (matNo === matData[j].matNo) { |
| | | if (count > maxCount || count < minCount) { |
| | | tips("数量不能超过范围", true); |
| | | return; |
| | | } |
| | | matData[j].count = Number(count); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | layer.close(countLayer); |
| | | tips("修改成功"); |
| | | } |
| | | |
| | | // 移除物料 |
| | | function remove() { |
| | | var matNo = $('#matNo').val(); |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (matNo === matData[j].matNo) { |
| | | matData.splice(j, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | layer.close(countLayer); |
| | | tips("移除成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#code').val(""); |
| | | $('#billNo').val(""); |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 组托 |
| | | function comb() { |
| | | var barcode = $('#code').val(); |
| | | if (isEmpty(barcode)) { |
| | | tips("托盘条码为空", true); |
| | | // document.getElementById("code").focus(); |
| | | return; |
| | | } |
| | | if (barcode.length !== 7) { |
| | | tips("条码必须为7位", true); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | | tips("请提取物料", true); |
| | | return; |
| | | } |
| | | var billNo = $('#billNo').val(); |
| | | $.ajax({ |
| | | url: baseUrl+"/mobile/comb/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | combMats: matData, |
| | | billNo: billNo |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | $("#code").val(""); |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>PDA首页</title> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <style> |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | box-sizing: border-box; |
| | | -webkit-box-sizing: border-box; |
| | | -moz-box-sizing: border-box; |
| | | } |
| | | html { |
| | | height: 100%; |
| | | /*line-height: 1.5;*/ |
| | | } |
| | | body { |
| | | height: 100%; |
| | | /*overflow: hidden;*/ |
| | | } |
| | | |
| | | /* 导航 */ |
| | | .nav { |
| | | background-color: #fff; /*todo*/ |
| | | color: #000; |
| | | list-style-type: none; |
| | | position: fixed; |
| | | width: 100%; |
| | | overflow: hidden; |
| | | box-shadow: 0 1px 2px 0 rgba(0,0,0,.1) |
| | | } |
| | | .nav li { |
| | | float: left; |
| | | border-right: 1px solid #f1f1f1; /*todo*/ |
| | | } |
| | | .nav li a { |
| | | font-size: 20px; |
| | | letter-spacing: 1px; |
| | | display: block; |
| | | text-decoration: none; |
| | | padding: 3px 10px; |
| | | text-align: center; |
| | | /*transform:scale(1.5);*/ |
| | | /*-webkit-transform:scale(1.5);*/ |
| | | /*-moz-transform:scale(1.5);*/ |
| | | } |
| | | .nav li a:hover { |
| | | color: #000; |
| | | } |
| | | .nav-unselect { |
| | | color: #666; |
| | | } |
| | | .nav-select { |
| | | background-color: #f1f1f1; /*todo*/ |
| | | color: #000; |
| | | } |
| | | |
| | | /* 主体 */ |
| | | #content { |
| | | padding-top: 32px; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | iframe { |
| | | border-width: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 导航栏 --> |
| | | <ul class="nav"> |
| | | <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">组托</a></li> |
| | | <li><a id="combPro" onclick="nav(this.id)" class="nav-unselect" href="#">关联组托</a></li> |
| | | <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li> |
| | | <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li> |
| | | </ul> |
| | | |
| | | <!-- 主体内容 --> |
| | | <iframe id="content" src="comb.html"></iframe> |
| | | |
| | | </body> |
| | | <script> |
| | | // 导航栏 |
| | | function nav(id) { |
| | | $('.nav-select').attr("class", "nav-unselect"); |
| | | $('#'+id).attr("class", "nav-select"); |
| | | $('#content').attr("src", id+".html"); |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>库存明细详情</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .form-box { |
| | | padding: 15px 5px 5px 5px; |
| | | font-size: 16px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .form-box span { |
| | | display: inline-block; |
| | | text-align: right; |
| | | width: 70px; |
| | | } |
| | | .form-box input { |
| | | width: 120px; |
| | | margin-left: 10px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow:hidden; |
| | | white-space:nowrap; |
| | | text-overflow:ellipsis; |
| | | } |
| | | |
| | | .number-tool { |
| | | margin-left: 10px; |
| | | padding: 1px 0 1px 5px; |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | | font-size: 16px; |
| | | height: 25px; |
| | | float: left; |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | | float: left; |
| | | margin: 0 5px; |
| | | width: 40px; |
| | | padding: 0; |
| | | } |
| | | |
| | | .form-button { |
| | | margin: 5px 10px 0 10px; |
| | | padding: 5px 15px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <span>库位号</span> |
| | | <input id="locNo" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料编码</span> |
| | | <input id="matnr" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料名称</span> |
| | | <input id="maktx" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <!-- <button onclick="add()">+</button>--> |
| | | </div> |
| | | </div> |
| | | <button class="form-button" id="save" onclick="save()">保存</button> |
| | | <button class="form-button" id="remove" onclick="remove()">移除</button> |
| | | </div> |
| | | </body> |
| | | <script> |
| | | var countDom = $('#count'); |
| | | |
| | | function save() { |
| | | console.log(countDom.val()) |
| | | if (countDom.val() < 1) { |
| | | return; |
| | | } |
| | | parent.updateTableData({ |
| | | locNo: $('#locNo').val(), |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | count: countDom.val() |
| | | }) |
| | | parent.layer.closeAll(); |
| | | } |
| | | |
| | | function remove() { |
| | | parent.removeTableData({ |
| | | locNo: $('#locNo').val(), |
| | | matnr: $('#matnr').val(), |
| | | }) |
| | | parent.layer.closeAll(); |
| | | } |
| | | |
| | | function add() { |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | function reduce() { |
| | | if (countDom.val() <= 1) { |
| | | return; |
| | | } |
| | | countDom.val(countDom.val() - 1); |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>系统登录</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <script type="text/javascript" src="../../static/layui/layui.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <style> |
| | | html{ |
| | | height: 100%; |
| | | overflow: hidden; |
| | | } |
| | | body.login-bg { |
| | | color: #777; |
| | | height: 100%; |
| | | background-image: linear-gradient(to right, #ff9569 0%, #e92758 100%); |
| | | /*background-image: linear-gradient(-90deg, #29bdd9 0%, #276ace 100%);*/ |
| | | /*background: -webkit-linear-gradient(red, blue); !* Safari 5.1 - 6.0 *!;*/ |
| | | /*background-image: url("../static/image/login_bg.jpg");*/ |
| | | /*background-repeat: no-repeat;*/ |
| | | /*background-size: cover;*/ |
| | | /*background-position: top center;*/ |
| | | } |
| | | |
| | | #login-wrapper { |
| | | box-sizing:border-box; |
| | | background: #fff; |
| | | height: 100%; |
| | | padding: 100px 60px; |
| | | text-align: center; |
| | | overflow: hidden; |
| | | } |
| | | #login-wrapper h1 { |
| | | font-weight: bolder; |
| | | margin-bottom: 20px; |
| | | letter-spacing: 5px; |
| | | /*transform:scale(3);*/ |
| | | /*-webkit-transform:scale(3);*/ |
| | | /*-moz-transform:scale(3);*/ |
| | | } |
| | | .layui-form-item { |
| | | margin-bottom: 15px; |
| | | position: relative; |
| | | } |
| | | .layui-form-item .layui-input { |
| | | height: 40px; |
| | | padding-left: 20px; |
| | | font-size: 16px; |
| | | border: 1px solid #767676; |
| | | color: inherit; |
| | | border-radius: 3px; |
| | | transition: 0.3s; |
| | | } |
| | | .layui-input:hover, .layui-textarea:hover { |
| | | border-color: #0767aa !important; |
| | | border-width: 1.5px; |
| | | } |
| | | .login-submit { |
| | | margin-top: 20px; |
| | | } |
| | | #login-button { |
| | | background-color: #0767aa; |
| | | width: 50%; |
| | | font-size: 14px; |
| | | font-weight: bolder; |
| | | border-radius: 5px; |
| | | height: 40px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body class="login-bg"> |
| | | |
| | | <div id="login-wrapper"> |
| | | <header> |
| | | <h1>系统登录</h1> |
| | | </header> |
| | | <div class="layui-form layadmin-user-login-body"> |
| | | <div class="layui-form-item"> |
| | | <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" placeholder="账号" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <input id="password" class="layui-input" type="password" name="password" lay-verify="password" placeholder="密码" autocomplete="off"> |
| | | </div> |
| | | <!-- <div class="layui-form-item" style="text-align: right;padding-left: 3px;">--> |
| | | <!-- <input id="rememberPwd" style="vertical-align: middle" type="checkbox" lay-skin='primary' lay-filter="remPwd" title="记住密码" checked="checked">--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <div class="layui-form-item login-submit"> |
| | | <button id="login-button" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">登 录</button> |
| | | </div> |
| | | </div> |
| | | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript"> |
| | | |
| | | layui.use(['form','layer'],function () { |
| | | var form = layui.form, |
| | | layer = layui.layer, |
| | | $ = layui.jquery; |
| | | |
| | | form.on('submit(login)', function (data) { |
| | | var mobile = $("#mobile").val(); |
| | | if (mobile === "") { |
| | | layer.msg("请输入账号", {icon: 2}) |
| | | $("#mobile").focus(); |
| | | return; |
| | | } |
| | | var password = $("#password").val(); |
| | | if (password === "") { |
| | | layer.msg("请输入密码", {icon: 2}) |
| | | $("#password").focus(); |
| | | return; |
| | | } |
| | | |
| | | var user = { |
| | | username: mobile, |
| | | password: hex_md5(password) |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/login.action", |
| | | data: user, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("登录成功", {icon: 1}) |
| | | localStorage.setItem("token", res.data.token); |
| | | localStorage.setItem("username", res.data.username); |
| | | window.location.href = "index.html"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#login-button").click(); |
| | | } else if (event.keyCode === 115) { |
| | | $("#login-button").click(); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>物料提取</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .form-box { |
| | | padding: 15px 5px 5px 5px; |
| | | font-size: 16px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .form-box span { |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | width: 70px; |
| | | } |
| | | .form-box input { |
| | | width: 120px; |
| | | margin-left: 10px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow:hidden; |
| | | white-space:nowrap; |
| | | text-overflow:ellipsis; |
| | | } |
| | | #confirm { |
| | | margin-top: 10px; |
| | | padding: 5px 20px; |
| | | } |
| | | |
| | | .number-tool { |
| | | margin-left: 10px; |
| | | padding: 1px 0 1px 5px; |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | | font-size: 16px; |
| | | height: 25px; |
| | | float: left; |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | | float: left; |
| | | margin: 0 5px; |
| | | width: 40px; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <span>物料编码</span> |
| | | <input id="matNo" type="text" placeholder="扫码 / 输入" onkeyup="find(this)" autocomplete="off"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料名称</span> |
| | | <input id="matName" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料规格</span> |
| | | <input id="str2" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>单位</span> |
| | | <input id="str1" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button><input id="count" type="number"><button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="confirm" onclick="confirm()">提取</button> |
| | | </div> |
| | | |
| | | </body> |
| | | <script> |
| | | var countDom = $('#count'); |
| | | var initMatCount = 1; |
| | | var pageCurr; |
| | | |
| | | /** |
| | | * 根据物料编码查询物料详情 |
| | | */ |
| | | function find(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/matCode/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | matnr: el.value |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | $('#matName').val(res.data.matName); |
| | | $('#str1').val(res.data.str1); |
| | | $('#str2').val(res.data.str2); |
| | | countDom.val(initMatCount); |
| | | $('#count').focus().select(); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | alert(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 提取 |
| | | */ |
| | | function confirm(){ |
| | | var data = { |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | count: countDom.val() |
| | | }; |
| | | parent.addTableData(data); |
| | | parent.layer.close(parent.matCodeLayerIdx); |
| | | } |
| | | |
| | | window.onload = function(){document.getElementById("matNo").focus();} |
| | | $(document).on('click','#confirm', function () { |
| | | }) |
| | | |
| | | // $('body').keydown(function () { |
| | | // if (event.keyCode === 13) { |
| | | // $("#confirm").click(); |
| | | // } |
| | | // }); |
| | | |
| | | function add() { |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | function reduce() { |
| | | if (countDom.val() <= initMatCount) { |
| | | return; |
| | | } |
| | | countDom.val(countDom.val() - 1); |
| | | } |
| | | |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | confirm(); |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>入库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .site-list { |
| | | padding: 2px 0; |
| | | height: 22px; |
| | | margin-bottom: 5px; |
| | | } |
| | | .site-list label { |
| | | padding-right: 15px; |
| | | } |
| | | .site-list label span { |
| | | vertical-align: middle; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .cool-checkbox:checked { |
| | | background:#1673ff |
| | | } |
| | | .cool-checkbox { |
| | | width:15px; |
| | | height:15px; |
| | | background-color:#ffffff; |
| | | border:solid 1px #dddddd; |
| | | -webkit-border-radius:50%; |
| | | border-radius:50%; |
| | | font-size:15px; |
| | | margin:0 5px 0 0; |
| | | padding:0; |
| | | position:relative; |
| | | display:inline-block; |
| | | vertical-align:middle; |
| | | cursor:default; |
| | | -webkit-appearance:none; |
| | | -webkit-user-select:none; |
| | | user-select:none; |
| | | -webkit-transition:background-color ease 0.1s; |
| | | transition:background-color ease 0.1s; |
| | | } |
| | | .cool-checkbox:checked::after { |
| | | content:''; |
| | | top:3px; |
| | | left:3px; |
| | | position:absolute; |
| | | background:transparent; |
| | | border:#fff solid 2px; |
| | | border-top:none; |
| | | border-right:none; |
| | | height:3px; |
| | | width:6px; |
| | | -moz-transform:rotate(-45deg); |
| | | -ms-transform:rotate(-45deg); |
| | | -webkit-transform:rotate(-45deg); |
| | | transform:rotate(-45deg); |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div style="margin: 5px 5px" class="layui-form"> |
| | | <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>提取</button> |
| | | <!-- 入库口 --> |
| | | <div class="layui-inline" style="width: 120px; margin-left: 15px"> |
| | | <select id="putSiteSelect"> |
| | | <option value="">入库口</option> |
| | | </select> |
| | | </div> |
| | | |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button id="empty-pakin" type="button" class="layui-btn layui-btn-normal" onclick="emptyPakIn()" style="margin-left: 15px">空板入库</button> |
| | | <button id="pakin" type="button" class="layui-btn layui-btn-normal" onclick="pakIn()" style="margin-left: 15px">入库</button> |
| | | </div> |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | var tableIns; |
| | | window.onload = function(){ |
| | | document.getElementById("code").focus(); |
| | | getInBound(); |
| | | } |
| | | |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#mat-btn').focus(); |
| | | getMat(); |
| | | } |
| | | } |
| | | |
| | | // 获取入库口 |
| | | function getInBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/put/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#putSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#putSiteSelect').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/pda"; |
| | | }else { |
| | | tips("获取入库口失败", true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 提取物料 |
| | | var matCodeLayerIdx; |
| | | function getMat() { |
| | | matCodeLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '物料', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '80%'], |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | | }, |
| | | end: function () { |
| | | $('#mat-btn').focus(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | function addTableData(data) { |
| | | if (isEmpty(data.matName)){ |
| | | tips("提取失败", true); |
| | | return; |
| | | } |
| | | let toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data.matNo === matData[j].matNo) { |
| | | matData[j].count = Number(matData[j].count) + Number(data.count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data); |
| | | } |
| | | tips("提取成功"); |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#code').val(""); |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | $('#putSiteSelect').val(""); |
| | | layui.form.render('select'); |
| | | // tips(""); |
| | | } |
| | | |
| | | // 入库 |
| | | function pakIn() { |
| | | var barcode = $('#code').val(); |
| | | if (isEmpty(barcode)) { |
| | | tips("托盘条码为空", true); |
| | | return; |
| | | } |
| | | if (barcode.length !== 7) { |
| | | tips("条码必须为7位", true); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | | tips("请提取物料", true); |
| | | return; |
| | | } |
| | | // var site = $('input:radio[name="site"]:checked').next("span").html(); |
| | | var site = $('#putSiteSelect').val(); |
| | | if (null === site || undefined === site || site === "") { |
| | | tips("请选择入库口", true); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/full/store/put/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | devpNo: site, |
| | | list: matData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("入库启动成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 空板入库 |
| | | function emptyPakIn() { |
| | | var barcode = $('#code').val(); |
| | | if (isEmpty(barcode)) { |
| | | tips("托盘条码为空", true); |
| | | return; |
| | | } |
| | | if (barcode.length !== 7) { |
| | | tips("条码必须为7位", true); |
| | | return; |
| | | } |
| | | var site = $('#putSiteSelect').val(); |
| | | if (null === site || undefined === site || site === "") { |
| | | tips("请选择入库口", true); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/empty/plate/in/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | barcode: barcode, |
| | | sourceStaNo: site |
| | | }, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("空板入库启动成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | // let tips = $('#tips'); |
| | | // tips.html(msg); |
| | | // tips.css("color", warn?"red":'#666'); |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#pakin").focus(); |
| | | pakIn(); |
| | | } else if (key === 113) { |
| | | $("#code").val(""); |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | <script type="text/template" id="putSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>入库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .site-list { |
| | | padding: 2px 0; |
| | | height: 22px; |
| | | margin-bottom: 5px; |
| | | } |
| | | .site-list label { |
| | | padding-right: 15px; |
| | | } |
| | | .site-list label span { |
| | | vertical-align: middle; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .cool-checkbox:checked { |
| | | background:#1673ff |
| | | } |
| | | .cool-checkbox { |
| | | width:15px; |
| | | height:15px; |
| | | background-color:#ffffff; |
| | | border:solid 1px #dddddd; |
| | | -webkit-border-radius:50%; |
| | | border-radius:50%; |
| | | font-size:15px; |
| | | margin:0 5px 0 0; |
| | | padding:0; |
| | | position:relative; |
| | | display:inline-block; |
| | | vertical-align:middle; |
| | | cursor:default; |
| | | -webkit-appearance:none; |
| | | -webkit-user-select:none; |
| | | user-select:none; |
| | | -webkit-transition:background-color ease 0.1s; |
| | | transition:background-color ease 0.1s; |
| | | } |
| | | .cool-checkbox:checked::after { |
| | | content:''; |
| | | top:3px; |
| | | left:3px; |
| | | position:absolute; |
| | | background:transparent; |
| | | border:#fff solid 2px; |
| | | border-top:none; |
| | | border-right:none; |
| | | height:3px; |
| | | width:6px; |
| | | -moz-transform:rotate(-45deg); |
| | | -ms-transform:rotate(-45deg); |
| | | -webkit-transform:rotate(-45deg); |
| | | transform:rotate(-45deg); |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline" style="margin-top: 20px"> |
| | | <label class="layui-form-label">成品</label> |
| | | <input class="layui-input" type="number" id="matCode" placeholder="扫码 / 输入" autocomplete="off" style="width: 75%; height: 40px; margin-right: 0;"> |
| | | </div> |
| | | <div style="margin-top: 20px" class="layui-form"> |
| | | <label class="layui-form-label">入库口</label> |
| | | <!-- 入库口 --> |
| | | <div class="layui-inline" style="width: 120px; margin-left: 15px"> |
| | | <select id="putSiteSelect"> |
| | | <option value="">入库口</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <!--<main>--> |
| | | <!-- <table class="layui-table" id="chooseData" lay-filter="chooseData"></table>--> |
| | | <!--</main>--> |
| | | <!-- 尾部 --> |
| | | <footer style="margin-top: 30px"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button id="pakin" type="button" class="layui-btn layui-btn-normal" onclick="pakIn()" style="margin-left: 15px">入库</button> |
| | | </div> |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | window.onload = function(){ |
| | | document.getElementById("code").focus(); |
| | | getInBound(); |
| | | } |
| | | |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | |
| | | }); |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#matCode').focus(); |
| | | } |
| | | } |
| | | |
| | | // 获取入库口 |
| | | function getInBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/put/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#putSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#putSiteSelect').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/pda"; |
| | | }else { |
| | | tips("获取入库口失败", true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#code').val(""); |
| | | $('#matCode').val(""); |
| | | $('#putSiteSelect').val(""); |
| | | layui.form.render('select'); |
| | | // tips(""); |
| | | } |
| | | |
| | | // 入库 |
| | | function pakIn() { |
| | | var barcode = $('#code').val(); |
| | | var matCode = $('#matCode').val(); |
| | | if (isEmpty(barcode)) { |
| | | tips("托盘条码为空", true); |
| | | return; |
| | | } |
| | | if (barcode.length !== 7) { |
| | | tips("条码必须为7位", true); |
| | | return; |
| | | } |
| | | if (isEmpty(matCode)) { |
| | | tips("成品码为空", true); |
| | | return; |
| | | } |
| | | // var site = $('input:radio[name="site"]:checked').next("span").html(); |
| | | var site = $('#putSiteSelect').val(); |
| | | if (null === site || undefined === site || site === "") { |
| | | tips("请选择入库口", true); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/full/store/put/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | devpNo: site, |
| | | productCode: matCode |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("入库启动成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | // let tips = $('#tips'); |
| | | // tips.html(msg); |
| | | // tips.css("color", warn?"red":'#666'); |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#pakin").focus(); |
| | | pakIn(); |
| | | } else if (key === 113) { |
| | | $("#code").val(""); |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | <script type="text/template" id="putSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>出库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.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/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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .layui-input-block { |
| | | margin-left: 60px; |
| | | } |
| | | main { |
| | | height: 200px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库位</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="number" id="locNo" onkeyup="findByLocNo(this)" autocomplete="off"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">物料</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="text" id="matNo" onkeyup="findByMatNo(this)" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">出库口</label> |
| | | <div class="layui-input-inline" style="margin-left: 5px;width: 120px"> |
| | | <select id="staNoSelect"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </header> |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="dataByLoc" lay-filter="dataByLoc"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button id="reset" type="button" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button id="pakOut" type="button" class="layui-btn layui-btn-normal" onclick="pakOut()" style="margin-left: 20px">出库</button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | |
| | | window.onload = function(){ |
| | | document.getElementById("locNo").focus(); |
| | | getOutBound(); |
| | | } |
| | | |
| | | /** |
| | | * 根据库位号查找库存明细 |
| | | */ |
| | | function findByLocNo(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $("#matNo").val(""); |
| | | find(el.value, null); |
| | | } |
| | | |
| | | /** |
| | | * 根据物料号查找库存明细 |
| | | */ |
| | | function findByMatNo(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $("#locNo").val(""); |
| | | find(null, el.value); |
| | | } |
| | | function find(locNo, matNo) { |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/locDetl", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | locNo: locNo, |
| | | matNo: matNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | locDetlData = res.data; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | $('#pakOut').focus(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 表格 |
| | | var locDetlData = []; |
| | | var tableIns; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | id: 'tableIdx', |
| | | elem: '#dataByLoc', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left', width:30}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(dataByLoc)', function(obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库存明细', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '70%'], |
| | | content: 'locDetlIframe.html', |
| | | success: function(layero, index){ |
| | | // 设置弹窗样式 |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | | // 注入值 |
| | | let el = layer.getChildFrame('.form-box', index); |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | } |
| | | }, |
| | | end: function () { |
| | | $('#pakOut').focus(); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/pda"; |
| | | }else { |
| | | tips("获取出库口失败", true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 出库 |
| | | function pakOut() { |
| | | var tableData = layui.table.checkStatus('tableIdx').data; |
| | | if (tableData.length === 0) { |
| | | tips("请选择物料", true); |
| | | return; |
| | | } |
| | | var site = $('#staNoSelect').val(); |
| | | if (null === site || undefined === site || site === "") { |
| | | tips("请选择出库口", true); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | outSite: site, |
| | | locDetls: tableData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("启动出库成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 修改表格数据 |
| | | function updateTableData(data) { |
| | | for (var i=0;i<locDetlData.length;i++) { |
| | | if (data.matnr === locDetlData[i].matnr && data.locNo === locDetlData[i].locNo) { |
| | | locDetlData[i].count = data.count; |
| | | break |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | // 删除表格行 |
| | | function removeTableData(data) { |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $("#matNo").val(""); |
| | | $("#locNo").val(""); |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | $('#staNoSelect').val(""); |
| | | layui.form.render('select'); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色var字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#pakOut").focus(); |
| | | pakOut(); |
| | | } else if (key === 113) { |
| | | $("#locNo").val(""); |
| | | $("#locNo").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{siteId}}">{{desc}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </html> |