Przeglądaj źródła

Merge branch 'feature-dgy-后台新功能批量处理' into feature-dgy-后台测试

DuGuYang 3 lat temu
rodzic
commit
a1c6f3af7b

+ 97 - 1
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using MySystem.Models;
+using System.Data;
 using Library;
 using LitJson;
 using MySystemLib;
@@ -4064,7 +4065,7 @@ namespace MySystem.Areas.Admin.Controllers
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
+
             CustomTagSet set = db.CustomTagSet.FirstOrDefault(m => m.Tags == "CashWithoutUser") ?? new CustomTagSet();
             ViewBag.set = set;
 
@@ -4801,5 +4802,100 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
+        #region 直营团队数据导出
+
+        public IActionResult Team1Info(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+        #endregion
+
+        #region 直营团队数据导出
+        public JsonResult Team1InfoDo(string MakerCode, string BindingTime, string ActivationTime, string PosFee, string BrandId, int page = 1, int limit = 30)
+        {
+            string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            string condition = " where 1=1";
+            var UserId = 0;
+            var bstart = "";
+            var bend = "";
+            var astart = "";
+            var aend = "";
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                var user = db.Users.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new Users();
+                UserId = user.Id;
+            }
+            if (!string.IsNullOrEmpty(BindingTime))
+            {
+                string[] datelist = BindingTime.Split(new string[] { " - " }, StringSplitOptions.None);
+                bstart = datelist[0] + " 00:00:00";
+                bend = datelist[1] + " 23:59:59";
+                condition += "and tb.BindingTime>='" + bstart + "' and tb.BindingTime<'" + bend + "'";
+            }
+            if (!string.IsNullOrEmpty(ActivationTime))
+            {
+                string[] datelist = ActivationTime.Split(new string[] { " - " }, StringSplitOptions.None);
+                astart = datelist[0] + " 00:00:00";
+                aend = datelist[1] + " 23:59:59";
+                condition += " and tb.ActivationTime>='" + astart + "' and tb.ActivationTime<'" + aend + "'";
+            }
+            if (!string.IsNullOrEmpty(PosFee))
+            {
+                condition += " and tb.SeoKeyword=" + PosFee;
+            }
+            if (!string.IsNullOrEmpty(BrandId))
+            {
+                condition += " and tb.BrandId=" + BrandId;
+            }
+            var sql = "select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
+
+            DataTable dt = CustomerSqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
+            foreach (DataRow item in dt.Rows)
+            {
+                Dictionary<string, object> curData = new Dictionary<string, object>();
+                curData.Add("wname", item["wname"].ToString()); //伙伴名称
+                curData.Add("Name", item["Name"].ToString()); //机具品牌
+                curData.Add("PosSn", item["PosSn"].ToString()); //机具Sn
+                curData.Add("SeoKeyword", item["SeoKeyword"].ToString()); //押金
+                curData.Add("BindingTime", string.IsNullOrEmpty(item["BindingTime"].ToString()) ? "" : Convert.ToDateTime(item["BindingTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
+                curData.Add("ActivationTime", string.IsNullOrEmpty(item["ActivationTime"].ToString()) ? "" : Convert.ToDateTime(item["ActivationTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //激活时间
+                dataList.Add(curData);
+            }
+            Dictionary<string, object> obj = new Dictionary<string, object>();
+            obj.Add("code", 0);
+            obj.Add("msg", "");
+            obj.Add("count", dataList.Count);
+            obj.Add("data", dataList);
+            return Json(obj);
+        }
+
+        #endregion
+
+
+        // #region 快捷导出Excel
+        // public IActionResult QuickExportExcel(string right)
+        // {
+        //     ViewBag.RightInfo = RightInfo;
+        //     ViewBag.right = right;
+
+        //     return View();
+        // }
+
+        // [HttpPost]
+        // public string QuickExportExcelDo(string UserIdMakerCode, string SourceMakerCode, string RemarkSelect, string CreateDateData, string SeoKeyword)
+        // { 
+        //     var Sql = "SELECT c.MakerCode '创客编号',c.RealName '创客姓名',DATE_FORMAT(c.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',c.Remark '变动类型',c.Type1Num '电签兑换券张数',c.Type2Num '大POS兑换券张数',d.LeaderBalanceAmount '可提现余额',c.ChangeAmt '使用额度',c.BeforeAmt '使用前剩余额度',c.AfterAmt '使用后剩余额度' FROM(SELECT a.*,b.MakerCode,b.RealName FROM(SELECT Id,UserId,CreateDate,ChangeAmt,BeforeAmt,AfterAmt,Remark,REPLACE (JSON_EXTRACT (SeoTitle, '$[0].Num'),'\\\"','') AS 'Type1Num', REPLACE (JSON_EXTRACT (SeoTitle, '$[1].Num'),'\\\"','') AS 'Type2Num' FROM LeaderReserveRecord WHERE 1=1 " + SqlString + ") a LEFT JOIN Users b ON a.UserId=b.Id) c LEFT JOIN UserAccount d ON c.UserId=d.Id";
+        //     var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
+        //     var FileName = "盟主储蓄金变动记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+        //     string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
+        //     RedisDbconn.Instance.AddList("ExportQueue", SendData);
+        //     return "success";
+        // }
+        // #endregion
+
     }
 }

+ 14 - 5
Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs

@@ -143,20 +143,29 @@ namespace MySystem.Areas.Admin.Controllers
         /// </summary>
         /// <returns></returns>
         [HttpPost]
-        public string Add(ToChargeBackRecord data)
+        public string Add(ToChargeBackRecord data, string MakerCode)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
-
-            Fields.Add("UserId", data.UserId); //创客
+            var user = db.Users.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new Users();
+            if (user.Id == 0)
+            {
+                return "创客" + MakerCode + "不存在或编号错误";
+            }
+            Fields.Add("UserId", user.Id); //创客Id
             Fields.Add("ChargeAmount", data.ChargeAmount); //待扣金额
-            Fields.Add("ChargeType", data.ChargeType); //待扣类型
+            Fields.Add("ChargeType", 1); //待扣类型
             Fields.Add("Remark", data.Remark); //备注
             Fields.Add("Field1", data.Field1); //备用字段
 
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
-            Fields.Add("SeoDescription", data.SeoDescription);
+            Fields.Add("SeoDescription", data.Remark);
             int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("ToChargeBackRecord", Fields, 0);
+            var toChargeBackRecord = db.ToChargeBackRecord.FirstOrDefault(m => m.Id == Id) ?? new ToChargeBackRecord();
+            if (toChargeBackRecord.Id > 0)
+            {
+                toChargeBackRecord.UpdateDate = null;
+            }
             AddSysLog(data.Id.ToString(), "ToChargeBackRecord", "add");
             db.SaveChanges();
 

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

@@ -2499,5 +2499,268 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         #endregion
+
+
+        #region 批量查询创客信息
+
+        public IActionResult BatchSeeUserInfo(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+        #endregion
+
+        #region 批量查询创客信息
+        public JsonResult BatchSeeUserInfoDo(string PosSns, string MerNos, int page = 1, int limit = 30)
+        {
+            var error = "";
+            //实际押金
+            string SeoKeyword = "0";
+            Dictionary<string, object> errorInfo = new Dictionary<string, object>();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            if (string.IsNullOrEmpty(PosSns) && string.IsNullOrEmpty(MerNos))
+            {
+                Dictionary<string, object> objs = new Dictionary<string, object>();
+                return Json(objs);
+            }
+            else if (!string.IsNullOrEmpty(PosSns) && !string.IsNullOrEmpty(MerNos))
+            {
+                Dictionary<string, object> objs = new Dictionary<string, object>();
+                return Json(objs);
+            }
+            else
+            {
+                if (!string.IsNullOrEmpty(PosSns))
+                {
+                    string[] PosSnsList = PosSns.Replace("\r", "").Replace("\n", ",").Split(',');
+                    foreach (string PosSn in PosSnsList)
+                    {
+                        Dictionary<string, object> data = new Dictionary<string, object>();
+                        var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn) ?? new PosMachinesTwo();
+                        if (pos.Id == 0)
+                        {
+                            error += "机具" + PosSn + "不存在\n";
+                        }
+                        else
+                        {
+                            var TopMakerCode = ""; //顶级创客编号
+                            var TopRealName = ""; //顶级创客名称
+                            var SecondMakerCode = ""; //次顶级创客编号
+                            var SecondRealName = ""; //次顶级创客姓名
+                            var ThirdMakerCode = ""; //次次顶级创客编号
+                            var ThirdRealName = ""; //次次顶级创客姓名
+                            var mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId) ?? new PosMerchantInfo();
+                            if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                            {
+                                if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
+                                {
+                                    SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
+                                }
+                                else
+                                {
+                                    SeoKeyword = pos.SeoKeyword;
+                                }
+                            }
+                            var user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
+                            if (!string.IsNullOrEmpty(user.ParentNav))
+                            {
+                                string[] ParentNavList = user.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                                var topUserInfo = new Users();
+                                var secondUserInfo = new Users();
+                                var thirdUserInfo = new Users();
+                                if (ParentNavList.Length > 1)
+                                {
+                                    topUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[1]))) ?? new Users();
+                                    if (ParentNavList.Length > 2)
+                                    {
+                                        secondUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[2]))) ?? new Users();
+                                        if (ParentNavList.Length > 3)
+                                        {
+                                            thirdUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[3]))) ?? new Users();
+                                        }
+                                    }
+                                }
+                                else
+                                {
+                                    topUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[0]))) ?? new Users();
+                                }
+                                TopMakerCode = topUserInfo.MakerCode; //顶级创客编号
+                                TopRealName = topUserInfo.RealName; //顶级创客名称
+                                SecondMakerCode = secondUserInfo.MakerCode; //次顶级创客编号
+                                SecondRealName = secondUserInfo.RealName; //次顶级创客姓名
+                                ThirdMakerCode = thirdUserInfo.MakerCode; //次次顶级创客编号
+                                ThirdRealName = thirdUserInfo.RealName; //次次顶级创客姓名
+                            }
+                            data["PosSn"] = pos.PosSn; //机具Sn
+                            data["MerNo"] = mer.KqMerNo; //商户编号
+                            data["PosFee"] = SeoKeyword; //服务费
+                            data["BindingTime"] = pos.BindingTime == null ? "" : pos.BindingTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); //绑定时间
+                            data["ActivationTime"] = pos.ActivationTime == null ? "" : pos.ActivationTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); //激活时间
+                            data["MakerCode"] = user.MakerCode; //创客编号
+                            data["RealName"] = user.RealName; //创客姓名
+                            data["TopMakerCode"] = TopMakerCode; //顶级创客编号
+                            data["TopRealName"] = TopRealName; //顶级创客名称
+                            data["SecondMakerCode"] = SecondMakerCode; //次顶级创客编号
+                            data["SecondRealName"] = SecondRealName; //次顶级创客姓名
+                            data["ThirdMakerCode"] = ThirdMakerCode; //次次顶级创客编号
+                            data["ThirdRealName"] = ThirdRealName; //次次顶级创客姓名
+                        }
+                        dataList.Add(data);
+                    }
+                }
+                if (!string.IsNullOrEmpty(MerNos))
+                {
+                    string[] MerNosList = MerNos.Replace("\r", "").Replace("\n", ",").Split(',');
+                    foreach (string MerNo in MerNosList)
+                    {
+                        Dictionary<string, object> data = new Dictionary<string, object>();
+                        var mer = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == MerNo) ?? new PosMerchantInfo();
+                        if (mer.Id == 0)
+                        {
+                            error += "商户" + MerNo + "不存在\n";
+                        }
+                        else
+                        {
+                            var TopMakerCode = ""; //顶级创客编号
+                            var TopRealName = ""; //顶级创客名称
+                            var SecondMakerCode = ""; //次顶级创客编号
+                            var SecondRealName = ""; //次顶级创客姓名
+                            var ThirdMakerCode = ""; //次次顶级创客编号
+                            var ThirdRealName = ""; //次次顶级创客姓名
+                            var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == mer.KqSnNo) ?? new PosMachinesTwo();
+                            if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                            {
+                                if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
+                                {
+                                    SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
+                                }
+                                else
+                                {
+                                    SeoKeyword = pos.SeoKeyword;
+                                }
+                            }
+                            var user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
+                            if (!string.IsNullOrEmpty(user.ParentNav))
+                            {
+                                string[] ParentNavList = user.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                                var topUserInfo = new Users();
+                                var secondUserInfo = new Users();
+                                var thirdUserInfo = new Users();
+                                if (ParentNavList.Length > 1)
+                                {
+                                    topUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[1]))) ?? new Users();
+                                    if (ParentNavList.Length > 2)
+                                    {
+                                        secondUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[2]))) ?? new Users();
+                                        if (ParentNavList.Length > 3)
+                                        {
+                                            thirdUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[3]))) ?? new Users();
+                                        }
+                                    }
+                                }
+                                else
+                                {
+                                    topUserInfo = db.Users.FirstOrDefault(m => m.Id == (int.Parse(ParentNavList[0]))) ?? new Users();
+                                }
+                                TopMakerCode = topUserInfo.MakerCode; //顶级创客编号
+                                TopRealName = topUserInfo.RealName; //顶级创客名称
+                                SecondMakerCode = secondUserInfo.MakerCode; //次顶级创客编号
+                                SecondRealName = secondUserInfo.RealName; //次顶级创客姓名
+                                ThirdMakerCode = thirdUserInfo.MakerCode; //次次顶级创客编号
+                                ThirdRealName = thirdUserInfo.RealName; //次次顶级创客姓名
+                            }
+                            data["PosSn"] = pos.PosSn; //机具Sn
+                            data["MerNo"] = mer.KqMerNo; //商户编号
+                            data["PosFee"] = SeoKeyword; //服务费
+                            data["BindingTime"] = pos.BindingTime == null ? "" : pos.BindingTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); //绑定时间
+                            data["ActivationTime"] = pos.ActivationTime == null ? "" : pos.ActivationTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); //激活时间
+                            data["MakerCode"] = user.MakerCode; //创客编号
+                            data["RealName"] = user.RealName; //创客姓名
+                            data["TopMakerCode"] = TopMakerCode; //顶级创客编号
+                            data["TopRealName"] = TopRealName; //顶级创客名称
+                            data["SecondMakerCode"] = SecondMakerCode; //次顶级创客编号
+                            data["SecondRealName"] = SecondRealName; //次顶级创客姓名
+                            data["ThirdMakerCode"] = ThirdMakerCode; //次次顶级创客编号
+                            data["ThirdRealName"] = ThirdRealName; //次次顶级创客姓名
+                        }
+                        dataList.Add(data);
+                    }
+                }
+                if (!string.IsNullOrEmpty(error))
+                {
+                    errorInfo.Add("code", -1);
+                    errorInfo.Add("msg", error);
+                    return Json(errorInfo);
+                }
+            }
+            Dictionary<string, object> obj = new Dictionary<string, object>();
+            obj.Add("code", 0);
+            obj.Add("msg", "");
+            obj.Add("count", dataList.Count);
+            obj.Add("data", dataList);
+            return Json(obj);
+        }
+
+        #endregion
+
+
+        #region 批量查询创客信息快捷导出Excel
+        public IActionResult ExportBatchSeeUserInfoExcel(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        [HttpPost]
+        public string ExportBatchSeeUserInfoExcelDo(string PosSns, string MerNos)
+        {
+            var sql = "";
+            if (string.IsNullOrEmpty(PosSns) && string.IsNullOrEmpty(MerNos))
+            {
+                return "请输入查询内容";
+            }
+            else if (!string.IsNullOrEmpty(PosSns) && !string.IsNullOrEmpty(MerNos))
+            {
+                return "不能同时输入机具Sn和商户编号";
+            }
+            else
+            {
+                if (!string.IsNullOrEmpty(PosSns))
+                {
+                    var posIds = "";
+                    string[] PosSnsList = PosSns.Replace("\r", "").Replace("\n", ",").Split(',');
+                    foreach (string PosSn in PosSnsList)
+                    {
+                        var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn) ?? new PosMachinesTwo();
+                        posIds += pos.Id + ",";
+                    }
+                    posIds = posIds.TrimEnd(',');
+                    sql = "SELECT i.PosSn '机具SN',j.KqMerNo '商编',j.MerchantName '商户名称',(CASE WHEN i.BrandId not in(2,7,10,11) THEN ROUND(CAST(i.SeoKeyword AS DECIMAL)/100, 2) ELSE i.SeoKeyword end) '服务费',DATE_FORMAT(i.BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(i.ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',i.uMakerCode '推荐码',i.uRealName '创客姓名',i.topMakerCode '顶级推荐码',i.topRealname '顶级姓名',i.secondMakerCode '次顶级推荐码',i.secondRealname '次顶级姓名',i.thirdMakerCode '次次顶级推荐码',i.thirdRealname '次次顶级姓名'  FROM(SELECT g.*,h.MakerCode thirdMakerCode,h.Realname thirdRealname FROM (SELECT e.*,f.MakerCode secondMakerCode,f.Realname secondRealname FROM(SELECT c.*,d.MakerCode topMakerCode,d.Realname topRealname FROM(SELECT a.*,b.Id useId,b.MakerCode uMakerCode,b.RealName uRealName, SUBSTRING_INDEX(SUBSTRING_INDEX(b.ParentNav,',',4),',',-1) topId,SUBSTRING_INDEX(SUBSTRING_INDEX(b.ParentNav,',',6),',',-1) secondId,SUBSTRING_INDEX(SUBSTRING_INDEX(b.ParentNav,',',8),',',-1) thirdId FROM PosMachinesTwo a LEFT JOIN Users b ON a.BuyUserId=b.Id WHERE a.Id in(" + posIds + "))c LEFT JOIN Users d ON c.topId=d.Id) e LEFT JOIN Users f ON e.secondId=f.Id) g LEFT JOIN Users h ON g.thirdId=h.Id) i LEFT JOIN PosMerchantInfo j ON i.BindMerchantId=j.Id";
+                }
+                if (!string.IsNullOrEmpty(MerNos))
+                {
+                    var merIds = "";
+                    string[] MerNosList = MerNos.Replace("\r", "").Replace("\n", ",").Split(',');
+                    foreach (string MerNo in MerNosList)
+                    {
+                        var mer = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == MerNo) ?? new PosMerchantInfo();
+                        merIds += mer.Id + ",";
+                    }
+                    merIds = merIds.TrimEnd(',');
+                    sql = "SELECT i.KqSnNo '机具SN',i.KqMerNo '商编',i.MerchantName '商户名称',i.SeoKeyword '服务费',i.BindingTime '绑定时间',i.ActivationTime '激活时间',i.uMakerCode '推荐码',i.uRealName '创客姓名',i.topMakerCode '顶级推荐码',i.topRealname '顶级姓名',i.secondMakerCode '次顶级推荐码',i.secondRealname '次顶级姓名',j.MakerCode '次次顶级推荐码',j.Realname '次次顶级姓名' FROM(SELECT g.*,h.MakerCode secondMakerCode,h.Realname secondRealname FROM(SELECT e.*,f.MakerCode topMakerCode,f.RealName topRealName FROM(SELECT c.*,d.MakerCode uMakerCode,d.RealName uRealName,SUBSTRING_INDEX(SUBSTRING_INDEX(d.ParentNav,',',4),',',-1) topId,SUBSTRING_INDEX(SUBSTRING_INDEX(d.ParentNav,',',6),',',-1) secondId,SUBSTRING_INDEX(SUBSTRING_INDEX(d.ParentNav,',',8),',',-1) thirdId FROM(SELECT a.KqMerNo,a.KqSnNo,a.MerchantName,(CASE WHEN b.BrandId not in(2,7,10,11) THEN ROUND(CAST(b.SeoKeyword AS DECIMAL)/100, 2) ELSE b.SeoKeyword end) SeoKeyword,b.BindingTime,b.ActivationTime,b.BuyUserId,b.BrandId FROM PosMerchantInfo a LEFT JOIN PosMachinesTwo b ON a.KqSnNo=b.PosSn WHERE a.Id in(" + merIds + "))c LEFT JOIN Users d ON c.BuyUserId=d.Id) e LEFT JOIN Users f ON e.topId=f.Id) g LEFT JOIN Users h ON g.secondId=h.Id) i LEFT JOIN Users j ON i.thirdId=j.Id";
+                }
+            }
+            var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
+            var FileName = "批量查询创客信息" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
+            RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            return "success";
+        }
+        #endregion
+
     }
 }

