@{
    string RightInfo = ViewBag.RightInfo as string;
    string right = ViewBag.right as string;
    string BrandId = ViewBag.BrandId as string;
}
<!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: 115px !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">
                <input type="hidden" name="BrandId" value="@BrandId">
                <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="MerchantNo" 
                                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="MerchantName" 
                                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="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="MerNo" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">快钱SN号</label>
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="SnNo" 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="MerMakerCode" 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="MerRealName" autocomplete="off">
                        </div>
                    </div>
                
                    <div class="layui-inline">
                        <label class="layui-form-label">银行卡类型</label>
                        <div class="layui-input-inline">
                            <select id="BankCardTypeSelect" name="BankCardTypeSelect" lay-search="">
                                <option value="">全部...</option>
                                <option value="1">贷记卡</option>
                                <option value="0">借记卡</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">商户创客类型</label>
                        <div class="layui-input-inline">
                            <select id="MerBuddyTypeSelect" name="MerBuddyTypeSelect" lay-search="">
                                <option value="">全部...</option>
                                <option value="0">非商户型合伙人</option>
                                <option value="1">商户型合伙人</option>
                            </select>
                        </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">
                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
                            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>
                        @if (RightInfo.Contains("," + right + "_export,"))
                        {
                            if(BrandId == "14")
                            {
                            <button class="layui-btn" data-type="Import">
                                <i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导激活
                            </button>
                            <button class="layui-btn" data-type="ImportTrade">
                                <i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导交易
                            </button>
                            <button class="layui-btn" onclick="GetActInfo()">
                                <i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>获取激活信息
                            </button>
                            }
                            <button class="layui-btn" data-type="ExportExcel">
                                <i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出
                            </button>
                        }
                    </div>
                </div>
            </div>

            <div class="layui-card-body">
                <blockquote class="layui-elem-quote layui-text">
                    贷记卡交易总额(元)：<span style="color: #f00;" id="TotalTrade0">0.00</span>　|　借记卡交易总额(元)：<span style="color: #f00;" id="TotalTrade1">0.00</span>
                </blockquote>
                
                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
                <script type="text/html" id="table-list-tools">
                </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/TradeRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
    <script>
        var BrandId = '@BrandId';
    </script>
    <script>
        function GetActInfo() {
            var index = layer.confirm('确定操作该功能吗？', function (index) {
                var indexs = layer.load(1, {
                    shade: [0.5, '#000']
                });
                var userdata = $("#confirmFrm").serialize();
                $.ajax({
                    type: "POST",
                    url: "/Admin/TradeRecord/GetActInfo?r=" + Math.random(1),
                    data: userdata,
                    dataType: "text",
                    success: function (data) {
                        layer.close(index); //关闭弹层
                        if (data == "success") {
                            layer.close(indexs); //关闭弹层
                            layer.msg('成功', {
                                time: 1000
                            }, function () {
                                window.location.reload();
                            });
                        } else {
                            layer.close(indexs); //关闭弹层
                            layer.msg(data, { time: 1000 }, function () {
                                window.location.reload();
                            });
                        }
                    }
                });
            });
        }
    </script>
</body>
</html>