Просмотр исходного кода

增加分仓向总仓申请机具接口文件

lichunlei 4 лет назад
Родитель
Сommit
23589c7dbb

+ 389 - 0
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -0,0 +1,389 @@
+/*
+ * 分仓机具额度记录
+ */
+
+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 StoreHouseAmountRecordController : BaseController
+    {
+        public StoreHouseAmountRecordController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+        }
+
+        #region 分仓机具额度记录列表
+
+        /// <summary>
+        /// 根据条件查询分仓机具额度记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(StoreHouseAmountRecord data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            
+            
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询分仓机具额度记录列表
+
+        /// <summary>
+        /// 分仓机具额度记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string AmountTypeSelect, string OperateTypeSelect, int page = 1, int limit = 30)
+        {
+            
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            
+            Fields.Add("CreateDate", "3"); //时间
+
+
+            string condition = " and Status>-1";
+            //创客真实姓名
+if (!string.IsNullOrEmpty(UserIdRealName))
+{
+condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+}
+//创客创客编号
+if (!string.IsNullOrEmpty(UserIdMakerCode))
+{
+condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+}
+//额度类别
+if (!string.IsNullOrEmpty(AmountTypeSelect))
+{
+condition += " and AmountType=" + AmountTypeSelect;
+}
+//操作类别
+if (!string.IsNullOrEmpty(OperateTypeSelect))
+{
+condition += " and OperateType=" + OperateTypeSelect;
+}
+
+
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //创客
+int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+dic["UserIdRealName"] = userid_Users.RealName;
+dic["UserIdMakerCode"] = userid_Users.MakerCode;
+dic.Remove("UserId");
+//申请单
+dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
+//额度类别
+int AmountType = int.Parse(dic["AmountType"].ToString());
+if(AmountType == 0) dic["AmountType"] = "固定额度";
+if(AmountType == 1) dic["AmountType"] = "临时额度";
+//操作类别
+int OperateType = int.Parse(dic["OperateType"].ToString());
+if(OperateType == 1) dic["OperateType"] = "增加";
+if(OperateType == 2) dic["OperateType"] = "减少";
+if(OperateType == 0) dic["OperateType"] = "";
+
+            }
+            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(StoreHouseAmountRecord data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            
+            Fields.Add("OperateType", data.OperateType); //操作类别
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Add("StoreHouseAmountRecord", Fields, 0);
+            AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "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;
+            
+
+            StoreHouseAmountRecord editData = db.StoreHouseAmountRecord.FirstOrDefault(m => m.Id == Id) ?? new StoreHouseAmountRecord();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 修改分仓机具额度记录
+
+        /// <summary>
+        /// 增加或修改分仓机具额度记录信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edit(StoreHouseAmountRecord data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            
+            Fields.Add("OperateType", data.OperateType); //操作类别
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", Fields, data.Id);
+            AddSysLog(data.Id.ToString(),"StoreHouseAmountRecord","update");
+            db.SaveChanges();
+            
+            return "success";
+        }
+
+        #endregion
+
+        #region 删除分仓机具额度记录信息
+
+        /// <summary>
+        /// 删除分仓机具额度记录信息
+        /// </summary>
+        /// <returns></returns>
+        public string Delete(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id,"StoreHouseAmountRecord","del");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", 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,"StoreHouseAmountRecord","open");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);
+                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", 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,"StoreHouseAmountRecord","close");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 0);
+                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 排序
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id"></param>
+        public string Sort(int Id, int Sort)
+        {
+            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Sort("StoreHouseAmountRecord", Sort, Id);
+            
+            AddSysLog(Id.ToString(), "StoreHouseAmountRecord", "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.StoreHouseAmountRecord.Add(new StoreHouseAmountRecord()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            AddSysLog("0", "StoreHouseAmountRecord", "Import");
+            return "success";
+        }
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string AmountTypeSelect, string OperateTypeSelect)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("CreateDate", "3"); //时间
+
+
+            string condition = " and Status>-1";
+            //创客真实姓名
+if (!string.IsNullOrEmpty(UserIdRealName))
+{
+condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+}
+//创客创客编号
+if (!string.IsNullOrEmpty(UserIdMakerCode))
+{
+condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+}
+//额度类别
+if (!string.IsNullOrEmpty(AmountTypeSelect))
+{
+condition += " and AmountType=" + AmountTypeSelect;
+}
+//操作类别
+if (!string.IsNullOrEmpty(OperateTypeSelect))
+{
+condition += " and OperateType=" + OperateTypeSelect;
+}
+
+
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //创客
+int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+dic["UserIdRealName"] = userid_Users.RealName;
+dic["UserIdMakerCode"] = userid_Users.MakerCode;
+dic.Remove("UserId");
+//申请单
+dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
+//额度类别
+int AmountType = int.Parse(dic["AmountType"].ToString());
+if(AmountType == 0) dic["AmountType"] = "固定额度";
+if(AmountType == 1) dic["AmountType"] = "临时额度";
+//操作类别
+int OperateType = int.Parse(dic["OperateType"].ToString());
+if(OperateType == 1) dic["OperateType"] = "增加";
+if(OperateType == 2) dic["OperateType"] = "减少";
+if(OperateType == 0) dic["OperateType"] = "";
+
+            }
+
+            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("UserIdRealName", "创客真实姓名");
+ReturnFields.Add("UserIdMakerCode", "创客创客编号");
+ReturnFields.Add("ApplyId", "申请单");
+ReturnFields.Add("UseAmount", "使用额度");
+ReturnFields.Add("BeforeAmount", "使用前剩余额度");
+ReturnFields.Add("AfterAmount", "使用后剩余额度");
+ReturnFields.Add("AmountType", "额度类别");
+ReturnFields.Add("OperateType", "操作类别");
+
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "StoreHouseAmountRecord", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+    }
+}

