Selaa lähdekoodia

增加小分仓相关后端文件,待调整

lichunlei 4 vuotta sitten
vanhempi
commit
6cf968334b

+ 46 - 0
AppStart/DictionaryClass/DictionaryClass.cs

@@ -350,6 +350,52 @@ namespace MySystem
 
         #endregion
 
+        #region SmallStoreHouse字典
+
+        public Dictionary<string, string> getSmallStoreHouseDic()
+        {
+            List<SmallStoreHouse> SmallStoreHouseList = db.SmallStoreHouse.ToList();
+            Dictionary<string, string> SmallStoreHouseDic = new Dictionary<string, string>();
+            foreach (SmallStoreHouse subSmallStoreHouse in SmallStoreHouseList)
+            {
+                SmallStoreHouseDic.Add(subSmallStoreHouse.Id.ToString(), subSmallStoreHouse.StoreName.ToString());
+            }
+            return SmallStoreHouseDic;
+        }
+
+        #endregion
+
+
+        #region KqProducts字典
+
+        public Dictionary<string, string> getKqProductsDic()
+        {
+            List<KqProducts> KqProductsList = db.KqProducts.ToList();
+            Dictionary<string, string> KqProductsDic = new Dictionary<string, string>();
+            foreach (KqProducts subKqProducts in KqProductsList)
+            {
+                KqProductsDic.Add(subKqProducts.Id.ToString(), subKqProducts.Name.ToString());
+            }
+            return KqProductsDic;
+        }
+
+        #endregion
+
+        #region PosMachinesTwo字典
+
+        public Dictionary<string, string> getPosMachinesTwoDic()
+        {
+            List<PosMachinesTwo> PosMachinesTwoList = db.PosMachinesTwo.ToList();
+            Dictionary<string, string> PosMachinesTwoDic = new Dictionary<string, string>();
+            foreach (PosMachinesTwo subPosMachinesTwo in PosMachinesTwoList)
+            {
+                PosMachinesTwoDic.Add(subPosMachinesTwo.Id.ToString(), subPosMachinesTwo.PosSn.ToString());
+            }
+            return PosMachinesTwoDic;
+        }
+
+        #endregion
+
 
 
         #region 根据字典key获取字典值

+ 13 - 0
AppStart/RelationClass.cs

@@ -473,5 +473,18 @@ namespace MySystem
             return "";
         }
 
+        public static string GetPosMachinesTwoInfo(int key)
+        {
+        using (WebCMSEntities db = new WebCMSEntities())
+        {
+        PosMachinesTwo item = db.PosMachinesTwo.FirstOrDefault(m => m.Id == key);
+        if (item != null)
+        {
+        return item.PosSn;
+        }
+        }
+        return "";
+        }
+
     }
 }

+ 573 - 0
Areas/Admin/Controllers/MainServer/PreSendStockDetailController.cs

@@ -0,0 +1,573 @@
+/*
+ * 预发货库存明细
+ */
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using MySystem.Models;
+using Library;
+using LitJson;
+using MySystemLib;
+
+namespace MySystem.Areas.Admin.Controllers
+{
+    [Area("Admin")]
+    [Route("Admin/[controller]/[action]")]
+    public class PreSendStockDetailController : BaseController
+    {
+        public PreSendStockDetailController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        #region 预发货库存明细列表
+
+        /// <summary>
+        /// 根据条件查询预发货库存明细列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(PreSendStockDetail data, string right, string StoreId)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.StoreId = StoreId;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询预发货库存明细列表
+
+        /// <summary>
+        /// 预发货库存明细列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(PreSendStockDetail data, string StoreIdStoreName, string StoreIdStoreNo, string BrandIdSelect, string ToUserIdMakerCode, string ToUserIdRealName, string ToStoreIdStoreNo, string ToStoreIdStoreName, string SourceStoreIdStoreNo, string SourceStoreIdStoreName, string FromUserIdMakerCode, string FromUserIdRealName, string FromStoreIdStoreNo, string FromStoreIdStoreName, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("StoreId", "1");
+
+            Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("SnNo", "1"); //SN编号
+            Fields.Add("ApplyDate", "3"); //申请时间
+
+
+            string condition = " and Status>-1";
+            //仓库仓库名称
+            if (!string.IsNullOrEmpty(StoreIdStoreName))
+            {
+                condition += " and StoreId in (select StoreId from SmallStoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
+            }
+            //仓库仓库编号
+            if (!string.IsNullOrEmpty(StoreIdStoreNo))
+            {
+                condition += " and StoreId in (select StoreId from SmallStoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
+            }
+            //产品类型
+            if (!string.IsNullOrEmpty(BrandIdSelect))
+            {
+                condition += " and BrandId=" + BrandIdSelect;
+            }
+            //收货人创客编号
+            if (!string.IsNullOrEmpty(ToUserIdMakerCode))
+            {
+                condition += " and ToUserId in (select ToUserId from UsersForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
+            }
+            //收货人真实姓名
+            if (!string.IsNullOrEmpty(ToUserIdRealName))
+            {
+                condition += " and ToUserId in (select ToUserId from UsersForRealName where RealName='" + ToUserIdRealName + "')";
+            }
+            //收货仓库仓库编号
+            if (!string.IsNullOrEmpty(ToStoreIdStoreNo))
+            {
+                condition += " and ToStoreId in (select ToStoreId from StoreHouseForStoreNo where StoreNo='" + ToStoreIdStoreNo + "')";
+            }
+            //收货仓库仓库名称
+            if (!string.IsNullOrEmpty(ToStoreIdStoreName))
+            {
+                condition += " and ToStoreId in (select ToStoreId from StoreHouseForStoreName where StoreName='" + ToStoreIdStoreName + "')";
+            }
+            //源仓库编号仓库编号
+            if (!string.IsNullOrEmpty(SourceStoreIdStoreNo))
+            {
+                condition += " and SourceStoreId in (select SourceStoreId from StoreHouseForStoreNo where StoreNo='" + SourceStoreIdStoreNo + "')";
+            }
+            //源仓库编号仓库名称
+            if (!string.IsNullOrEmpty(SourceStoreIdStoreName))
+            {
+                condition += " and SourceStoreId in (select SourceStoreId from StoreHouseForStoreName where StoreName='" + SourceStoreIdStoreName + "')";
+            }
+            //出货创客创客编号
+            if (!string.IsNullOrEmpty(FromUserIdMakerCode))
+            {
+                condition += " and FromUserId in (select FromUserId from UsersForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
+            }
+            //出货创客真实姓名
+            if (!string.IsNullOrEmpty(FromUserIdRealName))
+            {
+                condition += " and FromUserId in (select FromUserId from UsersForRealName where RealName='" + FromUserIdRealName + "')";
+            }
+            //出货仓库仓库编号
+            if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreNo where StoreNo='" + FromStoreIdStoreNo + "')";
+            }
+            //出货仓库仓库名称
+            if (!string.IsNullOrEmpty(FromStoreIdStoreName))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreName where StoreName='" + FromStoreIdStoreName + "')";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PreSendStockDetail", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //仓库
+                int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
+                SmallStoreHouse storeid_SmallStoreHouse = db.SmallStoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new SmallStoreHouse();
+                dic["StoreIdStoreName"] = storeid_SmallStoreHouse.StoreName;
+                dic["StoreIdStoreNo"] = storeid_SmallStoreHouse.StoreNo;
+                dic.Remove("StoreId");
+                //产品类型
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+                //SNID
+                dic["SnId"] = RelationClass.GetPosMachinesTwoInfo(int.Parse(dic["SnId"].ToString()));
+                //收货人
+                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
+                Users touserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["ToUserIdMakerCode"] = touserid_Users.MakerCode;
+                dic["ToUserIdRealName"] = touserid_Users.RealName;
+                dic.Remove("ToUserId");
+                //收货仓库
+                int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));
+                StoreHouse tostoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToStoreId) ?? new StoreHouse();
+                dic["ToStoreIdStoreNo"] = tostoreid_StoreHouse.StoreNo;
+                dic["ToStoreIdStoreName"] = tostoreid_StoreHouse.StoreName;
+                dic.Remove("ToStoreId");
+                //源仓库编号
+                int SourceStoreId = int.Parse(function.CheckInt(dic["SourceStoreId"].ToString()));
+                StoreHouse sourcestoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == SourceStoreId) ?? new StoreHouse();
+                dic["SourceStoreIdStoreNo"] = sourcestoreid_StoreHouse.StoreNo;
+                dic["SourceStoreIdStoreName"] = sourcestoreid_StoreHouse.StoreName;
+                dic.Remove("SourceStoreId");
+                dic["ApplyFlagName"] = dic["ApplyFlag"].ToString() == "1" ? "是" : "否";
+                //出货创客
+                int FromUserId = int.Parse(function.CheckInt(dic["FromUserId"].ToString()));
+                Users fromuserid_Users = db.Users.FirstOrDefault(m => m.Id == FromUserId) ?? new Users();
+                dic["FromUserIdMakerCode"] = fromuserid_Users.MakerCode;
+                dic["FromUserIdRealName"] = fromuserid_Users.RealName;
+                dic.Remove("FromUserId");
+                //出货仓库
+                int FromStoreId = int.Parse(function.CheckInt(dic["FromStoreId"].ToString()));
+                StoreHouse fromstoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == FromStoreId) ?? new StoreHouse();
+                dic["FromStoreIdStoreNo"] = fromstoreid_StoreHouse.StoreNo;
+                dic["FromStoreIdStoreName"] = fromstoreid_StoreHouse.StoreName;
+                dic.Remove("FromStoreId");
+                dic["CancelFlagName"] = dic["CancelFlag"].ToString() == "1" ? "是" : "否";
+
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+        #region 增加预发货库存明细
+
+        /// <summary>
+        /// 增加或修改预发货库存明细信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Add(string right, string StoreId)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.StoreId = StoreId;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 增加预发货库存明细
+
+        /// <summary>
+        /// 增加或修改预发货库存明细信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Add(PreSendStockDetail data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            Fields.Add("StoreId", data.StoreId);
+
+            Fields.Add("StoreId", data.StoreId); //仓库
+            Fields.Add("BrandId", data.BrandId); //产品类型
+            Fields.Add("SnId", data.SnId); //SNID
+            Fields.Add("ToUserId", data.ToUserId); //收货人
+            Fields.Add("ToStoreId", data.ToStoreId); //收货仓库
+            Fields.Add("SourceStoreId", data.SourceStoreId); //源仓库编号
+            Fields.Add("ApplyFlag", data.ApplyFlag); //申请标记
+            Fields.Add("ApplyDate", data.ApplyDate); //申请时间
+            Fields.Add("FromUserId", data.FromUserId); //出货创客
+            Fields.Add("FromStoreId", data.FromStoreId); //出货仓库
+            Fields.Add("CancelFlag", data.CancelFlag); //撤回标记
+            Fields.Add("CancelDate", data.CancelDate); //撤回时间
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("PreSendStockDetail", Fields, 0);
+            AddSysLog(data.Id.ToString(), "PreSendStockDetail", "add");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 修改预发货库存明细
+
+        /// <summary>
+        /// 增加或修改预发货库存明细信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Edit(string right, string StoreId, int Id = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.StoreId = StoreId;
+
+
+            PreSendStockDetail editData = db.PreSendStockDetail.FirstOrDefault(m => m.Id == Id) ?? new PreSendStockDetail();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 修改预发货库存明细
+
+        /// <summary>
+        /// 增加或修改预发货库存明细信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edit(PreSendStockDetail data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            Fields.Add("StoreId", data.StoreId);
+
+            Fields.Add("StoreId", data.StoreId); //仓库
+            Fields.Add("BrandId", data.BrandId); //产品类型
+            Fields.Add("SnId", data.SnId); //SNID
+            Fields.Add("ToUserId", data.ToUserId); //收货人
+            Fields.Add("ToStoreId", data.ToStoreId); //收货仓库
+            Fields.Add("SourceStoreId", data.SourceStoreId); //源仓库编号
+            Fields.Add("ApplyFlag", data.ApplyFlag); //申请标记
+            Fields.Add("ApplyDate", data.ApplyDate); //申请时间
+            Fields.Add("FromUserId", data.FromUserId); //出货创客
+            Fields.Add("FromStoreId", data.FromStoreId); //出货仓库
+            Fields.Add("CancelFlag", data.CancelFlag); //撤回标记
+            Fields.Add("CancelDate", data.CancelDate); //撤回时间
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PreSendStockDetail", Fields, data.Id);
+            AddSysLog(data.Id.ToString(), "PreSendStockDetail", "update");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 删除预发货库存明细信息
+
+        /// <summary>
+        /// 删除预发货库存明细信息
+        /// </summary>
+        /// <returns></returns>
+        public string Delete(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PreSendStockDetail", "del");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PreSendStockDetail", Fields, id);
+            }
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 开启
+
+        /// <summary>
+        /// 开启
+        /// </summary>
+        /// <returns></returns>
+        public string Open(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PreSendStockDetail", "open");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PreSendStockDetail", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 关闭
+
+        /// <summary>
+        /// 关闭
+        /// </summary>
+        /// <returns></returns>
+        public string Close(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PreSendStockDetail", "close");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 0);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PreSendStockDetail", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 排序
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id"></param>
+        public string Sort(int Id, int Sort)
+        {
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("PreSendStockDetail", Sort, Id);
+
+            AddSysLog(Id.ToString(), "PreSendStockDetail", "sort");
+            return "success";
+        }
+        #endregion
+
+        #region 导入数据
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData"></param>
+        public string Import(string ExcelData)
+        {
+            ExcelData = HttpUtility.UrlDecode(ExcelData);
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count; i++)
+            {
+                JsonData dr = list[i];
+
+                db.PreSendStockDetail.Add(new PreSendStockDetail()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+
+                });
+                db.SaveChanges();
+            }
+            AddSysLog("0", "PreSendStockDetail", "Import");
+            return "success";
+        }
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(PreSendStockDetail data, string StoreIdStoreName, string StoreIdStoreNo, string BrandIdSelect, string ToUserIdMakerCode, string ToUserIdRealName, string ToStoreIdStoreNo, string ToStoreIdStoreName, string SourceStoreIdStoreNo, string SourceStoreIdStoreName, string FromUserIdMakerCode, string FromUserIdRealName, string FromStoreIdStoreNo, string FromStoreIdStoreName)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("SnNo", "1"); //SN编号
+            Fields.Add("ApplyDate", "3"); //申请时间
+
+
+            string condition = " and Status>-1";
+            //仓库仓库名称
+            if (!string.IsNullOrEmpty(StoreIdStoreName))
+            {
+                condition += " and StoreId in (select StoreId from SmallStoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
+            }
+            //仓库仓库编号
+            if (!string.IsNullOrEmpty(StoreIdStoreNo))
+            {
+                condition += " and StoreId in (select StoreId from SmallStoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
+            }
+            //产品类型
+            if (!string.IsNullOrEmpty(BrandIdSelect))
+            {
+                condition += " and BrandId=" + BrandIdSelect;
+            }
+            //收货人创客编号
+            if (!string.IsNullOrEmpty(ToUserIdMakerCode))
+            {
+                condition += " and ToUserId in (select ToUserId from UsersForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
+            }
+            //收货人真实姓名
+            if (!string.IsNullOrEmpty(ToUserIdRealName))
+            {
+                condition += " and ToUserId in (select ToUserId from UsersForRealName where RealName='" + ToUserIdRealName + "')";
+            }
+            //收货仓库仓库编号
+            if (!string.IsNullOrEmpty(ToStoreIdStoreNo))
+            {
+                condition += " and ToStoreId in (select ToStoreId from StoreHouseForStoreNo where StoreNo='" + ToStoreIdStoreNo + "')";
+            }
+            //收货仓库仓库名称
+            if (!string.IsNullOrEmpty(ToStoreIdStoreName))
+            {
+                condition += " and ToStoreId in (select ToStoreId from StoreHouseForStoreName where StoreName='" + ToStoreIdStoreName + "')";
+            }
+            //源仓库编号仓库编号
+            if (!string.IsNullOrEmpty(SourceStoreIdStoreNo))
+            {
+                condition += " and SourceStoreId in (select SourceStoreId from StoreHouseForStoreNo where StoreNo='" + SourceStoreIdStoreNo + "')";
+            }
+            //源仓库编号仓库名称
+            if (!string.IsNullOrEmpty(SourceStoreIdStoreName))
+            {
+                condition += " and SourceStoreId in (select SourceStoreId from StoreHouseForStoreName where StoreName='" + SourceStoreIdStoreName + "')";
+            }
+            //出货创客创客编号
+            if (!string.IsNullOrEmpty(FromUserIdMakerCode))
+            {
+                condition += " and FromUserId in (select FromUserId from UsersForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
+            }
+            //出货创客真实姓名
+            if (!string.IsNullOrEmpty(FromUserIdRealName))
+            {
+                condition += " and FromUserId in (select FromUserId from UsersForRealName where RealName='" + FromUserIdRealName + "')";
+            }
+            //出货仓库仓库编号
+            if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreNo where StoreNo='" + FromStoreIdStoreNo + "')";
+            }
+            //出货仓库仓库名称
+            if (!string.IsNullOrEmpty(FromStoreIdStoreName))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreName where StoreName='" + FromStoreIdStoreName + "')";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PreSendStockDetail", Fields, "Id desc", "0", 1, 20000, condition, "StoreId,BrandId,SnNo,SnId,ToUserId,ToStoreId,SourceStoreId,ApplyFlag,ApplyDate,FromUserId,FromStoreId,CancelFlag,CancelDate", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //仓库
+                int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
+                SmallStoreHouse storeid_SmallStoreHouse = db.SmallStoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new SmallStoreHouse();
+                dic["StoreIdStoreName"] = storeid_SmallStoreHouse.StoreName;
+                dic["StoreIdStoreNo"] = storeid_SmallStoreHouse.StoreNo;
+                dic.Remove("StoreId");
+                //产品类型
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+                //SNID
+                dic["SnId"] = RelationClass.GetPosMachinesTwoInfo(int.Parse(dic["SnId"].ToString()));
+                //收货人
+                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
+                Users touserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["ToUserIdMakerCode"] = touserid_Users.MakerCode;
+                dic["ToUserIdRealName"] = touserid_Users.RealName;
+                dic.Remove("ToUserId");
+                //收货仓库
+                int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));
+                StoreHouse tostoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToStoreId) ?? new StoreHouse();
+                dic["ToStoreIdStoreNo"] = tostoreid_StoreHouse.StoreNo;
+                dic["ToStoreIdStoreName"] = tostoreid_StoreHouse.StoreName;
+                dic.Remove("ToStoreId");
+                //源仓库编号
+                int SourceStoreId = int.Parse(function.CheckInt(dic["SourceStoreId"].ToString()));
+                StoreHouse sourcestoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == SourceStoreId) ?? new StoreHouse();
+                dic["SourceStoreIdStoreNo"] = sourcestoreid_StoreHouse.StoreNo;
+                dic["SourceStoreIdStoreName"] = sourcestoreid_StoreHouse.StoreName;
+                dic.Remove("SourceStoreId");
+                dic["ApplyFlagName"] = dic["ApplyFlag"].ToString() == "1" ? "是" : "否";
+                //出货创客
+                int FromUserId = int.Parse(function.CheckInt(dic["FromUserId"].ToString()));
+                Users fromuserid_Users = db.Users.FirstOrDefault(m => m.Id == FromUserId) ?? new Users();
+                dic["FromUserIdMakerCode"] = fromuserid_Users.MakerCode;
+                dic["FromUserIdRealName"] = fromuserid_Users.RealName;
+                dic.Remove("FromUserId");
+                //出货仓库
+                int FromStoreId = int.Parse(function.CheckInt(dic["FromStoreId"].ToString()));
+                StoreHouse fromstoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == FromStoreId) ?? new StoreHouse();
+                dic["FromStoreIdStoreNo"] = fromstoreid_StoreHouse.StoreNo;
+                dic["FromStoreIdStoreName"] = fromstoreid_StoreHouse.StoreName;
+                dic.Remove("FromStoreId");
+                dic["CancelFlagName"] = dic["CancelFlag"].ToString() == "1" ? "是" : "否";
+
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+            ReturnFields.Add("StoreIdStoreName", "仓库仓库名称");
+            ReturnFields.Add("StoreIdStoreNo", "仓库仓库编号");
+            ReturnFields.Add("BrandId", "产品类型");
+            ReturnFields.Add("SnNo", "SN编号");
+            ReturnFields.Add("SnId", "SNID");
+            ReturnFields.Add("ToUserIdMakerCode", "收货人创客编号");
+            ReturnFields.Add("ToUserIdRealName", "收货人真实姓名");
+            ReturnFields.Add("ToStoreIdStoreNo", "收货仓库仓库编号");
+            ReturnFields.Add("ToStoreIdStoreName", "收货仓库仓库名称");
+            ReturnFields.Add("SourceStoreIdStoreNo", "源仓库编号仓库编号");
+            ReturnFields.Add("SourceStoreIdStoreName", "源仓库编号仓库名称");
+            ReturnFields.Add("ApplyFlag", "申请标记");
+            ReturnFields.Add("ApplyDate", "申请时间");
+            ReturnFields.Add("FromUserIdMakerCode", "出货创客创客编号");
+            ReturnFields.Add("FromUserIdRealName", "出货创客真实姓名");
+            ReturnFields.Add("FromStoreIdStoreNo", "出货仓库仓库编号");
+            ReturnFields.Add("FromStoreIdStoreName", "出货仓库仓库名称");
+            ReturnFields.Add("CancelFlag", "撤回标记");
+            ReturnFields.Add("CancelDate", "撤回时间");
+
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "PreSendStockDetail", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+    }
+}

+ 383 - 0
Areas/Admin/Controllers/MainServer/SmallStoreHouseController.cs

@@ -0,0 +1,383 @@
+/*
+ * 小仓库
+ */
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using MySystem.Models;
+using Library;
+using LitJson;
+using MySystemLib;
+
+namespace MySystem.Areas.Admin.Controllers
+{
+    [Area("Admin")]
+    [Route("Admin/[controller]/[action]")]
+    public class SmallStoreHouseController : BaseController
+    {
+        public SmallStoreHouseController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        #region 小仓库列表
+
+        /// <summary>
+        /// 根据条件查询小仓库列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(SmallStoreHouse data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询小仓库列表
+
+        /// <summary>
+        /// 小仓库列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(SmallStoreHouse data, string UserIdSelect, string FromStoreIdStoreNo, string FromStoreIdStoreName, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("StoreNo", "1"); //仓库编号
+            Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("StoreName", "1"); //仓库名称
+            Fields.Add("BrandId", "2"); //产品类型
+            Fields.Add("Mobile", "1"); //仓库归属人手机号
+
+
+            string condition = " and Status>-1";
+            //仓库归属人
+            if (!string.IsNullOrEmpty(UserIdSelect))
+            {
+                condition += " and UserId=" + UserIdSelect;
+            }
+            //出货仓库仓库编号
+            if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreNo where StoreNo='" + FromStoreIdStoreNo + "')";
+            }
+            //出货仓库仓库名称
+            if (!string.IsNullOrEmpty(FromStoreIdStoreName))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreName where StoreName='" + FromStoreIdStoreName + "')";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SmallStoreHouse", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //出货仓库
+                int FromStoreId = int.Parse(function.CheckInt(dic["FromStoreId"].ToString()));
+                StoreHouse fromstoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == FromStoreId) ?? new StoreHouse();
+                dic["FromStoreIdStoreNo"] = fromstoreid_StoreHouse.StoreNo;
+                dic["FromStoreIdStoreName"] = fromstoreid_StoreHouse.StoreName;
+                dic.Remove("FromStoreId");
+
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+        #region 增加小仓库
+
+        /// <summary>
+        /// 增加或修改小仓库信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Add(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 增加小仓库
+
+        /// <summary>
+        /// 增加或修改小仓库信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Add(SmallStoreHouse data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+            Fields.Add("StoreNo", data.StoreNo); //仓库编号
+            Fields.Add("StoreName", data.StoreName); //仓库名称
+            Fields.Add("UserId", data.UserId); //仓库归属人
+            Fields.Add("BrandId", data.BrandId); //产品类型
+            Fields.Add("TotalNum", data.TotalNum); //总库存数
+            Fields.Add("LaveNum", data.LaveNum); //剩余库存数
+            Fields.Add("Remark", data.Remark); //备注
+            Fields.Add("Mobile", data.Mobile); //仓库归属人手机号
+            Fields.Add("FromStoreId", data.FromStoreId); //出货仓库
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("SmallStoreHouse", Fields, 0);
+            AddSysLog(data.Id.ToString(), "SmallStoreHouse", "add");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 修改小仓库
+
+        /// <summary>
+        /// 增加或修改小仓库信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Edit(string right, int Id = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            SmallStoreHouse editData = db.SmallStoreHouse.FirstOrDefault(m => m.Id == Id) ?? new SmallStoreHouse();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 修改小仓库
+
+        /// <summary>
+        /// 增加或修改小仓库信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edit(SmallStoreHouse data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+            Fields.Add("StoreNo", data.StoreNo); //仓库编号
+            Fields.Add("StoreName", data.StoreName); //仓库名称
+            Fields.Add("UserId", data.UserId); //仓库归属人
+            Fields.Add("BrandId", data.BrandId); //产品类型
+            Fields.Add("TotalNum", data.TotalNum); //总库存数
+            Fields.Add("LaveNum", data.LaveNum); //剩余库存数
+            Fields.Add("Remark", data.Remark); //备注
+            Fields.Add("Mobile", data.Mobile); //仓库归属人手机号
+            Fields.Add("FromStoreId", data.FromStoreId); //出货仓库
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("SmallStoreHouse", Fields, data.Id);
+            AddSysLog(data.Id.ToString(), "SmallStoreHouse", "update");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 删除小仓库信息
+
+        /// <summary>
+        /// 删除小仓库信息
+        /// </summary>
+        /// <returns></returns>
+        public string Delete(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "SmallStoreHouse", "del");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("SmallStoreHouse", Fields, id);
+            }
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 开启
+
+        /// <summary>
+        /// 开启
+        /// </summary>
+        /// <returns></returns>
+        public string Open(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "SmallStoreHouse", "open");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("SmallStoreHouse", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 关闭
+
+        /// <summary>
+        /// 关闭
+        /// </summary>
+        /// <returns></returns>
+        public string Close(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "SmallStoreHouse", "close");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 0);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("SmallStoreHouse", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 排序
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id"></param>
+        public string Sort(int Id, int Sort)
+        {
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("SmallStoreHouse", Sort, Id);
+
+            AddSysLog(Id.ToString(), "SmallStoreHouse", "sort");
+            return "success";
+        }
+        #endregion
+
+        #region 导入数据
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData"></param>
+        public string Import(string ExcelData)
+        {
+            ExcelData = HttpUtility.UrlDecode(ExcelData);
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count; i++)
+            {
+                JsonData dr = list[i];
+
+                db.SmallStoreHouse.Add(new SmallStoreHouse()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+
+                });
+                db.SaveChanges();
+            }
+            AddSysLog("0", "SmallStoreHouse", "Import");
+            return "success";
+        }
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(SmallStoreHouse data, string UserIdSelect, string FromStoreIdStoreNo, string FromStoreIdStoreName)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("StoreNo", "1"); //仓库编号
+            Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("StoreName", "1"); //仓库名称
+            Fields.Add("BrandId", "2"); //产品类型
+            Fields.Add("Mobile", "1"); //仓库归属人手机号
+
+
+            string condition = " and Status>-1";
+            //仓库归属人
+            if (!string.IsNullOrEmpty(UserIdSelect))
+            {
+                condition += " and UserId=" + UserIdSelect;
+            }
+            //出货仓库仓库编号
+            if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreNo where StoreNo='" + FromStoreIdStoreNo + "')";
+            }
+            //出货仓库仓库名称
+            if (!string.IsNullOrEmpty(FromStoreIdStoreName))
+            {
+                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreName where StoreName='" + FromStoreIdStoreName + "')";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SmallStoreHouse", Fields, "Id desc", "0", 1, 20000, condition, "StoreNo,StoreName,UserId,BrandId,TotalNum,LaveNum,Mobile,FromStoreId", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //出货仓库
+                int FromStoreId = int.Parse(function.CheckInt(dic["FromStoreId"].ToString()));
+                StoreHouse fromstoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == FromStoreId) ?? new StoreHouse();
+                dic["FromStoreIdStoreNo"] = fromstoreid_StoreHouse.StoreNo;
+                dic["FromStoreIdStoreName"] = fromstoreid_StoreHouse.StoreName;
+                dic.Remove("FromStoreId");
+
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+            ReturnFields.Add("StoreNo", "仓库编号");
+            ReturnFields.Add("StoreName", "仓库名称");
+            ReturnFields.Add("UserId", "仓库归属人");
+            ReturnFields.Add("BrandId", "产品类型");
+            ReturnFields.Add("TotalNum", "总库存数");
+            ReturnFields.Add("LaveNum", "剩余库存数");
+            ReturnFields.Add("Mobile", "仓库归属人手机号");
+            ReturnFields.Add("FromStoreIdStoreNo", "出货仓库仓库编号");
+            ReturnFields.Add("FromStoreIdStoreName", "出货仓库仓库名称");
+
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "SmallStoreHouse", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+    }
+}

