| | |
| | | // Page<ManLocDetl> page = manLocDetlService.getPage(manLocDetlPage); |
| | | return R.ok(outPage); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public R initPakout(@RequestBody List<InitPakoutParam> params) { |
| | | return nodeService.initPakout(params, getUserId(), getHostId()); |
| | | } |
| | | |
| | | @PostMapping(value = "/work/empty/stock") |
| | | public R getGroupEmptyStock(@RequestParam(required = false) String sourceLocNo) { |
| | | List<Node> allEmptys = nodeService.selectList(new EntityWrapper<Node>() |
| | | .eq("type","3")); |
| | | return R.ok().add(allEmptys); |
| | | } |
| | | @RequestMapping("/work/move/start") |
| | | @ManagerAuth(memo = "库位移转") |
| | | public R locMoveStart(@RequestParam String sourceLocNo, |
| | | @RequestParam String targetLocNo) { |
| | | nodeService.locMove(sourceLocNo, targetLocNo, getUserId()); |
| | | return R.ok("移库启动成功"); |
| | | } |
| | | } |
| | |
| | | R stockPakin(PakinParam number, Long userId, Long hostId); |
| | | |
| | | R initPakout(List<InitPakoutParam> params, Long userId, Long hostId); |
| | | |
| | | void locMove(String sourceLocNo, String targetLocNo, Long userId); |
| | | } |
| | |
| | | } |
| | | return R.ok("出库成功"); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void locMove(String sourceLocNo, String targetLocNo, Long userId) { |
| | | List<ManLocDetl> targets = manLocDetlService.selectList(new EntityWrapper<ManLocDetl>() |
| | | .like("loc_no", sourceLocNo)); |
| | | for (ManLocDetl target : targets) { |
| | | Node uuid = nodeService.selectOne(new EntityWrapper<Node>() |
| | | .eq("uuid", targetLocNo)); |
| | | if (uuid == null || uuid.equals("")) { |
| | | throw new RuntimeException("无法查询到移库的目标库位"); |
| | | } |
| | | manLocDetlService.deleteById(target); |
| | | target.setLocNo(uuid.getUuid()); |
| | | target.setNodeId(uuid.getId()); |
| | | manLocDetlService.insert(target); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | var pageCurr = 0; |
| | | var tableIns; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var form = layui.form; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locMatCode', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | // url: baseUrl+'/locDetl/list/auth', |
| | | data:[], |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 50, 100, 200, 500], |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | clearSelect(); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 搜索库位物料 |
| | | function getLoc(el) { |
| | | tableIns.reload({ |
| | | url: baseUrl+'/manLocDetl/list' |
| | | , where: {loc_no: el.value} |
| | | , done:function (res) { |
| | | limit(); |
| | | clearSelect(); |
| | | // 获取同一堆垛机的空库位 |
| | | http.post(baseUrl + "/work/empty/stock", {sourceLocNo: el.value}, function (res) { |
| | | if (res.data != null) { |
| | | var tpl = $("#emptyLocStock").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#targetLocNo').append(html); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 移库启动 |
| | | function locMove() { |
| | | var sourceLocNo = $("#sourceLocNo").val(); |
| | | var targetLocNo = $("#targetLocNo").val(); |
| | | if (sourceLocNo === null || sourceLocNo === ""){ |
| | | $("#sourceLocNo").css("border-color", "red"); |
| | | setTimeout(function () { |
| | | $("#sourceLocNo").css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | layer.msg("请输入源库位"); |
| | | return; |
| | | } |
| | | if (targetLocNo === null || targetLocNo === "") { |
| | | $(".layui-select-title .layui-input").css("border-color", "red"); |
| | | setTimeout(function () { |
| | | $(".layui-select-title .layui-input").css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | layer.msg("请输入目标库位"); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/work/move/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | data: { |
| | | sourceLocNo: sourceLocNo, |
| | | targetLocNo: targetLocNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | $("#sourceLocNo").val(""); |
| | | $("#targetLocNo").empty(); |
| | | layui.form.render('select'); |
| | | tableIns.reload({ |
| | | data: [], |
| | | url: '', |
| | | done:function (res) { |
| | | limit();clearSelect(); |
| | | } |
| | | }); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function clearSelect() { |
| | | $("#targetLocNo").empty(); |
| | | layui.form.render('select'); |
| | | } |
New file |
| | |
| | | <!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"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | box-sizing: border-box; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | padding-bottom: 20px; |
| | | } |
| | | .function-area { |
| | | padding: 50px 80px 50px 70px; |
| | | display: inline-block; |
| | | } |
| | | .cool-auto-complete-div { |
| | | height: 40px; |
| | | border-radius: 5px; |
| | | border: 1px solid #b8b8b8; |
| | | color: #888; |
| | | box-shadow: inset 0 1px 2px #ECECEC; |
| | | -moz-box-shadow: inset 0 1px 2px #ECECEC; |
| | | -webkit-box-shadow: inset 0 1px 2px #ECECEC; |
| | | } |
| | | |
| | | .function-btn { |
| | | margin-left: 15px; |
| | | background: #E27575; |
| | | border: none; |
| | | padding: 10px 25px 10px 25px; |
| | | color: #FFF; |
| | | box-shadow: 1px 1px 5px #B6B6B6; |
| | | border-radius: 3px; |
| | | text-shadow: 1px 1px 1px #9E3F3F; |
| | | cursor: pointer; |
| | | } |
| | | .function-btn:hover { |
| | | opacity: 0.8 |
| | | } |
| | | |
| | | .layui-layer-lan .layui-layer-btn a { |
| | | background: #4476A7; |
| | | border-color: #4476A7; |
| | | color: #fff; |
| | | } |
| | | .layui-layer-lan .layui-layer-btn .layui-layer-btn1 { |
| | | background: #fff; |
| | | color: #333; |
| | | border-color: #E9E7E7; |
| | | } |
| | | .layui-layer-lan .layui-layer-btn .layui-layer-btn1:hover { |
| | | background-color: #f7f7f7; |
| | | } |
| | | |
| | | #loc-move-btn { |
| | | /*display: none;*/ |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="function-area layui-form"> |
| | | <!-- 源库位 --> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input id="sourceLocNo" class="layui-input" onkeyup="getLoc(this)" type="text" placeholder="源库位" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-mid" style="float: none; display: inline-block; margin-left: 10px">-</div> |
| | | <div class="layui-input-inline"> |
| | | <select id="targetLocNo" name="modules" lay-verify="required" lay-search=""> |
| | | <option value="">目标空库位</option> |
| | | </select> |
| | | </div> |
| | | <button id="loc-move-btn" class="function-btn" onclick="locMove()" style="background: #4476A7;text-shadow: inherit;height: 45px;font-size: 15px;margin-left: 20px">库位移转</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <table class="layui-table" id="locMatCode" lay-filter="locMatCode"></table> |
| | | |
| | | <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> |
| | | <script type="text/javascript" src="../../static/js/saas/locMove.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="emptyLocStock"> |
| | | <option value="">请输入并选择</option> |
| | | {{#each data}} |
| | | <option value="{{this.uuid}}">{{this.uuid}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <div id="locMoveWindow" style="height: 100%;display: none"> |
| | | <div style="float: left;width: 35%;height: 100%"> |
| | | <div> |
| | | <span style="display: block">源库位</span> |
| | | <input type="text"> |
| | | </div> |
| | | </div> |
| | | <div style="float: left;width: 30%;height: 100%;position: relative;"> |
| | | <span style="position:absolute;top: 45%;left: 50%;color: #666;transform: translateX(-50%);;display: block">移转至</span> |
| | | <hr style="position: absolute; top: 50%;width: 100%;border: none;height: 1px;background-color: #666"> |
| | | |
| | | </div> |
| | | <div style="float: right;width: 35%;height: 100%"> |
| | | <div> |
| | | <span style="display: block">目标库位</span> |
| | | <input type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | </html> |