自动化立体仓库 - WMS系统
lty
7 天以前 539a56279625242c497b4b4093f2defbb9d80334
src/main/webapp/static/js/report/inOut.js
@@ -7,6 +7,17 @@
    var form = layui.form;
    // Define columns function
    function getCols() {
        return [[
            {field: 'ymd', align: 'center', title: typeof I18n !== 'undefined' ? I18n.t('date') : '日期'}
            ,{field: 'source_sta_no', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('source_station') : '站点'}
            ,{field: 'sto_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('inbound_count') : '入库次数'}
            ,{field: 'ret_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('outbound_count') : '出库次数'}
            ,{field: 'total_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('total_count') : '入出总数'}
        ]];
    }
    // 数据渲染
    tableIns = table.render({
        elem: '#inOut',
@@ -16,14 +27,10 @@
        limit: 10,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
            // {type: 'checkbox'}
            {field: 'ymd', align: 'center', title: '日期'}
            ,{field: 'source_sta_no', align: 'center',title: '站点'}
            ,{field: 'sto_qty', align: 'center',title: '入库次数'}
            ,{field: 'ret_qty', align: 'center',title: '出库次数'}
            ,{field: 'total_qty', align: 'center',title: '入出总数'}
        ]],
        text: {
            none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '暂无相关数据'
        },
        cols: getCols(),
        request: {
            pageName: 'curr',
            pageSize: 'limit'
@@ -45,7 +52,32 @@
            }
            pageCurr=curr;
            limit();
            if (typeof I18n !== 'undefined') {
                I18n.updateLayuiPagination();
                I18n.updatePage();
                $('#btn-export').text(I18n.t('export'));
            }
        }
    });
    // Listen for language change
    $(document).on('i18n:languageChanged', function() {
        tableIns.reload({
            cols: getCols(),
            text: {
                none: I18n.t('no_data')
            },
            done: function(res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
                I18n.updateLayuiPagination();
                I18n.updatePage();
                $('#btn-export').text(I18n.t('export'));
            }
        });
    });
    // 监听排序事件
@@ -76,7 +108,7 @@
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
            case 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_export') : '确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {