From 49078aaf0ed076434159100892bff875d5edc0f8 Mon Sep 17 00:00:00 2001 From: zgf Date: Tue, 5 Sep 2023 20:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0hiprint=20=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Configs/Controllers/PrintController.cs | 34 +++- .../Areas/Configs/Views/Print/Index.cshtml | 190 +++++++++++------- HHWMS.Web/Views/Shared/_Layout.cshtml | 11 +- 3 files changed, 159 insertions(+), 76 deletions(-) diff --git a/HHWMS.Web/Areas/Configs/Controllers/PrintController.cs b/HHWMS.Web/Areas/Configs/Controllers/PrintController.cs index ee8904b..67b088d 100644 --- a/HHWMS.Web/Areas/Configs/Controllers/PrintController.cs +++ b/HHWMS.Web/Areas/Configs/Controllers/PrintController.cs @@ -30,6 +30,38 @@ namespace HHWMS.Web.Controllers } #endregion Search - + [HttpPost] + public ActionResult ScanCode(string code) + { + var material = _unitwork.FindSingle(x => x.QRCode.Equals(code)); + if (material == null) + { + return JsonMore(null, 500, $"二维码{code}不存在!"); + } + else + { + return JsonMore(null); + } + } + + [HttpPost] + public ActionResult GenCode(string code) + { + var material = _unitwork.FindSingle(x => x.QRCode.Equals(code)); + if (material == null) + { + return JsonMore(null, 500, $"二维码{code}不存在!"); + } + else + { + + var prefix = code.Split("@")[1].Substring(2); + var unique = _unitwork.GetSerialNumber(prefix, 8); + var uniqueCode = prefix + unique; + + material.UniqueCode = uniqueCode; + return JsonMore(uniqueCode); + } + } } } diff --git a/HHWMS.Web/Areas/Configs/Views/Print/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Print/Index.cshtml index 9da7e15..dd38600 100644 --- a/HHWMS.Web/Areas/Configs/Views/Print/Index.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Print/Index.cshtml @@ -1,86 +1,134 @@ - + + + + + + + 生成 + + +
+ @* 富文本 *@ + - 打印 + 打印
diff --git a/HHWMS.Web/Views/Shared/_Layout.cshtml b/HHWMS.Web/Views/Shared/_Layout.cshtml index 6f2dcb8..176b307 100644 --- a/HHWMS.Web/Views/Shared/_Layout.cshtml +++ b/HHWMS.Web/Views/Shared/_Layout.cshtml @@ -20,8 +20,10 @@ + - + + @@ -42,11 +44,12 @@ - - + + + - +