Răsfoiți Sursa

wifi押金列表

lcl 1 an în urmă
părinte
comite
ce8e05e0d2

+ 319 - 1
Areas/Admin/Controllers/MainServer/OrdersController.cs

@@ -352,7 +352,6 @@ namespace MySystem.Areas.Admin.Controllers
         }
         #endregion
 
-
         #region 创客退货订单列表
 
         /// <summary>
@@ -440,6 +439,325 @@ namespace MySystem.Areas.Admin.Controllers
             return Json(obj);
         }
         #endregion
+        
+        #region WIFI押金列表
+
+        /// <summary>
+        /// 根据条件查询WIFI押金列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult IndexWifiDeposit(Orders data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询WIFI押金列表
+
+        /// <summary>
+        /// WIFI押金列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexWifiDepositData(Orders data, string OrderNo, string TradeNo, string RealName, string Mobile, string StoreContact, string ErpCode, string SnNos, string PayDateData, string CreateDateData, string SendDateData, string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string StatusSelect, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("ErpCode", "1"); //运单号
+            Fields.Add("TradeNo", "1"); //支付交易号
+            Fields.Add("StoreContact", "1"); //仓库联系人
+            Fields.Add("SnNos", "2"); //SN编号
+            Fields.Add("TopUserId", "0");
+
+
+            // string condition = " and Status>=-1 and  Status<4";
+            string condition = " and Status>=-1 and Sort=0";
+            //平台订单号
+            if (!string.IsNullOrEmpty(OrderNo))
+            {
+                condition += " and OrderNo like '" + OrderNo + "'";
+            }
+            //渠道订单号
+            if (!string.IsNullOrEmpty(TradeNo))
+            {
+                condition += " and TradeNo='" + TradeNo + "'";
+            }
+            //收件人姓名
+            if (!string.IsNullOrEmpty(RealName))
+            {
+                condition += " and RealName='" + RealName + "'";
+            }
+            //收件人电话
+            if (!string.IsNullOrEmpty(Mobile))
+            {
+                condition += " and Mobile='" + Mobile + "'";
+            }
+
+            //创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //创客真实姓名
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select Id from Users where RealName='" + UserIdRealName + "')";
+            }
+            //支付方式
+            if (!string.IsNullOrEmpty(PayModeSelect))
+            {
+                condition += " and PayMode=" + PayModeSelect;
+            }
+            //仓库编号
+            if (!string.IsNullOrEmpty(StoreIdStoreNo))
+            {
+                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
+            }
+            //仓库名称
+            if (!string.IsNullOrEmpty(StoreIdStoreName))
+            {
+                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
+            }
+            //仓库联系人
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+
+            //仓库归属创客编号
+            if (!string.IsNullOrEmpty(StoreUserIdMakerCode))
+            {
+                condition += " and StoreUserId in (select StoreUserId from UserForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
+            }
+            //仓库归属创客真实姓名
+            if (!string.IsNullOrEmpty(StoreUserIdRealName))
+            {
+                condition += " and StoreUserId in (select Id from Users where RealName='" + StoreUserIdRealName + "')";
+            }
+            //快递单号
+            if (!string.IsNullOrEmpty(ErpCode))
+            {
+                condition += " and ErpCode='" + ErpCode + "'";
+            }
+            //SN
+            if (!string.IsNullOrEmpty(SnNos))
+            {
+                condition += " and SnNos like '%" + SnNos + "%'";
+            }
+            //支付时间
+            if (!string.IsNullOrEmpty(PayDateData))
+            {
+                string[] datelist = PayDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and PayDate>='" + start + " 00:00:00' and PayDate<='" + end + " 23:59:59'";
+            }
+            //下单时间
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            //发货时间
+            if (!string.IsNullOrEmpty(SendDateData))
+            {
+                string[] datelist = SendDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and SendDate>='" + start + " 00:00:00' and SendDate<='" + end + " 23:59:59'";
+            }
+            //订单状态
+            if (!string.IsNullOrEmpty(StatusSelect))
+            {
+                condition += " and Status=" + StatusSelect;
+            }
+            //退款状态
+            if (!string.IsNullOrEmpty(RefundStatusSelect))
+            {
+                condition += " and RefundStatus=" + RefundStatusSelect;
+            }
+            //提货类型
+            if (!string.IsNullOrEmpty(DeliveryTypeSelect))
+            {
+                condition += " and DeliveryType=" + DeliveryTypeSelect;
+            }
+            //发货状态
+            if (!string.IsNullOrEmpty(SendStatusSelect))
+            {
+                condition += " and SendStatus=" + SendStatusSelect;
+            }
+            //商品类型名称
+            if (!string.IsNullOrEmpty(ProductIdSelect))
+            {
+                condition += " and Id in (select OrderId from OrderProduct where ProductId=" + ProductIdSelect + ")";//表数据量过大时不适用
+            }
+            //仓库类型
+            if (!string.IsNullOrEmpty(StoreTypeSelect))
+            {
+                condition += " and StoreType=" + StoreTypeSelect;
+            }
+            //支付状态
+            if (!string.IsNullOrEmpty(PayStatusSelect))
+            {
+                condition += " and PayStatus=" + PayStatusSelect;
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Orders", 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["OrderNo"] = dic["OrderNo"].ToString() + "<br />" + dic["TradeNo"].ToString();
+                dic["StoreContact"] = dic["StoreContact"].ToString() + "<br />" + dic["StoreContactMobile"].ToString();
+                dic["Address"] = dic["Areas"].ToString() + dic["Address"].ToString();
+                dic["RecieveInfo"] = dic["RealName"].ToString() + "<br />" + dic["Mobile"].ToString();
+                dic["ErpInfo"] = dic["ErpCode"].ToString() + "<br />" + dic["ErpName"].ToString();
+
+                //创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserInfo"] = userid_Users.MakerCode + "<br />" + userid_Users.RealName + "<br />" + userid_Users.Id;
+
+                //顶级创客信息
+                if (!string.IsNullOrEmpty(userid_Users.ParentNav))
+                {
+                    string[] ParentNavList = userid_Users.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                    var topUserInfo = new Users();
+                    if (ParentNavList.Length > 1)
+                    {
+                        topUserInfo = PublicFunction.GetTopUserInfo(userid_Users.ParentNav, 1);
+                    }
+                    else
+                    {
+                        topUserInfo = PublicFunction.GetTopUserInfo(userid_Users.ParentNav, 0);
+                    }
+                    //顶级创客信息
+                    dic["TopUserInfo"] = topUserInfo.MakerCode + "<br />" + topUserInfo.RealName;
+
+                    //分离顶级创客信息
+                    dic["TopUserInfoMakerCode"] = topUserInfo.MakerCode;
+                    dic["TopUserInfoRealName"] = topUserInfo.RealName;
+                }
+                else
+                {
+                    dic["TopUserInfo"] = "";
+                }
+
+                //订单状态
+                int Status = int.Parse(dic["Status"].ToString());
+                if (Status == -1) dic["StatusName"] = "已取消";
+                if (Status == 1) dic["StatusName"] = "待发货";
+                if (Status == 2) dic["StatusName"] = "已完成";
+                if (Status == 3) dic["StatusName"] = "已发货";
+                if (Status == 4) dic["StatusName"] = "已退款";
+
+                //物流名称
+                dic["ErpName"] = RelationClass.GetErpCompanysInfo(dic["ErpName"].ToString());
+
+                //支付方式
+                int PayMode = int.Parse(dic["PayMode"].ToString());
+                if (PayMode == 1) dic["PayMode"] = "支付宝";
+                if (PayMode == 2) dic["PayMode"] = "微信";
+                if (PayMode == 3) dic["PayMode"] = "账户余额";
+                if (PayMode == 0) dic["PayMode"] = "";
+
+                //仓库
+                int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
+                StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
+
+                //仓库类型
+                int StoreType = int.Parse(dic["StoreType"].ToString());
+                if (StoreType == 0) dic["StoreType"] = "总仓";
+                if (StoreType == 1) dic["StoreType"] = "分仓";
+                dic["Store"] = storeid_StoreHouse.StoreNo + "<br />" + dic["StoreType"].ToString();
+                dic.Remove("StoreId");
+
+                // //退款状态
+                // int RefundStatus = int.Parse(dic["RefundStatus"].ToString());
+                // if (RefundStatus == 0) dic["RefundStatusName"] = "未退款";
+                // if (RefundStatus == 1) dic["RefundStatusName"] = "已退款";
+
+                //提货类型
+                int DeliveryType = int.Parse(dic["DeliveryType"].ToString());
+                if (DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
+                if (DeliveryType == 2) dic["DeliveryType"] = "上门自提";
+                if (DeliveryType == 0) dic["DeliveryType"] = "";
+
+                // //发货状态
+                // int SendStatus = int.Parse(dic["SendStatus"].ToString());
+                // if (SendStatus == -1) dic["SendStatusName"] = "已驳回";
+                // if (SendStatus == 0) dic["SendStatusName"] = "未发货";
+                // if (SendStatus == 1) dic["SendStatusName"] = "已发货";
+                // if (SendStatus == 2) dic["SendStatusName"] = "已退货";
+                // if (SendStatus == 0)
+                // {
+                //     dic["SendInfo"] = dic["SendStatusName"];
+                // }
+                // else
+                // {
+                //     dic["SendInfo"] = dic["SendStatusName"].ToString() + "<br />" + dic["SendDate"].ToString();
+                // }
+                //商品名称
+                dic["ProductId"] = RelationClass.GetProductsInfo(int.Parse(dic["ProductId"].ToString()));
+
+                //商品名称
+                int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
+                OrderProduct orderProducts = db.OrderProduct.FirstOrDefault(m => m.OrderId == Id) ?? new OrderProduct();
+                var product = db.Products.FirstOrDefault(m => m.Id == orderProducts.ProductId) ?? new Products();
+                dic["ProductName"] = orderProducts.ProductName;
+                if (product.ProductKind == 1) dic["ProductKind"] = "实物商品";
+                if (product.ProductKind == 2) dic["ProductKind"] = "虚拟商品";
+
+                //退款时间
+                var orderRefund = db.OrderRefund.FirstOrDefault(m => m.OrderId == Id) ?? new OrderRefund();
+                dic["RefundDate"] = "";
+                if (orderRefund.Id > 0)
+                {
+                    dic["RefundDate"] = orderRefund.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
+                }
+
+                //仓库归属创客
+                int StoreUserId = int.Parse(function.CheckInt(dic["StoreUserId"].ToString()));
+                Users storeuserid_Users = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
+                dic["StoreFrom"] = storeuserid_Users.MakerCode + "<br />" + storeid_StoreHouse.StoreName;
+                dic.Remove("StoreUserId");
+
+                
+
+                // //支付状态
+                // int PayStatus = int.Parse(dic["PayStatus"].ToString());
+                // if (PayStatus == 0) dic["PayStatusName"] = "未支付";
+                // if (PayStatus == 1) dic["PayStatusName"] = "支付成功";
+                // if (PayStatus == 2) dic["PayStatusName"] = "支付失败";
+                // if (PayStatus == 3) dic["PayStatusName"] = "支付锁定中";
+                // if (PayStatus == 4) dic["PayStatusName"] = "支付处理中";
+
+            }
+            Dictionary<string, object> other = new Dictionary<string, object>();
+            string SuccessAmount = "0.00";//支付成功总金额
+            string FailAmount = "0.00";//支付失败总金额
+            DataTable dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=1 and Status>-1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=2 and Status>-1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            other.Add("SuccessAmount", SuccessAmount);
+            other.Add("FailAmount", FailAmount);
+            obj.Add("other", other);
+            return Json(obj);
+        }
+        #endregion
 
         #region 增加创客订单
 

BIN
Areas/Admin/Views/MainServer/.DS_Store


+ 264 - 0
Areas/Admin/Views/MainServer/Orders/IndexWifiDeposit.cshtml

@@ -0,0 +1,264 @@
+@{
+    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">
+                    <input type="hidden" id="ProductIdSelect" name="ProductIdSelect" value="134" />
+                    <div class="layui-inline">
+                        <label class="layui-form-label">平台订单号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="OrderNo" 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="TradeNo" 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="RealName" 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="Mobile" placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="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" 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="StoreIdStoreNo" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">仓库名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="StoreIdStoreName" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">仓库联系人</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="StoreContact" 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="StoreUserIdMakerCode" 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="StoreUserIdRealName" 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="ErpCode" placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">SN</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="SnNos" placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+
+                    <div class="layui-inline">
+                        <label class="layui-form-label">支付时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="PayDateData" id="PayDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">下单时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">发货时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="SendDateData" id="SendDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">支付渠道</label>
+                        <div class="layui-input-inline">
+                            <select id="PayModeSelect" name="PayModeSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="1">支付宝</option>
+                                <option value="2">微信</option>
+                                <option value="3">账户余额</option>
+                            </select>
+                        </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="-1">已取消</option>
+                                <option value="1">待发货</option>
+                                <option value="2">已完成</option>
+                                <option value="3">已发货</option>
+                                <option value="4">已退款</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">提货类型</label>
+                        <div class="layui-input-inline">
+                            <select id="DeliveryTypeSelect" name="DeliveryTypeSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="1">邮寄到付</option>
+                                <option value="2">上门自提</option>
+                            </select>
+                        </div>
+                    </div>
+                    @{
+                        Dictionary<string, string> ProductsDic = new MySystem.DictionaryClass().getProductsDic();
+                    }
+                    <div class="layui-inline">
+                        <label class="layui-form-label">仓库类型</label>
+                        <div class="layui-input-inline">
+                            <select id="StoreTypeSelect" name="StoreTypeSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="0">总仓</option>
+                                <option value="1">分仓</option>
+                            </select>
+                        </div>
+                    </div>
+                    @{
+                        Dictionary<string, string> TopUserDic = new MySystem.DictionaryClass().getTopUserDic();
+                    }
+                    <div class="layui-inline">
+                        <label class="layui-form-label">顶级创客</label>
+                        <div class="layui-input-inline">
+                            <select id="TopUserId" name="TopUserId" lay-search="">
+                                <option value="">全部...</option>
+                                @foreach (string key in TopUserDic.Keys)
+                                {
+                                    <option value="@key">@TopUserDic[key]</option>
+                                }
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <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="ExportsExcel"><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="SuccessAmount">0.00</span> | 支付失败总金额(元):<span
+                        style="color: #f00;" id="FailAmount">0.00</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="detail"><i class="layui-icon layui-icon-read"></i>详情</a>
+                    @if (RightInfo.Contains("," + right + "_send,"))
+                    {
+                        @Html.Raw("{{#if (d.Status == 1){ }}")
+                            <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 + "_return,"))
+                    {
+                        @Html.Raw("{{#if (d.RefundStatus == 0 && d.PayStatus == 1 && d.Sort == 0 && d.TotalPrice > 0){ }}")
+                            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="return"><i class="layui-icon layui-icon-edit"></i>退款</a>
+                        @("{{#} }}")
+                    }
+                    @*<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="prize100"><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/OrdersWifiDeposit_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 5 - 0
wwwroot/layuiadmin/modules_main/MachineApply_Admin.js

