layui.use('table', function() {
    var table=layui.table;
    table.render({
        id: 'data_table',
        elem: '#data_table',
        height:'full-83',
        even: true,
        cols:  [formfield],
        url: '/index/service/base_goods_list',
        page: true,
        limit: 30,
        limits: [30,60,90,150,300],
        method: 'post',
        where: search_info('obj'),
    });//渲染表格
    //调用插件
    $.fn.zTree.init($("#s_goodsclass"), {
        callback: {
            onClick: function(event, treeId, treeNode) {
                $('#s\\|class').val(treeNode.name).attr('nod',treeNode.id);
                $('.ztree_box').hide();
            }
        }
	}, ztree_data);
    //调用插件
    $('#s_brand').selectpage({
        url:'/index/service/brand_list',
        tip:'全部品牌',
        valid:'s|brand'
    });
    //调用插件
    $('#s_unit').selectpage({
        url:'/index/service/unit_list',
        tip:'全部单位',
        valid:'s|unit'
    });
});
//条件搜索
function search() {
    layui.use('table', function() {
        layui.table.reload('data_table',{
            where: search_info('obj'),
            page:1
        });
    });
}
//获取商品数据
function get_goods(){
    var arr=[];
    layui.use('table', function() {
        var table=layui.table;
        var checkStatus = table.checkStatus('data_table');
        arr = checkStatus.data;//获取选中行的数据
    });
    return arr;
}