+ 384 - 779
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -1,779 +1,384 @@
-// 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;
-
-// /// <summary>
-// /// 机具申请记录
-// /// </summary>
-// namespace MySystem.Areas.Admin.Controllers
-// {
-//     [Area("Admin")]
-//     [Route("Admin/[controller]/[action]")]
-//     public class StoreMachineApplyController : BaseController
-//     {
-//         public StoreMachineApplyController(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(StoreMachineApply data, string right)
-//         {
-//             ViewBag.RightInfo = RightInfo;
-//             ViewBag.right = right;
-
-//             return View();
-//         }
-
-//         #endregion
-
-//         #region 根据条件查询机具申请记录列表
-
-//         /// <summary>
-//         /// 机具申请记录列表
-//         /// </summary>
-//         /// <returns></returns>
-//         public JsonResult IndexData(StoreMachineApply data, string MakerCode, string RealName, string StoreNo, string StoreName, string StoreMakerCode, string StatusSelect, string SendStatusSelect, string StoreTypeSelect, int page = 1, int limit = 30)
-//         {
-
-//             Dictionary<string, string> Fields = new Dictionary<string, string>();
-
-//             Fields.Add("ApplyNo", "1"); //申请单号
-//             Fields.Add("BrandId", "1"); //品牌
-//             Fields.Add("ExpressNo", "1"); //快递单号
-
-//             string condition = " and Status>-1";
-//             //创客编号
-//             if (!string.IsNullOrEmpty(MakerCode))
-//             {
-//                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
-//             }
-//             //创客名称
-//             if (!string.IsNullOrEmpty(RealName))
-//             {
-//                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
-//             }
-//             //仓库编号
-//             if (!string.IsNullOrEmpty(StoreNo))
-//             {
-//                 condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreNo + "')";
-//             }
-//             //仓库名称
-//             if (!string.IsNullOrEmpty(StoreName))
-//             {
-//                 condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreName + "')";
-//             }
-//             //仓库归属创客编号
-//             if (!string.IsNullOrEmpty(StoreMakerCode))
-//             {
-//                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + StoreMakerCode + "')";
-//             }
-//             //订单状态
-//             if (!string.IsNullOrEmpty(StatusSelect))
-//             {
-//                 condition += " and Status=" + StatusSelect;
-//             }
-//             //发货状态
-//             if (!string.IsNullOrEmpty(SendStatusSelect))
-//             {
-//                 condition += " and SendStatus=" + SendStatusSelect;
-//             }
-//             //仓库类型
-//             if (!string.IsNullOrEmpty(StoreTypeSelect))
-//             {
-//                 condition += " and StoreType=" + StoreTypeSelect;
-//             }
-
-//             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreMachineApply", 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)
-//             {
-//                 dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
-
-//                 //申请仓库信息
-//                 int StoreId = int.Parse(dic["StoreId"].ToString());
-//                 StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
-//                 dic["StoreInfo"] = store.StoreNo + "<br />" + store.StoreName;
-
-//                 //仓库收货地址
-//                 dic["StoreAddressInfo"] = store.Areas + "<br />" + store.Address;
-
-//                 //仓库联系人信息
-//                 //dic["StoreContact"] = dic["StoreManagerMobile"].ToString() + "<br />" + dic["StoreManager"].ToString();
-
-//                 //仓库归属信息
-//                 // int StoreUserId = int.Parse(dic["StoreUserId"].ToString());
-//                 // Users storeUser = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
-//                 // int StoreType = int.Parse(dic["StoreType"].ToString());
-//                 // string StoreTypeName = "";
-//                 // if(StoreType == 0) StoreTypeName = "总仓";
-//                 // if(StoreType == 1) StoreTypeName = "分仓";
-//                 // dic["StoreUser"] = storeUser.MakerCode + "<br />" + StoreTypeName;
-
-//                 //创客信息
-//                 int UserId = int.Parse(dic["UserId"].ToString());
-//                 Users puser = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-//                 dic["UserInfo"] = puser.MakerCode + "<br />" + puser.RealName;
-
-//                 //顶级创客
-//                 // int TopUserId = int.Parse(dic["TopUserId"].ToString());
-//                 // Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
-//                 // dic["TopUserInfo"] = tuser.MakerCode + "<br />" + tuser.RealName;
-
-//                 //申请状态
-//                 int Status = int.Parse(dic["Status"].ToString());
-//                 if (Status == 0) dic["Status"] = "待审核";
-//                 if (Status == 1) dic["Status"] = "申请成功";
-//                 if (Status == 2) dic["Status"] = "申请失败";
-//             }
-//             Dictionary<string, object> other = new Dictionary<string, object>();
-//             other.Add("ApplyNum", 0);
-//             other.Add("SendNum", 0);
-//             obj.Add("other", other);
-//             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(StoreMachineApply data)
-//         {
-//             Dictionary<string, object> Fields = new Dictionary<string, object>();
-
-
-//             Fields.Add("SeoTitle", data.SeoTitle);
-//             Fields.Add("SeoKeyword", data.SeoKeyword);
-//             Fields.Add("SeoDescription", data.SeoDescription);
-//             int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreMachineApply", Fields, 0);
-//             AddSysLog(data.Id.ToString(), "StoreMachineApply", "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;
-
-//             StoreMachineApply editData = db.StoreMachineApply.FirstOrDefault(m => m.Id == Id) ?? new StoreMachineApply();
-//             ViewBag.data = editData;
-
-//             KqProducts kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == editData.BrandId);
-//             ViewBag.BrandName = kqProducts.Name;
-
-//             Users user = db.Users.FirstOrDefault(m => m.Id == editData.UserId) ?? new Users();
-//             ViewBag.MakerCode = user.MakerCode;
-//             ViewBag.RealName = user.RealName;
-
-//             int Status = editData.Status;
-//             if (Status == 0) ViewBag.Status = "待审核";
-//             if (Status == 1) ViewBag.Status = "申请成功";
-//             if (Status == 2) ViewBag.Status = "申请失败";
-//             return View();
-//         }
-
-//         #endregion
-
-//         #region 修改机具申请记录
-
-//         /// <summary>
-//         /// 增加或修改机具申请记录信息
-//         /// </summary>
-//         /// <returns></returns>
-//         [HttpPost]
-//         public string Edit(StoreMachineApply data)
-//         {
-//             Dictionary<string, object> Fields = new Dictionary<string, object>();
-
-//             Fields.Add("ApplyNo", data.ApplyNo); //申请单号
-//             // Fields.Add("BrandId", data.BrandId); //产品Id
-//             Fields.Add("ApplyNum", data.ApplyNum); //申请箱数
-//             Fields.Add("SendNum", data.SendNum); //发货箱数
-//             // Fields.Add("UserId", data.UserId); //创客ID
-//             Fields.Add("Status", data.Status); //申请状态
-//             Fields.Add("SwapSnExpand", data.SwapSnExpand);//已发货机具SN
-//             Fields.Add("SeoDescription", data.SeoDescription); //申请描述
-
-//             new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreMachineApply", Fields, data.Id);
-//             AddSysLog(data.Id.ToString(), "StoreMachineApply", "update");
-//             db.SaveChanges();
-
-//             return "success";
-//         }
-
-//         #endregion
-
-//         #region 删除机具申请记录信息
-
-//         /// <summary>
-//         /// 删除机具申请记录信息
-//         /// </summary>
-//         /// <returns></returns>
-//         public string Delete(string Id)
-//         {
-//             string[] idlist = Id.Split(new char[] { ',' });
-//             AddSysLog(Id, "StoreMachineApply", "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("StoreMachineApply", Fields, id);
-//             }
-//             db.SaveChanges();
-
-//             return "success";
-//         }
-
-//         #endregion
-
-//         #region 取消机具申请记录信息
-
-//         /// <summary>
-//         /// 取消机具申请记录信息
-//         /// </summary>
-//         /// <returns></returns>
-//         public string Cancel(int Id)
-//         {
-//             StoreMachineApply storeMachineApply = db.StoreMachineApply.FirstOrDefault(m => m.Id == Id);
-//             Orders order = db.Orders.FirstOrDefault(m => m.Id == storeMachineApply.OrderId);
-//             if (storeMachineApply != null && order != null)
-//             {
-//                 function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(storeMachineApply) + "#cut#" + Newtonsoft.Json.JsonConvert.SerializeObject(order) + "#cut#" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "机具申请订单取消日志");
-//                 db.StoreMachineApply.Remove(storeMachineApply);
-//                 db.Orders.Remove(order);
-//                 db.SaveChanges();
-//             }
-//             AddSysLog(Id, "StoreMachineApply", "cancel");
-//             AddSysLog(Id, "Orders", "cancel");
-//             return "success";
-//         }
-
-//         #endregion
-
-//         #region 开启
-
-//         /// <summary>
-//         /// 开启
-//         /// </summary>
-//         /// <returns></returns>
-//         public string Open(string Id)
-//         {
-//             string[] idlist = Id.Split(new char[] { ',' });
-//             AddSysLog(Id, "StoreMachineApply", "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("StoreMachineApply", 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, "StoreMachineApply", "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("StoreMachineApply", 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("StoreMachineApply", Sort, Id);
-
-//             AddSysLog(Id.ToString(), "StoreMachineApply", "sort");
-//             return "success";
-//         }
-//         #endregion
-
-//         #region 导入数据
-
-//         public IActionResult Import(string right, string ExcelKind)
-//         {
-//             ViewBag.RightInfo = RightInfo;
-//             ViewBag.right = right;
-//             ViewBag.ExcelKind = ExcelKind;
-//             return View();
-//         }
-//         /// <summary>
-//         /// 导入数据
-//         /// </summary>
-//         /// <param name="ExcelData"></param>
-//         [HttpPost]
-//         public string ImportPost(string ExcelData)
-//         {
-//             // // RedisDbconn.Instance.AddList("ExcelImport", ExcelPath + "#cut#" + Kind);
-//             // string key = function.MD5_16(Guid.NewGuid().ToString());
-//             // RedisDbconn.Instance.AddList("ExcelImportV2", ExcelPath + "#cut#" + Kind + "#cut#" + key);
-//             // return "success|" + key;
-//             ExcelData = HttpUtility.UrlDecode(ExcelData);
-//             JsonData list = JsonMapper.ToObject(ExcelData);
-//             for (int i = 1; i < list.Count; i++)
-//             {
-//                 JsonData dr = list[i];
-//                 // string SwapSnExpand = dr[0].ToString();
-//                 var temp = dr[0].ToString();
-//                 temp = temp.Substring(1);
-//                 temp = temp.Substring(0, temp.Length - 1);
-//                 var SwapSnExpand = temp.Split(",,");
-//                 // StoreMachineApply storeMachineApply = db.StoreMachineApply.FirstOrDefault(m => m.MakerCode == MakerCode);
-//                 // if (UserCode != null)
-//                 // {
-//                 //     Users User = db.Users.FirstOrDefault(m => m.Id == UserCode.UserId);
-//                 //     if (User != null)
-//                 //     {
-//                 //         User.SettleAmount = decimal.Parse(function.CheckInt(SettleAmount));
-//                 //     }
-//                 // }
-//             }
-//             db.SaveChanges();
-//             return "success";
-//         }
-//         #endregion
-
-//         #region 导出Excel
-
-//         /// <summary>
-//         /// 导出Excel
-//         /// </summary>
-//         /// <returns></returns>
-//         public JsonResult ExportExcel(StoreMachineApply data, string MakerCode, string RealName, string StoreNo, string StoreName, string StoreMakerCode, string StatusSelect, string SendStatusSelect, string StoreTypeSelect)
-//         {
-//             Dictionary<string, string> Fields = new Dictionary<string, string>();
-
-//             Fields.Add("ApplyNo", "1"); //申请单号
-//             Fields.Add("BrandId", "1"); //品牌
-//             Fields.Add("ApplyTime", "3"); //申请时间
-//             Fields.Add("ExpressNo", "1"); //快递单号
-
-//             string condition = " and Status>-1";
-//             //创客编号
-//             if (!string.IsNullOrEmpty(MakerCode))
-//             {
-//                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
-//             }
-//             //创客名称
-//             if (!string.IsNullOrEmpty(RealName))
-//             {
-//                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
-//             }
-//             //仓库编号
-//             if (!string.IsNullOrEmpty(StoreNo))
-//             {
-//                 condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreNo + "')";
-//             }
-//             //仓库名称
-//             if (!string.IsNullOrEmpty(RealName))
-//             {
-//                 condition += " and StoreId in (select StoreId from StoreForName where Name='" + RealName + "')";
-//             }
-//             //仓库归属创客编号
-//             if (!string.IsNullOrEmpty(StoreMakerCode))
-//             {
-//                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + StoreMakerCode + "')";
-//             }
-//             //订单状态
-//             if (!string.IsNullOrEmpty(StatusSelect))
-//             {
-//                 condition += " and Status=" + StatusSelect;
-//             }
-//             //发货状态
-//             if (!string.IsNullOrEmpty(SendStatusSelect))
-//             {
-//                 condition += " and SendStatus=" + SendStatusSelect;
-//             }
-//             //仓库类型
-//             if (!string.IsNullOrEmpty(StoreTypeSelect))
-//             {
-//                 condition += " and StoreType=" + StoreTypeSelect;
-//             }
-
-//             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MachineApply", Fields, "Id desc", "0", 1, 20000, condition, "ApplyNo,UserId,TopUserId,BrandId,Areas,Address,RealName,Mobile,ApplyDeviceName,ApplyDeviceNum,ApplyTime,SendStatus,ExpressNo,ExpressName,DeliveryType,StoreId,StoreName,StoreManager,StoreManagerMobile,Remark,StoreUserId,SendDate,StoreType,Status", false);
-//             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
-//             foreach (Dictionary<string, object> dic in diclist)
-//             {
-//                 dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
-
-//                 //申请仓库信息
-//                 int StoreId = int.Parse(dic["StoreId"].ToString());
-//                 StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
-//                 dic["StoreInfo"] = store.StoreNo + "<br />" + store.StoreName;
-
-//                 //仓库联系人信息
-//                 //dic["StoreContact"] = dic["StoreManagerMobile"].ToString() + "<br />" + dic["StoreManager"].ToString();
-
-//                 //仓库归属信息
-//                 // int StoreUserId = int.Parse(dic["StoreUserId"].ToString());
-//                 // Users storeUser = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
-//                 // int StoreType = int.Parse(dic["StoreType"].ToString());
-//                 // string StoreTypeName = "";
-//                 // if(StoreType == 0) StoreTypeName = "总仓";
-//                 // if(StoreType == 1) StoreTypeName = "分仓";
-//                 // dic["StoreUser"] = storeUser.MakerCode + "<br />" + StoreTypeName;
-
-//                 //创客信息
-//                 int UserId = int.Parse(dic["UserId"].ToString());
-//                 Users puser = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-//                 dic["UserInfo"] = puser.MakerCode + "<br />" + puser.RealName;
-
-//                 //顶级创客
-//                 // int TopUserId = int.Parse(dic["TopUserId"].ToString());
-//                 // Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
-//                 // dic["TopUserInfo"] = tuser.MakerCode + "<br />" + tuser.RealName;
-
-//                 //申请状态
-//                 int Status = int.Parse(dic["Status"].ToString());
-//                 if (Status == 0) dic["Status"] = "待审核";
-//                 if (Status == 1) dic["Status"] = "申请成功";
-//                 if (Status == 2) dic["Status"] = "申请失败";
-
-//                 dic.Remove("BrandId");
-//                 dic.Remove("StoreInfo");
-//                 dic.Remove("UserInfo");
-//                 dic.Remove("Status");
-//             }
-
-//             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("ApplyNo", "申请单号");
-//             ReturnFields.Add("BrandId", "产品类型");
-//             ReturnFields.Add("StoreId", "申请仓库");
-//             ReturnFields.Add("StoreMakerCode", "仓库归属创客编号");
-//             ReturnFields.Add("StoreRealName", "仓库归属创客名称");
-//             ReturnFields.Add("MakerCode", "创客编号");
-//             ReturnFields.Add("MakerName", "创客名称");
-//             ReturnFields.Add("Status", "申请状态");
-//             ReturnFields.Add("ApplyTime", "申请时间");
-//             ReturnFields.Add("ApplyNum", "申请箱数");
-//             ReturnFields.Add("SendNum", "发货箱数");
-//             ReturnFields.Add("SwapSnExpand", "已发货SN号");
-//             ReturnFields.Add("SeoDescription", "申请描述");
-
-//             result.Add("Fields", ReturnFields);
-//             AddSysLog("0", "StoreMachineApply", "ExportExcel");
-//             return Json(result);
-//         }
-
-//         #endregion
-
-
-
-
-
-//         #region 审核发货
-
-//         public IActionResult AuditSend(string right, int Id = 0)
-//         {
-//             ViewBag.RightInfo = RightInfo;
-//             ViewBag.right = right;
-
-
-//             StoreMachineApply editData = db.StoreMachineApply.FirstOrDefault(m => m.Id == Id) ?? new StoreMachineApply();
-//             ViewBag.data = editData;
-
-//             Users users = db.Users.FirstOrDefault(m => m.Id == editData.UserId) ?? new Users();
-//             StoreHouse storeHouse = db.StoreHouse.FirstOrDefault(m => m.Id == editData.StoreId) ?? new StoreHouse();
-//             ViewBag.MakerCode = users.MakerCode;
-//             ViewBag.RealName = users.RealName;
-
-//             return View();
-//         }
-
-//         #endregion
-
-//         #region 审核发货
-
-//         [HttpPost]
-//         public string AuditSend(StoreMachineApply data, string ExcelData)
-//         {
-//             Dictionary<string, object> Fields = new Dictionary<string, object>();
-//             Fields.Add("ApplyNum", data.ApplyNum); //申请箱数
-//             Fields.Add("SendNum", data.SendNum); //发货箱数
-//             Fields.Add("SeoDescription", data.SeoDescription); //申请描述
-//             Fields.Add("Status", data.Status);
-//             new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreMachineApply", Fields, data.Id);
-//             AddSysLog(data.Id.ToString(), "StoreMachineApply", "AuditSend");
-//             StoreMachineApply apply = db.StoreMachineApply.FirstOrDefault(m=>m.Id == data.Id) ?? new StoreMachineApply();
-//             StoreHouse tostore = db.StoreHouse.FirstOrDefault(m=>m.Id == apply.StoreId) ?? new StoreHouse();
-//             int BrandId = apply.BrandId.Value;
-//             var FromStoreId = 0;
-//             if (BrandId==1)
-//             {
-//                 FromStoreId=7;
-//             }
-//             else if (BrandId==2)
-//             {
-//                 FromStoreId=721;
-//             }
-//             else if (BrandId==3)
-//             {
-//                 FromStoreId=697;
-//             }
-//             else if (BrandId==4)
-//             {
-//                 FromStoreId=774;
-//             }
-//             else if (BrandId==5)
-//             {
-//                 FromStoreId=775;
-//             }
-//             else if (BrandId==6)
-//             {
-//                 FromStoreId=871;
-//             }
-//             else if (BrandId==7)
-//             {
-//                 FromStoreId=0;
-//             }
-//             ExcelData = HttpUtility.UrlDecode(ExcelData);
-//             JsonData list = JsonMapper.ToObject(ExcelData);            
-//             Dictionary<string, int> storeData = new Dictionary<string, int>();
-//             Dictionary<string, int> toStoreData = new Dictionary<string, int>();
-//             for (int i = 1; i < list.Count; i++)
-//             {
-//                 JsonData dr = list[i];
-//                 string itemJson = dr.ToJson();
-//                 string SnNo = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
-//                 string BatchNo = itemJson.Contains("\"B\"") ? dr["B"].ToString() : "";
-//                 string OutNote = itemJson.Contains("\"C\"") ? dr["B"].ToString() : "";
-//                 StoreMachineApply storeMachineApply = db.StoreMachineApply.FirstOrDefault(m=>m.Id == data.Id);
-//                 if (storeMachineApply != null)
-//                 {
-//                     storeMachineApply.SwapSnExpand = function.CheckString(SnNo)+',';
-//                 }
-//                 MachineForSnNo machinefor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
-//                 PosMachinesTwo machine = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machinefor.SnId && m.StoreId != apply.StoreId && m.BuyUserId == 0 && m.UserId == 0) ?? new PosMachinesTwo();
-//                 if (machine.Id > 0)
-//                 {
-//                     StoreStockChange stockchange = db.StoreStockChange.Add(new StoreStockChange()
-//                     {
-//                         CreateDate = DateTime.Now,
-//                         StoreId = FromStoreId, //出货仓库
-//                         BrandId = BrandId, //产品类型
-//                         ProductName = RelationClass.GetKqProductBrandInfo(BrandId), //产品名称
-//                         BizBatchNo = BatchNo, //业务批次号
-//                         TransType = 1, //交易类型
-//                         SnNo = SnNo, //SN编号
-//                         StockOpDirect = 1, //库存操作方向
-//                         SnStatus = 1, //SN状态
-//                         DeviceVendor = machine.DeviceName, //设备厂商
-//                         DeviceModel = machine.DeviceKind, //设备型号
-//                         DeviceType = machine.DeviceType, //设备类型
-//                         FromUserId = tostore.UserId, //出货人
-//                         FromDate = DateTime.Now, //出库时间
-//                         FromRemark = OutNote, //出库备注
-//                         ToUserId = tostore.UserId, //收货人
-//                         ToStoreId = tostore.Id, //退货收货仓库                        
-//                         SourceStoreId = machine.SourceStoreId, //源仓库编号
-//                         BrandType = machine.DeviceType, //品牌类型
-//                     }).Entity;
-//                     db.SaveChanges();
-//                     string ChangeNo = "SC";
-//                     int StoreStockChangeId = stockchange.Id;
-//                     string StoreStockChangeIdString = StoreStockChangeId.ToString();
-//                     for (int j = 0; j < 18 - StoreStockChangeId.ToString().Length; j++)
-//                     {
-//                         StoreStockChangeIdString = "0" + StoreStockChangeIdString;
-//                     }
-//                     ChangeNo += StoreStockChangeIdString;
-//                     stockchange.ChangeNo = ChangeNo; //交易流水编号
-//                     machine.StoreId = tostore.Id;
-
-//                     db.StoreChangeHistory.Add(new StoreChangeHistory()
-//                     {
-//                         CreateDate = DateTime.Now,
-//                         UserId = tostore.UserId, //创客
-//                         BrandId = BrandId, //产品类型
-//                         ChangeRecordNo = ChangeNo, //变更记录单号
-//                         BizBatchNo = BatchNo, //业务批次号
-//                         TransType = 1, //交易类型
-//                         SnNo = SnNo, //SN编号
-//                         SnType = machine.PosSnType, //SN机具类型
-//                         StockOpDirect = 1, //库存操作方向
-//                         DeviceVendor = machine.DeviceName, //设备厂商
-//                         DeviceModel = machine.DeviceKind, //设备型号
-//                         DeviceType = machine.DeviceType, //设备类型
-//                         FromUserId = tostore.UserId, //出货创客
-//                         FromDate = DateTime.Now, //出库时间
-//                         FromRemark = OutNote, //出库备注
-//                         SourceStoreId = machine.SourceStoreId, //源仓库
-//                         StoreId = tostore.Id, //仓库
-//                     });
-
-//                     db.StoreChangeHistory.Add(new StoreChangeHistory()
-//                     {
-//                         CreateDate = DateTime.Now,
-//                         UserId = tostore.UserId, //创客
-//                         BrandId = BrandId, //产品类型
-//                         ChangeRecordNo = ChangeNo, //变更记录单号
-//                         BizBatchNo = BatchNo, //业务批次号
-//                         TransType = 1, //交易类型
-//                         SnNo = SnNo, //SN编号
-//                         SnType = machine.PosSnType, //SN机具类型
-//                         StockOpDirect = 0, //库存操作方向
-//                         DeviceVendor = machine.DeviceName, //设备厂商
-//                         DeviceModel = machine.DeviceKind, //设备型号
-//                         DeviceType = machine.DeviceType, //设备类型
-//                         ToUserId = tostore.UserId, //收货创客
-//                         ToStoreId = tostore.Id, //创客退货收货仓库
-//                         ToDate = DateTime.Now, //入库时间
-//                         ToRemark = OutNote, //入库备注
-//                         SourceStoreId = machine.SourceStoreId, //源仓库
-//                         StoreId = tostore.Id, //仓库
-//                     });
-//                     db.SaveChanges();
-//                 }
-//             }
-//             db.SaveChanges();
-
-//             int StoreId = FromStoreId;
-//             int OpStoreNum = list.Count - 1;
-//             StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
-//             StoreBalance balance = db.StoreBalance.Add(new StoreBalance()
-//             {
-//                 CreateDate = DateTime.Now,
-//                 StoreId = StoreId, //仓库
-//                 TransType = 1, //交易类型
-//                 BrandId = BrandId, //产品类型
-//                 OpStoreNum = OpStoreNum, //操作库存数
-//                 OpSymbol = "-", //操作符
-//                 BeforeTotalNum = store.TotalNum, //操作前总库存数
-//                 AfterTotalNum = store.TotalNum, //操作后总库存数
-//                 BeforeLaveNum = store.LaveNum, //操作前剩余库存数
-//                 AfterLaveNum = store.LaveNum - OpStoreNum, //操作后剩余库存数
-//                 BeforeOutNum = store.OutNum, //操作前出库数
-//                 AfterOutNum = store.OutNum + OpStoreNum, //操作后出库数
-//             }).Entity;
-//             db.SaveChanges();
-//             string ChangeNo1 = "SC";
-//             int StoreStockChangeId1 = balance.Id;
-//             string StoreStockChangeId1String = StoreStockChangeId1.ToString();
-//             for (int i = 0; i < 18 - StoreStockChangeId1.ToString().Length; i++)
-//             {
-//                 StoreStockChangeId1String = "0" + StoreStockChangeId1String;
-//             }
-//             ChangeNo1 += StoreStockChangeId1String;
-//             balance.TransRecordNo = ChangeNo1; //交易流水编号
-//             store.LaveNum -= OpStoreNum;
-//             store.OutNum += OpStoreNum;
-//             db.SaveChanges();
-            
-//             StoreId = tostore.Id;
-//             balance = db.StoreBalance.Add(new StoreBalance()
-//             {
-//                 CreateDate = DateTime.Now,
-//                 StoreId = StoreId, //仓库
-//                 TransType = 0, //交易类型
-//                 BrandId = BrandId, //产品类型
-//                 OpStoreNum = OpStoreNum, //操作库存数
-//                 OpSymbol = "+", //操作符
-//                 BeforeTotalNum = store.TotalNum, //操作前总库存数
-//                 AfterTotalNum = store.TotalNum + OpStoreNum, //操作后总库存数
-//                 BeforeLaveNum = store.LaveNum, //操作前剩余库存数
-//                 AfterLaveNum = store.LaveNum + OpStoreNum, //操作后剩余库存数
-//                 BeforeOutNum = store.OutNum, //操作前出库数
-//                 AfterOutNum = store.OutNum, //操作后出库数
-//             }).Entity;
-//             db.SaveChanges();
-//             string ChangeNo2 = "SC";
-//             int StoreStockChangeId2 = balance.Id;
-//             string StoreStockChangeId2String = StoreStockChangeId2.ToString();
-//             for (int i = 0; i < 18 - StoreStockChangeId2.ToString().Length; i++)
-//             {
-//                 StoreStockChangeId2String = "0" + StoreStockChangeId2String;
-//             }
-//             ChangeNo2 += StoreStockChangeId2String;
-//             balance.TransRecordNo = ChangeNo2; //交易流水编号
-//             store.TotalNum += OpStoreNum;
-//             store.LaveNum += OpStoreNum;
-//             db.SaveChanges();
-//             if (data.Status == 1)
-//             {
-//                 return "success";
-//             }
-//             else
-//             {
-//                 return "false";
-//             }
-
-//         }
-//         #endregion
-
-//     }
-// }
+/*
+ * 分仓机具申请记录
+ */
+
+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 StoreMachineApplyController : BaseController
+    {
+        public StoreMachineApplyController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+        }
+
+        #region 分仓机具申请记录列表
+
+        /// <summary>
+        /// 根据条件查询分仓机具申请记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(StoreMachineApply data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            
+            
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询分仓机具申请记录列表
+
+        /// <summary>
+        /// 分仓机具申请记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(StoreMachineApply data, string BrandIdSelect, string UserIdRealName, string UserIdMakerCode, int page = 1, int limit = 30)
+        {
+            
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            
+            Fields.Add("CreateDate", "3"); //时间
+Fields.Add("ApplyNo", "1"); //申请单号
+Fields.Add("SendMode", "1"); //发货方式
+
+
+            string condition = " and Status>-1";
+            //品牌
+if (!string.IsNullOrEmpty(BrandIdSelect))
+{
+condition += " and BrandId=" + BrandIdSelect;
+}
+//创客真实姓名
+if (!string.IsNullOrEmpty(UserIdRealName))
+{
+condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+}
+//创客创客编号
+if (!string.IsNullOrEmpty(UserIdMakerCode))
+{
+condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+}
+
+
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreMachineApply", 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)
+            {
+                //品牌
+dic["BrandId"] = RelationClass.GetKqProductsInfo(int.Parse(dic["BrandId"].ToString()));
+dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
+//创客
+int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+dic["UserIdRealName"] = userid_Users.RealName;
+dic["UserIdMakerCode"] = userid_Users.MakerCode;
+dic.Remove("UserId");
+
+            }
+            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(StoreMachineApply data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            
+            Fields.Add("BrandId", data.BrandId); //品牌
+Fields.Add("ApplyNo", data.ApplyNo); //申请单号
+Fields.Add("ApplyNum", data.ApplyNum); //申请台数
+Fields.Add("SendNum", data.SendNum); //发货台数
+Fields.Add("UseAmount", data.UseAmount); //使用额度
+Fields.Add("SendMode", data.SendMode); //发货方式
+Fields.Add("ErpCode", data.ErpCode); //快递单号
+Fields.Add("SendSn", data.SendSn); //发货SN数据
+Fields.Add("UserId", data.UserId); //创客
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Add("StoreMachineApply", Fields, 0);
+            AddSysLog(data.Id.ToString(), "StoreMachineApply", "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;
+            
+
+            StoreMachineApply editData = db.StoreMachineApply.FirstOrDefault(m => m.Id == Id) ?? new StoreMachineApply();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 修改分仓机具申请记录
+
+        /// <summary>
+        /// 增加或修改分仓机具申请记录信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edit(StoreMachineApply data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            
+            Fields.Add("BrandId", data.BrandId); //品牌
+Fields.Add("ApplyNo", data.ApplyNo); //申请单号
+Fields.Add("ApplyNum", data.ApplyNum); //申请台数
+Fields.Add("SendNum", data.SendNum); //发货台数
+Fields.Add("UseAmount", data.UseAmount); //使用额度
+Fields.Add("SendMode", data.SendMode); //发货方式
+Fields.Add("ErpCode", data.ErpCode); //快递单号
+Fields.Add("SendSn", data.SendSn); //发货SN数据
+Fields.Add("UserId", data.UserId); //创客
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", Fields, data.Id);
+            AddSysLog(data.Id.ToString(),"StoreMachineApply","update");
+            db.SaveChanges();
+            
+            return "success";
+        }
+
+        #endregion
+
+        #region 删除分仓机具申请记录信息
+
+        /// <summary>
+        /// 删除分仓机具申请记录信息
+        /// </summary>
+        /// <returns></returns>
+        public string Delete(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id,"StoreMachineApply","del");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", 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,"StoreMachineApply","open");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);
+                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", 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,"StoreMachineApply","close");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 0);
+                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 排序
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id"></param>
+        public string Sort(int Id, int Sort)
+        {
+            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Sort("StoreMachineApply", Sort, Id);
+            
+            AddSysLog(Id.ToString(), "StoreMachineApply", "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.StoreMachineApply.Add(new StoreMachineApply()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            AddSysLog("0", "StoreMachineApply", "Import");
+            return "success";
+        }
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(StoreMachineApply data, string BrandIdSelect, string UserIdRealName, string UserIdMakerCode)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("CreateDate", "3"); //时间
+Fields.Add("ApplyNo", "1"); //申请单号
+Fields.Add("SendMode", "1"); //发货方式
+
+
+            string condition = " and Status>-1";
+            //品牌
+if (!string.IsNullOrEmpty(BrandIdSelect))
+{
+condition += " and BrandId=" + BrandIdSelect;
+}
+//创客真实姓名
+if (!string.IsNullOrEmpty(UserIdRealName))
+{
+condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+}
+//创客创客编号
+if (!string.IsNullOrEmpty(UserIdMakerCode))
+{
+condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+}
+
+
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreMachineApply", Fields, "Id desc", "0", 1, 20000, condition, "BrandId,ApplyNo,ApplyNum,SendNum,UseAmount,SendMode,ErpCode,UserId", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //品牌
+dic["BrandId"] = RelationClass.GetKqProductsInfo(int.Parse(dic["BrandId"].ToString()));
+dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
+//创客
+int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+dic["UserIdRealName"] = userid_Users.RealName;
+dic["UserIdMakerCode"] = userid_Users.MakerCode;
+dic.Remove("UserId");
+
+            }
+
+            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("BrandId", "品牌");
+ReturnFields.Add("ApplyNo", "申请单号");
+ReturnFields.Add("ApplyNum", "申请台数");
+ReturnFields.Add("SendNum", "发货台数");
+ReturnFields.Add("UseAmount", "使用额度");
+ReturnFields.Add("SendMode", "发货方式");
+ReturnFields.Add("ErpCode", "快递单号");
+ReturnFields.Add("UserIdRealName", "创客真实姓名");
+ReturnFields.Add("UserIdMakerCode", "创客创客编号");
+
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "StoreMachineApply", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+    }
+}

