Browse Source

Merge branch 'feature-dgy-后台功能修复' into feature-dgy-后台测试

DuGuYang 3 years ago
parent
commit
67e8a096f1

+ 10 - 3
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -445,7 +445,7 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
@@ -554,7 +554,7 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
@@ -575,7 +575,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
 
             var Ids = "";
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "Id,UserId,UseAmount", false);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "Id,CreateDate,UserId,UseAmount", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
@@ -596,6 +596,11 @@ namespace MySystem.Areas.Admin.Controllers
 
                 //记录Id
                 int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
+                var storeHouseAmountRecord = db.StoreHouseAmountRecord.FirstOrDefault(m => m.Id == Id) ?? new StoreHouseAmountRecord();
+                if (storeHouseAmountRecord.Status == 0) dic["Status"] = "待处理";
+                if (storeHouseAmountRecord.Status == 2) dic["Status"] = "处理中";
+                if (storeHouseAmountRecord.Status == 1) dic["Status"] = "成功";
+                if (storeHouseAmountRecord.Status == -1) dic["Status"] = "失败";
                 dic["Id"] = Id;
                 Ids += Id + ",";
             }
@@ -607,6 +612,8 @@ namespace MySystem.Areas.Admin.Controllers
             result.Add("Obj", diclist);
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("Id", "记录ID");
+            ReturnFields.Add("CreateDate", "提现申请时间");
+            ReturnFields.Add("Status", "提现结果");
             ReturnFields.Add("UserIdRealName", "创客真实姓名");
             ReturnFields.Add("UserIdMakerCode", "创客编号");
             ReturnFields.Add("UseAmount", "申请提现临额");

+ 98 - 28
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -105,7 +105,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
-        public string CheckMachineDo(string MakerCode, string PosSn, string MerNo = "", int AddActPrize = 0, int IsPre = 0, int IsSend = 0)
+        public string CheckMachineDo(string MakerCode, string PosSn, int AddActPrize = 0, int IsSend = 0)
         {
             if (string.IsNullOrEmpty(MakerCode))
             {
@@ -115,6 +115,8 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "请输入机具SN";
             }
+
+            var MerNo = "";
             PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
             KqProducts kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId);
             if (pos == null)
@@ -126,7 +128,7 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "创客编号不存在";
             }
-            if (IsPre == 1)
+            if (pos.PreUserId > 0)
             {
                 if (pos.BuyUserId == 0)
                 {
@@ -287,6 +289,7 @@ namespace MySystem.Areas.Admin.Controllers
                 pos.ActivationTime = DateTime.Now;
             }
             PosMerchantInfo merchant = new PosMerchantInfo();
+
             if (!string.IsNullOrEmpty(MerNo))
             {
                 merchant = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == MerNo);
@@ -364,7 +367,7 @@ namespace MySystem.Areas.Admin.Controllers
                 pos.BindMerchantId = merchant.Id;
             }
             db.SaveChanges();
-            function.WriteLog(DateTime.Now.ToString() + "\n" + SysUserName + "\nMakerCode:" + MakerCode + ", PosSn:" + PosSn + ", MerNo:" + MerNo + ", AddActPrize:" + AddActPrize + ", IsPre:" + IsPre, "机具补录日志");
+            function.WriteLog(DateTime.Now.ToString() + "\n" + SysUserName + "\nMakerCode:" + MakerCode + ", PosSn:" + PosSn + ", MerNo:" + MerNo + ", AddActPrize:" + AddActPrize, "机具补录日志");
             return "success";
         }
         public IActionResult CheckMachine2(string right)