+ 340 - 0
Areas/Admin/Views/MainServer/PreSendStockDetail/Add.cshtml

@@ -0,0 +1,340 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    string StoreId = ViewBag.StoreId 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>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        <input type="hidden" name="StoreId" value="@StoreId" />
+
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+@{Dictionary<string, string> SmallStoreHouseDic = new MySystem.DictionaryClass().getSmallStoreHouseDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">仓库</label>
+<div class="layui-input-inline">
+<select id="StoreId" name="StoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in SmallStoreHouseDic.Keys)
+{
+<option value="@key">@SmallStoreHouseDic[key]</option>
+}
+</select>
+</div>
+</div>
+@{Dictionary<string, string> KqProductsDic = new MySystem.DictionaryClass().getKqProductsDic();}
+<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">@KqProductsDic[key]</option>
+}
+</select>
+</div>
+</div>
+@{Dictionary<string, string> PosMachinesTwoDic = new MySystem.DictionaryClass().getPosMachinesTwoDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">SNID</label>
+<div class="layui-input-inline">
+<select id="SnId" name="SnId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in PosMachinesTwoDic.Keys)
+{
+<option value="@key">@PosMachinesTwoDic[key]</option>
+}
+</select>
+</div>
+</div>
+@{Dictionary<string, string> UsersDic = new MySystem.DictionaryClass().getUsersDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">收货人</label>
+<div class="layui-input-inline">
+<select id="ToUserId" name="ToUserId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in UsersDic.Keys)
+{
+<option value="@key">@UsersDic[key]</option>
+}
+</select>
+</div>
+</div>
+@{Dictionary<string, string> StoreHouseDic = new MySystem.DictionaryClass().getStoreHouseDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">收货仓库</label>
+<div class="layui-input-inline">
+<select id="ToStoreId" name="ToStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">源仓库编号</label>
+<div class="layui-input-inline">
+<select id="SourceStoreId" name="SourceStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">申请标记</label>
+<div class="layui-input-inline">
+<input type="checkbox" id="ApplyFlag" name="ApplyFlag" value="1" lay-skin="switch" lay-filter="switchTest" title="开关">
+</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="ApplyDate" name="ApplyDate" 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="FromUserId" name="FromUserId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in UsersDic.Keys)
+{
+<option value="@key">@UsersDic[key]</option>
+}
+</select>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">出货仓库</label>
+<div class="layui-input-inline">
+<select id="FromStoreId" name="FromStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">撤回标记</label>
+<div class="layui-input-inline">
+<input type="checkbox" id="CancelFlag" name="CancelFlag" value="1" lay-skin="switch" lay-filter="switchTest" title="开关">
+</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="CancelDate" name="CancelDate" lay-verify="" autocomplete="off" placeholder="请输入撤回时间">
+</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');
+            });
+    
+            //日期
+            laydate.render({
+elem: '#ApplyDate',
+type: 'datetime',
+trigger: 'click'
+});
+laydate.render({
+elem: '#CancelDate',
+type: 'datetime',
+trigger: 'click'
+});
+
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 350 - 0
Areas/Admin/Views/MainServer/PreSendStockDetail/Edit.cshtml

@@ -0,0 +1,350 @@
+@using MySystem.Models;
+@{PreSendStockDetail editData = ViewBag.data as PreSendStockDetail;}
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    string StoreId = ViewBag.StoreId 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>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        <input type="hidden" name="Id" value="@editData.Id" />
+        <input type="hidden" name="StoreId" value="@StoreId" />
+
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+@{Dictionary<string, string> SmallStoreHouseDic = new MySystem.DictionaryClass().getSmallStoreHouseDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">仓库</label>
+<div class="layui-input-inline">
+<select id="StoreId" name="StoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in SmallStoreHouseDic.Keys)
+{
+<option value="@key">@SmallStoreHouseDic[key]</option>
+}
+</select>
+<script>$("#StoreId").val("@editData.StoreId");</script>
+</div>
+</div>
+@{Dictionary<string, string> KqProductsDic = new MySystem.DictionaryClass().getKqProductsDic();}
+<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">@KqProductsDic[key]</option>
+}
+</select>
+<script>$("#BrandId").val("@editData.BrandId");</script>
+</div>
+</div>
+@{Dictionary<string, string> PosMachinesTwoDic = new MySystem.DictionaryClass().getPosMachinesTwoDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">SNID</label>
+<div class="layui-input-inline">
+<select id="SnId" name="SnId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in PosMachinesTwoDic.Keys)
+{
+<option value="@key">@PosMachinesTwoDic[key]</option>
+}
+</select>
+<script>$("#SnId").val("@editData.SnId");</script>
+</div>
+</div>
+@{Dictionary<string, string> UsersDic = new MySystem.DictionaryClass().getUsersDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">收货人</label>
+<div class="layui-input-inline">
+<select id="ToUserId" name="ToUserId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in UsersDic.Keys)
+{
+<option value="@key">@UsersDic[key]</option>
+}
+</select>
+<script>$("#ToUserId").val("@editData.ToUserId");</script>
+</div>
+</div>
+@{Dictionary<string, string> StoreHouseDic = new MySystem.DictionaryClass().getStoreHouseDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">收货仓库</label>
+<div class="layui-input-inline">
+<select id="ToStoreId" name="ToStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+<script>$("#ToStoreId").val("@editData.ToStoreId");</script>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">源仓库编号</label>
+<div class="layui-input-inline">
+<select id="SourceStoreId" name="SourceStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+<script>$("#SourceStoreId").val("@editData.SourceStoreId");</script>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">申请标记</label>
+<div class="layui-input-inline">
+<input type="checkbox" id="ApplyFlag" name="ApplyFlag" value="1" @(editData.ApplyFlag == 1 ? "checked=checked" : "") lay-skin="switch" lay-filter="switchTest" title="开关">
+</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="ApplyDate" name="ApplyDate" value="@(editData.ApplyDate == null ? "" : editData.ApplyDate.Value.ToString("yyyy-MM-dd HH:mm:ss"))" 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="FromUserId" name="FromUserId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in UsersDic.Keys)
+{
+<option value="@key">@UsersDic[key]</option>
+}
+</select>
+<script>$("#FromUserId").val("@editData.FromUserId");</script>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">出货仓库</label>
+<div class="layui-input-inline">
+<select id="FromStoreId" name="FromStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+<script>$("#FromStoreId").val("@editData.FromStoreId");</script>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">撤回标记</label>
+<div class="layui-input-inline">
+<input type="checkbox" id="CancelFlag" name="CancelFlag" value="1" @(editData.CancelFlag == 1 ? "checked=checked" : "") lay-skin="switch" lay-filter="switchTest" title="开关">
+</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="CancelDate" name="CancelDate" value="@(editData.CancelDate == null ? "" : editData.CancelDate.Value.ToString("yyyy-MM-dd HH:mm:ss"))" lay-verify="" autocomplete="off" placeholder="请输入撤回时间">
+</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');
+            });
+    
+            //日期
+            laydate.render({
+elem: '#ApplyDate',
+type: 'datetime',
+trigger: 'click'
+});
+laydate.render({
+elem: '#CancelDate',
+type: 'datetime',
+trigger: 'click'
+});
+
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 221 - 0
Areas/Admin/Views/MainServer/PreSendStockDetail/Index.cshtml

@@ -0,0 +1,221 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    string StoreId = ViewBag.StoreId as string;
+
+}
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>预发货库存明细</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline{
+            width: 175px !important;
+        }
+        .layui-form-label{
+            width: 85px !important;
+        }
+        .layui-inline{
+            margin-right: 0px !important;
+        }
+        .w100{
+            width: 100px !important;
+        }
+        .ml50{
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+<label class="layui-form-label">仓库仓库名称</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="StoreIdStoreName" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">仓库仓库编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="StoreIdStoreNo" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">创建时间</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate" placeholder="" autocomplete="off">
+</div></div>@{Dictionary<string, string> KqProductsDic = new MySystem.DictionaryClass().getKqProductsDic();}
+<div class="layui-inline">
+<label class="layui-form-label">产品类型</label>
+<div class="layui-input-inline">
+<select id="BrandIdSelect" name="BrandIdSelect" lay-search="">
+<option value="">全部...</option>
+@foreach (string key in KqProductsDic.Keys)
+{
+<option value="@key">@KqProductsDic[key]</option>
+}
+</select>
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">SN编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="SnNo" placeholder="" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">收货人创客编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="ToUserIdMakerCode" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">收货人真实姓名</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="ToUserIdRealName" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">收货仓库仓库编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="ToStoreIdStoreNo" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">收货仓库仓库名称</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="ToStoreIdStoreName" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">源仓库编号仓库编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="SourceStoreIdStoreNo" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">源仓库编号仓库名称</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="SourceStoreIdStoreName" 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="ApplyDateData" id="ApplyDate" placeholder="" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">出货创客创客编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="FromUserIdMakerCode" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">出货创客真实姓名</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="FromUserIdRealName" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">出货仓库仓库编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="FromStoreIdStoreNo" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">出货仓库仓库名称</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="FromStoreIdStoreName" 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">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_add,"))
+                    {
+                        <button class="layui-btn" data-type="add"><i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                    <button class="layui-btn" data-type="ExportExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+
+                    }
+                </div>
+                
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                    
+                    }
+                </script>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">模板下载</label>
+                <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/PreSendStockDetail_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        var StoreId='@StoreId';
+
+    </script>
+</body>
+</html>

+ 302 - 0
Areas/Admin/Views/MainServer/SmallStoreHouse/Add.cshtml

@@ -0,0 +1,302 @@
+@{
+    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>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <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="StoreNo" name="StoreNo" maxlength="16" 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" id="StoreName" name="StoreName" maxlength="32" 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="UserId" name="UserId" lay-search="">
+<option value="">请选择</option>
+</select>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">产品类型</label>
+<div class="layui-input-block">
+<input type="hidden" id="BrandId" name="BrandId" value="" />
+<div id="BrandIdTransfer" class="demo-transfer"></div>
+</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="TotalNum" name="TotalNum" maxlength="20" lay-verify="required|int|" 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="LaveNum" name="LaveNum" maxlength="20" lay-verify="required|int|" 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="请输入备注"></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="Mobile" name="Mobile" maxlength="11" lay-verify="required|phone|" autocomplete="off" placeholder="请输入仓库归属人手机号">
+</div>
+</div>
+@{Dictionary<string, string> StoreHouseDic = new MySystem.DictionaryClass().getStoreHouseDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">出货仓库</label>
+<div class="layui-input-inline">
+<select id="FromStoreId" name="FromStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+</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');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            transfer.render({
+elem: '#BrandIdTransfer'
+, data: @Html.Raw(Json)
+, title: ['待选项', '选中项']
+
+, showSearch: true
+, onchange: function (obj, index) {
+if (index == 0) {
+var source = $("#BrandId").val();
+$.each(obj, function (index, value) {
+var val = obj[index].value;                        
+if (source != "") {
+source += "," + val;
+} else {
+source += val;
+}
+});
+$("#BrandId").val(source);
+} else if (index == 1) {
+var source = "," + $("#BrandId").val() + ",";
+$.each(obj, function (index, value) {
+var val = obj[index].value;
+source = source.replace("," + val + ",", ",");
+});
+if (source != "") {
+if (source == ",") {
+source = "";
+} else {
+source = source.substring(1, source.length - 1);
+}
+}
+$("#BrandId").val(source);
+}
+}
+});
+
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 306 - 0
Areas/Admin/Views/MainServer/SmallStoreHouse/Edit.cshtml

@@ -0,0 +1,306 @@
+@using MySystem.Models;
+@{SmallStoreHouse editData = ViewBag.data as SmallStoreHouse;}
+@{
+    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>
+</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">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <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="StoreNo" name="StoreNo" value="@editData.StoreNo" maxlength="16" 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" id="StoreName" name="StoreName" value="@editData.StoreName" maxlength="32" 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="UserId" name="UserId" lay-search="">
+<option value="">请选择</option>
+</select>
+<script>$("#UserId").val("@editData.UserId");</script>
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">产品类型</label>
+<div class="layui-input-block">
+<input type="hidden" id="BrandId" name="BrandId" value="" />
+<div id="BrandIdTransfer" class="demo-transfer"></div>
+</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="TotalNum" name="TotalNum" value="@editData.TotalNum" maxlength="20" lay-verify="required|int|" 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="LaveNum" name="LaveNum" value="@editData.LaveNum" maxlength="20" lay-verify="required|int|" 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 class="layui-form-item">
+<label class="layui-form-label">仓库归属人手机号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="Mobile" name="Mobile" value="@editData.Mobile" maxlength="11" lay-verify="required|phone|" autocomplete="off" placeholder="请输入仓库归属人手机号">
+</div>
+</div>
+@{Dictionary<string, string> StoreHouseDic = new MySystem.DictionaryClass().getStoreHouseDic();}
+<div class="layui-form-item">
+<label class="layui-form-label">出货仓库</label>
+<div class="layui-input-inline">
+<select id="FromStoreId" name="FromStoreId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in StoreHouseDic.Keys)
+{
+<option value="@key">@StoreHouseDic[key]</option>
+}
+</select>
+<script>$("#FromStoreId").val("@editData.FromStoreId");</script>
+</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');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            transfer.render({
+elem: '#BrandIdTransfer'
+, data: @Html.Raw(Json)
+, title: ['待选项', '选中项']
+, value: ["@Html.Raw(Library.function.CheckNull(editData.BrandId).Replace(",", "\",\""))"]
+, showSearch: true
+, onchange: function (obj, index) {
+if (index == 0) {
+var source = $("#BrandId").val();
+$.each(obj, function (index, value) {
+var val = obj[index].value;                        
+if (source != "") {
+source += "," + val;
+} else {
+source += val;
+}
+});
+$("#BrandId").val(source);
+} else if (index == 1) {
+var source = "," + $("#BrandId").val() + ",";
+$.each(obj, function (index, value) {
+var val = obj[index].value;
+source = source.replace("," + val + ",", ",");
+});
+if (source != "") {
+if (source == ",") {
+source = "";
+} else {
+source = source.substring(1, source.length - 1);
+}
+}
+$("#BrandId").val(source);
+}
+}
+});
+
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 168 - 0
Areas/Admin/Views/MainServer/SmallStoreHouse/Index.cshtml

