#
luxiaotao1123
2021-03-13 60cdc93fe5b1d873e0ae74ce5220cf527a47027e
#
3个文件已修改
132 ■■■■ 已修改文件
src/main/java/zy/cloud/wms/common/service/MainService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/entity/StoPreTab.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/custOrder/custOrder.js 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/common/service/MainService.java
@@ -102,7 +102,7 @@
                if (issued > 0) {
                    // 视图对象
                    StoPreTab tab = new StoPreTab();
                    tab.setTitle(mat.getMatnr() + "<br>" + mat.getMaktx() + "<br>数量:" + anfme);
                    tab.setTitle(mat.getMatnr() + "(" + mat.getMaktx() + ")");
                    tab.setMatnr(mat.getMatnr());
                    tab.setMaktx(mat.getMaktx());
                    tab.setAnfme(anfme);
@@ -111,7 +111,9 @@
                    tab.setNodeId(locDetl.getNodeId());
                    tab.setTotal(locDetl.getAnfme());
                    tab.setReduce(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued);
                    tab.setRemQty(tab.getTotal() - tab.getReduce());
                    tab.setPrior(locDetlService.isPrior(locDetl.getNodeId(), mat.getMatnr()));
                    tab.setPrior$(tab.getPrior()?"✔":"×");
                    result.add(tab);
                    // 剩余待出数量递减
                    issued = issued - locDetl.getAnfme();
src/main/java/zy/cloud/wms/manager/entity/StoPreTab.java
@@ -24,6 +24,10 @@
    private Double reduce;
    private Double remQty;
    private Boolean prior;
    private String prior$;
}
src/main/webapp/static/js/custOrder/custOrder.js
@@ -196,7 +196,7 @@
                    }),
                    method: 'POST',
                    success: function (res) {
                        console.log(res)
                        console.log(JSON.stringify(res.data))
                        layer.close(loadIndex);
                        // 成功
                        if (res.code === 200){
@@ -205,38 +205,40 @@
                                ,title: false
                                ,closeBtn: false
                                ,offset: '100px'
                                ,area: '1200px;'
                                ,area: '800px;'
                                ,shade: 0.5
                                ,id: 'LAY_layuipro'
                                ,btn: ['马上拣货', '稍后处理']
                                ,btnAlign: 'c'
                                ,moveType: 1 //拖拽模式,0或者1
                                // ,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">你知道吗?亲!<br>layer ≠ layui<br><br>layer只是作为Layui的一个弹层模块,由于其用户基数较大,所以常常会有人以为layui是layerui<br><br>layer虽然已被 Layui 收编为内置的弹层模块,但仍然会作为一个独立组件全力维护、升级。<br><br>我们此后的征途是星辰大海 ^_^</div>'
                                ,content: $('#stoukOutPreview')
                                ,success: function(layero, index){
                                    table.render({
                                        elem: '#stoPreTab',
                                        // url: 'tablex-tb2.json',
                                        data: res.data,
                                        page: true,
                                        cellMinWidth: 100,
                                        cols: [[
                                            {field: 'title', title: '名称', sort: true},
                                            {field: 'maktx', title: '菜单名称'},
                                            {field: 'locNo', title: '货位'},
                                            {field: 'reduce', title: '出库数量'},
                                            {field: 'prior', title: '推荐货位'},
                                            {field: 'title', title: '商品', align: 'center'},
                                            {field: 'anfme', title: '总数量', align: 'center', style: 'font-weight: bold', width: 80},
                                            {field: 'locNo', title: '货位', align: 'center'},
                                            {field: 'prior$', title: '推荐货位', align: 'center', width: 100},
                                            {field: 'reduce', title: '数量', align: 'center', width: 80, style: 'font-weight: bold'},
                                            {field: 'remQty', title: '余量', align: 'center', width: 80},
                                        ]],
                                        done: function () {
                                            tableX.merges('stoPreTab', [0]);
                                            tableX.merges('stoPreTab', [0,1]);
                                        }
                                    });
                                    // var btn = layero.find('.layui-layer-btn');
                                    // btn.find('.layui-layer-btn0').attr({
                                    //     href: 'http://www.layui.com/'
                                    //     ,target: '_blank'
                                    // });
                                }
                                ,yes: function(index, layero){
                                    //按钮【马上拣货】的回调
                                    stockOut(data.number);
                                }
                                ,btn2: function(index, layero){
                                    //按钮【稍后处理】的回调
                                    //return false 开启该代码可禁止点击该按钮关闭
                                }
                            });
                        // 缺料
@@ -260,51 +262,6 @@
                        }
                    }
                })
                // layer.confirm(data.number + ' 订单开始拣货?', {shadeClose: true}, function(){
                //     layer.closeAll();
                //     $.ajax({
                //         url: baseUrl+"/work/stock/out",
                //         headers: {'token': localStorage.getItem('token')},
                //         contentType:'application/json;charset=UTF-8',
                //         data: JSON.stringify({
                //             number: data.number
                //         }),
                //         method: 'POST',
                //         success: function (res) {
                //             // 成功
                //             if (res.code === 200){
                //                 layer.confirm(res.msg, {
                //                         shadeClose: true
                //                         , btn: ['打印拣货单']
                //                     }, function() {
                //                         layer.closeAll();
                //                         printPakouts(data.number);
                //                     }
                //                 )
                //             // 缺料
                //             } else if (res.code === 20001) {
                //                 layer.confirm(res.msg, {
                //                         shadeClose: true
                //                         , btn: ['库存调拨', '取消']
                //                     }, function() {
                //                         // todo 库存调拨
                //                         layer.closeAll();
                //                     }, function() {
                //                         // printPakouts(data.number);
                //                         layer.closeAll();
                //                     }
                //                 )
                //             } else if (res.code === 403){
                //                 top.location.href = baseUrl+"/";
                //             } else {
                //                 layer.msg(res.msg)
                //             }
                //             $(".layui-laypage-btn")[0].click();
                //         }
                //     })
                // });
                break;
            // 打印
            case 'print':
@@ -317,6 +274,53 @@
        }
    });
    // 开始拣货
    function stockOut(number) {
        layer.confirm(number + ' 订单开始拣货?', {shadeClose: true}, function(){
            layer.closeAll();
            $.ajax({
                url: baseUrl+"/work/stock/out",
                headers: {'token': localStorage.getItem('token')},
                contentType:'application/json;charset=UTF-8',
                data: JSON.stringify({
                    number: number
                }),
                method: 'POST',
                success: function (res) {
                    // 成功
                    if (res.code === 200){
                        layer.confirm(res.msg, {
                                shadeClose: true
                                , btn: ['打印拣货单']
                            }, function() {
                                layer.closeAll();
                                printPakouts(number);
                            }
                        )
                    // 缺料
                    } else if (res.code === 20001) {
                        layer.confirm(res.msg, {
                                shadeClose: true
                                , btn: ['库存调拨', '取消']
                            }, function() {
                                // todo 库存调拨
                                layer.closeAll();
                            }, function() {
                                // printPakouts(data.number);
                                layer.closeAll();
                            }
                        )
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg)
                    }
                    $(".layui-laypage-btn")[0].click();
                }
            })
        });
    }
    // 打印拣货单
    function printPakouts(docNumber) {
        $.ajax({