@@ -237,6 +237,11 @@ layui.config({
                 width: 200,
                 title: '发货状态',
                 sort: true
+            }, {
+                field: 'OutBatchNo',
+                width: 100,
+                title: 'WIFI设备押金',
+                sort: true
             }, {
                 field: 'ExpressInfo',
                 width: 200,

+ 741 - 0
wwwroot/layuiadmin/modules_main/OrdersWifiDeposit_Admin.js

@@ -0,0 +1,741 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/Orders/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 layPayeDate = laydate.render({
+        elem: '#PayDate',
+        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;
+                    layPayeDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layPayeDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#PayDate').val(value);
+            }
+        }
+    });
+    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 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/Orders/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/Orders/IndexWifiDepositData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            // , { field: 'SendInfo', width: 200, title: '发货状态-发货时间', sort: true }
+            , { field: 'StatusName', width: 200, title: '订单状态', sort: true }
+            , { field: 'OrderNo', width: 200, title: '平台订单号-渠道订单号', sort: true }
+            , { field: 'ProductName', width: 200, title: '商品名称', sort: true }
+            , { field: 'ProductKind', width: 200, title: '商品类型', sort: true }
+            , { field: 'TotalPrice', width: 200, title: '订单金额', sort: true }
+            , { field: 'BuyCount', width: 200, title: '购买数量', sort: true }
+            , { field: 'UserInfo', width: 200, title: '创客信息', sort: true }
+            , { field: 'UserId', width: 100, title: '创客Id', sort: true }
+            , { field: 'Store', width: 200, title: '发货仓库信息', sort: true }
+            , { field: 'StoreContact', width: 200, title: '仓库联系人信息', sort: true }
+            , { field: 'StoreFrom', width: 200, title: '仓库归属信息', sort: true }
+            , { field: 'TopUserInfo', width: 200, title: '顶级创客信息', sort: true }
+            , { field: 'Address', width: 200, title: '收货地址', sort: true }
+            , { field: 'RecieveInfo', width: 200, title: '收件人姓名-联系电话', sort: true }
+            , { field: 'PayMode', width: 200, title: '支付渠道', sort: true }
+            // , { field: 'PayStatusName', width: 200, title: '支付状态', sort: true }
+            , { field: 'DeliveryType', width: 200, title: '提货类型', sort: true }
+            , { field: 'Remark', width: 200, title: '订单备注', sort: true }
+            // , { field: 'RefundStatusName', width: 200, title: '退款状态', sort: true }
+            , { field: 'ErpInfo', width: 200, title: '快递单号-快递名称', sort: true }
+            , { field: 'CreateDate', width: 200, title: '下单时间', sort: true }
+            , { field: 'PayDate', width: 200, title: '支付时间', sort: true }
+            , { field: 'SendDate', width: 200, title: '发货时间', sort: true }
+            , { field: 'RefundDate', width: 200, title: '退款时间', sort: true }
+            , { field: 'SnNos', width: 200, title: '设备SN', sort: true }
+
+            , { title: '操作', align: 'center', width: 300, fixed: 'right', toolbar: '#table-list-tools' }
+        ]]
+        , where: {
+
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $("#SuccessAmount").text(res.other.SuccessAmount);
+            $("#FailAmount").text(res.other.FailAmount);
+            $(".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/Orders/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/Orders/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);
+        } else if (obj.event === 'detail') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '订单详情'
+                , content: 'Detail?Id=' + data.Id + ''
+                , maxmin: true
+                , area: ['700px', '650px']
+                , btn: ['关闭']
+                , yes: function (index, layero) {
+                    layer.close(index);
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        } else if (obj.event === 'send') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '创客订单-发货'
+                , content: 'Send?Id=' + data.Id + ''
+                , maxmin: true
+                , area: ['500px', '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({});
+                        var IdList = '';
+                        layero.find('iframe').contents().find('input[type=hidden][name=IdList]').each(function (i) {
+                            IdList += $(this).val() + "#";
+                        });
+                        userdata += "&IdList=" + IdList;
+
+                        var StoreIdList = '';
+                        layero.find('iframe').contents().find('select[name=StoreIdList]').each(function (i) {
+                            StoreIdList += $(this).val() + "#";
+                        });
+                        userdata += "&StoreIdList=" + StoreIdList;
+
+                        var SnNosList = '';
+                        layero.find('iframe').contents().find('textarea[name=SnNosList]').each(function (i) {
+                            SnNosList += $(this).val() + "#";
+                        });
+                        userdata += "&SnNosList=" + SnNosList;
+
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/Orders/Send?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                if (data == "success") {
+                                    layer.close(index); //关闭弹层
+                                    layer.msg('提交成功', { time: 1500 }, function () {
+                                        table.reload('LAY-list-manage'); //数据刷新
+                                    });
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+        } else if (obj.event === 'return') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '退款'
+                , content: 'Return?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/Orders/Return?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                if (data == "success") {
+                                    layer.close(index); //关闭弹层
+                                    layer.msg('提交成功', { time: 1500 }, function () {
+                                        table.reload('LAY-list-manage'); //数据刷新
+                                    });
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+        } else if (obj.event === 'prize100') {
+            var loadindex = layer.load(1, {
+                shade: [0.5, '#000']
+            });
+            $.ajax({
+                url: "/Admin/Orders/Prize100?r=" + Math.random(1),
+                data: "Id=" + data.Id,
+                dataType: "json",
+                success: function (data) {
+                    layer.close(loadindex);
+                    if (data.code == '1') {
+                        layer.alert(data.result.replace(/\n/g, '<br />'), { area: ['680px', '460px'] });
+                    } else {
+                        var index = layer.confirm(data.result.replace(/\n/g, '<br />') + '<br />是否立即补发?', { area: ['500px', '460px'] }, function (index) {
+                            $.ajax({
+                                type: "POST",
+                                url: "/Admin/Orders/AddPrize100?r=" + Math.random(1),
+                                data: "Id=" + data.Id,
+                                dataType: "text",
+                                success: function (data) {
+                                    if (data == "success") {
+                                        layer.close(index);
+                                        layer.msg("补发成功");
+                                    } else {
+                                        layer.msg(data);
+                                    }
+                                }
+                            });
+                        });
+                    }
+                }
+            });
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/Orders/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/Orders/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>');
+        }, ExportsExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                console.log($(this).attr('name'));
+                console.log($(this).val());
+                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/Orders/ExportsExcel?r=" + Math.random(1),
+            //     data: userdata,
+            //     dataType: "json",
+            //     success: function (data) {
+            //         data.Obj.unshift(data.Fields);
+            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
+            //     }
+            // });
+            var index = layer.confirm('确定导出吗?', function (index) {
+                var indexs = layer.load(1, {
+                    shade: [0.5, '#000']
+                });
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/Orders/QuickExportExcelDo?r=" + Math.random(1),
+                    data: userdata,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        if (data == "success") {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg('导出成功,请到我的下载中点击下载文件', {
+                                time: 1000
+                            }, function () {
+                                window.location.reload();
+                            });
+                        } else {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg(data);
+                        }
+                    }
+                });
+            });
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            var index = layer.load(1, {
+                shade: [0.8, '#000'],
+                content: '',
+                success: function (layero) {
+                    var obj = layero.find('.layui-layer-content').css({
+                        'padding-top': '10px',
+                        'width': '200px',
+                        'color': '#fff',
+                        'text-align': 'center'
+                    });
+                    var st = setInterval(function () {
+                        $.ajax({
+                            type: "GET",
+                            url: "/Admin/Orders/CheckExport?r=" + Math.random(1),
+                            dataType: "text",
+                            success: function (data) {
+                                if (data == "finish") {
+                                    clearInterval(st);
+                                } else {
+                                    obj.text(data);
+                                }
+                            }
+                        });
+                    }, 1000);
+                }
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/Orders/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "text",
+                success: function (data) {
+                    layer.close(index);
+                    if (data.indexOf("success|") > -1) {
+                        var datalist = data.split('|');
+                        window.location.href = datalist[1];
+                    } else {
+                        layer.msg('导出失败');
+                    }
+                    // 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/Orders/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/Orders/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) : '';
+    });
+});