@@ -3702,6 +3705,70 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
+        // public string TransferPosDo(string PosSn, string FromMakerCode, string ToMakerCode)
+        // {
+        //     if (string.IsNullOrEmpty(PosSn))
+        //     {
+        //         return "请输入机具SN";
+        //     }
+        //     if (string.IsNullOrEmpty(FromMakerCode))
+        //     {
+        //         return "请输入机具来源创客编号";
+        //     }
+        //     if (string.IsNullOrEmpty(ToMakerCode))
+        //     {
+        //         return "请输入划拨对象创客编号";
+        //     }
+        //     var query = PosSn + "," + FromMakerCode + "," + ToMakerCode;
+        //     var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
+        //     var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
+        //     if (posInfo.Id == 0)
+        //     {
+        //         return "机具" + PosSn + "不存在";
+        //     }
+        //     var user = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == FromMakerCode) ?? new UserForMakerCode();
+        //     var tuser = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == ToMakerCode) ?? new UserForMakerCode();
+        //     var fUserId = db.Users.FirstOrDefault(m => m.Id == user.UserId) ?? new Users();
+        //     if (fUserId.Id == 0)
+        //     {
+        //         return "来源创客" + FromMakerCode + "不存在";
+        //     }
+        //     var tUserId = db.Users.FirstOrDefault(m => m.Id == tuser.UserId) ?? new Users();
+        //     if (tUserId.Id == 0)
+        //     {
+        //         return "划拨创客" + ToMakerCode + "不存在";
+        //     }
+        //     if (posInfo.BindingState == 0)
+        //     {
+        //         if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
+        //         {
+        //             posInfo.BuyUserId = tUserId.Id;
+        //             posInfo.UserId = tUserId.Id;
+        //         }
+        //         else
+        //         {
+        //             posInfo.BuyUserId = tUserId.Id;
+        //         }
+        //         var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+        //         var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+        //         fUserPos.TotalMachineCount -= 1;
+        //         fUserPos.UnBindCount -= 1;
+        //         tUserPos.TotalMachineCount += 1;
+        //         tUserPos.UnBindCount += 1;
+        //         db.SaveChanges();
+        //         function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
+        //     }
+        //     else
+        //     {
+        //         return "机具" + PosSn + "已使用";
+        //     }
+
+        //     return "success";
+        // }
+        // #endregion
+
+
+
         public string TransferPosDo(string PosSn, string FromMakerCode, string ToMakerCode)
         {
             if (string.IsNullOrEmpty(PosSn))
@@ -3716,13 +3783,6 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "请输入划拨对象创客编号";
             }
-            var query = PosSn + "," + FromMakerCode + "," + ToMakerCode;
-            var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
-            var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
-            if (posInfo.Id == 0)
-            {
-                return "机具" + PosSn + "不存在";
-            }
             var user = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == FromMakerCode) ?? new UserForMakerCode();
             var tuser = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == ToMakerCode) ?? new UserForMakerCode();
             var fUserId = db.Users.FirstOrDefault(m => m.Id == user.UserId) ?? new Users();
@@ -3735,30 +3795,40 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "划拨创客" + ToMakerCode + "不存在";
             }
-            if (posInfo.BindingState == 0)
+            var SnIds = "";
+            string[] PosSnList = PosSn.Replace("\r", "").Replace("\n", ",").Split(',');
+            foreach (string Sn in PosSnList)
             {
-                if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
+                var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == Sn) ?? new MachineForSnNo();
+                var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
+                if (posInfo.Id == 0)
                 {
-                    posInfo.BuyUserId = tUserId.Id;
-                    posInfo.UserId = tUserId.Id;
+                    return "机具" + PosSn + "不存在";
                 }
-                else
+                if (posInfo.BindingState == 0)
                 {
-                    posInfo.BuyUserId = tUserId.Id;
+                    SnIds += posInfo.Id + ",";
+                    if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
+                    {
+                        posInfo.BuyUserId = tUserId.Id;
+                        posInfo.UserId = tUserId.Id;
+                    }
+                    else
+                    {
+                        posInfo.BuyUserId = tUserId.Id;
+                    }
+                    var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+                    var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+                    fUserPos.TotalMachineCount -= 1;
+                    fUserPos.UnBindCount -= 1;
+                    tUserPos.TotalMachineCount += 1;
+                    tUserPos.UnBindCount += 1;
                 }
-                var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
-                var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
-                fUserPos.TotalMachineCount -= 1;
-                fUserPos.UnBindCount -= 1;
-                tUserPos.TotalMachineCount += 1;
-                tUserPos.UnBindCount += 1;
-                db.SaveChanges();
-                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
-            }
-            else
-            {
-                return "机具" + PosSn + "已使用";
             }