+ 213 - 0
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Add.cshtml

@@ -0,0 +1,213 @@
+@{
+    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">
+<select id="OperateType" name="OperateType" lay-search="">
+<option value="">请选择</option>
+<option value="1">增加</option>
+<option value="2">减少</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');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 216 - 0
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Edit.cshtml

@@ -0,0 +1,216 @@
+@using MySystem.Models;
+@{StoreHouseAmountRecord editData = ViewBag.data as StoreHouseAmountRecord;}
+@{
+    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">
+<select id="OperateType" name="OperateType" lay-search="">
+<option value="">请选择</option>
+<option value="1">增加</option>
+<option value="2">减少</option>
+</select>
+<script>$("#OperateType").val("@editData.OperateType");</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');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 154 - 0
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Index.cshtml

@@ -0,0 +1,154 @@
+@{
+    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="UserIdRealName" 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="UserIdMakerCode" 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">
+<select id="AmountTypeSelect" name="AmountTypeSelect" lay-search="">
+<option value="">全部...</option>
+<option value="0">固定额度</option>
+<option value="1">临时额度</option>
+</select>
+</div>
+</div>
+<div class="layui-inline">
+<label class="layui-form-label">操作类别</label>
+<div class="layui-input-inline">
+<select id="OperateTypeSelect" name="OperateTypeSelect" lay-search="">
+<option value="">全部...</option>
+<option value="1">增加</option>
+<option value="2">减少</option>
+</select>
+</div>
+</div>
+
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
+                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
+                        </button>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_add,"))
+                    {
+                        <button class="layui-btn" data-type="add"><i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                    <button class="layui-btn" data-type="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/StoreHouseAmountRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        
+    </script>
+</body>
+</html>

+ 274 - 203
Areas/Admin/Views/MainServer/StoreMachineApply/Add.cshtml

@@ -1,203 +1,274 @@
-@{
-    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>
-
-                </div>
-            </div>
-            <div class="layui-form-item layui-hide">
-                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
-            </div>
-          </div>
-        </div>
-    </div>
-
-    <script src="/layuiadmin/layui/layui.js"></script>
-    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
-    <script src="/other/mybjq/kindeditor-min.js"></script>
-    <script src="/other/mybjq/lang/zh_CN.js"></script>
-    <script>
-        
-                    
-        //编辑器
-        KindEditor.ready(function (K) {
-            
-        });
-
-        var ids = "";
-        function getChildren(obj) {
-            $.each(obj, function (index, value) {
-                var id = obj[index].id;
-                ids += id + ",";
-                var children = obj[index].children;
-                if (children) {
-                    getChildren(children);
-                }
-            });
-        }
-
-        function AreasProvinceInit(tagId, areasVal, form) {
-            for (var i = 0; i < provs_data.length; i++) {
-                var sel = "";
-                if (areasVal.indexOf(provs_data[i].text) > -1) {
-                    sel = " selected=selected";
-                }
-                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
-            }
-            form.render();
-        }
-
-        function AreasProvinceSelected(tagId, areasVal, form, value) {
-            $("#" + tagId + "City").html('<option value="">市</option>');
-            var list = citys_data[value];
-            for (var i = 0; i < list.length; i++) {
-                var sel = "";
-                if (areasVal.indexOf(list[i].text) > -1) {
-                    sel = " selected=selected";
-                }
-                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
-            }
-            $("#" + tagId + "Area").html('<option value="">县/区</option>');
-            form.render();
-            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
-        }
-
-        function AreasCitySelected(tagId, areasVal, form, value) {
-            $("#" + tagId + "Area").html('<option value="">县/区</option>');
-            var list = dists_data[value];
-            for (var i = 0; i < list.length; i++) {
-                var sel = "";
-                if (areasVal.indexOf(list[i].text) > -1) {
-                    sel = " selected=selected";
-                }
-                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
-            }
-            form.render();
-            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
-        }
-
-        function AreasAreaSelected(tagId, form) {
-            form.render();
-            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
-        }
-        function movePrev(obj, tagId) {
-            $(obj).parent().prev().insertAfter($(obj).parent());
-            checkPics(tagId);
-        }
-        function moveNext(obj, tagId) {
-            $(obj).parent().next().insertBefore($(obj).parent());
-            checkPics(tagId);
-        }
-        function deletePic(obj, tagId) {
-            $(obj).parent().remove();
-            checkPics(tagId);
-        }
-        function checkPics(tagId) {
-            var pics = "";
-            var texts = "";
-            $("#" + tagId + "Image div img").each(function (i) {
-                pics += $(this).attr("src").replace(osshost, '') + "|";
-            });
-            $("#" + tagId + "Image div input").each(function (i) {
-                texts += $(this).val() + "|";
-            });
-            if (pics == "") {
-                $("#" + tagId).val("");
-            } else {
-                pics = pics.substring(0, pics.length - 1);
-                texts = texts.substring(0, pics.length - 1);
-                $("#" + tagId).val(pics + "#cut#" + texts);
-            }
-        }
-        function checkBox(tagId) {
-            var text = "";
-            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
-                text += $(this).val() + ",";
-            });
-            $("#" + tagId).val(text);
-        }
-        function showBigPic(picpath) {
-            parent.layer.open({
-                type: 1,
-                title: false,
-                closeBtn: 0,
-                shadeClose: true,
-                area: ['auto', 'auto'],
-                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
-            });
-        }
-
-        
-        var tree;
-        var element;
-        var upload;
-        layui.config({
-            base: '/layuiadmin/' //静态资源所在路径
-        }).extend({
-            index: 'lib/index' //主入口模块
-        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
-            var $ = layui.$
-                , form = layui.form
-                , layer = layui.layer
-                , layedit = layui.layedit
-                , laydate = layui.laydate
-                , croppers = layui.croppers
-                , transfer = layui.transfer
-                , util = layui.util;
-            tree = layui.tree;
-            element = layui.element;
-            upload = layui.upload;
-        
-            //Hash地址的定位
-            var layid = location.hash.replace(/^#test=/, '');
-            element.tabChange('test', layid);
-            element.on('tab(test)', function (elem) {
-                location.hash = 'test=' + $(this).attr('lay-id');
-            });
-    
-            //日期
-            
-
-            //上传文件
-            
-
-            //穿梭框
-            
-
-            //TreeView,比如权限管理
-            
-
-            //省市区
-            
-        })
-
-    </script>
-</body>
-</html>
+@{
+    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><li lay-id="8">发货SN</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+@{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>
+<div class="layui-form-item">
+<label class="layui-form-label">申请单号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="ApplyNo" name="ApplyNo" maxlength="50" 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="ApplyNum" name="ApplyNum" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入申请台数">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">发货台数</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="SendNum" name="SendNum" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入发货台数">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">使用额度</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="UseAmount" name="UseAmount" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入使用额度">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">发货方式</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="SendMode" name="SendMode" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入发货方式">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">快递单号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="ErpCode" name="ErpCode" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入快递单号">
+</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="UserId" name="UserId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in UsersDic.Keys)
+{
+<option value="@key">@UsersDic[key]</option>
+}
+</select>
+</div>
+</div>
+
+</div>
+<div class="layui-tab-item">
+<div class="layui-form-item layui-form-text">
+<label class="layui-form-label">发货SN数据</label>
+<div class="layui-input-block">
+<textarea class="layui-textarea" id="SendSn" name="SendSn" maxlength="" lay-verify="" placeholder="请输入发货SN数据"></textarea>
+</div>
+</div>
+
+</div>
+
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        
+                    
+        //编辑器
+        KindEditor.ready(function (K) {
+            
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+        
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 0 - 207
Areas/Admin/Views/MainServer/StoreMachineApply/AuditSend copy.cshtml

@@ -1,207 +0,0 @@
-@using MySystem.Models;
-@{
-    StoreMachineApply editData = ViewBag.data as StoreMachineApply;
-}
-@{
-    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" />
-        <input type="hidden" name="ExcelData" value="ExcelData" />
-
-        <div class="layui-card">
-            <div class="layui-card-body">
-                <div class="layui-tab" lay-filter="mytabbar">
-                    <div class="layui-tab-content mt20">
-                        <div class="layui-tab-item layui-show">
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">创客编号</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" readonly id="MakerCode" name="MakerCode"
-                                        value="@ViewBag.MakerCode" lay-verify="">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">创客名称</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" readonly id="RealName" name="RealName"
-                                        value="@ViewBag.RealName" lay-verify="">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">申请箱数</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" readonly id="ApplyNum" name="ApplyNum"
-                                        value="@editData.ApplyNum" 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">
-                                    <input class="layui-input" type="text" id="SendNum" name="SendNum"
-                                        value="@editData.SendNum" maxlength="32" lay-verify="required|"
-                                        autocomplete="off" placeholder="请输入发货箱数">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">*审核结果</label>
-                                <div class="layui-input-inline">
-                                    <select id="Status" name="Status" lay-verify="required|" lay-search="">
-                                        <option value="">请选择</option>
-                                        <option value="0">待审核</option>
-                                        <option value="1">审核通过</option>
-                                        <option value="2">审核不通过</option>
-                                    </select>
-                                    <script>
-                                        $("#Status").val("@editData.Status");
-                                    </script>
-                                </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="SeoDescription" name="SeoDescription"
-                                        maxlength="128" lay-verify=""
-                                        placeholder="请输入申请描述">@editData.SeoDescription</textarea>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="layui-form-item"">
-                            <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">
-                                    <a href="/users/批量添加机具SN模版.xlsx">点击下载批量添加机具SN模版</a>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="layui-form-item"">
-                        <label class=" layui-form-label">导入机具SN</label>
-                        <div class=" layui-input-block">
-                            <div class="layui-upload">
-                                <input type="file" id="ExcelFile" name="ExcelFile" value="">
-                                @* <button class="layui-btn" type="button" id="ExcelPathBtn">选择</button> *@
-                                <div class="layui-inline layui-word-aux"></div>
-                            </div>
-                            <div class="mt10" id="ExcelPathFile">
-                            </div>
-                        </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);
-                }
-            });
-        }
-
-        var tree;
-        var element;
-        var upload;
-        var excel;
-        var ExcelData;
-        layui.config({
-            base: '/layuiadmin/' //静态资源所在路径
-        }).extend({
-            index: 'lib/index' //主入口模块
-        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'excel', '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');
-            });
-
-            //excel导入
-            excel = layui.excel;
-            $('#ExcelFile').change(function (e) {
-                var files = e.target.files;
-                excel.importExcel(files, {}, function (data) {
-                    ExcelData = data[0].sheet1;
-                });
-            });
-
-
-            //日期
-
-
-            //上传文件
-            WebUploadJs('ExcelPathBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload', { width: 0, height: 0, quality: 0 }, { max_file_size: 1048576 }, function (filename) {
-                $('#ExcelPathFile').html(filename);
-                $('#ExcelPath').val(filename);
-            });
-
-
-            //穿梭框
-
-
-            //TreeView,比如权限管理
-
-
-            //省市区
-
-        })
-
-    </script>
-</body>
-
-</html>

+ 0 - 207
Areas/Admin/Views/MainServer/StoreMachineApply/AuditSend.cshtml

@@ -1,207 +0,0 @@
-@using MySystem.Models;
-@{
-    StoreMachineApply editData = ViewBag.data as StoreMachineApply;
-}
-@{
-    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" />
-        <input type="hidden" name="ExcelData" value="ExcelData" />
-
-        <div class="layui-card">
-            <div class="layui-card-body">
-                <div class="layui-tab" lay-filter="mytabbar">
-                    <div class="layui-tab-content mt20">
-                        <div class="layui-tab-item layui-show">
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">创客编号</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" readonly id="MakerCode" name="MakerCode"
-                                        value="@ViewBag.MakerCode" lay-verify="">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">创客名称</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" readonly id="RealName" name="RealName"
-                                        value="@ViewBag.RealName" lay-verify="">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">申请箱数</label>
-                                <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" readonly id="ApplyNum" name="ApplyNum"
-                                        value="@editData.ApplyNum" 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">
-                                    <input class="layui-input" type="text" id="SendNum" name="SendNum"
-                                        value="@editData.SendNum" maxlength="32" lay-verify="required|"
-                                        autocomplete="off" placeholder="请输入发货箱数">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">*审核结果</label>
-                                <div class="layui-input-inline">
-                                    <select id="Status" name="Status" lay-verify="required|" lay-search="">
-                                        <option value="">请选择</option>
-                                        <option value="0">待审核</option>
-                                        <option value="1">审核通过</option>
-                                        <option value="2">审核不通过</option>
-                                    </select>
-                                    <script>
-                                        $("#Status").val("@editData.Status");
-                                    </script>
-                                </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="SeoDescription" name="SeoDescription"
-                                        maxlength="128" lay-verify=""
-                                        placeholder="请输入申请描述">@editData.SeoDescription</textarea>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="layui-form-item"">
-                            <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">
-                                    <a href="/users/批量添加机具SN模版.xlsx">点击下载批量添加机具SN模版</a>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="layui-form-item"">
-                        <label class=" layui-form-label">导入机具SN</label>
-                        <div class=" layui-input-block">
-                            <div class="layui-upload">
-                                <input type="file" id="ExcelFile" name="ExcelFile" value="">
-                                @* <button class="layui-btn" type="button" id="ExcelPathBtn">选择</button> *@
-                                <div class="layui-inline layui-word-aux"></div>
-                            </div>
-                            <div class="mt10" id="ExcelPathFile">
-                            </div>
-                        </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);
-                }
-            });
-        }
-
-        var tree;
-        var element;
-        var upload;
-        var excel;
-        var ExcelData;
-        layui.config({
-            base: '/layuiadmin/' //静态资源所在路径
-        }).extend({
-            index: 'lib/index' //主入口模块
-        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'excel', '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');
-            });
-
-            //excel导入
-            excel = layui.excel;
-            $('#ExcelFile').change(function (e) {
-                var files = e.target.files;
-                excel.importExcel(files, {}, function (data) {
-                    ExcelData = data[0].sheet1;
-                });
-            });
-
-
-            //日期
-
-
-            //上传文件
-            WebUploadJs('ExcelPathBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload', { width: 0, height: 0, quality: 0 }, { max_file_size: 1048576 }, function (filename) {
-                $('#ExcelPathFile').html(filename);
-                $('#ExcelPath').val(filename);
-            });
-
-
-            //穿梭框
-
-
-            //TreeView,比如权限管理
-
-
-            //省市区
-
-        })
-
-    </script>
-</body>
-
-</html>

