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();