@using MySystem.Models;
@{
    string RightInfo = ViewBag.RightInfo as string;
    string right = ViewBag.right as string;
    string SelfId = ViewBag.SelfId as string;
    string ParentId = ViewBag.ParentId as string;
    string UserId = ViewBag.Id as string;
    string MakerCode = ViewBag.MakerCode as string;
    List<Users> TopUsers = ViewBag.TopUsers as List<Users>;
    List<UserLevelSet> Levels = ViewBag.Levels as List<UserLevelSet>;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>创客</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <script src="/admin/js/jquery-1.10.1.min.js"></script>
    <style>
        .layui-input-inline{
            width: 175px !important;
        }
        .layui-form-label{
            width: 85px !important;
        }
        .layui-inline{
            margin-right: 0px !important;
        }
        .w100{
            width: 100px !important;
        }
        .ml50{
            margin-left: 50px !important;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                <div class="layui-form-item">
                    <input class="layui-input" type="hidden" name="ShowFlag" autocomplete="off">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">创客编号</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="MakerCode" value="@MakerCode" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">创客名称</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="RealName" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">直属创客编号</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="ParentMakerCode" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">直属创客名称</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="ParentRealName" autocomplete="off">
                            </div>
                        </div>
                    
                        <div class="layui-inline">
                            <label class="layui-form-label">手机号码</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="Mobile" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">身份证号码</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="CertId" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">注册时间</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate" autocomplete="off">
                            </div>
                        </div>
                        @{Dictionary<string, string> TopUserDic = new MySystem.DictionaryClass().getTopUserDic();}
                        <div class="layui-inline">
                            <label class="layui-form-label">顶级创客</label>
                            <div class="layui-input-inline">
                                <select id="TopUserId" name="TopUserId" lay-search="">
                                    <option value="">全部...</option>
                                    @foreach (string key in TopUserDic.Keys)
                                    {
                                    <option value="@key">@TopUserDic[key]</option>
                                    }
                                </select>
                            </div>
                        </div>
                    
                        <div class="layui-inline">
                            <label class="layui-form-label">创客等级</label>
                            <div class="layui-input-inline">
                                <select id="UserLevel" name="UserLevel" lay-search="">
                                    <option value="">全部...</option>
                                    @foreach(UserLevelSet Level in Levels)
                                    {
                                    <option value="@Level.Id">@Level.Name</option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">实名状态</label>
                            <div class="layui-input-inline">
                                <select id="AuthFlagSelect" name="AuthFlagSelect" lay-search="">
                                    <option value="">全部...</option>
                                    <option value="0">未实名</option>
                                    <option value="1">已实名</option>
                                </select>
                            </div>
                        </div>
                        @{Dictionary<string, string> KqProductBrandDic = new MySystem.DictionaryClass().getKqProductBrandDic();}
                        <div class="layui-inline">
                            <label class="layui-form-label">损坏机具类型</label>
                            <div class="layui-input-inline">
                                <select id="BrandId" name="BrandId" lay-search="">
                                    <option value="">全部...</option>
                                    @foreach (string key in KqProductBrandDic.Keys)
                                    {
                                    <option value="@key">@KqProductBrandDic[key]</option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">风控标识</label>
                            <div class="layui-input-inline">
                                <select id="RiskFlagSelect" name="RiskFlagSelect" lay-search="">
                                    <option value="">全部...</option>
                                    <option value="0">未风控</option>
                                    <option value="1">已风控</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">商户创客类型</label>
                            <div class="layui-input-inline">
                                <select id="MerchantTypeSelect" name="MerchantTypeSelect" lay-search="">
                                    <option value="">全部...</option>
                                    <option value="0">非商户型合伙人</option>
                                    <option value="1">商户型合伙人</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">结算金额</label>
                            <div class="layui-input-inline w100">
                                <input class="layui-input" type="text" name="sSettleAmount" id="sSettleAmount"
                                    autocomplete="off">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline w100">
                                <input class="layui-input" type="text" name="eSettleAmount" id="eSettleAmount"
                                    autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">冻结金额</label>
                            <div class="layui-input-inline w100">
                                <input class="layui-input" type="text" name="sCashFreezeAmt" id="sCashFreezeAmt"
                                    autocomplete="off">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline w100">
                                <input class="layui-input" type="text" name="eCashFreezeAmt" id="eCashFreezeAmt"
                                    autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline ml50">
                            <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
                            </button>
                            <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
                                <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-card-body">
                <div style="padding-bottom: 10px;">
                    @if (RightInfo.Contains("," + right + "_add,"))
                    {
                        <button class="layui-btn" data-type="add"><i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>新增</button>
                    }
                    <button class="layui-btn" data-type="ThreeElement"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>三/四要素验证</button>
                    @if (RightInfo.Contains("," + right + "_export,"))
                    {
                        <button class="layui-btn" data-type="ExportExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
                        <button class="layui-btn" data-type="ExportZSExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出直属创客</button>
                        <button class="layui-btn" data-type="ExportSJExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出上级创客</button>
                    }
                    @if (RightInfo.Contains("," + right + "_import,"))
                    {
                        <button class="layui-btn" data-type="ImportSettleAmount"><i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导入结算金额</button>
                        <button class="layui-btn" data-type="ImportFreezeAmt"><i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导入冻结金额</button>
                        <button class="layui-btn" data-type="ImportRisk"><i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导入风控数据</button>
                        <button class="layui-btn" data-type="ImportEditAmt"><i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>批量修改账户金额</button>
                    }
                </div>

                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
                <script type="text/html" id="imgTpl">
                    <img style="display: inline-block; width: 50%; height: 100%;" src={{ d.avatar }}>
                </script>
                <script type="text/html" id="MakerCodeTpl">
                    <a lay-href="/Admin/UserAccount/Index?right=@right&UserId=@("{{d.Id}}")" lay-text="{{d.MakerCode}}账户信息" style="color: #428bca;">{{d.MakerCode}}</a>
                </script>
                <script type="text/html" id="table-list-tools">
                    @if (RightInfo.Contains("," + right + "_SettleAmount,"))
                    {
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="EditSettleAmount"><i class="layui-icon layui-icon-edit"></i>修改结算金额</a>
                    }
                    @if (RightInfo.Contains("," + right + "_CashFreezeAmt,"))
                    {
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="EditCashFreezeAmt"><i class="layui-icon layui-icon-edit"></i>修改账户金额</a>
                    }
                    @if (RightInfo.Contains("," + right + "_Balance,"))
                    {
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="EditBalance"><i class="layui-icon layui-icon-edit"></i>账户操作</a>
                    }
                    @if (RightInfo.Contains("," + right + "_EnterpriseMaker,"))
                    {
                        @("{{#if (d.BusinessFlag == 0){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="EnterpriseMaker"><i class="layui-icon layui-icon-edit"></i>一键企业创客</a>
                        @("{{#} }}")
                    }
                    @if (RightInfo.Contains("," + right + "_LockEnterpriseMaker,"))
                    {
                         @("{{#if (d.BusinessFlag == 1){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="LockEnterpriseMaker"><i class="layui-icon layui-icon-edit"></i>取消企业创客</a>
                        @("{{#} }}")
                    }
                    @if (RightInfo.Contains("," + right + "_SetBigLeader,"))
                    {
                        @("{{#if (d.LeaderLevel == 0 || d.LeaderLevel == 1){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="SetBigLeader"><i class="layui-icon layui-icon-edit"></i>一键大盟主</a>
                        @("{{#} }}")
                    }
                    @if (RightInfo.Contains("," + right + "_SetSmallLeader,"))
                    {
                         @("{{#if (d.LeaderLevel == 0 || d.LeaderLevel == 2){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="SetSmallLeader"><i class="layui-icon layui-icon-edit"></i>一键小盟主</a>
                        @("{{#} }}")
                    }
                    @if (RightInfo.Contains("," + right + "_ChangeLeaderAmount,"))
                    {
                         @("{{#if (d.LeaderLevel == 1 || d.LeaderLevel == 2){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="ChangeLeaderAmount"><i class="layui-icon layui-icon-edit"></i>修改盟主金额</a>
                        @("{{#} }}")
                    }
                    <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="detail"><i class="layui-icon layui-icon-read"></i>详情</a>
                    @if (RightInfo.Contains("," + right + "_Lock,"))
                    {
                        @("{{#if (d.Status == 0){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Lock"><i class="layui-icon layui-icon-edit"></i>锁定</a>
                        @("{{#}else{ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="UnLock"><i class="layui-icon layui-icon-edit"></i>解锁</a>
                        @("{{#} }}")
                    }
                    @if (RightInfo.Contains("," + right + "_ResetPwd,"))
                    {
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="ResetPwd"><i class="layui-icon layui-icon-edit"></i>重置密码</a>
                    }
                    @if (RightInfo.Contains("," + right + "_ProfitSet,"))
                    {
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-text="{{d.MakerCode}}分润规则" lay-href="/Admin/UserProfit/Index?right=@right&UserId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>分润规则</a>
                    }
                    @if (RightInfo.Contains("," + right + "_Risk,"))
                    {
                        @("{{#if (d.RiskFlag == 0){ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Risk"><i class="layui-icon layui-icon-edit"></i>风控</a>
                        @("{{#}else{ }}")
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Risk"><i class="layui-icon layui-icon-edit"></i>解除风控</a>
                        @("{{#} }}")
                    }
                    @if (RightInfo.Contains("," + right + "_Logout,"))
                    {
                        @* <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>注销</a> *@
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cancle"><i class="layui-icon layui-icon-delete"></i>注销</a>
                    }
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>服务商信息修改</a>
                    @if (RightInfo.Contains("," + right + "_sycn,"))
                    {
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sycn"><i class="layui-icon layui-icon-edit"></i>同步机具数</a>
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sycntrade"><i class="layui-icon layui-icon-edit"></i>同步交易额</a>
                    }
                    @if (RightInfo.Contains("," + right + "_sycnamount,"))
                    {
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sycnamount"><i class="layui-icon layui-icon-edit"></i>重置小分仓额度</a>
                    }
                    @if (RightInfo.Contains("," + right + "_resetsmallposcount,"))
                    {
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="resetsmallposcount"><i class="layui-icon layui-icon-edit"></i>重置小分仓机具数</a>
                    }
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cleartoken"><i class="layui-icon layui-icon-edit"></i>清除登陆TOKEN</a>
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/Users/Index?right=@right&SelfId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>上级创客</a>
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/Users/Index?right=@right&ParentId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>直属创客</a>
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/Users/Children?right=@right&ParentId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>直属创客交易额</a>
                </script>
            </div>
        </div>
    </div>
    <div id="excelForm" style="display:none; padding:20px;">
        <div class="layui-tab-item layui-show">
            <div class="layui-form-item">
                <label class="layui-form-label">模板下载</label>
                <div class="layui-form-mid layui-word-aux" id="excelTemp">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">excel文件</label>
                <div class="layui-form-mid layui-word-aux">
                    <div class="layui-upload">
                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
                    </div>
                    <div class="mt10" id="ExcelFileList">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item ml10">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
            </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script src="/layuiadmin/modules_main/Users_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
    <script>
        var SelfId = '@SelfId';
        var ParentId = '@ParentId';
        var UserId = '@UserId';
        var MakerCode = '@MakerCode';
    </script>
</body>
</html>