+            var query = SnIds + ";" + FromMakerCode + ";" + ToMakerCode;
+            function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
+            db.SaveChanges();
+            db.Dispose();
 
             return "success";
         }

+ 146 - 0
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -181,6 +181,152 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 创客列表
+
+        /// <summary>
+        /// 根据条件查询创客列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult CancleUsers(Users data, string right, int SelfId = 0, int ParentId = 0, string MakerCode = "")
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.SelfId = SelfId.ToString();
+            ViewBag.ParentId = ParentId.ToString();
+            ViewBag.MakerCode = MakerCode;
+
+            List<Users> TopUsers = db.Users.Where(m => m.ParentUserId == 0).ToList();
+            ViewBag.TopUsers = TopUsers;
+            List<UserLevelSet> Levels = db.UserLevelSet.OrderBy(m => m.Id).ToList();
+            ViewBag.Levels = Levels;
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询创客列表
+
+        /// <summary>
+        /// 创客列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult CancleUsersData(Users data, string ParentMakerCode, string ParentRealName, string AuthFlagSelect, string CreateDateData, int TopUserId, string RiskFlagSelect, string MerchantTypeSelect, int? sSettleAmount, int? eSettleAmount, int? sCashFreezeAmt, int? eCashFreezeAmt, int UserId, int SelfId = 0, int ParentId = 0, int ShowFlag = 0, int page = 1, int limit = 30)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("MakerCode", "1"); //创客编号
+            Fields.Add("RealName", "1"); //创客名称
+            Fields.Add("Mobile", "1"); //手机号
+            Fields.Add("CertId", "1"); //身份证号码
+            Fields.Add("SettleAmount", "3"); //结算金额
+            Fields.Add("CashFreezeAmt", "3"); //冻结金额
+            Fields.Add("UserLevel", "0"); //创客等级
+
+            string condition = " and Status=-1";
+            string sort = "Id desc";
+            //直属创客编号
+            if (!string.IsNullOrEmpty(ParentMakerCode))
+            {
+                condition += " and ParentUserId in (select UserId from UserForMakerCode where MakerCode='" + ParentMakerCode + "')";
+            }
+            //直属创客名称
+            if (!string.IsNullOrEmpty(ParentRealName))
+            {
+                condition += " and ParentUserId in (select UserId from UserForRealName where RealName='" + ParentRealName + "')";
+            }
+            //实名状态
+            if (!string.IsNullOrEmpty(AuthFlagSelect))
+            {
+                condition += " and AuthFlag=" + AuthFlagSelect;
+            }
+            //顶级创客
+            if (TopUserId > 0)
+            {
+                condition += " and ParentNav like '," + TopUserId + ",%'";
+            }
+            //风控标识
+            if (!string.IsNullOrEmpty(RiskFlagSelect))
+            {
+                condition += " and RiskFlag=" + RiskFlagSelect;
+            }
+            //商户创客类型
+            if (!string.IsNullOrEmpty(MerchantTypeSelect))
+            {
+                condition += " and MerchantType=" + MerchantTypeSelect;
+            }
+            if (sSettleAmount != null)
+            {
+                condition += " and SettleAmount>=" + sSettleAmount.Value;
+            }
+            if (eSettleAmount != null)
+            {
+                condition += " and SettleAmount<=" + eSettleAmount.Value;
+            }
+            if (sCashFreezeAmt != null)
+            {
+                condition += " and CashFreezeAmt>=" + sCashFreezeAmt.Value;
+            }
+            if (eCashFreezeAmt != null)
+            {
+                condition += " and CashFreezeAmt<=" + eCashFreezeAmt.Value;
+            }
+            if (SelfId > 0)
+            {
+                Users self = db.Users.FirstOrDefault(m => m.Id == SelfId);
+                if (self != null)
+                {
+                    string ParentNav = function.CheckNull(self.ParentNav);
+                    condition += " and Id in (" + ParentNav.Trim(',').Replace(",,", ",") + ")";
+                    sort = "ParentNav asc";
+                }
+            }
+            if (ParentId > 0)
+            {
+                condition += " and ParentUserId=" + ParentId;
+            }
+            if (UserId > 0)
+            {
+                condition += " and Id=" + UserId;
+            }
+            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("Users", Fields, sort, "True", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                dic["AuthFlagName"] = dic["AuthFlag"].ToString() == "1" ? "已实名" : "未实名";
+                dic["RiskFlagName"] = dic["RiskFlag"].ToString() == "1" ? "已风控" : "未风控";
+                dic["UserLevel"] = RelationClass.GetUserLevelSetInfo(int.Parse(dic["UserLevel"].ToString()));
+                dic["MerchantType"] = RelationClassForConst.GetMerchantTypeInfo(int.Parse(dic["MerchantType"].ToString()));
+                int ParentUserId = int.Parse(dic["ParentUserId"].ToString());
+                Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
+                dic["ParentMakerCode"] = puser.MakerCode;
+                dic["ParentRealName"] = puser.RealName;
+                string ParentNav = dic["ParentNav"].ToString();
+                if (!string.IsNullOrEmpty(ParentNav))
+                {
+                    string[] list = ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                    if (list.Length > 1)
+                    {
+                        int TopId = int.Parse(function.CheckInt(list[1]));
+                        Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
+                        dic["TopMakerCode"] = tuser.MakerCode;
+                        dic["TopRealName"] = tuser.RealName;
+                    }
+                }
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+
         #region 增加创客
 
         /// <summary>

+ 135 - 0
Areas/Admin/Controllers/OperateServer/AmountRecordOperateController.cs

@@ -0,0 +1,135 @@
+/*
+ * 创客账户变动记录
+ */
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Data;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using MySystem.OpModels;
+using Library;
+using LitJson;
+using MySystemLib;
+
+namespace MySystem.Areas.Admin.Controllers
+{
+    [Area("Admin")]
+    [Route("Admin/[controller]/[action]")]
+    public class AmountRecordOperateController : BaseController
+    {
+        public AmountRecordOperateController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["OpSqlConnStr"].ToString();
+        }
+
+        #region 运营中心额度变动明细记录列表
+
+        /// <summary>
+        /// 根据条件查询运营中心额度变动明细记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(AmountRecord data, string right, int UserId = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询运营中心额度变动明细记录列表
+
+        /// <summary>
+        /// 运营中心额度变动明细记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(AmountRecord data, string MakerCode, string OpCode, string CreateDateData, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            string condition = " and Status>-1";
+            //创客编号
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                condition += " and UserId in (select UserId from SysAdmin where MakerCode='" + MakerCode + "')";
+            }
+            //运营中心编号
+            if (!string.IsNullOrEmpty(OpCode))
+            {
+                condition += " and UserId in (select UserId from SysAdmin where OpCode='" + OpCode + "')";
+            }
+            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'";
+                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
+                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
+                var check = opdb.AmountRecord.Any(m => m.CreateDate >= start);
+                var checks = opdb.AmountRecord.Any(m => m.CreateDate <= end);
+                if (check)
+                {
+                    var sId = opdb.AmountRecord.Where(m => m.CreateDate >= start).Min(m => m.Id);
+                    condition += "  and Id >=" + sId;
+                }
+                if (checks)
+                {
+                    var eId = opdb.AmountRecord.Where(m => m.CreateDate <= end).Max(m => m.Id);
+                    condition += " and Id <=" + eId;
+                }
+            }
+            else
+            {
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
+                var check = opdb.AmountRecord.Any(m => m.CreateDate >= start);
+                if (check)
+                {
+                    var minId = opdb.AmountRecord.Where(m => m.CreateDate >= start).Min(m => m.Id);
+                    var Info = function.ReadInstance("/WritePage/AmountRecordOperate/AmountRecordOperate.txt");
+                    if (string.IsNullOrEmpty(Info.ToString()))
+                    {
+                        function.WritePage("/WritePage/AmountRecordOperate/", "AmountRecordOperate.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
+                    else
+                    {
+                        condition += " and Id >=" + Convert.ToInt32(Info);
+                    }
+                }
+                else
+                {
+                    condition += " and Id =0";
+                }
+            }
+
+            Dictionary<string, object> obj = new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).IndexData("AmountRecord", 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 UserId = int.Parse(dic["UserId"].ToString());
+                SysAdmin sysAdmin = opdb.SysAdmin.FirstOrDefault(m => m.UserId == UserId) ?? new SysAdmin();
+                dic["OpCode"] = sysAdmin.OpCode;
+                dic["MakerCode"] = sysAdmin.MakerCode;
+                dic["MakerName"] = sysAdmin.MakerName;
+                int OperateType = int.Parse(dic["OperateType"].ToString());
+                dic["OperateTypeName"] = "";
+                if (OperateType == 1) dic["OperateTypeName"] = "收入";
+                if (OperateType == 2) dic["OperateTypeName"] = "支出";
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+    }
+}

