public ActionResult CheckOrderAfterService(int asId, CheckOrderAfterServiceModel model) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Checking) { return(PromptView("不能执行此操作")); } if (ModelState.IsValid) { if (model.State == 0) { AdminOrderAfterServices.CheckRefuseOrderAfterService(asId, model.CheckResult ?? "", DateTime.Now); } else { AdminOrderAfterServices.CheckAgreeOrderAfterService(asId, model.CheckResult ?? "", DateTime.Now); } return(PromptView("操作成功")); } ViewData["asId"] = asId; return(View(model)); }
public ActionResult BackOrderAfterService(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Received) { return(PromptView("不能执行此操作")); } BackOrderAfterServiceModel model = new BackOrderAfterServiceModel(); ViewData["asId"] = asId; ViewData["orderAfterServiceInfo"] = orderAfterServiceInfo; List <SelectListItem> shipCompanyList = new List <SelectListItem>(); shipCompanyList.Add(new SelectListItem() { Text = "请选择", Value = "0" }); foreach (ShipCompanyInfo item in ShipCompanies.GetShipCompanyList()) { shipCompanyList.Add(new SelectListItem() { Text = item.Name, Value = item.ShipCoId.ToString() }); } ViewData["shipCompanyList"] = shipCompanyList; return(View(model)); }
/// <summary> /// 订单售后服务信息 /// </summary> /// <param name="asId">售后服务id</param> /// <returns></returns> public ActionResult OrderAfterServiceInfo(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } OrderAfterServiceModel model = new OrderAfterServiceModel(); model.OrderAfterServiceInfo = orderAfterServiceInfo; model.RegionInfo = Regions.GetRegionById(orderAfterServiceInfo.RegionId); ViewData["referer"] = MallUtils.GetMallAdminRefererCookie(); return(View(model)); }
public ActionResult BackOrderAfterService(int asId, BackOrderAfterServiceModel model) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Received) { return(PromptView("不能执行此操作")); } ShipCompanyInfo shipCompanyInfo = ShipCompanies.GetShipCompanyById(model.ShipCoId); if (shipCompanyInfo == null) { ModelState.AddModelError("ShipCoId", "配送公司不存在"); } if (ModelState.IsValid) { AdminOrderAfterServices.BackOrderAfterService(asId, model.ShipCoId, shipCompanyInfo.Name, model.ShipSN); return(PromptView("操作成功")); } ViewData["asId"] = asId; ViewData["orderAfterServiceInfo"] = orderAfterServiceInfo; ViewData["orderAfterServiceInfo"] = orderAfterServiceInfo; List <SelectListItem> shipCompanyList = new List <SelectListItem>(); shipCompanyList.Add(new SelectListItem() { Text = "请选择", Value = "0" }); foreach (ShipCompanyInfo item in ShipCompanies.GetShipCompanyList()) { shipCompanyList.Add(new SelectListItem() { Text = item.Name, Value = item.ShipCoId.ToString() }); } ViewData["shipCompanyList"] = shipCompanyList; return(View(model)); }
public ActionResult CheckOrderAfterService(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Checking) { return(PromptView("不能执行此操作")); } CheckOrderAfterServiceModel model = new CheckOrderAfterServiceModel(); ViewData["asId"] = asId; return(View(model)); }
/// <summary> /// 商城收到客户邮寄的商品 /// </summary> public ActionResult ReceiveOrderAfterService(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Sended) { return(PromptView("不能执行此操作")); } if (orderAfterServiceInfo.Type == 0) { AdminOrderAfterServices.CompleteOrderAfterService(asId); OrderInfo orderInfo = AdminOrders.GetOrderByOid(orderAfterServiceInfo.Oid); OrderRefunds.ApplyRefund(new OrderRefundInfo() { State = (int)OrderRefundState.Applied, StoreId = orderInfo.StoreId, StoreName = orderInfo.StoreName, Oid = orderInfo.Oid, OSN = orderInfo.OSN, Uid = orderInfo.Uid, ASId = orderAfterServiceInfo.ASId, PaySystemName = orderInfo.PaySystemName, PayFriendName = orderInfo.PayFriendName, PaySN = orderInfo.PaySN, PayMoney = orderAfterServiceInfo.Money, RefundMoney = orderAfterServiceInfo.Money, ApplyTime = DateTime.Now }); } else { AdminOrderAfterServices.ReceiveOrderAfterService(asId, DateTime.Now); } return(PromptView("操作成功")); }
/// <summary> /// 订单售后服务列表 /// </summary> /// <param name="accountName">账户名</param> /// <param name="applyStartTime">申请开始时间</param> /// <param name="applyEndTime">申请结束时间</param> /// <param name="oid">订单id</param> /// <param name="state">状态</param> /// <param name="type">类型</param> /// <param name="pageSize">每页数</param> /// <param name="pageNumber">当前页数</param> /// <returns></returns> public ActionResult AfterServiceList(string accountName, string applyStartTime, string applyEndTime, int oid = 0, int state = -1, int type = -1, int pageSize = 15, int pageNumber = 1) { //获取用户id int uid = Users.GetUidByAccountName(accountName); string condition = AdminOrderAfterServices.GetOrderProductAfterServiceListCondition(WorkContext.StoreId, uid, oid, state, type, applyStartTime, applyEndTime); PageModel pageModel = new PageModel(pageSize, pageNumber, AdminOrderAfterServices.GetOrderProductAfterServiceCount(condition)); List <SelectListItem> stateList = new List <SelectListItem>(); stateList.Add(new SelectListItem() { Text = "全部", Value = "-1" }); stateList.Add(new SelectListItem() { Text = "审核中", Value = ((int)OrderAfterServiceState.Checking).ToString() }); stateList.Add(new SelectListItem() { Text = "审核通过", Value = ((int)OrderAfterServiceState.CheckAgree).ToString() }); stateList.Add(new SelectListItem() { Text = "审核拒绝", Value = ((int)OrderAfterServiceState.CheckRefuse).ToString() }); stateList.Add(new SelectListItem() { Text = "客户已邮寄", Value = ((int)OrderAfterServiceState.Sended).ToString() }); stateList.Add(new SelectListItem() { Text = "商城已收货", Value = ((int)OrderAfterServiceState.Received).ToString() }); stateList.Add(new SelectListItem() { Text = "商城已发货", Value = ((int)OrderAfterServiceState.Backed).ToString() }); stateList.Add(new SelectListItem() { Text = "完成", Value = ((int)OrderAfterServiceState.Completed).ToString() }); List <SelectListItem> typeList = new List <SelectListItem>(); typeList.Add(new SelectListItem() { Text = "全部", Value = "-1" }); typeList.Add(new SelectListItem() { Text = "退货", Value = "0" }); typeList.Add(new SelectListItem() { Text = "换货", Value = "1" }); typeList.Add(new SelectListItem() { Text = "维修", Value = "2" }); OrderAfterServiceListModel model = new OrderAfterServiceListModel() { PageModel = pageModel, OrderAfterServiceList = AdminOrderAfterServices.GetOrderProductAfterServiceList(pageModel.PageSize, pageModel.PageNumber, condition), Oid = oid, AccountName = accountName, State = state, StateList = stateList, Type = type, TypeList = typeList, ApplyStartTime = applyStartTime, ApplyEndTime = applyEndTime }; MallUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&oid={3}&AccountName={4}&state={5}&type={6}&applyStartTime={7}&applyEndTime={8}", Url.Action("afterservicelist"), pageModel.PageNumber, pageModel.PageSize, oid, accountName, state, type, applyStartTime, applyEndTime)); return(View(model)); }