+ 277 - 274
Areas/Admin/Views/MainServer/StoreMachineApply/Edit.cshtml

@@ -1,275 +1,278 @@
-@using MySystem.Models;
-@{
-    StoreMachineApply editData = ViewBag.data as StoreMachineApply;
-}
-@{
-    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">
-                    <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" style="width: 250px;">
-                                    <input class="layui-input" type="text" readonly id="ApplyNo" name="ApplyNo"
-                                        value="@editData.ApplyNo" maxlength="32" lay-verify="required|"
-                                        autocomplete="off" placeholder="请输入申请单号">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">产品名称</label>
-                                <div class="layui-input-inline" style="width: 250px;">
-                                    <input class="layui-input" type="text" readonly id="BrandName" name="BrandName"
-                                        value="@ViewBag.BrandName" maxlength="30" lay-verify="required|"
-                                        autocomplete="off" placeholder="请输入产品名称">
-                                </div>
-                            </div>
-                             <div class="layui-form-item">
-                                <label class="layui-form-label">申请箱数</label>
-                                <div class="layui-input-inline" style="width: 250px;">
-                                    <input class="layui-input" type="text" readonly id="ApplyNum" name="ApplyNum"
-                                        value="@editData.ApplyNum" maxlength="32" lay-verify="required|"
-                                        autocomplete="off" placeholder="请输入申请箱数">
-                                </div>
-                            </div>
-                             <div class="layui-form-item">
-                                <label class="layui-form-label">*发货箱数</label>
-                                <div class="layui-input-inline" style="width: 250px;">
-                                    <input class="layui-input" type="text" id="SendNum" name="SendNum"
-                                        value="@editData.SendNum" maxlength="32" lay-verify="required|"
-                                        autocomplete="off" placeholder="请输入发货箱数">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">创客名称</label>
-                                <div class="layui-input-inline" style="width: 250px;">
-                                    <input class="layui-input" type="text" readonly id="RealName"
-                                        name="RealName" value="@ViewBag.RealName" maxlength="20"
-                                        lay-verify="" autocomplete="off" placeholder="请输入创客名称">
-                                </div>
-                            </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">申请状态</label>
-                                <div class="layui-input-inline" style="width: 250px;">
-                                    <select id="Status" name="Status" lay-search="" lay-verify="required|">
-                                        <option value="">请选择</option>
-                                        <option value="0">待审核</option>
-                                        <option value="1">审核成功</option>
-                                        <option value="2">审核失败</option>
-                                    </select>
-                                    <script>
-                                        $("#Status").val("@editData.Status");
-                                    </script>
-                                </div>
-                            </div>
-                            @* <div class="layui-form-item layui-form-text">
-                                <label class="layui-form-label">已发货机具SN</label>
-                                <div class="layui-input-block">
-                                    <textarea class="layui-textarea" id="SwapSnExpand" name="SwapSnExpand"
-                                        lay-verify="" placeholder="请输入已发货机具SN">@editData.SwapSnExpand</textarea>
-                                </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="SeoDescription" name="SeoDescription" maxlength="128"
-                                        lay-verify="" placeholder="请输入申请描述">@editData.SeoDescription</textarea>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="layui-form-item layui-hide">
-                    <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit"
-                        value="确认">
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <script src="/layuiadmin/layui/layui.js"></script>
-    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
-    <script src="/other/mybjq/kindeditor-min.js"></script>
-    <script src="/other/mybjq/lang/zh_CN.js"></script>
-    <script>
-
-
-        //编辑器
-        KindEditor.ready(function (K) {
-
-        });
-
-        var ids = "";
-        function getChildren(obj) {
-            $.each(obj, function (index, value) {
-                var id = obj[index].id;
-                ids += id + ",";
-                var children = obj[index].children;
-                if (children) {
-                    getChildren(children);
-                }
-            });
-        }
-
-        function AreasProvinceInit(tagId, areasVal, form) {
-            for (var i = 0; i < provs_data.length; i++) {
-                var sel = "";
-                if (areasVal.indexOf(provs_data[i].text) > -1) {
-                    sel = " selected=selected";
-                }
-                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
-            }
-            form.render();
-        }
-
-        function AreasProvinceSelected(tagId, areasVal, form, value) {
-            $("#" + tagId + "City").html('<option value="">市</option>');
-            var list = citys_data[value];
-            for (var i = 0; i < list.length; i++) {
-                var sel = "";
-                if (areasVal.indexOf(list[i].text) > -1) {
-                    sel = " selected=selected";
-                }
-                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
-            }
-            $("#" + tagId + "Area").html('<option value="">县/区</option>');
-            form.render();
-            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
-        }
-
-        function AreasCitySelected(tagId, areasVal, form, value) {
-            $("#" + tagId + "Area").html('<option value="">县/区</option>');
-            var list = dists_data[value];
-            for (var i = 0; i < list.length; i++) {
-                var sel = "";
-                if (areasVal.indexOf(list[i].text) > -1) {
-                    sel = " selected=selected";
-                }
-                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
-            }
-            form.render();
-            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
-        }
-
-        function AreasAreaSelected(tagId, form) {
-            form.render();
-            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
-        }
-        function movePrev(obj, tagId) {
-            $(obj).parent().prev().insertAfter($(obj).parent());
-            checkPics(tagId);
-        }
-        function moveNext(obj, tagId) {
-            $(obj).parent().next().insertBefore($(obj).parent());
-            checkPics(tagId);
-        }
-        function deletePic(obj, tagId) {
-            $(obj).parent().remove();
-            checkPics(tagId);
-        }
-        function checkPics(tagId) {
-            var pics = "";
-            var texts = "";
-            $("#" + tagId + "Image div img").each(function (i) {
-                pics += $(this).attr("src").replace(osshost, '') + "|";
-            });
-            $("#" + tagId + "Image div input").each(function (i) {
-                texts += $(this).val() + "|";
-            });
-            if (pics == "") {
-                $("#" + tagId).val("");
-            } else {
-                pics = pics.substring(0, pics.length - 1);
-                texts = texts.substring(0, pics.length - 1);
-                $("#" + tagId).val(pics + "#cut#" + texts);
-            }
-        }
-        function checkBox(tagId) {
-            var text = "";
-            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
-                text += $(this).val() + ",";
-            });
-            $("#" + tagId).val(text);
-        }
-        function showBigPic(picpath) {
-            parent.layer.open({
-                type: 1,
-                title: false,
-                closeBtn: 0,
-                shadeClose: true,
-                area: ['auto', 'auto'],
-                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
-            });
-        }
-
-        var tree;
-        var element;
-        var upload;
-        layui.config({
-            base: '/layuiadmin/' //静态资源所在路径
-        }).extend({
-            index: 'lib/index' //主入口模块
-        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
-            var $ = layui.$
-                , form = layui.form
-                , layer = layui.layer
-                , layedit = layui.layedit
-                , laydate = layui.laydate
-                , croppers = layui.croppers
-                , transfer = layui.transfer
-                , util = layui.util;
-            tree = layui.tree;
-            element = layui.element;
-            upload = layui.upload;
-
-            //Hash地址的定位
-            var layid = location.hash.replace(/^#test=/, '');
-            element.tabChange('test', layid);
-            element.on('tab(test)', function (elem) {
-                location.hash = 'test=' + $(this).attr('lay-id');
-            });
-
-            //日期
-
-
-            //上传文件
-
-
-            //穿梭框
-
-
-            //TreeView,比如权限管理
-
-
-            //省市区
-
-        })
-
-    </script>
-</body>
-
+@using MySystem.Models;
+@{StoreMachineApply editData = ViewBag.data as StoreMachineApply;}
+@{
+    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><li lay-id="8">发货SN</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+@{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>
+<div class="layui-form-item">
+<label class="layui-form-label">申请单号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="ApplyNo" name="ApplyNo" value="@editData.ApplyNo" maxlength="50" 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="ApplyNum" name="ApplyNum" value="@editData.ApplyNum" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入申请台数">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">发货台数</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="SendNum" name="SendNum" value="@editData.SendNum" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入发货台数">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">使用额度</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="UseAmount" name="UseAmount" value="@editData.UseAmount" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入使用额度">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">发货方式</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="SendMode" name="SendMode" value="@editData.SendMode" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入发货方式">
+</div>
+</div>
+<div class="layui-form-item">
+<label class="layui-form-label">快递单号</label>
+<div class="layui-input-inline">
+<input class="layui-input" type="text" id="ErpCode" name="ErpCode" value="@editData.ErpCode" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入快递单号">
+</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="UserId" name="UserId" lay-search="">
+<option value="">请选择</option>
+@foreach (string key in UsersDic.Keys)
+{
+<option value="@key">@UsersDic[key]</option>
+}
+</select>
+<script>$("#UserId").val("@editData.UserId");</script>
+</div>
+</div>
+
+</div>
+<div class="layui-tab-item">
+<div class="layui-form-item layui-form-text">
+<label class="layui-form-label">发货SN数据</label>
+<div class="layui-input-block">
+<textarea class="layui-textarea" id="SendSn" name="SendSn" maxlength="" lay-verify="" placeholder="请输入发货SN数据">@editData.SendSn</textarea>
+</div>
+</div>
+
+</div>
+
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        
+        
+        //编辑器
+        KindEditor.ready(function (K) {
+            
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
 </html>

+ 0 - 141
Areas/Admin/Views/MainServer/StoreMachineApply/Import.cshtml

@@ -1,141 +0,0 @@
-@{
-    string RightInfo = ViewBag.RightInfo as string;
-    string right = ViewBag.right as string;
-    string ExcelKind = ViewBag.ExcelKind as string;
-    
-}
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>导入数据</title>
-    <meta name="renderer" content="webkit">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
-    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
-    <script src="/admin/js/jquery-1.10.1.min.js"></script>
-    <script src="/admin/js/LAreaData2.js"></script>
-    <style>
-        .layui-form-label{
-            width: 135px !important;
-        }
-        .layui-form-item .layui-input-block{
-            margin-left: 165px !important;
-        }
-    </style>
-</head>
-<body>
-
-    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
-        <input type="hidden" name="Kind" value="@ExcelKind" />
-        
-        <div class="layui-card">
-          <div class="layui-card-body">
-            <div class="layui-tab" lay-filter="mytabbar">
-                <div class="layui-tab-content mt20">
-                    <div class="layui-tab-item layui-show">
-                        <div class="layui-form-item">
-                            <label class="layui-form-label">模板下载</label>
-                            <div class="layui-form-mid layui-word-aux" id="excelTemp">
-                                @if(ExcelKind == "1")
-                                {
-                                <a href="/users/客小爽入库模版.xlsx">点击下载入库模版</a>
-                                }
-                                @if(ExcelKind == "2")
-                                {
-                                <a href="/users/客小爽仓库调拨模版.xlsx">点击下载仓库调拨模版</a>
-                                }
-                                @if(ExcelKind == "3")
-                                {
-                                <a href="/users/客小爽仓库发货至创客模版.xlsx">点击下载仓库发货至创客模版</a>
-                                }
-                            </div>
-                        </div>
-                        <div class="layui-form-item">
-                            <label class="layui-form-label">excel文件</label>
-                            <div class="layui-input-block">
-                                <div class="layui-upload">
-                                    <input type="hidden" id="ExcelPath" name="ExcelPath" value="">
-                                    <button class="layui-btn" type="button" id="ExcelPathBtn">选择</button>
-                                    <div class="layui-inline layui-word-aux"></div>
-                                </div>
-                                <div class="mt10" id="ExcelPathFile">
-                                </div>
-                            </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 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');
-            });
-    
-            //日期
-            
-
-            //上传文件
-            WebUploadJs('ExcelPathBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload', {width:0,height:0,quality:0},{max_file_size:1048576},  function (filename) {
-                $('#ExcelPathFile').html(filename);
-                $('#ExcelPath').val(filename);
-            });
-
-            //穿梭框
-            
-            
-
-            //TreeView,比如权限管理
-            
-
-            //省市区
-
-        });
-
-    </script>
-</body>
-</html>

+ 160 - 146
Areas/Admin/Views/MainServer/StoreMachineApply/Index.cshtml

@@ -1,147 +1,161 @@
-@{
-    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: 115px !important;
-        }
-        .layui-inline{
-            margin-right: 0px !important;
-        }        
-        .w100{
-            width: 100px !important;
-        }
-        .ml50{
-            margin-left: 50px !important;
-        }
-        tbody .layui-table-cell{
-            height: 60px !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="ApplyNo" autocomplete="off">
-                        </div>
-                    </div>
-                    @{Dictionary<string, string> KqProductBrandDic = new MySystem.DictionaryClass().getKqProductBrandDic();}
-                    <div class="layui-inline">
-                        <label class="layui-form-label">产品类型</label>
-                        <div class="layui-input-inline">
-                            <select id="BrandId" name="BrandId" lay-search="">
-                                <option value="">全部...</option>
-                                @foreach (string key in KqProductBrandDic.Keys)
-                                {
-                                <option value="@key">@KqProductBrandDic[key]</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="MakerCode" autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">创客姓名</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="RealName" autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">仓库编号</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="StoreNo" 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" 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="ApplyTimeData" id="ApplyTime"
-                            placeholder="申请时间" autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">申请状态</label>
-                        <div class="layui-input-inline">
-                            <select id="StatusSelect" name="StatusSelect" lay-search="">
-                                <option value="">全部...</option>
-                                <option value="0">待审核</option>
-                                <option value="1">申请成功</option>
-                                <option value="2">申请失败</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="layui-inline ml50">
-                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
-                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
-                        </button>
-                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
-                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
-                        </button>
-                        @if (RightInfo.Contains("," + right + "_export,"))
-                        {
-                            <button class="layui-btn" data-type="ExportExcel">
-                                <i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出
-                            </button>
-                        }
-                    </div>
-                </div>
-            </div>
-
-            <div class="layui-card-body">     
-                <blockquote class="layui-elem-quote layui-text">
-                    申请机具数:<span style="color: #f00;" id="ApplyCount">0</span> | 发货机具数:<span style="color: #f00;" id="SendCount">0</span>
-                </blockquote>
-                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
-                <script type="text/html" id="table-list-tools">
-                    <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-form"></i>编辑</a>
-                    @if (RightInfo.Contains("," + right + "_audit,"))
-                    {
-                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="send"><i class="layui-icon layui-icon-edit"></i>审核发货</a>
-                    }
-                    @if (RightInfo.Contains("," + right + "_cancel,"))
-                    {
-                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancel"><i class="layui-icon layui-icon-edit"></i>取消订单</a>
-                    }
-                </script>
-            </div>
-        </div>
-    </div>
-
-    <script src="/layuiadmin/layui/layui.js"></script>
-    <script src="/layuiadmin/modules_main/StoreMachineApply_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
-    <script>
-        
-    </script>
-</body>
+@{
+    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">
+                    @{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">创建时间</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="ApplyNo" 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="SendMode" 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="UserIdRealName" 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="UserIdMakerCode" 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="Open">开启</button>
+<button class="layui-btn" data-type="Close">关闭</button>
+<button class="layui-btn" data-type="ExportExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+
+                    }
+                </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/StoreMachineApply_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        
+    </script>
+</body>
 </html>

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

@@ -0,0 +1,413 @@
+var ExcelData,ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/StoreHouseAmountRecord/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/StoreHouseAmountRecord/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+    
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/StoreHouseAmountRecord/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+    		, {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
+            ,{field:'UserIdRealName', width: 200, title:'创客真实姓名', sort: true}
+,{field:'UserIdMakerCode', width: 200, title:'创客创客编号', sort: true}
+,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
+,{field:'ApplyId', width: 200, title:'申请单', sort: true}
+,{field:'UseAmount', width: 200, title:'使用额度', sort: true}
+,{field:'BeforeAmount', width: 200, title:'使用前剩余额度', sort: true}
+,{field:'AfterAmount', width: 200, title:'使用后剩余额度', sort: true}
+,{field:'AmountType', width: 200, title:'额度类别', sort: true}
+,{field:'OperateType', 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/StoreHouseAmountRecord/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/StoreHouseAmountRecord/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/StoreHouseAmountRecord/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/StoreHouseAmountRecord/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/StoreHouseAmountRecord/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/StoreHouseAmountRecord/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/StoreHouseAmountRecord/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) : '';
+    });
+});

+ 414 - 606
wwwroot/layuiadmin/modules_main/StoreMachineApply_Admin.js

@@ -1,607 +1,415 @@
-var ExcelData;
-
-function ConfirmImport() {
-    $.ajax({
-        type: "POST",
-        url: "/Admin/StoreMachineApply/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);
-            }
-        }
-    });
-}
-
-$("#excelTemp").html('<a href="/users/批量添加机具SN模版.xlsx">点击下载批量添加机具SN模版</a>');
-
-var excel;
-layui.config({
-    base: '/layuiadmin/' //静态资源所在路径
-}).extend({
-    myexcel: 'layui/lay/modules/excel',
-    index: 'lib/index' //主入口模块
-}).use(['index', 'table', 'excel', 'laydate'], function () {
-    var $ = layui.$,
-        form = layui.form,
-        table = layui.table;
-
-    //- 筛选条件-日期
-    var laydate = layui.laydate;
-    var layCreateDate = laydate.render({
-        elem: '#CreateDate',
-        type: 'date',
-        range: true,
-        trigger: 'click',
-        change: function (value, date, endDate) {
-            var op = true;
-            if (date.year == endDate.year && endDate.month - date.month <= 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 layApplyTime = laydate.render({
-        elem: '#ApplyTime',
-        trigger: 'click',
-        type: 'date',
-        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;
-                    layApplyTime.hint('日期范围请不要超过1个月');
-                    setTimeout(function () {
-                        $(".laydate-btns-confirm").addClass("laydate-disabled");
-                    }, 1);
-                }
-            } else {
-                op = false;
-                layApplyTime.hint('日期范围请不要超过1个月');
-                setTimeout(function () {
-                    $(".laydate-btns-confirm").addClass("laydate-disabled");
-                }, 1);
-            }
-            if (op) {
-                $('#ApplyTime').val(value);
-            }
-        }
-    });
-    var laySendDate = laydate.render({
-        elem: '#SendDate',
-        trigger: 'click',
-        type: 'date',
-        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;
-                    laySendDate.hint('日期范围请不要超过1个月');
-                    setTimeout(function () {
-                        $(".laydate-btns-confirm").addClass("laydate-disabled");
-                    }, 1);
-                }
-            } else {
-                op = false;
-                laySendDate.hint('日期范围请不要超过1个月');
-                setTimeout(function () {
-                    $(".laydate-btns-confirm").addClass("laydate-disabled");
-                }, 1);
-            }
-            if (op) {
-                $('#SendDate').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/StoreMachineApply/Sort?r=" + Math.random(1),
-                data: "Id=" + data.Id + "&Sort=" + value,
-                dataType: "text",
-                success: function (data) {}
-            });
-        }
-    });
-
-    //列表数据
-    table.render({
-        elem: '#LAY-list-manage',
-        url: '/Admin/StoreMachineApply/IndexData' //模拟接口
-            ,
-        cols: [[
-            {type: 'checkbox',fixed: 'left'}, 
-            {field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true },
-            {field: 'ApplyNo',width: 200,title: '申请单号',sort: true}, 
-            {field: 'BrandId', width: 200,title: '产品名称',sort: true}, 
-            {field: 'UserInfo',width: 200,title: '创客信息',sort: true},
-            {field: 'StoreInfo',width: 200,title: '申请仓库信息',sort: true},
-            {field: 'StoreAddressInfo',width: 300,title: '仓库收货地址',sort: true}, 
-            // {field: 'StoreContact',width: 200,title: '仓库联系人信息',sort: true}, 
-            // {field: 'StoreUser',width: 200,title: '仓库归属信息',sort: true}, 
-            {field: 'Status',width: 200,title: '申请状态',sort: true}, 
-            {field: 'ApplyTime',width: 200,title: '申请时间',sort: true}, 
-            {title: '操作', width: 260,align: 'center',fixed: 'right',toolbar: '#table-list-tools'}
-        ]],
-        where: {
-
-        },
-        page: true,
-        limit: 30,
-        height: 'full-' + String($('.layui-card-header').height() + 130),
-        text: '对不起,加载出现异常!',
-        done: function (res, curr, count) {
-            $("#ApplyCount").text(res.other.ApplyCount);
-            $("#SendCount").text(res.other.SendCount);
-            $(".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/StoreMachineApply/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 === 'cancel') {
-            var index = layer.confirm('确定要取消订单吗?取消后不能恢复!', function (index) {
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/StoreMachineApply/Cancel?r=" + Math.random(1),
-                    data: "Id=" + data.Id,
-                    dataType: "text",
-                    success: function (data) {
-                        if (data == "success") {
-                            obj.del();
-                            layer.close(index);
-                            parent.layer.msg('已取消');
-                        } else {
-                            parent.layer.msg(data);
-                        }
-                    }
-                });
-            });
-        } else if (obj.event === 'detail') {
-            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) {
-                    layer.close(perContent);
-                },
-                success: function (layero, index) {
-
-                }
-            });
-            layer.full(perContent);
-        } else if (obj.event === 'send') {
-            var tr = $(obj.tr);
-            var perContent = layer.open({
-                type: 2,
-                title: '审核发货',
-                content: 'AuditSend?Id=' + data.Id + '',
-                maxmin: true,
-                area: ['450px', '680px'],
-                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/StoreMachineApply/AuditSend?r=" + Math.random(1),
-                            data: userdata,
-                            dataType: "text",
-                            success: function (data) {
-                                if (data == "success") {
-                                    layer.close(index); //关闭弹层
-                                    layer.msg('发货成功', {
-                                        time: 1500
-                                    }, function () {
-                                        table.reload('LAY-list-manage'); //数据刷新
-                                    });
-                                } else {
-                                    layer.close(index); //关闭弹层
-                                    layer.msg('审核完成', {
-                                        time: 1500
-                                    }, function () {
-                                        table.reload('LAY-list-manage'); //数据刷新
-                                    });
-                                }
-                            }
-                        });
-                    });
-
-                    submit.trigger('click');
-                },
-                success: function (layero, index) {
-
-                }
-            });
-        }else if (obj.event === 'edit') {
-            var tr = $(obj.tr);
-            var perContent = layer.open({
-                type: 2,
-                title: '机具申请记录-编辑',
-                content: 'Edit?Id=' + data.Id + '',
-                maxmin: true,
-                area: ['800px', '650px'],
-                btn: ['确定', '取消'],
-                yes: function (index, layero) {
-                    var iframeWindow = window['layui-layer-iframe' + index],
-                        submitID = 'LAY-list-front-submit',
-                        submit = layero.find('iframe').contents().find('#' + submitID);
-
-                    setTimeout(function () {
-                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
-                            var errObj = $(this).find('.layui-form-danger');
-                            if (errObj.length > 0) {
-                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
-                                submit.click();
-                            }
-                        });
-                    }, 300);
-
-                    //监听提交
-                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
-                        var field = data.field; //获取提交的字段
-                        var userdata = "";
-                        for (var prop in field) {
-                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
-                        }
-                        //提交 Ajax 成功后,静态更新表格中的数据
-                        //$.ajax({});
-
-                        $.ajax({
-                            type: "POST",
-                            url: "/Admin/StoreMachineApply/Edit?r=" + Math.random(1),
-                            data: userdata,
-                            dataType: "text",
-                            success: function (data) {
-                                if (data == "success") {
-                                    layer.close(index); //关闭弹层
-                                    table.reload('LAY-list-manage'); //数据刷新
-                                } else {
-                                    layer.msg(data);
-                                }
-                            }
-                        });
-                    });
-
-                    submit.trigger('click');
-                },
-                success: function (layero, index) {
-
-                }
-            });
-        }
-    });
-
-
-    //监听搜索
-    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/StoreMachineApply/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/StoreMachineApply/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);
-        },
-        ImportChange: function () {
-            var perContent = layer.open({
-                type: 2,
-                title: '添加机具SN',
-                content: 'Import?ExcelKind=2',
-                maxmin: true,
-                area: ['650px', '350px'],
-                btn: ['确定', '取消'],
-                yes: function (index, layero) {
-                    var iframeWindow = window['layui-layer-iframe' + index],
-                        submitID = 'LAY-list-front-submit',
-                        submit = layero.find('iframe').contents().find('#' + submitID);
-
-
-                    //监听提交
-                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
-                        var field = data.SwapSnExpand; //获取提交的字段
-                        var userdata = "";
-                        for (var prop in field) {
-                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
-                        }
-                        //提交 Ajax 成功后,静态更新表格中的数据
-                        //$.ajax({});
-                        var loadindex = layer.load(1, {
-                            shade: [0.5, '#000']
-                        });
-                        $.ajax({
-                            type: "POST",
-                            url: "/Admin/StoreMachineApply/ImportPost?r=" + Math.random(1),
-                            data: userdata,
-                            dataType: "text",
-                            success: function (data) {
-                                if (data.indexOf("success") == 0) {
-                                    var datalist = data.split('|');
-                                    var key = datalist[1];
-                                    CheckImport(table, key, loadindex, index);
-                                } else {
-                                    layer.msg(data);
-                                }
-                            }
-                        });
-                    });
-
-                    submit.trigger('click');
-                }
-            });
-        },
-        ImportData: function () {
-            layer.open({
-                type: 1,
-                title: '导入',
-                maxmin: false,
-                area: ['460px', '180px'],
-                content: $('#excelForm'),
-                cancel: function () {}
-            });
-        },
-        ExportExcel: function () {
-            var userdata = '';
-            $(".layuiadmin-card-header-auto input").each(function (i) {
-                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
-            });
-            $(".layuiadmin-card-header-auto select").each(function (i) {
-                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
-            });
-            $.ajax({
-                type: "GET",
-                url: "/Admin/StoreMachineApply/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/StoreMachineApply/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/StoreMachineApply/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) : '';
-    });
+var ExcelData,ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/StoreMachineApply/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/StoreMachineApply/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+    
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/StoreMachineApply/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+    		, {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
+            ,{field:'BrandId', width: 200, title:'品牌', sort: true}
+,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
+,{field:'StatusName', width: 200, title:'状态', sort: true}
+,{field:'ApplyNo', width: 200, title:'申请单号', sort: true}
+,{field:'ApplyNum', width: 200, title:'申请台数', sort: true}
+,{field:'SendNum', width: 200, title:'发货台数', sort: true}
+,{field:'UseAmount', width: 200, title:'使用额度', sort: true}
+,{field:'SendMode', width: 200, title:'发货方式', sort: true}
+,{field:'ErpCode', width: 200, title:'快递单号', sort: true}
+,{field:'UserIdRealName', width: 200, title:'创客真实姓名', sort: true}
+,{field:'UserIdMakerCode', 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/StoreMachineApply/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/StoreMachineApply/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/StoreMachineApply/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/StoreMachineApply/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/StoreMachineApply/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/StoreMachineApply/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/StoreMachineApply/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) : '';
+    });
 });