@@ -0,0 +1,168 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    
+}
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>小仓库</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline{
+            width: 175px !important;
+        }
+        .layui-form-label{
+            width: 85px !important;
+        }
+        .layui-inline{
+            margin-right: 0px !important;
+        }
+        .w100{
+            width: 100px !important;
+        }
+        .ml50{
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+<label class="layui-form-label">仓库编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="StoreNo" 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="CreateDateData" id="CreateDate" placeholder="" autocomplete="off">
+</div></div><div class="layui-inline">
+<label class="layui-form-label">仓库名称</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="StoreName" placeholder="" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">仓库归属人</label>
+<div class="layui-input-inline">
+<select id="UserIdSelect" name="UserIdSelect" lay-search="">
+<option value="">全部...</option>
+</select>
+</div>
+</div>
+<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>
+</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="Mobile" placeholder="" autocomplete="off">
+</div>
+</div><div class="layui-inline">
+<label class="layui-form-label">出货仓库仓库编号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="FromStoreIdStoreNo" autocomplete="off">
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">出货仓库仓库名称</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" name="FromStoreIdStoreName" 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">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_add,"))
+                    {
+                        <button class="layui-btn" data-type="add"><i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                    <button class="layui-btn" data-type="ImportData"><i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导入</button>
+<button class="layui-btn" data-type="ExportExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+
+                    }
+                </div>
+                
+                <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,"))
+                    {
+                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/Admin/PreSendStockDetail/Index?right=@right&StoreId=@("{{d.Id}}")">预发货库存明细</a>
+
+                    }
+                </script>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">模板下载</label>
+                <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/SmallStoreHouse_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        
+    </script>
+</body>
+</html>

