Quellcode durchsuchen

创客交易额查询
一键新建仓库(待完善)

“DuGuYang” vor 4 Jahren
Ursprung
Commit
da8f84d0c4

+ 136 - 30
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -304,6 +304,112 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 一键添加仓库
+
+        /// <summary>
+        /// 一件添加仓库
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Edits(string right, int Id = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            StoreHouse editData = db.StoreHouse.FirstOrDefault(m => m.Id == Id) ?? new StoreHouse();
+            ViewBag.data = editData;
+
+            Users manage = db.Users.FirstOrDefault(m => m.Id == editData.ManageUserId) ?? new Users();
+            ViewBag.ManageMakerCode = manage.MakerCode;
+            ViewBag.ManageRealName = manage.RealName;
+
+            Users user = db.Users.FirstOrDefault(m => m.Id == editData.ManageUserId) ?? new Users();
+            ViewBag.MakerCode = user.MakerCode;
+            return View();
+        }
+
+        #endregion
+
+        #region 一键添加仓库
+
+        /// <summary>
+        /// 一键添加仓库
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edits(StoreHouse data, string ManageMakerCode, string MakerCode)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            StoreHouse storeHouse = db.StoreHouse.FirstOrDefault(m => m.Id == data.Id);
+            if (!string.IsNullOrEmpty(storeHouse.BrandId))
+            {
+                return "您已有该品牌类型的仓库,请重新选择";
+            }
+            if (!string.IsNullOrEmpty(storeHouse.StoreName))
+            {
+                return "您的仓库名重复,请重新填写";
+            }
+            Fields.Add("StoreName", data.StoreName); //仓库名称
+            UserForMakerCode user = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode);
+            if (user == null)
+            {
+                return "您输入的仓库归属创客编号不存在,请重新输入正确的仓库归属创客编号";
+            }
+            Fields.Add("UserId", user.UserId); //仓库归属人
+            Fields.Add("Areas", data.Areas); //所属地区
+            Fields.Add("Address", data.Address); //仓库地址
+            UserForMakerCode manage = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == ManageMakerCode);
+            if (manage == null)
+            {
+                return "您输入的仓库负责人编号不存在,请重新输入正确的仓库负责人编号";
+            }
+            Fields.Add("ManageUserId", manage.UserId); //仓库管理员
+            Fields.Add("ManagerEmail", data.ManagerEmail); //管理者邮箱
+            Fields.Add("ManageMobile", data.ManageMobile);
+            Fields.Add("Remark", data.Remark); //备注
+            Fields.Add("LimitTopUserId", data.LimitTopUserId); //限制创客特殊仓库
+            Fields.Add("StoreKind", data.StoreKind); //仓库归属类型
+            int bid = int.Parse(storeHouse.BrandId);
+            KqProducts pro = db.KqProducts.FirstOrDefault(m => m.Id == bid) ?? new KqProducts();
+            Fields.Add("BrandId", storeHouse.BrandId);
+            Fields.Add("ProductName", pro.Name);
+            Fields.Add("StoreStatus", 1);
+            Fields.Add("Status", 1);
+
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreHouse", Fields, 0);
+            StoreHouse edit = db.StoreHouse.FirstOrDefault(m => m.Id == Id);
+            if (edit != null)
+            {
+                string No = Id.ToString();
+                for (int i = 0; i < 7 - Id.ToString().Length; i++)
+                {
+                    No = "0" + No;
+                }
+                No = "S" + No;
+                edit.StoreNo = No;
+                db.StoreForCode.Add(new StoreForCode()
+                {
+                    Code = No,
+                    StoreId = Id,
+                });
+                RedisDbconn.Instance.Set("StoreForCode:" + No, Id);
+            }
+            db.StoreForName.Add(new StoreForName()
+            {
+                Name = data.StoreName,
+                StoreId = Id,
+            });
+            RedisDbconn.Instance.Set("StoreForName:" + data.StoreName, Id);
+            AddSysLog(data.Id.ToString(), "StoreHouse", "add");
+            db.SaveChanges();
+
+            SetRedis(Id, user.UserId);
+            return "success";
+        }
+
+        #endregion
+
+
         #region 删除仓库信息
 
         /// <summary>
