DuGuYang 3 سال پیش
والد
کامیت
5cc4894fb1

+ 107 - 11
Areas/Admin/Controllers/MainServer/MerchantDepositReturnsController.cs

@@ -29,10 +29,10 @@ namespace MySystem.Areas.Admin.Controllers
             OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         }
 
-        #region 商户退押金申请记录列表
+        #region 首台商户退押金申请记录列表
 
         /// <summary>
-        /// 根据条件查询商户退押金申请记录列表
+        /// 根据条件查询首台商户退押金申请记录列表
         /// </summary>
         /// <returns></returns>
         public IActionResult Index(MerchantDepositReturns data, string right)
@@ -46,10 +46,10 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
-        #region 根据条件查询商户退押金申请记录列表
+        #region 根据条件查询首台商户退押金申请记录列表
 
         /// <summary>
-        /// 商户退押金申请记录列表
+        /// 首台商户退押金申请记录列表
         /// </summary>
         /// <returns></returns>
         public JsonResult IndexData(MerchantDepositReturns data, string CreateDateData, string StatusSelect = "0", int page = 1, int limit = 30)
@@ -60,7 +60,101 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("AlipayAccountNo", "1"); //支付宝账号
             Fields.Add("SeoKeyword", "1"); //退押订单号
 
-            string condition = " and Status>-1";
+            string condition = " and Status>-1 and QueryCount=1";
+
+            //提现状态
+            if (!string.IsNullOrEmpty(StatusSelect))
+            {
+                condition += " and Status=" + StatusSelect;
+            }
+            //创建时间
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //商户
+                int MerchantId = int.Parse(function.CheckInt(dic["MerchantId"].ToString()));
+                PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == MerchantId) ?? new PosMerchantInfo();
+                dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
+                dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
+                dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
+                dic.Remove("MerchantId");
+                int Status = int.Parse(dic["Status"].ToString());
+                if (Status == 0) dic["StatusName"] = "待处理";
+                if (Status == 1) dic["StatusName"] = "成功";
+                if (Status == 2) dic["StatusName"] = "失败";
+                if (Status == 4) dic["StatusName"] = "通过";
+                if (Status == 5) dic["StatusName"] = "未通过";
+                //创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic.Remove("UserId");
+
+                //实际返还金额
+                var amt = int.Parse(function.CheckInt(dic["ReturnAmount"].ToString()));
+                dic["fReturnAmount"] = amt * 0.92;
+            }
+            Dictionary<string, object> other = new Dictionary<string, object>();
+            decimal ReturnAmount = 0;
+            decimal fReturnAmount = 0;
+            DataTable dt = OtherMySqlConn.dtable("SELECT SUM(ReturnAmount),SUM(ReturnAmount*0.92) FROM MerchantDepositReturns WHERE Status>-1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                ReturnAmount = decimal.Parse(dt.Rows[0][0].ToString());
+                fReturnAmount = decimal.Parse(dt.Rows[0][1].ToString());
+            }
+            other.Add("ReturnAmount", ReturnAmount.ToString("f2"));
+            other.Add("fReturnAmount", fReturnAmount.ToString("f2"));
+            obj.Add("other", other);
+            return Json(obj);
+        }
+
+        #endregion
+
+
+        #region 非首台商户退押金申请记录列表
+
+        /// <summary>
+        /// 根据条件查询非首台商户退押金申请记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Indexs(MerchantDepositReturns data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询非首台商户退押金申请记录列表
+
+        /// <summary>
+        /// 非首台商户退押金申请记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexsData(MerchantDepositReturns data, string CreateDateData, string StatusSelect = "0", int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("AlipayAccountNo", "1"); //支付宝账号
+            Fields.Add("SeoKeyword", "1"); //退押订单号
+
+            string condition = " and Status>-1 and QueryCount=0";
 
             //提现状态
             if (!string.IsNullOrEmpty(StatusSelect))
@@ -106,22 +200,24 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["fReturnAmount"] = amt * 0.92;
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            var ReturnAmount = "0";
-            var fReturnAmount = "0";
+            decimal ReturnAmount = 0;
+            decimal fReturnAmount = 0;
             DataTable dt = OtherMySqlConn.dtable("SELECT SUM(ReturnAmount),SUM(ReturnAmount*0.92) FROM MerchantDepositReturns WHERE Status>-1" + condition);
             if (dt.Rows.Count > 0)
             {
-                ReturnAmount = dt.Rows[0][0].ToString();
-                fReturnAmount = dt.Rows[0][1].ToString();
+                ReturnAmount = decimal.Parse(dt.Rows[0][0].ToString());
+                fReturnAmount = decimal.Parse(dt.Rows[0][1].ToString());
             }
-            other.Add("ReturnAmount", ReturnAmount);
-            other.Add("fReturnAmount", fReturnAmount);
+            other.Add("ReturnAmount", ReturnAmount.ToString("f2"));
+            other.Add("fReturnAmount", fReturnAmount.ToString("f2"));
             obj.Add("other", other);
             return Json(obj);
         }
 
         #endregion
 
+
+
         #region 增加商户退押金申请记录
 
         /// <summary>

+ 1 - 1
Areas/Admin/Views/MainServer/MerchantDepositReturns/Index.cshtml

@@ -8,7 +8,7 @@
 
 <head>
     <meta charset="utf-8">