+ 24 - 0
Models/ActivityRedPackageJoins.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ActivityRedPackageJoins
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public decimal PrizeAmt { get; set; }
+        public string ActivityDate { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 24 - 0
Models/ActivityRedPackageJoinss.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ActivityRedPackageJoinss
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public decimal PrizeAmt { get; set; }
+        public string ActivityDate { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 24 - 0
Models/ActivityRedPackageStock.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ActivityRedPackageStock
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string ActivityDate { get; set; }
+        public decimal PrizeAmt { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 24 - 0
Models/ActivityRedPackageStocks.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ActivityRedPackageStocks
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string ActivityDate { get; set; }
+        public decimal PrizeAmt { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 25 - 0
Models/ActivityRedPackageTop10.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ActivityRedPackageTop10
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int Kind { get; set; }
+        public int TimeNum { get; set; }
+        public decimal PrizeAmt { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 25 - 0
Models/ActivityRedPackageTop10s.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ActivityRedPackageTop10s
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int Kind { get; set; }
+        public int TimeNum { get; set; }
+        public decimal PrizeAmt { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 32 - 0
Models/PreSendStockDetail.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class PreSendStockDetail
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public DateTime? CancelDate { get; set; }
+        public ulong CancelFlag { get; set; }
+        public int FromStoreId { get; set; }
+        public int FromUserId { get; set; }
+        public DateTime? ApplyDate { get; set; }
+        public ulong ApplyFlag { get; set; }
+        public int SourceStoreId { get; set; }
+        public string ToRemark { get; set; }
+        public int ToStoreId { get; set; }
+        public int ToUserId { get; set; }
+        public int SnId { get; set; }
+        public string SnNo { get; set; }
+        public int BrandId { get; set; }
+        public int StoreId { get; set; }
+    }
+}

+ 41 - 0
Models/ProfitSubsidyDetail04.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ProfitSubsidyDetail04
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Remark { get; set; }
+        public decimal SubsidyProfit { get; set; }
+        public decimal SubsidyProfitRate { get; set; }
+        public decimal CreditProfitRate { get; set; }
+        public decimal NonQrCreditTradeAmt { get; set; }
+        public decimal QrCreditTradeAmt { get; set; }
+        public decimal CreditTradeAmt { get; set; }
+        public int SubsidyType { get; set; }
+        public int SubsidyUserId { get; set; }
+        public ulong MerHelpFlag { get; set; }
+        public int BelongUserId { get; set; }
+        public DateTime? MerStandardDate { get; set; }
+        public DateTime? MerRegTime { get; set; }
+        public string SnNo { get; set; }
+        public string MerNo { get; set; }
+        public int MerchantId { get; set; }
+        public string TradeMonth { get; set; }
+        public string ProductName { get; set; }
+        public int BrandId { get; set; }
+        public string RecordNo { get; set; }
+    }
+}

+ 27 - 0
Models/SmallStoreHouse.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class SmallStoreHouse
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int FromStoreId { get; set; }
+        public string Mobile { get; set; }
+        public string Remark { get; set; }
+        public int LaveNum { get; set; }
+        public int TotalNum { get; set; }
+        public string BrandId { get; set; }
+        public int UserId { get; set; }
+        public string StoreName { get; set; }
+        public string StoreNo { get; set; }
+    }
+}