@@ -459,7 +565,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (datalist[0] == "success")
                 {
                     List<string> errList = RedisDbconn.Instance.GetList<string>("ErrList" + key);
-                    if(errList.Count > 0)
+                    if (errList.Count > 0)
                     {
                         Obj.Add("status", 2);
                         Obj.Add("errList", errList);
@@ -594,7 +700,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
 
-        
+
         #region 仓库列表
 
         /// <summary>
@@ -622,7 +728,7 @@ namespace MySystem.Areas.Admin.Controllers
             OtherMySqlConn.connstr = ConfigurationManager.AppSettings["StatSqlConnStr"].ToString();
             string sCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
             string eCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59";
-            if(!string.IsNullOrEmpty(CreateDateData))
+            if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 sCreateDate = datelist[0] + " 00:00:00";
@@ -635,7 +741,7 @@ namespace MySystem.Areas.Admin.Controllers
                 nodata.Add("msg", "");
                 nodata.Add("count", 0);
                 nodata.Add("data", new List<Dictionary<string, object>>());
-                
+
                 return Json(nodata);
             }
             string minId = "0";
@@ -643,52 +749,52 @@ namespace MySystem.Areas.Admin.Controllers
             string minPosId = "0";
             string maxPosId = "0";
             DataTable startDt = OtherMySqlConn.dtable("select min(Id) from StoreStockChange where CreateDate>='" + sCreateDate + "'");
-            if(startDt.Rows.Count > 0)
+            if (startDt.Rows.Count > 0)
             {
                 minId = function.CheckInt(startDt.Rows[0][0].ToString());
-                if(minId == "0")
+                if (minId == "0")
                 {
                     startDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange");
-                    if(startDt.Rows.Count > 0)
+                    if (startDt.Rows.Count > 0)
                     {
                         minId = function.CheckInt(startDt.Rows[0][0].ToString());
                     }
                 }
             }
             DataTable endDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange where CreateDate>='" + sCreateDate + "'");
-            if(endDt.Rows.Count > 0)
+            if (endDt.Rows.Count > 0)
             {
                 maxId = function.CheckInt(endDt.Rows[0][0].ToString());
-                if(minId == "0")
+                if (minId == "0")
                 {
                     endDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange");
-                    if(endDt.Rows.Count > 0)
+                    if (endDt.Rows.Count > 0)
                     {
                         maxId = function.CheckInt(endDt.Rows[0][0].ToString());
                     }
                 }
             }
             DataTable startPosDt = OtherMySqlConn.dtable("select min(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
-            if(startPosDt.Rows.Count > 0)
+            if (startPosDt.Rows.Count > 0)
             {
                 minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
-                if(minPosId == "0")
+                if (minPosId == "0")
                 {
                     startPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
-                    if(startPosDt.Rows.Count > 0)
+                    if (startPosDt.Rows.Count > 0)
                     {
                         minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
                     }
                 }
             }
             DataTable endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
-            if(endPosDt.Rows.Count > 0)
+            if (endPosDt.Rows.Count > 0)
             {
                 maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
-                if(maxPosId == "0")
+                if (maxPosId == "0")
                 {
                     endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
-                    if(endPosDt.Rows.Count > 0)
+                    if (endPosDt.Rows.Count > 0)
                     {
                         maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
                     }
@@ -718,7 +824,7 @@ namespace MySystem.Areas.Admin.Controllers
             obj.Add("msg", "");
             obj.Add("count", recordcount);
             obj.Add("data", diclist);
-            
+
             return Json(obj);
         }
 
@@ -735,7 +841,7 @@ namespace MySystem.Areas.Admin.Controllers
             OtherMySqlConn.connstr = ConfigurationManager.AppSettings["StatSqlConnStr"].ToString();
             string sCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
             string eCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59";
-            if(!string.IsNullOrEmpty(CreateDateData))
+            if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 sCreateDate = datelist[0] + " 00:00:00";
@@ -765,52 +871,52 @@ namespace MySystem.Areas.Admin.Controllers
             string minPosId = "0";
             string maxPosId = "0";
             DataTable startDt = OtherMySqlConn.dtable("select min(Id) from StoreStockChange where CreateDate>='" + sCreateDate + "'");
-            if(startDt.Rows.Count > 0)
+            if (startDt.Rows.Count > 0)
             {
                 minId = function.CheckInt(startDt.Rows[0][0].ToString());
-                if(minId == "0")
+                if (minId == "0")
                 {
                     startDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange");
-                    if(startDt.Rows.Count > 0)
+                    if (startDt.Rows.Count > 0)
                     {
                         minId = function.CheckInt(startDt.Rows[0][0].ToString());
                     }
                 }
             }
             DataTable endDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange where CreateDate>='" + sCreateDate + "'");
-            if(endDt.Rows.Count > 0)
+            if (endDt.Rows.Count > 0)
             {
                 maxId = function.CheckInt(endDt.Rows[0][0].ToString());
-                if(minId == "0")
+                if (minId == "0")
                 {
                     endDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange");
-                    if(endDt.Rows.Count > 0)
+                    if (endDt.Rows.Count > 0)
                     {
                         maxId = function.CheckInt(endDt.Rows[0][0].ToString());
                     }
                 }
             }
             DataTable startPosDt = OtherMySqlConn.dtable("select min(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
-            if(startPosDt.Rows.Count > 0)
+            if (startPosDt.Rows.Count > 0)
             {
                 minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
-                if(minPosId == "0")
+                if (minPosId == "0")
                 {
                     startPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
-                    if(startPosDt.Rows.Count > 0)
+                    if (startPosDt.Rows.Count > 0)
                     {
                         minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
                     }
                 }
             }
             DataTable endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
-            if(endPosDt.Rows.Count > 0)
+            if (endPosDt.Rows.Count > 0)
             {
                 maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
-                if(maxPosId == "0")
+                if (maxPosId == "0")
                 {
                     endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
-                    if(endPosDt.Rows.Count > 0)
+                    if (endPosDt.Rows.Count > 0)
                     {
                         maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
                     }

+ 211 - 1
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -58,7 +58,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 创客列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(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 SelfId = 0, int ParentId = 0, int page = 1, int limit = 30)
+        public JsonResult IndexData(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 page = 1, int limit = 30)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("MakerCode", "1"); //创客编号
@@ -131,6 +131,10 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and ParentUserId=" + ParentId;
             }
+            if (UserId > 0)
+            {
+                condition += " and Id=" + UserId;
+            }
             if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
@@ -1181,5 +1185,211 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 根据条件查询直属创客交易额列表
+
+        /// <summary>
+        /// 直属创客交易额列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Children(Users data, string right, int ParentId = 0, string MakerCode = "")
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            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;
+            List<KqProducts> Brands = db.KqProducts.OrderBy(m => m.Id).ToList();
+            ViewBag.Brands = Brands;
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询直属创客交易额列表
+
+        /// <summary>
+        /// 直属创客交易额列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ChildrenData(Users data, int BrandSelect, string MakerCode, string CreateDateData, int ParentId = 0, int page = 1, int limit = 30)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("MakerCode", "1"); //创客编号
+
+            int BrandId = BrandSelect;
+            string start = "";
+            string end = "";
+
+            string condition = " and Status>-1";
+            string sort = "Id desc";
+            //创客编号
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                condition += " and Id in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
+            }
+            if (ParentId > 0)
+            {
+                condition += " and ParentUserId=" + ParentId + " or Id=" + ParentId;
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                start = datelist[0].Replace("-", "");
+                end = datelist[1].Replace("-", "");
+            }
+
+            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)
+            {
+                int UId = int.Parse(dic["Id"].ToString());
+                var Info = GetMonthTradeForBrand(UId, start, end, BrandId);
+
+                dic["TotalAmtfc"] = Convert.ToDecimal(Info["TotalAmtfc"].ToString()) + Convert.ToDecimal(Info["YAmtfc"].ToString());
+                dic["DAmtfc"] = Convert.ToDecimal(Info["DAmtfc"].ToString());
+                dic["JAmtfc"] = Convert.ToDecimal(Info["JAmtfc"].ToString());
+                dic["JfAmtfc"] = Convert.ToDecimal(Info["JfAmtfc"].ToString());
+                dic["JCountfc"] = Convert.ToInt32(Info["JCountfc"].ToString());
+                dic["YAmtfc"] = Convert.ToDecimal(Info["YAmtfc"].ToString());
+
+                dic["TotalAmtwd"] = Convert.ToDecimal(Info["TotalAmtwd"].ToString()) + Convert.ToDecimal(Info["YAmtwd"].ToString());
+                dic["DAmtwd"] = Convert.ToDecimal(Info["DAmtwd"].ToString());
+                dic["JAmtwd"] = Convert.ToDecimal(Info["JAmtwd"].ToString());
+                dic["JfAmtwd"] = Convert.ToDecimal(Info["JfAmtwd"].ToString());
+                dic["JCountwd"] = Convert.ToInt32(Info["JCountwd"].ToString());
+                dic["YAmtwd"] = Convert.ToDecimal(Info["YAmtwd"].ToString());
+
+            }
+            return Json(obj);
+        }
+
+        public Dictionary<string, object> GetMonthTradeForBrand(int UserId, string sTradeDate, string eTradeDate, int BrandId)
+        {
+            string condition = " and Status>-1";
+
+            //产品类型
+            if (!string.IsNullOrEmpty(BrandId.ToString()) && BrandId > 0)
+            {
+                condition += " and BrandId =" + BrandId;
+            }
+            //创客Id
+            if (!string.IsNullOrEmpty(UserId.ToString()))
+            {
+                condition += " and UserId =" + UserId;
+            }
+            //创客Id
+            if (!string.IsNullOrEmpty(sTradeDate))
+            {
+                condition += " and TradeDate >=" + Convert.ToInt32(sTradeDate);
+            }
+            //创客Id
+            if (!string.IsNullOrEmpty(eTradeDate))
+            {
+                condition += " and TradeDate <=" + Convert.ToInt32(eTradeDate);
+            }
+
+            //扶持期
+            decimal TotalAmtfc = 0;
+            decimal DAmtfc = 0;
+            decimal JAmtfc = 0;
+            decimal JfAmtfc = 0;
+            int JCountfc = 0;
+            decimal YAmtfc = 0;
+
+            //稳定期
+            decimal TotalAmtwd = 0;
+            decimal DAmtwd = 0;
+            decimal JAmtwd = 0;
+            decimal JfAmtwd = 0;
+            int JCountwd = 0;
+            decimal YAmtwd = 0;
+
+            WebCMSEntities db = new WebCMSEntities();
+            Dictionary<string, object> obj = new Dictionary<string, object>();
+            DataTable dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                TotalAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                DAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectDebitTradeAmt),Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                JAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                JfAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                JCountfc = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                YAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+
+            dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt + NotHelpNonDirectDebitTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                TotalAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                DAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectDebitTradeAmt),Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                JAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                JfAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                JCountwd = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
+            }
+            dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team'"+ condition);
+            if (dt.Rows.Count > 0)
+            {
+                YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+
+            obj.Add("TotalAmtfc", TotalAmtfc);
+            obj.Add("DAmtfc", DAmtfc);
+            obj.Add("JAmtfc", JAmtfc);
+            obj.Add("JfAmtfc", JfAmtfc);
+            obj.Add("JCountfc", JCountfc);
+            obj.Add("YAmtfc", YAmtfc);
+
+            obj.Add("TotalAmtwd", TotalAmtwd);
+            obj.Add("DAmtwd", DAmtwd);
+            obj.Add("JAmtwd", JAmtwd);
+            obj.Add("JfAmtwd", JfAmtwd);
+            obj.Add("JCountwd", JCountwd);
+            obj.Add("YAmtwd", YAmtwd);
+            db.Dispose();
+            return obj;
+        }
+
+        #endregion
     }
 }

