From 5c57bc1ad77494c42f6f57c55503f317bf117589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Wed, 15 Sep 2021 15:59:47 +0000 Subject: [PATCH] =?UTF-8?q?!132=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E5=88=97=E8=A1=A8=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=EF=BC=8C=E7=B1=BB=E5=9E=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E9=87=8D=E5=A4=8D=E5=87=BA=E6=98=BE?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=86=E7=B1=BB=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E8=AE=A2=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=EF=BC=8C=E5=AF=B9=E4=BA=8E=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=88=A0=E9=99=A4=E7=9A=84=E8=AE=A2=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=8C=89=E9=92=AE=E5=87=BA=E7=8E=B0=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=20*=201=E3=80=81?= =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E5=B9=BF=E5=91=8A=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=87=BA=E6=98=BE=E6=96=87=E7=AB=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E9=97=AE=E9=A2=98=E3=80=82=20#I4A5UO=EF=BC=9B2?= =?UTF-8?q?=E3=80=81=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8=EF=BC=8C=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=88=A0=E9=99=A4=E7=9A=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E8=BF=98=E5=8E=9F=E6=8C=89=E9=92=AE=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreCms.Net.Configuration/GlobalEnumVars.cs | 2 +- .../Order/CoreCmsOrderController.cs | 28 +++++++++++++++++++ .../wwwroot/views/order/orders/index.html | 20 +++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) 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) {