自动化立体仓库 - WMS系统
zhangc
2024-12-23 ae5efa8720b18cba84a55a7b98413813b55407c7
src/main/webapp/static/js/report/workCountOut.js
@@ -2,8 +2,8 @@
function getCol() {
    var cols = [
        {field: 'oneday', align: 'center', title: '入库日期', width: 200}
        ,{field: 'matnr', align: 'center',title: '商品编号'}
        ,{field: 'maktx', align: 'center',title: '商品名称'}
        ,{field: 'matnr', align: 'center',title: '物料号'}
        ,{field: 'maktx', align: 'center',title: '物料名称'}
        ,{field: 'anfme', align: 'center',title: '数量'}
    ];
@@ -34,11 +34,12 @@
            limitName: 'pageSize'
        },
        parseData: function (res) {
            $('#countNum').text(res.data.sum + '个');
            return {
                'code': res.code,
                'msg': res.msg,
                'count': res.data.total,
                'data': res.data.records
                'count': res.data.page.total,
                'data': res.data.page.records
            }
        },
        response: {
@@ -90,32 +91,34 @@
                            fields.push(col.field);
                        }
                    });
                    var exportData = {};
                    var param = '?';
                    $.each($('#search-box [name]').serializeArray(), function() {
                        exportData[this.name] = this.value;
                        param += this.name + '=' + this.value + '&';
                    });
                    var param = {
                        fields: fields,
                        exportData: exportData
                    };
                    $.ajax({
                        url: baseUrl+"/report/viewWorkOutExport.action",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            layer.closeAll();
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
                        }
                    });
                    window.location.href = baseUrl + "/report/download/countOut" + param;
                    layer.closeAll();
                    // var param = {
                    //     fields: fields,
                    //     exportData: exportData
                    // };
                    // $.ajax({
                    //     url: baseUrl+"/report/download/out",
                    //     headers: {'token': localStorage.getItem('token')},
                    //     data: JSON.stringify(param),
                    //     dataType:'json',
                    //     contentType:'application/json;charset=UTF-8',
                    //     method: 'POST',
                    //     success: function (res) {
                    //         layer.closeAll();
                    //         if (res.code === 200) {
                    //             table.exportFile(titles,res.data,'xls');
                    //         } else if (res.code === 403) {
                    //             top.location.href = baseUrl+"/";
                    //         } else {
                    //             layer.msg(res.msg)
                    //         }
                    //     }
                    // });
                });
                break;
        }