Ver código fonte

创客机具申请详情添加发货机具Sn

DuGuYang 2 anos atrás
pai
commit
2f3fff6f75

+ 65 - 48
Areas/Admin/Controllers/MainServer/MachineApplyController.cs

@@ -51,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 机具申请订单列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(MachineApply data,string ApplyNo, string MakerCode, string RealName, string StoreNo, string StoreName, string StoreMakerCode, string StatusSelect, string ApplyTimeData, string SendDateData, string SendStatusSelect, string StoreTypeSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(MachineApply data, string ApplyNo, string MakerCode, string RealName, string StoreNo, string StoreName, string StoreMakerCode, string StatusSelect, string ApplyTimeData, string SendDateData, string SendStatusSelect, string StoreTypeSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -69,7 +69,7 @@ namespace MySystem.Areas.Admin.Controllers
             //申请单号
             if (!string.IsNullOrEmpty(ApplyNo))
             {
-                condition += " and ApplyNo like'" + ApplyNo + "' " ;
+                condition += " and ApplyNo like'" + ApplyNo + "' ";
             }
             //创客编号
             if (!string.IsNullOrEmpty(MakerCode))
@@ -97,22 +97,22 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + StoreMakerCode + "')";
             }
             //订单状态
-            if(!string.IsNullOrEmpty(StatusSelect))
+            if (!string.IsNullOrEmpty(StatusSelect))
             {
                 condition += " and Status=" + StatusSelect;
             }
             //发货状态
-            if(!string.IsNullOrEmpty(SendStatusSelect))
+            if (!string.IsNullOrEmpty(SendStatusSelect))
             {
                 condition += " and SendStatus=" + SendStatusSelect;
             }
             //仓库类型
-            if(!string.IsNullOrEmpty(StoreTypeSelect))
+            if (!string.IsNullOrEmpty(StoreTypeSelect))
             {
                 condition += " and StoreType=" + StoreTypeSelect;
             }
             //申请时间
-            if(!string.IsNullOrEmpty(ApplyTimeData))
+            if (!string.IsNullOrEmpty(ApplyTimeData))
             {
                 string[] datelist = ApplyTimeData.Split(new string[] { " - " }, StringSplitOptions.None);
                 string start = datelist[0];
@@ -120,7 +120,7 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and ApplyTime>='" + start + " 00:00:00' and ApplyTime<='" + end + " 23:59:59'";
             }
 
-            if(!string.IsNullOrEmpty(SendDateData))
+            if (!string.IsNullOrEmpty(SendDateData))
             {
                 string[] datelist = SendDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 string start = datelist[0];
@@ -147,8 +147,8 @@ namespace MySystem.Areas.Admin.Controllers
                 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 = "分仓";
+                if (StoreType == 0) StoreTypeName = "总仓";
+                if (StoreType == 1) StoreTypeName = "分仓";
                 dic["StoreUser"] = storeUser.MakerCode + "<br />" + StoreTypeName;
 
                 //创客信息
@@ -160,29 +160,29 @@ namespace MySystem.Areas.Admin.Controllers
                 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;
-                
+
                 //收件人姓名-联系电话
                 dic["StoreContact"] = dic["RealName"].ToString() + "<br />" + dic["Mobile"].ToString();
 
                 //订单状态
                 int Status = int.Parse(dic["Status"].ToString());
-                if(Status == -1) dic["StatusName"] = "已驳回";
-                if(Status == 0) dic["StatusName"] = "待审核";
-                if(Status == 1) dic["StatusName"] = "申请成功";
-                if(Status == 2) dic["StatusName"] = "申请失败";
+                if (Status == -1) dic["StatusName"] = "已驳回";
+                if (Status == 0) dic["StatusName"] = "待审核";
+                if (Status == 1) dic["StatusName"] = "申请成功";
+                if (Status == 2) dic["StatusName"] = "申请失败";
 
                 //提货方式
                 int DeliveryType = int.Parse(dic["DeliveryType"].ToString());
-                if(DeliveryType == 0) dic["DeliveryType"] = "";
-                if(DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
-                if(DeliveryType == 2) dic["DeliveryType"] = "上门自提";
+                if (DeliveryType == 0) dic["DeliveryType"] = "";
+                if (DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
+                if (DeliveryType == 2) dic["DeliveryType"] = "上门自提";
 
                 //发货状态
                 int SendStatus = int.Parse(dic["Status"].ToString());
-                if(SendStatus == -1) dic["SendStatus"] = "已驳回";
-                if(SendStatus == 0) dic["SendStatus"] = "未发货";
-                if(SendStatus == 1) dic["SendStatus"] = "已发货";
-                
+                if (SendStatus == -1) dic["SendStatus"] = "已驳回";
+                if (SendStatus == 0) dic["SendStatus"] = "未发货";
+                if (SendStatus == 1) dic["SendStatus"] = "已发货";
+
                 //快递单号-快递名称
                 dic["ExpressInfo"] = dic["ExpressName"].ToString() + "<br />" + dic["ExpressNo"].ToString();
             }
@@ -262,28 +262,45 @@ namespace MySystem.Areas.Admin.Controllers
             MachineApply editData = db.MachineApply.FirstOrDefault(m => m.Id == Id) ?? new MachineApply();
             ViewBag.data = editData;
 
+            var SnNos = "";
+            var order = db.Orders.FirstOrDefault(m => m.Id == editData.QueryCount) ?? new Orders();
+            if (!string.IsNullOrEmpty(order.SnNos))
+            {
+                var sendSn = order.SnNos.Replace("\r", "").Replace("\n", ",").Split(',');
+                for (int a = 0; a < sendSn.Length; a++)
+                {
+                    SnNos += sendSn[a] + "\n";
+                }
+            }
+            ViewBag.SnNos = SnNos;
+
             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 = "申请失败";
+            if (Status == 0) ViewBag.Status = "待审核";
+            if (Status == 1) ViewBag.Status = "申请成功";
+            if (Status == 2) ViewBag.Status = "申请失败";
 
             int AuditResult = editData.AuditResult;
-            if(AuditResult == 0) ViewBag.AuditResult = "未通过";
-            if(AuditResult == 1) ViewBag.AuditResult = "通过";
+            if (AuditResult == 0) ViewBag.AuditResult = "未通过";
+            if (AuditResult == 1) ViewBag.AuditResult = "通过";
 
             //邮寄方式
             int DeliveryType = editData.DeliveryType;
-            if(DeliveryType == 1) ViewBag.DeliveryType = "邮寄到付";
-            if(DeliveryType == 2) ViewBag.DeliveryType = "上门自提";
+            if (DeliveryType == 1) ViewBag.DeliveryType = "邮寄到付";
+            if (DeliveryType == 2) ViewBag.DeliveryType = "上门自提";
 
             //发货状态
-            int SendStatus = editData.SendStatus;
-            if(SendStatus == 0) ViewBag.SendStatus = "未发货";
-            if(SendStatus == 1) ViewBag.SendStatus = "已发货";
+            // int SendStatus = editData.SendStatus;
+            // if (SendStatus == 0) ViewBag.SendStatus = "未发货";
+            // if (SendStatus == 1) ViewBag.SendStatus = "已发货";
+
+            int SendStatus = editData.Status;
+            if (SendStatus == -1) ViewBag.SendStatus = "已驳回";
+            if (SendStatus == 0) ViewBag.SendStatus = "未发货";
+            if (SendStatus == 1) ViewBag.SendStatus = "已发货";
             return View();
         }
 
@@ -336,7 +353,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         #endregion
-        
+
         #region 取消机具申请订单
 
         /// <summary>
@@ -351,7 +368,7 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 Orders order = db.Orders.FirstOrDefault(m => m.Id == apply.QueryCount);
                 if (order != null)
-                { 
+                {
                     string SwapSnExpand = apply.SwapSnExpand;
                     if (!string.IsNullOrEmpty(SwapSnExpand))
                     {
@@ -583,17 +600,17 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + StoreMakerCode + "')";
             }
             //订单状态
-            if(!string.IsNullOrEmpty(StatusSelect))
+            if (!string.IsNullOrEmpty(StatusSelect))
             {
                 condition += " and Status=" + StatusSelect;
             }
             //发货状态
-            if(!string.IsNullOrEmpty(SendStatusSelect))
+            if (!string.IsNullOrEmpty(SendStatusSelect))
             {
                 condition += " and SendStatus=" + SendStatusSelect;
             }
             //仓库类型
-            if(!string.IsNullOrEmpty(StoreTypeSelect))
+            if (!string.IsNullOrEmpty(StoreTypeSelect))
             {
                 condition += " and StoreType=" + StoreTypeSelect;
             }
@@ -615,8 +632,8 @@ namespace MySystem.Areas.Admin.Controllers
                 Users storeUser = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
                 dic["StoreMakerCode"] = storeUser.MakerCode;
                 int StoreType = int.Parse(dic["StoreType"].ToString());
-                if(StoreType == 0) dic["StoreType"] = "总仓";
-                if(StoreType == 1) dic["StoreType"] = "分仓";
+                if (StoreType == 0) dic["StoreType"] = "总仓";
+                if (StoreType == 1) dic["StoreType"] = "分仓";
 
                 //创客信息
                 int UserId = int.Parse(dic["UserId"].ToString());
@@ -629,23 +646,23 @@ namespace MySystem.Areas.Admin.Controllers
                 Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
                 dic["TopMakerCode"] = tuser.MakerCode;
                 dic["TopRealName"] = tuser.RealName;
-                
+
                 //订单状态
                 int Status = int.Parse(dic["Status"].ToString());
-                if(Status == 0) dic["Status"] = "待审核";
-                if(Status == 1) dic["Status"] = "申请成功";
-                if(Status == 2) dic["Status"] = "申请失败";
+                if (Status == 0) dic["Status"] = "待审核";
+                if (Status == 1) dic["Status"] = "申请成功";
+                if (Status == 2) dic["Status"] = "申请失败";
 
                 //提货方式
                 int DeliveryType = int.Parse(dic["DeliveryType"].ToString());
-                if(DeliveryType == 0) dic["DeliveryType"] = "";
-                if(DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
-                if(DeliveryType == 2) dic["DeliveryType"] = "上门自提";
+                if (DeliveryType == 0) dic["DeliveryType"] = "";
+                if (DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
+                if (DeliveryType == 2) dic["DeliveryType"] = "上门自提";
 
                 //发货状态
                 int SendStatus = int.Parse(dic["SendStatus"].ToString());
-                if(SendStatus == 0) dic["SendStatus"] = "未发货";
-                if(SendStatus == 1) dic["SendStatus"] = "已发货";
+                if (SendStatus == 0) dic["SendStatus"] = "未发货";
+                if (SendStatus == 1) dic["SendStatus"] = "已发货";
 
                 dic.Remove("UserId");
                 dic.Remove("TopUserId");
@@ -694,7 +711,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
 
-        
+
         #region 审核发货
 
         public IActionResult AuditSend(string right, int Id = 0)

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

@@ -181,7 +181,7 @@
                             <div class="layui-inline">
                                 <label class="layui-form-label">发货SN编号:</label>
                                 <div class="layui-input-inline">
-                                    @editData.SendSn
+                                    @ViewBag.SnNos
                                 </div>
                             </div>
                         </div>