+ 1 - 1
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Indexs.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"

+ 4 - 4
Areas/Admin/Views/MainServer/SysTools/CheckMachine.cshtml

@@ -43,13 +43,13 @@
                                             autocomplete="off" placeholder="请输入机具SN">
                                     </div>
                                 </div>
-                                <div class="layui-form-item">
+                                @* <div class="layui-form-item">
                                     <label class="layui-form-label">商户编号</label>
                                     <div class="layui-input-inline">
                                         <input class="layui-input" type="text" id="MerNo"
                                             name="MerNo" maxlength="50" autocomplete="off" placeholder="请输入商户编号">
                                     </div>
-                                </div>
+                                </div> *@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">补激活奖励</label>
                                     <div class="layui-input-block">
@@ -57,13 +57,13 @@
                                             lay-skin="switch" lay-filter="switchTest" title="开关">
                                     </div>
                                 </div>
-                                <div class="layui-form-item">
+                                @* <div class="layui-form-item">
                                     <label class="layui-form-label">是否预发机</label>
                                     <div class="layui-input-block">
                                         <input type="checkbox" id="IsPre" name="IsPre" value="1"
                                             lay-skin="switch" lay-filter="switchTest" title="开关">
                                     </div>
-                                </div>
+                                </div> *@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">是否推送消息</label>
                                     <div class="layui-input-block">