+ 355 - 0
Areas/Admin/Views/MainServer/StoreHouse/Edits.cshtml

@@ -0,0 +1,355 @@
+@using MySystem.Models;
+@{StoreHouse editData = ViewBag.data as StoreHouse;}
+@{
+    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">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <script src="/admin/js/LAreaData2.js"></script>
+    <style>
+        .layui-form-label{
+            width: 135px !important;
+        }
+        .layui-form-item .layui-input-block{
+            margin-left: 165px !important;
+        }
+    </style>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        <input type="hidden" name="Id" value="@editData.Id" />
+        
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">*仓库名称</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" id="StoreName" name="StoreName"
+                                    value="@editData.StoreName" maxlength="32" lay-verify="required|" autocomplete="off"
+                                    placeholder="请输入仓库名称">
+                            </div>
+                        </div>
+                        @{Dictionary<string, string> KqProductsDic = new MySystem.DictionaryClass().getKqProductBrandDic();}
+                        <div class="layui-form-item">
+                            <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 KqProductsDic.Keys)
+                                    {
+                                    <option value="@key" @(editData.BrandId.ToString() == key ? "selected" : "")>@KqProductsDic[key]</option>
+                                    }
+                                </select>
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">*仓库状态</label>
+                            <div class="layui-input-inline">
+                                <select id="Status" name="Status" lay-search="" lay-verify="required|">
+                                    <option value="">请选择</option>
+                                    <option value="1">正常</option>
+                                    <option value="0">停用</option>
+                                </select>
+                                <script>
+                                    $("#Status").val("@editData.Status");
+                                </script>
+                            </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="ManageMakerCode" name="ManageMakerCode"
+                                    value="@ViewBag.ManageMakerCode" maxlength="30" lay-verify="required|" autocomplete="off"
+                                    placeholder="请输入仓库负责人编号">
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">*仓库管理员</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" readonly id="ManageRealName" name="ManageRealName"
+                                    value="@ViewBag.ManageRealName" maxlength="20" lay-verify="" autocomplete="off"
+                                    placeholder="请输入仓库负责人编号">
+                            </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="MakerCode" name="MakerCode"
+                                    value="@ViewBag.MakerCode" maxlength="30" lay-verify="" autocomplete="off"
+                                    placeholder="请输入仓库归属创客编号(操作员)">
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">*仓库归属类型</label>
+                            <div class="layui-input-inline">
+                                <select id="StoreKind" name="StoreKind" lay-search="" lay-verify="required|">
+                                    <option value="">请选择</option>
+                                    <option value="0">分仓</option>
+                                    <option value="1">总仓</option>
+                                </select>
+                                <script>
+                                    $("#StoreKind").val("@editData.StoreKind");
+                                </script>
+                            </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="ManagerEmail" name="ManagerEmail"
+                                    value="@editData.ManagerEmail" maxlength="32" lay-verify="required|email|"
+                                    autocomplete="off" placeholder="请输入管理者邮箱">
+                            </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="ManageMobile" name="ManageMobile"
+                                    value="@editData.ManageMobile" maxlength="11" lay-verify="required|phone|"
+                                    autocomplete="off" placeholder="请输入管理者手机号">
+                            </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="LimitTopUserId" name="LimitTopUserId"
+                                    value="@editData.LimitTopUserId" maxlength="100" lay-verify="" autocomplete="off"
+                                    placeholder="请输入特殊团队仓库专属-限制创客编号(多个用,隔开)">
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">*仓库所属地区</label>
+                            <input type="hidden" id="Areas" name="Areas" value="@editData.Areas" />
+                            <div class="layui-input-inline">
+                                <select id="AreasProvince" lay-search="" lay-filter="AreasProvince" lay-verify="required|">
+                                    <option value="">省</option>
+                                </select>
+                            </div>
+                            <div class="layui-input-inline">
+                                <select id="AreasCity" lay-search="" lay-filter="AreasCity" lay-verify="required|">
+                                    <option value="">市</option>
+                                </select>
+                            </div>
+                            <div class="layui-input-inline">
+                                <select id="AreasArea" lay-search="" lay-filter="AreasArea">
+                                    <option value="">县/区</option>
+                                </select>
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">*仓库地址</label>
+                            <div class="layui-input-block">
+                                <input class="layui-input" type="text" id="Address" name="Address"
+                                    value="@editData.Address" maxlength="128" lay-verify="required|" autocomplete="off"
+                                    placeholder="请输入仓库地址">
+                            </div>
+                        </div>
+                        <div class="layui-form-item layui-form-text">
+                            <label class="layui-form-label">备注</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" id="Remark" name="Remark" maxlength="128"
+                                    lay-verify="" placeholder="请输入备注">@editData.Remark</textarea>
+                            </div>
+                        </div>
+                        
+
+                    </div>
+
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        
+        
+        //编辑器
+        KindEditor.ready(function (K) {
+            
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            form.on('select(AreasProvince)', function (data) {
+AreasProvinceSelected("Areas", "@editData.Areas", form, data.value);
+});
+form.on('select(AreasCity)', function (data) {
+AreasCitySelected("Areas", "@editData.Areas", form, data.value)
+});
+form.on('select(AreasArea)', function (data) {
+AreasAreaSelected("Areas", form)
+});
+setTimeout(function () {
+AreasProvinceInit("Areas", "@(Html.Raw(editData.Areas))", form);
+AreasProvinceSelected("Areas", "@(Html.Raw(editData.Areas))", form, $("#AreasProvince").val());
+AreasCitySelected("Areas", "@(Html.Raw(editData.Areas))", form, $("#AreasCity").val());
+AreasAreaSelected("Areas", form);
+}, 1000);
+
+        })
+
+    </script>
+</body>
+</html>

