layui.use(['table'], function(){
    var table = layui.table;

    // 领取记录
    table.render({
        id: 'list'
        ,elem: '#apply_log'
        ,url: '/api/ApiSelfSampleApplyLog' //数据接口
        ,method:'post'
        ,cellMinWidth: 80 //全局定义常规单元格的最小宽度
        ,page: true //开启分页
        ,where: {
            user_id : $('input[name=user_id]').val()
        }
        ,cols: [[ //表头
            {title: '序号', type: 'numbers', fixed: 'left', width: 80}
            ,{field: 'user_id', title: '用户ID', width: 120}
            ,{field: 'account', title: '用户账户', width: 200}
            ,{field: 'order_id', title: '订单ID', width: 120}
            ,{field: 'order_sn', title: '订单编号', width: 200}
            ,{field: 'order_status', title: '订单状态', width: 100}
            ,{field: 'goods_id', title: '样片ID', width: 120}
            ,{field: 'goods_name', title: '样片名称', width: 300}
            ,{field: 'apply_num', title: '领取数量', width: 120}
            ,{field: 'quota', title: '样片消耗人数', width: 120}
            ,{field: 'create_time', title: '领取时间', width: 215}
        ]]
        ,limit: 10
        ,limits: [10, 20, 50,]
    });

    // 邀约记录
    table.render({
        id: 'list'
        ,elem: '#invite_log'
        ,url: '/api/ApiSelfSampleInviteLog' //数据接口
        ,method:'post'
        ,cellMinWidth: 80 //全局定义常规单元格的最小宽度
        ,page: true //开启分页
        ,where: {
            user_id : $('input[name=user_id]').val()
        }
        ,cols: [[ //表头
            {title: '序号', type: 'numbers', fixed: 'left', width: 80}
            ,{field: 'user_id', title: '用户ID'}
            ,{field: 'account', title: '用户账户'}
            ,{field: 'invitee_uid', title: '受邀人ID'}
            ,{field: 'invitee_mobile', title: '受邀人手机号码'}
            ,{field: 'create_time', title: '受邀人注册时间'}
        ]]
        ,limit: 10
        ,limits: [10, 20, 50,]
    });
 

});