+ 7 - 1
Areas/Admin/Views/MainServer/SysTools/TransferPos.cshtml

@@ -30,12 +30,18 @@
                         </ul>
                         <div class="layui-tab-content mt20">
                             <div class="layui-tab-item layui-show">
-                                <div class="layui-form-item">
+                                @* <div class="layui-form-item">
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-inline">
                                         <input class="layui-input" type="text" id="PosSn" name="PosSn" maxlength="50"
                                             lay-verify="required|" autocomplete="off" placeholder="请输入机具SN">
                                     </div>
+                                </div> *@
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">机具SN</label>
+                                    <div class="layui-input-block">
+                                        <textarea class="layui-textarea" lay-verify="required|" name="PosSn" id="PosSn" placeholder="请输入机具SN,多个机具SN用回车隔开"></textarea>
+                                    </div>
                                 </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">来源创客编号</label>

+ 131 - 0
Areas/Admin/Views/MainServer/Users/CancleUsers.cshtml

@@ -0,0 +1,131 @@
+@using MySystem.Models;
+@{
+    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-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="" 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="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>
+                        <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>
+                        <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;">
+                </div>
+
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+            </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/UsersCancle_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+    </script>
+</body>
+</html>

+ 88 - 0
Areas/Admin/Views/OperateServer/AmountRecordOperate/Index.cshtml

@@ -0,0 +1,88 @@
+@using MySystem.Models;
+@{
+    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" name="OpCode" 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" readonly name="CreateDateData" id="CreateDate"
+                            placeholder="交易时间" 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,"))
+                        {
+                            <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">
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                </script>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_operate/AmountRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+    </script>
+</body>
+</html>

+ 1 - 1
wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js

@@ -99,7 +99,7 @@ layui.config({
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'Status', width: 200, title: '状态', sort: true }
             , { field: 'UserIdRealName', width: 200, title: '创客真实姓名', sort: true }
-            , { field: 'UserIdMakerCode', width: 200, title: '创客创客编号', sort: true }
+            , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'UseAmount', width: 200, title: '申请提现临额', sort: true }
             , { field: 'CertId', width: 200, title: '身份证号', sort: true }

+ 307 - 0
wwwroot/layuiadmin/modules_main/UsersCancle_Admin.js

@@ -0,0 +1,307 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/Users/Import?r=" + Math.random(1),
+        data: "Kind=" + ExcelKind + "&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[0], { time: 20000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+
+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: 'date',
+        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导入
+    var 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/Users/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/Users/CancleUsersData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', width: 100, title: 'ID', sort: true }
+            , { field: 'MakerCode', width: 200, title: '创客编号', sort: true, templet: '#MakerCodeTpl' }
+            , { field: 'RealName', width: 200, title: '创客姓名', sort: true }
+            , { field: 'UserLevel', width: 200, title: '创客等级', sort: true }
+            , { field: 'AgentAreas', width: 200, title: '展业地区', sort: true }
+            , { field: 'SettleAmount', width: 200, title: '提现金额(元)', sort: true }
+            , { field: 'FreezeAmount', width: 200, title: '冻结金额(元)', sort: true }
+            , { field: 'CertId', width: 200, title: '身份证号', sort: true }
+            , { field: 'Mobile', width: 200, title: '联系手机', sort: true }
+            , { field: 'MerchantType', width: 200, title: '商户创客类型', sort: true }
+            , { field: 'MerchantDate', width: 200, title: '成为商户创客时间', sort: true }
+            , { field: 'ParentMakerCode', width: 200, title: '直属创客编号', sort: true }
+            , { field: 'ParentRealName', width: 200, title: '直属创客名称', sort: true }
+            , { field: 'TopMakerCode', width: 200, title: '顶级创客编号', sort: true }
+            , { field: 'TopRealName', width: 200, title: '顶级创客名称', sort: true }
+            , { field: 'AuthFlagName', width: 200, title: '实名状态', sort: true }
+            , { field: 'RiskFlagName', width: 200, title: '风控状态', sort: true }
+            , { field: 'CreateDate', width: 200, title: '注册时间', sort: true }
+
+        ]]
+        , where: {
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-' + String($('.layui-card-header').height() + 130)
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+    });
+
+
+    //监听搜索
+    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/Users/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', '550px']
+                , 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/Users/Add?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                if (data == "success") {
+                                    layer.close(index); //关闭弹层
+                                    layer.msg('新增成功', { time: 1500 }, function () {
+                                        table.reload('LAY-list-manage'); //数据刷新
+                                    });
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+        }
+        , 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/Users/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/Users/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);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});