+ 1 - 14
Areas/Admin/Views/MainServer/LeaderReserveRecord/Index.cshtml

@@ -94,7 +94,7 @@
                             @if (RightInfo.Contains("," + right + "_export,"))
                             {
                                 <button class="layui-btn" data-type="ExportExcel"><i
-                                    class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+                                        class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
                             }
                         </div>
                     </div>
@@ -103,18 +103,6 @@
                 <div class="layui-card-body">
                     <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>
@@ -143,7 +131,6 @@
                 </div>
             </div>
         </div>
-
         <script src="/layuiadmin/layui/layui.js"></script>
         <script
             src="/layuiadmin/modules_main/LeaderReserveRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>

+ 110 - 0
Areas/Admin/Views/MainServer/SysTools/Team1Info.cshtml

@@ -0,0 +1,110 @@
+@{
+    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" id="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="BindingTimeData" id="BindingTime"
+                                    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" readonly name="ActivationTimeData"
+                                    id="ActivationTime" placeholder="" autocomplete="off">
+                            </div>
+                        </div>
+                        @{
+                            Dictionary<string, string> ProfitObjectsActivesDic = new
+                            MySystem.DictionaryClass().getKqProductBrandDic();
+                        }
+                        <div class="layui-inline">
+                            <label class="layui-form-label">品牌</label>
+                            <div class="layui-input-inline">
+                                <select id="BrandId" name="BrandId" lay-search="">
+                                    <option value="">全部...</option>
+                                    @foreach (string key in ProfitObjectsActivesDic.Keys)
+                                    {
+                                        <option value="@key">@ProfitObjectsActivesDic[key]</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>
+                            @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>
+
+            <div class="layui-card-body">
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/Team1Info_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+    </script>
+</body>
+
+</html>

+ 6 - 21
Areas/Admin/Views/MainServer/ToChargeBackRecord/Add.cshtml

@@ -30,19 +30,11 @@
                     </ul>
                     <div class="layui-tab-content mt20">
                         <div class="layui-tab-item layui-show">
-                            @{
-                                Dictionary<string, string> UsersDic = new MySystem.DictionaryClass().getUsersDic();
-                            }
                             <div class="layui-form-item">
-                                <label class="layui-form-label">创客</label>
+                                <label class="layui-form-label">创客编号</label>
                                 <div class="layui-input-inline">
-                                    <select id="UserId" name="UserId" lay-search="">
-                                        <option value="">请选择</option>
-                                        @foreach (string key in UsersDic.Keys)
-                                        {
-                                            <option value="@key">@UsersDic[key]</option>
-                                        }
-                                    </select>
+                                    <input class="layui-input" type="text" id="MakerCode" name="MakerCode"
+                                        maxlength="20" lay-verify="required|" autocomplete="off" placeholder="请输入创客编号">
                                 </div>
                             </div>
                             <div class="layui-form-item">
@@ -52,16 +44,16 @@
                                         maxlength="20" lay-verify="required|" autocomplete="off" placeholder="请输入待扣金额">
                                 </div>
                             </div>
-                            <div class="layui-form-item">
+                            @* <div class="layui-form-item">
                                 <label class="layui-form-label">待扣类型</label>
                                 <div class="layui-input-inline">
                                     <select id="ChargeType" name="ChargeType" lay-search="">
                                         <option value="">请选择</option>
                                         <option value="1">过期机具扣款</option>
-                                        <option value="2">人工预扣</option>
+                                        <option value="2">创客预扣款</option>
                                     </select>
                                 </div>
-                            </div>
+                            </div> *@
                             <div class="layui-form-item layui-form-text">
                                 <label class="layui-form-label">备注</label>
                                 <div class="layui-input-block">
@@ -69,13 +61,6 @@
                                         lay-verify="" placeholder="请输入备注"></textarea>
                                 </div>
                             </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">备用字段</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" id="Field1" name="Field1" maxlength="200"
-                                        lay-verify="" autocomplete="off" placeholder="请输入备用字段">
-                                </div>
-                            </div>
 
                         </div>
 

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeBackRecord/Edit.cshtml

@@ -38,7 +38,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">创客编号</label>
                                 <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" id="ChargeAmount" name="ChargeAmount" readonly
+                                    <input class="layui-input" type="text" id="MakerCode" name="MakerCode" readonly
                                         value="@ViewBag.MakerCode" maxlength="20" lay-verify="required|"
                                         autocomplete="off" placeholder="请输入待扣金额">
                                 </div>

+ 105 - 0
Areas/Admin/Views/MainServer/Users/BatchSeeUserInfo.cshtml

@@ -0,0 +1,105 @@
+@using MySystem.Models;
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    string UserId = ViewBag.UserId as string;
+    List<Users> TopUsers = ViewBag.TopUsers as List<Users>;
+}
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>批量查询创客信息</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline {
+            width: 175px !important;
+        }
+
+        .layui-form-label {
+            width: 85px !important;
+        }
+
+        .layui-inline {
+            margin-right: 0px !important;
+        }
+
+        .w100 {
+            width: 100px !important;
+        }
+
+        .ml50 {
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <input class="layui-input" type="hidden" name="ShowFlag" autocomplete="off">
+                    <div class="layui-form-item">
+                        <div class="layui-inline">
+                            <label class="layui-form-label">机具Sn</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" id="PosSns" name="PosSns" placeholder="多个机具Sn用逗号隔开" 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" id="MerNos" name="MerNos" placeholder="多个商户编号用逗号隔开" autocomplete="off">
+                            </div>
+                        </div>
+                        @* <div class="layui-inline">
+                            <label class="layui-form-label">机具Sn</label>
+                            <div class="layui-input-inline">
+                                <textarea class="layui-textarea" name="PosSn"
+                                    id="PosSn" placeholder="请输入机具Sn,多个机具Sn用回车隔开"></textarea>
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">商户编号</label>
+                            <div class="layui-input-inline">
+                                <textarea class="layui-textarea" name="MerNos"
+                                    id="MerNos" placeholder="请输入商户编号,多个商户编号用回车隔开"></textarea>
+                            </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>
+                            @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>
+            <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_main/BatchSeeUserInfo_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+    </script>
+</body>
+
+</html>

+ 163 - 0
wwwroot/layuiadmin/modules_main/BatchSeeUserInfo_Admin.js

@@ -0,0 +1,163 @@
+var ExcelData;
+
+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.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/Users/BatchSeeUserInfoDo' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'PosSn', width: 150, title: '机具Sn', sort: true }
+            , { field: 'MerNo', width: 150, title: '商户编号', sort: true }
+            , { field: 'PosFee', width: 150, title: '服务费', sort: true }
+            , { field: 'BindingTime', width: 150, title: '绑定时间', sort: true }
+            , { field: 'ActivationTime', width: 150, title: '激活时间', sort: true }
+            , { field: 'MakerCode', width: 105, title: '创客编号', sort: true }
+            , { field: 'RealName', width: 105, title: '创客姓名', sort: true }
+            , { field: 'TopMakerCode', width: 160, title: '顶级创客编号', sort: true }
+            , { field: 'TopRealName', width: 160, title: '顶级创客名称', sort: true }
+            , { field: 'SecondMakerCode', width: 160, title: '次顶级创客编号', sort: true }
+            , { field: 'SecondRealName', width: 160, title: '次顶级创客姓名', sort: true }
+            , { field: 'ThirdMakerCode', width: 160, title: '次次顶级创客编号', sort: true }
+            , { field: 'ThirdRealName', width: 160, 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
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: {
+                UserId: UserId
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        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()) + '&';
+            });
+            var index = layer.confirm('确定导出吗?', function (index) {
+                var indexs = layer.load(1, {
+                    shade: [0.5, '#000']
+                });
+                $.ajax({
+                    type: "Post",
+                    url: "/Admin/Users/ExportBatchSeeUserInfoExcelDo?r=" + Math.random(1),
+                    data: userdata,
+                    dataType: "json",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        if (data == "success") {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg('成功', {
+                                time: 1000
+                            }, function () {
+                                window.location.reload();
+                            });
+                        } else {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg(data);
+                        }
+                    }
+                });
+            });
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});

