/// <summary> /// 订单列表 /// </summary> /// <param name="storeName">店铺名称</param> /// <param name="osn">订单编号</param> /// <param name="accountName">账户名</param> /// <param name="consignee">收货人</param> /// <param name="storeId">店铺id</param> /// <param name="orderState">订单状态</param> /// <param name="pageSize">每页数</param> /// <param name="pageNumber">当前页数</param> /// <returns></returns> public ActionResult OrderList(string storeName, string osn, string accountName, string consignee, string sortColumn, string sortDirection, int storeId = -1, int orderState = 0, int pageSize = 15, int pageNumber = 1) { //获取用户id int uid = Users.GetUidByAccountName(accountName); string condition = AdminOrders.GetOrderListCondition(storeId, osn, uid, consignee, orderState); string sort = AdminOrders.GetOrderListSort(sortColumn, sortDirection); PageModel pageModel = new PageModel(pageSize, pageNumber, AdminOrders.GetOrderCount(condition)); OrderListModel model = new OrderListModel() { OrderList = AdminOrders.GetOrderList(pageModel.PageSize, pageModel.PageNumber, condition, sort), PageModel = pageModel, SortColumn = sortColumn, SortDirection = sortDirection, StoreId = storeId, StoreName = string.IsNullOrWhiteSpace(storeName) ? "全部店铺" : storeName, OSN = osn, AccountName = accountName, Consignee = consignee, OrderState = orderState }; MallUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&sortColumn={3}&sortDirection={4}&storeId={5}&storeName={6}&OSN={7}&AccountName={8}&Consignee={9}&OrderState={10}", Url.Action("orderlist"), pageModel.PageNumber, pageModel.PageSize, sortColumn, sortDirection, storeId, storeName, osn, accountName, consignee, orderState)); List <SelectListItem> itemList = new List <SelectListItem>(); itemList.Add(new SelectListItem() { Text = "全部", Value = "0" }); itemList.Add(new SelectListItem() { Text = "已提交", Value = ((int)OrderState.Submitted).ToString() }); itemList.Add(new SelectListItem() { Text = "等待付款", Value = ((int)OrderState.WaitPaying).ToString() }); itemList.Add(new SelectListItem() { Text = "待确认", Value = ((int)OrderState.Confirming).ToString() }); itemList.Add(new SelectListItem() { Text = "已确认", Value = ((int)OrderState.Confirmed).ToString() }); itemList.Add(new SelectListItem() { Text = "备货中", Value = ((int)OrderState.PreProducting).ToString() }); itemList.Add(new SelectListItem() { Text = "已发货", Value = ((int)OrderState.Sended).ToString() }); itemList.Add(new SelectListItem() { Text = "已完成", Value = ((int)OrderState.Completed).ToString() }); itemList.Add(new SelectListItem() { Text = "已锁定", Value = ((int)OrderState.Locked).ToString() }); itemList.Add(new SelectListItem() { Text = "已取消", Value = ((int)OrderState.Cancelled).ToString() }); itemList.Add(new SelectListItem() { Text = "已退货", Value = ((int)OrderState.Returned).ToString() }); ViewData["orderStateList"] = itemList; return(View(model)); }