+ 393 - 0
wwwroot/layuiadmin/modules_operate/AmountRecord_Admin.js

@@ -0,0 +1,393 @@
+var ExcelData;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/AmountRecordOperate/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 {
+                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: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 2) {
+                if (endDate.month - date.month == 2 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过2个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过2个月');
+                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/AmountRecordOperate/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/AmountRecordOperate/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'OpCode', width: 105, title: '运营中心编号', sort: true }
+            , { field: 'MakerCode', width: 105, title: '创客编号', sort: true }
+            , { field: 'MakerName', width: 105, title: '创客姓名', sort: true }
+            , { field: 'SeoDescription', width: 100, title: '备注', sort: true }
+            , { field: 'UseAmount', width: 110, title: '交易金额', sort: true }
+            , { field: 'BeforeAmount', width: 130, title: '交易前总金额', sort: true }
+            , { field: 'AfterAmount', width: 130, title: '交易后总金额', sort: true }
+            , { field: 'CreateDate', width: 110, title: '交易时间', sort: true }
+        ]]
+        , where: {
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-' + String($('.layui-card-header').height() + 130)
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".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/AmountRecordOperate/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/AmountRecordOperate/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/AmountRecordOperate/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/AmountRecordOperate/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 () {
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '180px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+        }
+        , 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/AmountRecordOperate/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/AmountRecordOperate/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/AmountRecordOperate/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);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});