+ 4 - 0
Areas/Admin/Views/MainServer/StoreHouse/Index.cshtml

@@ -152,6 +152,10 @@
                     {
                     <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 + "_edits,"))
+                    {
+                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edits"><i class="layui-icon layui-icon-add"></i>一键新建仓库</a>
+                    }
                     @if (RightInfo.Contains("," + right + "_sycn,"))
                     {
                     <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sycn"><i class="layui-icon layui-icon-edit"></i>同步库存</a>

+ 106 - 0
Areas/Admin/Views/MainServer/Users/Children.cshtml

@@ -0,0 +1,106 @@
+@using MySystem.Models;
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    string SelfId = ViewBag.SelfId as string;
+    string ParentId = ViewBag.ParentId as string;
+    string UserId = ViewBag.Id as string;
+    string MakerCode = ViewBag.MakerCode as string;
+    List<Users> TopUsers = ViewBag.TopUsers as List<Users>;
+    List<UserLevelSet> Levels = ViewBag.Levels as List<UserLevelSet>;
+    List<KqProducts> Brands = ViewBag.Brands as List<KqProducts>;
+
+}
+<!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="MakerCode" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">产品类型</label>
+                        <div class="layui-input-inline">
+                            <select id="BrandSelect" name="BrandSelect" lay-search="">
+                                <option value="">全部...</option>
+                                @foreach (KqProducts Brand in Brands)
+                                {
+                                    <option value="@Brand.Id">@Brand.Name</option>
+                                }
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">交易时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="CreateDateData" id="CreateDate"
+                                autocomplete="off">
+                        </div>
+                    </div>
+
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
+                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
+                        </button>
+                    </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/UsersChildren_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        var ParentId = '@ParentId';
+        var MakerCode = '@MakerCode';
+    </script>
+</body>
+
+</html>

