自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-17 ddb173948bcb021a0b8099a69cc3da3071f33ca4
src/main/webapp/static/js/pakStore/emptyOut.js
@@ -6,6 +6,29 @@
    var layDate = layui.laydate;
    var form = layui.form;
    // 获取出库口
    function getOutBound(){
        $.ajax({
            url: baseUrl+"/available/empty/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);
                    form.render('select');
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
            }
        })
    }
    // 数据渲染
    tableIns = table.render({
        elem: '#locMast',
@@ -13,6 +36,8 @@
        url: baseUrl+'/locMast/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        where: {loc_type: "D"},
        even: true,
        toolbar: '#toolbar',
        defaultToolbar: ['filter'],
@@ -25,7 +50,7 @@
            ,{field: 'crnNo', align: 'center',title: '堆垛机号'}
            ,{field: 'row1', align: 'center',title: '排'}
            ,{field: 'bay1', align: 'center',title: '列'}
            ,{field: 'lev1', align: 'center',title: '层', sort:true}
            ,{field: 'lev1', align: 'center',title: '层'}
            ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){
                    var html = "<input value='fullPlt' type='checkbox' disabled=‘disabled’ lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.fullPlt === 'Y'){html += " checked ";}
@@ -34,7 +59,6 @@
                },width:80}
            ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser'}
            ,{field: 'modiTime$', align: 'center',title: '修改时间'}
        ]],
        request: {
            pageName: 'curr',
@@ -56,6 +80,7 @@
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            getOutBound();
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
@@ -70,19 +95,43 @@
    // 监听头工具栏事件
    table.on('toolbar(locMast)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        var data = table.checkStatus(obj.config.id).data;
        switch (obj.event) {
            case 'outbound':
                layer.open({
                    type: 1,
                    title: '出库',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: true,
                    content: $("#outboundDiv"),
                    success: function (layero, index) {
                    }
                var staNo = $("#staNoSelect").val();
                if (staNo === "" || staNo === null){
                    layer.msg("请选择出库口");
                    return;
                }
                var locNos = [];
                data.forEach(function(elem) {
                    locNos.push(elem.locNo);
                });
                if (data.length === 0){
                    layer.msg('请至少选中一行数据');
                } else {
                    $.ajax({
                        url: baseUrl+"/empty/plate/out/start",
                        headers: {'token': localStorage.getItem('token')},
                        data: {
                            outSite: staNo,
                            locNos: locNos
                        },
                        method: 'POST',
                        traditional:true,
                        success: function (res) {
                            if (res.code === 200){
                                tableReload(); // 重载表格
                                getOutBound(); // 重载出库口
                                layer.msg(res.msg);
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
                        }
                    });
                }
                break;
        }
    });
@@ -92,6 +141,7 @@
        pageCurr = 1;
        $('#detlTable').css("display", 'none');
        tableReload(false);
        getOutBound();
    });
    // 搜索栏重置事件
@@ -100,6 +150,7 @@
        clearFormVal($('#search-box'));
        $('#detlTable').css("display", 'none');
        tableReload(false);
        getOutBound();
    });
})
@@ -132,5 +183,3 @@
        }
    });
}