@page
@model Waste.Web.Entry.Pages.Business.IndexModel
@{
    ViewData["Title"] = "客户管理";
}
<div class="layui-card">
    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入商户名称" />
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="Phone" id="Phone" placeholder="请输入商户手机号" />
                </div>
            </div>
            <div class="layui-inline">
                <button class="btn btn-primary btn-lg  js-search" type="button">查询</button>
            </div>
        </div>
    </div>
    <div class="layui-card-body">
        <table class="layui-table" id="list" lay-filter="list">
        </table>
    </div>
</div>
@section Scripts
{
    <script type="text/javascript">
        var table = "";
        layui.use(['common','table'], function () {
            var common = layui.common;
            table = layui.table;
            common.initTable({
                url: '/api/business/getlistnoadmin'
                , method: 'post'
                , cols: [[
                    {type:"radio"},
                    {
                        field: 'name', title: '商户'
                    },
                    {
                        field: 'phone', title: '手机号'
                    }
                    ,
                    {
                        field: 'status', title: '状态', templet: function (d) {
                            return StatusType[d.status];
                        }
                    }
                    ,
                    {
                        field: 'createtime', title: '注册时间'
                    }
                ]]
            });
            $(".js-search").on("click", function () {
                common.reloadtable("list", {
                    where: {
                        queryParam: [{
                            "Name": 'Name',
                            "Type": QueryCond.Like,
                            "Value": $("#Name").val()
                        }, {
                            "Name": 'Phone',
                            "Type": QueryCond.Like,
                            "Value": $("#Phone").val()
                        }]
                    }
                });
            });
        });
        function getselect() {
            var checkStatus = table.checkStatus("list");
            var data = checkStatus.data;
            var len = checkStatus.data.length;
            if (len == 0) {
                return [];
            }
            return data;
        }
    </script>
}