+ 1 - 0
Models/Users.cs

@@ -81,5 +81,6 @@ namespace MySystem.Models
         public string NickName { get; set; }
         public int CashStatus { get; set; }
         public string CashNote { get; set; }
+        public decimal ThisMonthTrade { get; set; }
     }
 }

+ 552 - 2
Models/WebCMSEntities.cs

@@ -19,6 +19,12 @@ namespace MySystem.Models
         public virtual DbSet<ActivityEnrolRecord> ActivityEnrolRecord { get; set; }
         public virtual DbSet<ActivityInfo> ActivityInfo { get; set; }
         public virtual DbSet<ActivityPrizeDetail> ActivityPrizeDetail { get; set; }
+        public virtual DbSet<ActivityRedPackageJoins> ActivityRedPackageJoins { get; set; }
+        public virtual DbSet<ActivityRedPackageJoinss> ActivityRedPackageJoinss { get; set; }
+        public virtual DbSet<ActivityRedPackageStock> ActivityRedPackageStock { get; set; }
+        public virtual DbSet<ActivityRedPackageStocks> ActivityRedPackageStocks { get; set; }
+        public virtual DbSet<ActivityRedPackageTop10> ActivityRedPackageTop10 { get; set; }
+        public virtual DbSet<ActivityRedPackageTop10s> ActivityRedPackageTop10s { get; set; }
         public virtual DbSet<Advertisment> Advertisment { get; set; }
         public virtual DbSet<AgentLevelSet> AgentLevelSet { get; set; }
         public virtual DbSet<AppBottomNavs> AppBottomNavs { get; set; }
@@ -103,6 +109,7 @@ namespace MySystem.Models
         public virtual DbSet<PosMerchantInfo> PosMerchantInfo { get; set; }
         public virtual DbSet<PosMerchantOtherInfo> PosMerchantOtherInfo { get; set; }
         public virtual DbSet<PosMerchantTradeSummay> PosMerchantTradeSummay { get; set; }
+        public virtual DbSet<PreSendStockDetail> PreSendStockDetail { get; set; }
         public virtual DbSet<ProductComment> ProductComment { get; set; }
         public virtual DbSet<ProductCommentAgree> ProductCommentAgree { get; set; }
         public virtual DbSet<ProductFareAreas> ProductFareAreas { get; set; }
@@ -129,6 +136,7 @@ namespace MySystem.Models
         public virtual DbSet<ProfitRecord> ProfitRecord { get; set; }
         public virtual DbSet<ProfitRewardRecord> ProfitRewardRecord { get; set; }
         public virtual DbSet<ProfitSubsidyDetail> ProfitSubsidyDetail { get; set; }
+        public virtual DbSet<ProfitSubsidyDetail04> ProfitSubsidyDetail04 { get; set; }
         public virtual DbSet<PublicAccountSet> PublicAccountSet { get; set; }
         public virtual DbSet<PullNewAct> PullNewAct { get; set; }
         public virtual DbSet<PullNewDetail> PullNewDetail { get; set; }
@@ -136,6 +144,7 @@ namespace MySystem.Models
         public virtual DbSet<RightDic> RightDic { get; set; }
         public virtual DbSet<ServiceCenter> ServiceCenter { get; set; }
         public virtual DbSet<SetMerchantTypeRecord> SetMerchantTypeRecord { get; set; }
+        public virtual DbSet<SmallStoreHouse> SmallStoreHouse { get; set; }
         public virtual DbSet<StoreBalance> StoreBalance { get; set; }
         public virtual DbSet<StoreChangeHistory> StoreChangeHistory { get; set; }
         public virtual DbSet<StoreForCode> StoreForCode { get; set; }
@@ -574,6 +583,310 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<ActivityRedPackageJoins>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActivityDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PrizeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<ActivityRedPackageJoinss>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActivityDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PrizeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<ActivityRedPackageStock>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActivityDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PrizeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<ActivityRedPackageStocks>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActivityDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PrizeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<ActivityRedPackageTop10>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Kind).HasColumnType("int(11)");
+
+                entity.Property(e => e.PrizeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TimeNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<ActivityRedPackageTop10s>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Kind).HasColumnType("int(11)");
+
+                entity.Property(e => e.PrizeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TimeNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<Advertisment>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -6899,6 +7212,74 @@ namespace MySystem.Models
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
             });
 
+            modelBuilder.Entity<PreSendStockDetail>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ApplyDate).HasColumnType("datetime");
+
+                entity.Property(e => e.ApplyFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CancelDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CancelFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.FromStoreId).HasColumnType("int(11)");
+
+                entity.Property(e => e.FromUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SnId).HasColumnType("int(11)");
+
+                entity.Property(e => e.SnNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.SourceStoreId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.StoreId).HasColumnType("int(11)");
+
+                entity.Property(e => e.ToRemark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ToStoreId).HasColumnType("int(11)");
+
+                entity.Property(e => e.ToUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<ProductComment>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -8668,6 +9049,108 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<ProfitSubsidyDetail04>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BelongUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreditProfitRate).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.MerHelpFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MerNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerRegTime).HasColumnType("datetime");
+
+                entity.Property(e => e.MerStandardDate).HasColumnType("datetime");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.NonQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ProductName)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RecordNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SnNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.SubsidyProfit).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.SubsidyProfitRate).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.SubsidyType).HasColumnType("int(11)");
+
+                entity.Property(e => e.SubsidyUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<PublicAccountSet>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -9244,6 +9727,69 @@ namespace MySystem.Models
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
             });
 
