自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-06 d23f39f6e3f743f7b46097a9315a6e28398218e5
src/main/webapp/static/js/matCode/matCode.js
@@ -135,14 +135,6 @@
                    }
                });
                break;
            case 'refreshData':
                tableIns.reload({
                    page: {
                        curr: pageCurr
                    }
                });
                limit();
                break;
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
@@ -171,42 +163,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':
@@ -225,7 +194,30 @@
                    }
                });
                break;
            // 批量打印
            case "btnPrintBatch":
                layer.open({
                    type: 1,
                    title: '批量打印',
                    shadeClose: true,
                    content: $('#printDataDiv'),
                    success: function(layero, index){
                    },
                    end: function () {
                    }
                });
                break;
        }
    });
    // 导出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
@@ -272,7 +264,7 @@
                    title: '详情',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    shadeClose: true,
                    content: 'matCode_detail.html',
                    success: function(layero, index){
                        setFormVal(layer.getChildFrame('#detail', index), data, true);
@@ -376,7 +368,20 @@
                   });
                }
                break;
            // 打印
            case "btnPrint":
                layer.open({
                    type: 1,
                    title: '打印',
                    shadeClose: true,
                    content: $('#printDataDiv'),
                    success: function(layero, index){
                    },
                    end: function () {
                    }
                });
                break;
        }
    });