-    <title>商户退押金申请记录</title>
+    <title>首台商户退押金申请记录</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport"

+ 182 - 0
Areas/Admin/Views/MainServer/MerchantDepositReturns/Indexs.cshtml

@@ -0,0 +1,182 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right 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: 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">
+                    <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"
+                                placeholder="" 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="OrderNo" placeholder="" 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="AlipayAccountNo" placeholder=""
+                                autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">退押状态</label>
+                        <div class="layui-input-inline">
+                            <select id="StatusSelect" name="StatusSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="0" selected="selected">待处理</option>
+                                <option value="2">失败</option>
+                                <option value="1">成功</option>
+                                <option value="4">通过</option>
+                                <option value="5">未通过</option>
+                            </select>
+                        </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 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>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i
+                            class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                    @* @if (RightInfo.Contains("," + right + "_edit,"))
+                        {
+                        <button class="layui-btn" data-type="Open">开启</button>
+                        <button class="layui-btn" data-type="Close">关闭</button>
+                        <button class="layui-btn" data-type="ExportExcel"><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>
+                    }
+                    @if (RightInfo.Contains("," + right + "_import,"))
+                    {
+                        <button class="layui-btn" data-type="ImportData"><i
+                            class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>退押结果导入</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_cash,"))
+                    {
+                        <button class="layui-btn" data-type="Cash"><i
+                            class="layui-icon layui-icon-up layuiadmin-button-btn"></i>提交到代付平台</button>
+                    }
+                </div>
+                <blockquote class="layui-elem-quote layui-text">
+                    退押总金额:<span style="color: #f00;" id="ReturnAmount">0.00</span> | 实际总金额:<span style="color: #f00;" id="fReturnAmount">0.00</span>
+                </blockquote>
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                                            <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 + "_delete,"))
+                    {
+                                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+
+                    }
+                </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/MerchantDepositReturnsn_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 1 - 0
wwwroot/layuiadmin/modules_main/MerchantDepositReturns_Admin.js

@@ -99,6 +99,7 @@ layui.config({
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'StatusName', width: 200, title: '状态', sort: true }
+            , { field: 'SeoDescription', width: 200, title: '描述', sort: true }
             , { field: 'SeoTitle', width: 200, title: '操作人', sort: true }
             , { field: 'SeoKeyword', width: 200, title: '退押订单号', sort: true }
             , { field: 'AlipayAccountNo', width: 200, title: '支付宝账号', sort: true }

+ 448 - 0
wwwroot/layuiadmin/modules_main/MerchantDepositReturnsn_Admin.js

@@ -0,0 +1,448 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/MerchantDepositReturns/Import?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else if (data.indexOf("Warning") == 0) {
+                var datalist = data.split('|');
+                layer.alert(datalist[1], { time: 20000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        type: 'datetime',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+
+
+    //excel导入
+    excel = layui.excel;
+    $('#ExcelFile').change(function (e) {
+        var files = e.target.files;
+        excel.importExcel(files, {}, function (data) {
+            ExcelData = data[0].Sheet1;
+        });
+    });
+
+    //监听单元格编辑
+    table.on('edit(LAY-list-manage)', function (obj) {
+        var value = obj.value //得到修改后的值
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
+            $.ajax({
+                type: "POST",
+                url: "/Admin/MerchantDepositReturns/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/MerchantDepositReturns/IndexsData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'StatusName', width: 200, title: '状态', sort: true }
+            , { field: 'SeoDescription', width: 200, title: '描述', sort: true }
+            , { field: 'SeoTitle', width: 200, title: '操作人', sort: true }
+            , { field: 'SeoKeyword', width: 200, title: '退押订单号', sort: true }
+            , { field: 'AlipayAccountNo', width: 200, title: '支付宝账号', sort: true }
+            , { field: 'ReturnAmount', width: 200, title: '返还金额', sort: true }
+            , { field: 'fReturnAmount', width: 200, title: '实际返还金额', sort: true }
+
+            // , { title: '操作', align: 'center', width: 400, fixed: 'right', toolbar: '#table-list-tools' }
+        ]]
+        , where: {
+
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $("#ReturnAmount").text(res.other.ReturnAmount);
+            $("#fReturnAmount").text(res.other.fReturnAmount);
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+        if (obj.event === 'del') {
+            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/MerchantDepositReturns/Delete?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        if (data == "success") {
+                            obj.del();
+                            layer.close(index);
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        } else if (obj.event === 'edit') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '商户退押金申请记录-编辑'
+                , content: 'Edit?Id=' + data.Id + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+
+
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/MerchantDepositReturns/Edit?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/MerchantDepositReturns/Delete?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , add: function () {
+            var perContent = layer.open({
+                type: 2
+                , title: '商户退押金申请记录-添加'
+                , content: 'Add'
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+
+
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/MerchantDepositReturns/Add?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+            layer.full(perContent);
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/users/退押结果模版.xlsx">点击下载退押结果模版</a>');
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/MerchantDepositReturns/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
+            });
+        }
+        , Open: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要开启的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要开启吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/MerchantDepositReturns/Open?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , Close: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要关闭的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要关闭吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/MerchantDepositReturns/Close?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        },Cash: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage'),
+                data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要提交代付的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要提交到代付平台申请出款吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/MerchantDepositReturns/Cash?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                layer.msg('提交成功,请等待代付平台处理');
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        },
+    };
+    
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});