#
luxiaotao1123
2021-03-26 0ffa7a000fee8d7bde4d9a4cd91327b063b41f7f
src/main/webapp/static/js/custOrder/custOrder.js
@@ -38,7 +38,7 @@
        cols: [[
            {type: 'checkbox'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'number', align: 'center',title: '销售单号'}
            ,{field: 'number', align: 'center',title: '单号'}
            ,{field: 'btypeId', align: 'center',title: '客户编号'}
            ,{field: 'etypeId', align: 'center',title: '经手人编号', hide: true}
@@ -74,6 +74,7 @@
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            tableX.merges('custOrder', [1, 11]);
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
@@ -205,8 +206,9 @@
                                ,closeBtn: false
                                ,offset: '100px'
                                // ,area: ['800px','450px']
                                ,area: '800px'
                                ,area: '1000px'
                                ,shade: 0.5
                                ,shadeClose: true
                                ,id: 'LAY_layuipro'
                                ,btn: ['立即生成', '稍后处理']
                                ,btnAlign: 'c'
@@ -222,14 +224,16 @@
                                        height: 432,
                                        cols: [[
                                            {field: 'title', title: '商品', align: 'center'},
                                            {field: 'anfme', title: '总数量', align: 'center', style: 'font-weight: bold', width: 80},
                                            {field: 'anfme', title: '总数量', align: 'center', style: 'font-weight: bold', width: 90},
                                            {field: 'type', title: '仓库', align: 'center', templet: '#typeTpl', width: 90},
                                            {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},
                                            {field: 'reduce', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'},
                                            // {field: 'remQty', title: '余量', align: 'center', width: 80},
                                            {field: 'total', title: '总量', align: 'center', width: 90},
                                        ]],
                                        done: function () {
                                            tableX.merges('stoPreTab', [0,1]);
                                            tableX.merges('stoPreTab', [0,1,2]);
                                            $('.layui-table-body.layui-table-main').css("overflow", "auto")
                                        }
                                    });
@@ -246,22 +250,24 @@
                            });
                        // 缺料
                        } else if (res.code === 20001) {
                            layer.confirm(res.msg, {
                                    shadeClose: true
                                    , area: ['400px']
                                    , btn: ['库存调拨', '取消']
                                }, function() {
                                    // todo 库存调拨
                                    layer.closeAll();
                                }, function() {
                                    // printPakouts(data.number);
                                    layer.closeAll();
                                }
                            )
                            // layer.confirm(res.msg, {
                            //         shadeClose: true
                            //         , area: ['400px']
                            //         , btn: ['库存调拨', '取消']
                            //     }, function() {
                            //         // 库存调拨
                            //         stockTransfer(data.number);
                            //         layer.closeAll();
                            //     }, function() {
                            //         // printPakouts(data.number);
                            //         layer.closeAll();
                            //     }
                            // )
                            layer.msg(res.msg, {icon: 2})
                        } else if (res.code === 403){
                            top.location.href = baseUrl+"/";
                        } else {
                            layer.msg(res.msg, {icon: 1})
                            layer.msg(res.msg, {icon: 2})
                        }
                    }
                })
@@ -306,22 +312,44 @@
                                shadeClose: true
                                , btn: ['库存调拨', '取消']
                            }, function() {
                                // todo 库存调拨
                                // 库存调拨
                                layer.closeAll();
                            }, function() {
                                // printPakouts(data.number);
                            alert(number)
                                layer.closeAll();
                            }
                        )
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg)
                        layer.msg(res.msg, {icon: 2})
                    }
                    $(".layui-laypage-btn")[0].click();
                }
            })
        // });
    }
    // 库存调拨
    function stockTransfer(number) {
        $.ajax({
            url: baseUrl + "/work/stock/transfer",
            headers: {'token': localStorage.getItem('token')},
            data: {
                number: number
            },
            method: 'POST',
            success: function (res) {
                if (res.code === 200) {
                    layer.msg(res.msg, {icon: 1})
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/";
                } else {
                    layer.msg(res.msg, {icon: 2})
                }
            }
        });
    }
    // 打印拣货单
@@ -485,22 +513,22 @@
        page: {
            curr: pageCurr
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
        }
        // done: function (res, curr, count) {
        //     if (res.code === 403) {
        //         top.location.href = baseUrl+"/";
        //     }
        //     pageCurr=curr;
        //     if (res.data.length === 0 && count !== 0) {
        //         tableIns.reload({
        //             where: searchData,
        //             page: {
        //                 curr: pageCurr-1
        //             }
        //         });
        //         pageCurr -= 1;
        //     }
        //     limit(child);
        // }
    });
}