From 63c5c1889fa6f74aa55e462353f4fe97548f4016 Mon Sep 17 00:00:00 2001 From: Yiru Date: Wed, 10 Apr 2024 22:12:04 +0800 Subject: [PATCH] =?UTF-8?q?Label=20=E9=9C=80=E5=A1=AB=E5=AF=AB=E6=AC=84?= =?UTF-8?q?=E4=BD=8D=E5=A2=9E=E5=8A=A0=E7=8B=80=E6=85=8B=E7=AF=A9=E9=81=B8?= =?UTF-8?q?=E6=A2=9D=E4=BB=B6=20Label=20=E6=96=99=E8=99=9F=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=9F=A5=E8=A9=A2=E6=94=B9=E7=82=BA%201R%=20LabeL002?= =?UTF-8?q?=20=E5=8A=A0=E5=A4=A7=E5=82=99=E8=A8=BB=E6=AC=84=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LABController.cs | 4 +-- AMESCoreStudio.Web/HttpApis/AMES/ILAB.cs | 7 ++++++ AMESCoreStudio.Web/Views/LAB/LAB001.cshtml | 19 +++++++++++++- AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml | 5 +++- AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml | 10 +++----- .../Controllers/AMES/LabelParamController.cs | 25 +++++++++++++++++++ .../AMES/LabelTemplateMasterController.cs | 2 +- 7 files changed, 61 insertions(+), 11 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/LABController.cs b/AMESCoreStudio.Web/Controllers/LABController.cs index e4f7d32c..b9666754 100644 --- a/AMESCoreStudio.Web/Controllers/LABController.cs +++ b/AMESCoreStudio.Web/Controllers/LABController.cs @@ -147,9 +147,9 @@ namespace AMESCoreStudio.Web.Controllers [ResponseCache(Duration = 0)] [HttpGet] - public async Task GetLabParamsAsync(int page = 0, int limit = 10) + public async Task GetLabParamsAsync(string status = "*" ,int page = 0, int limit = 10) { - var result = await _labApi.GetLabParamsByLabelID(page, limit); + var result = await _labApi.GetLabParamsByStatus(status,page, limit); if (result.Data.Count() > 0) { diff --git a/AMESCoreStudio.Web/HttpApis/AMES/ILAB.cs b/AMESCoreStudio.Web/HttpApis/AMES/ILAB.cs index a6865718..91806b75 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/ILAB.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/ILAB.cs @@ -98,6 +98,13 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/LabelParam/byLabelID/{id}")] ITask> GetLabParamsByLabelID(int page = 0, int limit = 10); + /// + /// 獲取Label 全部參數資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/LabelParam/byStatus/{status}")] + ITask> GetLabParamsByStatus(string status,int page = 0, int limit = 10); + /// /// Label 參數儲存 /// diff --git a/AMESCoreStudio.Web/Views/LAB/LAB001.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB001.cshtml index fdc216f9..2c71fb62 100644 --- a/AMESCoreStudio.Web/Views/LAB/LAB001.cshtml +++ b/AMESCoreStudio.Web/Views/LAB/LAB001.cshtml @@ -9,6 +9,23 @@
@ViewBag.Title
+
+
+ +
+ +
+
+
+ +
+
@@ -73,7 +90,7 @@ } ]; //基本数据表格 - var table = hg.table.datatable('test', 'Label 需填寫欄位', '/LAB/GetLabParams', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', 'Label 需填寫欄位', '/LAB/GetLabParams' , {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml index f6c8efa0..fce5d2c2 100644 --- a/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml +++ b/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml @@ -63,9 +63,12 @@
- +
+ + +
diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml index fb13e752..e98730fa 100644 --- a/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml +++ b/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml @@ -59,12 +59,10 @@
-
-
- - - -
+
+ + +
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs index d4bf6103..f910b5a5 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs @@ -73,6 +73,31 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } + // GET: api/LabelParam/5 + [HttpGet("byStatus/{status}")] + public async Task> GetLabelParambyStatus(string status, int page = 0, int limit = 10) + { + ResultModel result = new ResultModel(); + IQueryable q = _context.LabelParam; + if (status != "*") + { + q = q.Where(w => w.STATUS_NO == status); + + } + result.DataTotal = q.Count(); + + // Table 頁數 + if (page > 0) + { + q = q.Skip((page - 1) * limit).Take(limit); + } + + result.Data = await q.ToListAsync(); + + return result; + } + + /// /// 更新Label參數檔 /// diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs index 48537dd4..bbc533f5 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs @@ -145,7 +145,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (!string.IsNullOrEmpty(LabelMatnr) && LabelMatnr != "*") { - q = q.Where(w => w.LABEL_MATNR.StartsWith(LabelMatnr)); + q = q.Where(w => w.LABEL_MATNR.Contains(LabelMatnr)); } result.DataTotal = q.Count();