+            modelBuilder.Entity<SmallStoreHouse>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.FromStoreId).HasColumnType("int(11)");
+
+                entity.Property(e => e.LaveNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.Mobile)
+                    .HasColumnType("varchar(11)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(128)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.StoreName)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.StoreNo)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TotalNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<StoreBalance>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -9565,6 +10111,8 @@ namespace MySystem.Models
 
             modelBuilder.Entity<StoreMachineApply>(entity =>
             {
+                entity.HasComment("机具申请记录表");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActualApply)
@@ -13974,7 +14522,7 @@ namespace MySystem.Models
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.CertId)
-                    .HasColumnType("varchar(18)")
+                    .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -14058,7 +14606,7 @@ namespace MySystem.Models
                 entity.Property(e => e.MerchantType).HasColumnType("int(11)");
 
                 entity.Property(e => e.Mobile)
-                    .HasColumnType("varchar(11)")
+                    .HasColumnType("varchar(15)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -14177,6 +14725,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ThisMonthTrade).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.UpdateMan)

+ 451 - 0
wwwroot/layuiadmin/modules_main/PreSendStockDetail_Admin.js

@@ -0,0 +1,451 @@
+var ExcelData,ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/PreSendStockDetail/Import?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+elem: '#CreateDate',
+type: 'datetime',
+range: true,
+trigger: 'click',
+change: function (value, date, endDate) {
+var op = true;
+if (date.year == endDate.year && endDate.month - date.month <= 1) {
+if (endDate.month - date.month == 1 && endDate.date > date.date) {
+op = false;
+layCreateDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+} else {
+op = false;
+layCreateDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+if (op) {
+$('#CreateDate').val(value);
+}
+}
+});
+var layApplyDate = laydate.render({
+elem: '#ApplyDate',
+trigger: 'click',
+type: 'datetime',
+range: true,
+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;
+layApplyDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+} else {
+op = false;
+layApplyDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+if (op) {
+$('#ApplyDate').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/PreSendStockDetail/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+    
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/PreSendStockDetail/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+    		, {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
+            ,{field:'StoreIdStoreName', width: 200, title:'仓库仓库名称', sort: true}
+,{field:'StoreIdStoreNo', width: 200, title:'仓库仓库编号', sort: true}
+,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
+,{field:'BrandId', width: 200, title:'产品类型', sort: true}
+,{field:'SnNo', width: 200, title:'SN编号', sort: true}
+,{field:'SnId', width: 200, title:'SNID', sort: true}
+,{field:'ToUserIdMakerCode', width: 200, title:'收货人创客编号', sort: true}
+,{field:'ToUserIdRealName', width: 200, title:'收货人真实姓名', sort: true}
+,{field:'ToStoreIdStoreNo', width: 200, title:'收货仓库仓库编号', sort: true}
+,{field:'ToStoreIdStoreName', width: 200, title:'收货仓库仓库名称', sort: true}
+,{field:'SourceStoreIdStoreNo', width: 200, title:'源仓库编号仓库编号', sort: true}
+,{field:'SourceStoreIdStoreName', width: 200, title:'源仓库编号仓库名称', sort: true}
+,{field:'ApplyFlagName', width: 200, title:'申请标记', sort: true}
+,{field:'ApplyDate', width: 200, title:'申请时间', sort: true}
+,{field:'FromUserIdMakerCode', width: 200, title:'出货创客创客编号', sort: true}
+,{field:'FromUserIdRealName', width: 200, title:'出货创客真实姓名', sort: true}
+,{field:'FromStoreIdStoreNo', width: 200, title:'出货仓库仓库编号', sort: true}
+,{field:'FromStoreIdStoreName', width: 200, title:'出货仓库仓库名称', sort: true}
+,{field:'CancelFlagName', width: 200, title:'撤回标记', sort: true}
+,{field:'CancelDate', width: 200, title:'撤回时间', sort: true}
+
+            , {field:'Sort', fixed: 'right', title:'排序', width:80, edit: 'text'}
+            , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+        ]]
+        , where: {
+            StoreId: StoreId
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+        if (obj.event === 'del') {
+            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/PreSendStockDetail/Delete?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        if (data == "success") {                            
+                            obj.del();
+                            layer.close(index);
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        } else if (obj.event === 'edit') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '预发货库存明细-编辑'
+                , content: 'Edit?Id=' + data.Id + '&StoreId=' + StoreId + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () { 
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });                        
+                    }, 300);
+
+                    
+                    
+                    
+                    
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+                        
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/PreSendStockDetail/Edit?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/PreSendStockDetail/Delete?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , add: function () {
+            var perContent = layer.open({
+                type: 2
+                , title: '预发货库存明细-添加'
+                , content: 'Add?StoreId=' + StoreId + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () { 
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });                        
+                    }, 300);
+
+                    
+                    
+                    
+                    
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+                        
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/PreSendStockDetail/Add?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+            layer.full(perContent);
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/PreSendStockDetail/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
+            });
+        }
+        , Open: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if(data.length < 1){
+                parent.layer.msg("请选择要开启的项");
+            }else{
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要开启吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/PreSendStockDetail/Open?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , Close: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if(data.length < 1){
+                parent.layer.msg("请选择要关闭的项");
+            }else{
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要关闭吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/PreSendStockDetail/Close?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});

+ 413 - 0
wwwroot/layuiadmin/modules_main/SmallStoreHouse_Admin.js

@@ -0,0 +1,413 @@
+var ExcelData,ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/SmallStoreHouse/Import?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+elem: '#CreateDate',
+type: 'datetime',
+range: true,
+trigger: 'click',
+change: function (value, date, endDate) {
+var op = true;
+if (date.year == endDate.year && endDate.month - date.month <= 1) {
+if (endDate.month - date.month == 1 && endDate.date > date.date) {
+op = false;
+layCreateDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+} else {
+op = false;
+layCreateDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+if (op) {
+$('#CreateDate').val(value);
+}
+}
+});
+
+
+    //excel导入
+    excel = layui.excel;        
+    $('#ExcelFile').change(function (e) {
+        var files = e.target.files;
+        excel.importExcel(files, { }, function (data) {
+            ExcelData = data[0].sheet1;
+        });
+    });
+
+    //监听单元格编辑
+    table.on('edit(LAY-list-manage)', function(obj){
+        var value = obj.value //得到修改后的值
+        ,data = obj.data //得到所在行所有键值
+        ,field = obj.field; //得到字段
+        if(field == "Sort"){
+            $.ajax({
+                type: "POST",
+                url: "/Admin/SmallStoreHouse/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+    
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/SmallStoreHouse/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+    		, {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
+            ,{field:'StoreNo', width: 200, title:'仓库编号', sort: true}
+,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
+,{field:'StoreName', width: 200, title:'仓库名称', sort: true}
+,{field:'BrandId', width: 200, title:'产品类型', sort: true}
+,{field:'TotalNum', width: 200, title:'总库存数', sort: true}
+,{field:'LaveNum', width: 200, title:'剩余库存数', sort: true}
+,{field:'Mobile', width: 200, title:'仓库归属人手机号', sort: true}
+,{field:'FromStoreIdStoreNo', width: 200, title:'出货仓库仓库编号', sort: true}
+,{field:'FromStoreIdStoreName', width: 200, title:'出货仓库仓库名称', sort: true}
+
+            , {field:'Sort', fixed: 'right', title:'排序', width:80, edit: 'text'}
+            , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+        ]]
+        , where: {
+            
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+        if (obj.event === 'del') {
+            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/SmallStoreHouse/Delete?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        if (data == "success") {                            
+                            obj.del();
+                            layer.close(index);
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        } else if (obj.event === 'edit') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '小仓库-编辑'
+                , content: 'Edit?Id=' + data.Id + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () { 
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });                        
+                    }, 300);
+
+                    
+                    
+                    
+                    
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+                        
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/SmallStoreHouse/Edit?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SmallStoreHouse/Delete?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , add: function () {
+            var perContent = layer.open({
+                type: 2
+                , title: '小仓库-添加'
+                , content: 'Add'
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () { 
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });                        
+                    }, 300);
+
+                    
+                    
+                    
+                    
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+                        
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/SmallStoreHouse/Add?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+            layer.full(perContent);
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/SmallStoreHouse/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
+            });
+        }
+        , Open: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if(data.length < 1){
+                parent.layer.msg("请选择要开启的项");
+            }else{
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要开启吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SmallStoreHouse/Open?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , Close: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if(data.length < 1){
+                parent.layer.msg("请选择要关闭的项");
+            }else{
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要关闭吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SmallStoreHouse/Close?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});