自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-06 a1547b55b98257f84fba107a7abd7c39c75b2eea
src/main/webapp/static/js/matCode/matCode.js
@@ -171,42 +171,19 @@
                break;
            // 导出
            case 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true,}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
                            titles.push(col.title);
                            fields.push(col.field);
                        }
                    });
                    var exportData = {};
                    $.each($('#search-box [name]').serializeArray(), function() {
                        exportData[this.name] = this.value;
                    });
                    var param = {
                        'matCode': exportData,
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/matCode/export/auth",
                        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)
                            // }
                        }
                    });
                });
                layer.open({
                    type: 1,
                    title: '数据导出',
                    shadeClose: true,
                    content: $('#exportDataDiv'),
                    success: function(layero, index){
                    },
                    end: function () {
                        $("#exportFileName").val("");
                        $("#exportRowCount").val("");
                    }
                })
                break;
            // 导入
            case 'intoData':
@@ -228,6 +205,15 @@
        }
    });
    // 导出excel
    form.on('submit(exportDo)', function(data) {
        layer.closeAll();
        layer.load(1, {shade: [0.1,'#fff']});
        location.href = baseUrl + "/matCode/export/auth?fileName="+$("#exportFileName").val()+"&rowCount="+$("#exportRowCount").val();
        layer.closeAll('loading');
        return false;
    });
    // 导入excel
    var uploader = upload.render({
        elem: '#uploadEx'