自动化立体仓库 - WMS系统
chen.llin
2025-12-25 5232d8b5939cb832c3d17c2aa1d6eaf66e5acb74
src/main/webapp/static/js/monthlySettle/monthlySettle.js
@@ -29,7 +29,7 @@
            {field: 'totalOutQty', align: 'center', title: '总出库数量', width: 120},
            {field: 'totalMaterials', align: 'center', title: '物料种类数', width: 120},
            {field: 'createTime$', title: '创建时间', minWidth: 180, width: 180},
            {align: 'center', title: '操作', toolbar: '#operate', width: 180}
            {align: 'center', title: '操作', toolbar: '#operate', width: 240}
        ]],
        request: {
            pageName: 'curr',
@@ -368,6 +368,8 @@
        var layEvent = obj.event;
        if (layEvent === 'detail') {
            showDetailDialog(data);
        } else if (layEvent === 'export') {
            exportDetail(data);
        } else if (layEvent === 'delete') {
            deleteSettle(data);
        }
@@ -478,6 +480,50 @@
        });
    }
    // 导出月结明细
    function exportDetail(data) {
        layer.confirm('确定导出月结明细 "' + data.settleNo + '" 吗?', {
            shade: .1,
            skin: 'layui-layer-admin'
        }, function (i) {
            layer.close(i);
            layer.load(2);
            $.ajax({
                url: baseUrl + '/monthlySettle/detail/export/' + data.id + '/auth',
                headers: {'token': localStorage.getItem('token')},
                method: 'POST',
                success: function (res) {
                    layer.closeAll('loading');
                    if (res.code === 200) {
                        // 定义表头
                        var titles = [
                            '物料编码',
                            '物料名称',
                            '批次',
                            '品牌',
                            '期初库存',
                            '期末库存',
                            '差异数量',
                            '本期入库',
                            '本期出库'
                        ];
                        // 使用 table.exportFile 导出
                        table.exportFile(titles, res.data, 'xls');
                        layer.msg('导出成功', {icon: 1});
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/";
                    } else {
                        layer.msg(res.msg || '导出失败', {icon: 2});
                    }
                },
                error: function() {
                    layer.closeAll('loading');
                    layer.msg('导出失败', {icon: 2});
                }
            });
        });
    }
    // 删除月结记录
    function deleteSettle(data) {
        layer.confirm('确认要删除月结记录 "' + data.settleNo + '" 吗?删除后将清除关联的出入库订单月结信息,可以重新进行月结。', {