+ 3 - 0
Areas/Admin/Views/MainServer/Users/Index.cshtml

@@ -4,6 +4,7 @@
     string right = ViewBag.right as string;
     string SelfId = ViewBag.SelfId as string;
     string ParentId = ViewBag.ParentId as string;
+    string UserId = ViewBag.Id as string;
     string MakerCode = ViewBag.MakerCode as string;
     List<Users> TopUsers = ViewBag.TopUsers as List<Users>;
     List<UserLevelSet> Levels = ViewBag.Levels as List<UserLevelSet>;
@@ -268,6 +269,7 @@
                     }
                     <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/Users/Index?right=@right&SelfId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>上级创客</a>
                     <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/Users/Index?right=@right&ParentId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>直属创客</a>
+                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/Users/Children?right=@right&ParentId=@("{{d.Id}}")"><i class="layui-icon layui-icon-edit"></i>直属创客交易额</a>
                 </script>
             </div>
         </div>
@@ -302,6 +304,7 @@
     <script>
         var SelfId = '@SelfId';
         var ParentId = '@ParentId';
+        var UserId = '@UserId';
         var MakerCode = '@MakerCode';
     </script>
 </body>

+ 61 - 0
wwwroot/layuiadmin/modules_main/StoreHouse_Admin.js

@@ -369,6 +369,67 @@ layui.config({
                 },
                 success: function (layero, index) {
 
+                }
+            });
+        } else if (obj.event === 'edits') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2,
+                title: '一键新建仓库',
+                content: 'Edits?Id=' + data.Id + '',
+                maxmin: true,
+                area: ['800px', '650px'],
+                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/StoreHouse/Edits?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                if (data == "success") {
+                                    layer.close(index); //关闭弹层
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                },
+                success: function (layero, index) {
+
                 }
             });
         }