+ 197 - 0
wwwroot/layuiadmin/modules_main/Team1Info_Admin.js

@@ -0,0 +1,197 @@
+var ExcelData, ExcelKind;
+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 layActivationTime = laydate.render({
+        elem: '#ActivationTime',
+        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;
+                    layActivationTime.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layActivationTime.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#ActivationTime').val(value);
+            }
+        }
+    });
+
+    var layBindingTime = laydate.render({
+        elem: '#BindingTime',
+        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;
+                    layBindingTime.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layBindingTime.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#BindingTime').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/StoreHouse/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) { }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/SysTools/Team1InfoDo' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'wname', width: 200, title: '伙伴名称', sort: true }
+            , { field: 'Name', width: 200, title: '机具品牌', sort: true }
+            , { field: 'PosSn', width: 200, title: '机具Sn', sort: true }
+            , { field: 'SeoKeyword', width: 200, title: '押金', sort: true }
+            , { field: 'BindingTime', width: 200, title: '绑定时间', sort: true }
+            , { field: 'ActivationTime', 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("无数据");
+        }
+    });
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+
+    //监听工具条
+    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 = {
+        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()) + '&';
+            });
+            var index = layer.confirm('确定导出吗?', function (index) {
+                var indexs = layer.load(1, {
+                    shade: [0.5, '#000']
+                });
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/LeaderReserveRecord/QuickExportExcelDo?r=" + Math.random(1),
+                    data: userdata,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        if (data == "success") {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg('导出成功,请在我的下载中点击下载', {
+                                time: 1000
+                            }, function () {
+                                window.location.reload();
+                            });
+                        } else {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg(data);
+                        }
+                    }
+                });
+            });
+        },
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});