diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index 1c55591..ffab8eb 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -1641,7 +1641,7 @@ namespace CoreCms.Net.Configuration /// 智能表单 /// [Description("智能表单")] - IntelligenceForm = 4 + IntelligenceForm = 5 } /// diff --git a/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs b/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs index a7bd65e..106c2f0 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs @@ -696,6 +696,34 @@ namespace CoreCms.Net.Web.Admin.Controllers } #endregion + #region 还原订单============================================================ + // POST: Api/CoreCmsOrder/DoRestore/10 + /// + /// 还原订单 + /// + /// + /// + [HttpPost] + [Description("还原订单")] + public async Task DoRestore([FromBody] FMStringId entity) + { + var jm = new AdminUiCallBack(); + + var model = await _coreCmsOrderServices.QueryByIdAsync(entity.id); + if (model == null) + { + jm.msg = GlobalConstVars.DataisNo; + return Json(jm); + } + //还原 + var bl = await _coreCmsOrderServices.UpdateAsync(p => new CoreCmsOrder() { isdel = false }, p => p.orderId == model.orderId); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + return Json(jm); + + } + #endregion + #region 判断是否存在售后============================================================ // POST: Api/CoreCmsOrder/GetDoHaveAfterSale/10 /// diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html index fb2b52b..b6977e4 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html @@ -492,6 +492,11 @@ var id = $(this).attr('data-id'); delOrder(id); }, + //还原订单 + restoreOrder: function () { + var id = $(this).attr('data-id'); + restoreOrder(id); + }, //打印购物订单 shoppingPrint: function () { var id = $(this).attr('data-id'); @@ -565,6 +570,21 @@ } }); } + + //还原订单 + function restoreOrder(id) { + layer.confirm('确认还原:' + id + ' 的订单吗?', { + title: '提示', btn: ['确认', '取消'] //按钮 + }, function () { + coreHelper.Post("Api/CoreCmsOrder/DoRestore", { id: id }, function (e) { + layer.msg(e.msg, { time: 1300 }, function () { + layui.table.reloadData('LAY-app-CoreCmsOrder-tableBox'); //重载表格 + doreLoadOrderCount(); + }); + }); + }); + return false; + } //秒发货 function doSecondsShip(id) {