+ 162 - 0
wwwroot/layuiadmin/modules_main/UsersChildren_Admin.js

@@ -0,0 +1,162 @@
+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/ChildrenData' //模拟接口
+        , 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: 'TotalAmtfc', width: 200, title: '刷卡交易总额(扶)', sort: true }
+            , { field: 'DAmtfc', width: 200, title: '贷记卡交易额(扶)', sort: true }
+            , { field: 'JAmtfc', width: 200, title: '借记卡非封顶交易额(扶)', sort: true }
+            , { field: 'JfAmtfc', width: 200, title: '借记卡封顶交易额(扶)', sort: true }
+            , { field: 'JCountfc', width: 200, title: '借记卡交易笔数(扶)', sort: true }
+            , { field: 'YAmtfc', width: 200, title: '云闪付小额交易额(扶)', sort: true }
+
+            , { field: 'TotalAmtwd', width: 200, title: '刷卡交易总额(稳)', sort: true }
+            , { field: 'DAmtwd', width: 200, title: '贷记卡交易额(稳', sort: true }
+            , { field: 'JAmtwd', width: 200, title: '借记卡非封顶交易额(稳', sort: true }
+            , { field: 'JfAmtwd', width: 200, title: '借记卡封顶交易额(稳', sort: true }
+            , { field: 'JCountwd', width: 200, title: '借记卡交易笔数(稳', sort: true }
+            , { field: 'YAmtwd', width: 200, title: '云闪付小额交易额(稳', sort: true }
+
+            // , { field: 'HelpInfo', width: 400, title: '扶持期商户交易信息', sort: true }
+            // , { field: 'NotHelpInfo', width: 400, title: '稳定期商户交易信息', sort: true }
+        ]]
+        , where: {
+            ParentId: ParentId,
+            MakerCode: MakerCode
+        }
+        , 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: {
+                SelfId: SelfId,
+                ParentId: ParentId,
+                MakerCode: MakerCode
+            }
+        });
+    });
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});

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

@@ -114,7 +114,7 @@ layui.config({
             , { field: 'RiskFlagName', width: 200, title: '风控状态', sort: true }
             , { field: 'CreateDate', width: 200, title: '注册时间', sort: true }
 
-            , { title: '操作', width: 1300, align: 'left', toolbar: '#table-list-tools' }
+            , { title: '操作', width: 1500, align: 'left', toolbar: '#table-list-tools' }
         ]]
         , where: {
             SelfId: SelfId,