行是否选中
            checkOnSelect : false,
            //交替出现背景
            striped : true,
            pagination: true,
            //自动截取数据
            //nowrap : true,
            //loadFilter: pagerFilter,
            pageSize: initPageSize,
            pageList: initPageNum,
            columns:[[
                { field: 'id',width:35,align:"center",checkbox:true},
                { title: '操作',field: 'op',align:"center",width:60,formatter:function(value,rec)
                    {
                        var str = '';
                        var rowInfo = rec.id + 'AaBb' + rec.supplier +'AaBb' + rec.contacts + 'AaBb'+ rec.phonenum + 'AaBb'+ rec.email + 'AaBb'+ rec.beginneedget + 'AaBb'+ rec.beginneedpay + 'AaBb' + rec.isystem + 'AaBb' + rec.description+ 'AaBb' + rec.type
                            + 'AaBb' + rec.fax + 'AaBb' + rec.telephone + 'AaBb' + rec.address + 'AaBb' + rec.taxnum + 'AaBb' + rec.bankname + 'AaBb' + rec.accountnumber + 'AaBb' + rec.taxrate;
                        str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSupplier(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
                        str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSupplier(\'' + rowInfo + '\');"/>';
                        return str;
                    }
                },
                { title: '名称',field:'supplier',width:150},
                { title: '联系人', field: 'contacts',width:50,align:"center"},
                { title: '手机号码', field: 'telephone',width:100,align:"center"},
                { title: '电子邮箱',field: 'email',width:80,align:"center"},
                { title: '联系电话', field: 'phonenum',width:100,align:"center"},
                { title: '传真', field: 'fax',width:100,align:"center"},
                { title: '预付款',field: 'advancein',width:70,align:"center"},
                { title: '期初应收',field: 'beginneedget',width:70,align:"center"},
                { title: '期初应付',field: 'beginneedpay',width:70,align:"center"},
                { title: '税率', field: 'taxrate',width:50,align:"center"},
                { title: '状态',field: 'enabled',width:70,align:"center",formatter:function(value){
                    return value? "启用":"禁用";
                }}
            ]],
            toolbar:[
                {
                    id:'addSupplier',
                    text:'增加',
                    iconCls:'icon-add',
                    handler:function() {
                        addSuppler();
                    }
                },'-',
                {
                    id:'deleteSupplier',
                    text:'删除',
                    iconCls:'icon-remove',
                    handler:function() {
                        batDeleteSupplier();
                    }
                },'-',
                {
                    id:'setEnable',
                    text:'启用',
                    iconCls:'icon-ok',
                    handler:function() {
                        setEnableFun();
                    }
                },'-',
                {
                    id:'setDisEnable',
                    text:'禁用',
                    iconCls:'icon-no',
                    handler:function() {
                        setDisEnableFun();
                    }
                },'-',
                {
                    id:'setInput',
                    text:'导入',
                    iconCls:'icon-excel',
                    handler:function() {
                        setInputFun();
                    }
                },'-',
                {
                    id:'setOutput',
                    text:'导出',
                    iconCls:'icon-excel',
                    handler:function() {
                        setOutputFun();
                    }
                }
            ],
            onLoadError:function() {
                $.messager.alert('页面加载提示','页面加载异常，请稍后再试！','error');
                return;
            }
        });
        showSupplierDetails(1,initPageSize);
    }


    //分页信息处理
    function ininPager() {
        try {
            var opts = $("#tableData").datagrid('options');
            var pager = $("#tableData").datagrid('getPager');
            pager.pagination({
                onSelectPage:function(pageNum, pageSize)
                {
                    opts.pageNumber = pageNum;
                    opts.pageSize = pageSize;
                    pager.pagination('refresh', {
                        pageNumber:pageNum,
                        pageSize:pageSize
                    });
                    showSupplierDetails(pageNum,pageSize);
                }
            });
        }
        catch (e) {
            $.messager.alert('异常处理提示',"分页信息异常 :  " + e.name + ": " + e.message,'error');
        }
    }

    //删除信息
    function deleteSupplier(supplierInfo) {
        $.messager.confirm('删除确认','确定要删除此条信息吗？',function(r) {
            if (r) {
                var supplierTotalInfo = supplierInfo.split("AaBb");
                $.ajax({
                    type:"post",
                    url: "/supplier/" + supplierTotalInfo[0] + "/delete",
                    dataType: "json",
                    success: function (res) {
                        if(res && res.code == 200) {
                            $("#searchBtn").click();
                        } else {
                            $.messager.alert('删除提示', '删除信息失败，请稍后再试！', 'error');
                        }
                    },
                    //此处添加错误处理
                    error:function() {
                        $.messager.alert('删除提示','删除信息异常，请稍后再试！','error');
                        return;
                    }
                });
            }
        });
    }

    //批量删除单位
    function batDeleteSupplier() {
        var row = $('#tableData').datagrid('getChecked');
        if(row.length == 0) {
            $.messager.alert('删除提示','没有记录被选中！','info');
            return;
        }
        if(row.length > 0) {
            $.messager.confirm('删除确认','确定要删除选中的' + row.length + '条信息吗？',function(r) {
                if (r) {
                    var ids = "";
                    for(var i = 0;i < row.length; i ++) {
                        if(i == row.length-1)
                        {
                            ids += row[i].id;
                            break;
                        }
                        ids += row[i].id + ",";
                    }
                    $.ajax({
                        type:"post",
                        url: "/supplier/batchDelete",
                        dataType: "json",
                        async :  false,
                        data: ({
                            ids : ids
                        }),
                        success: function (res) {
                            if(res && res.code === 200) {
                                $("#searchBtn").click();
                                $(":checkbox").attr("checked", false);
                            } else {
                                $.messager.alert('删除提示', '删除信息失败，请稍后再试！', 'error');
                            }
                        },
                        //此处添加错误处理
                        error:function() {
                            $.messager.alert('删除