diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index d1a2b30d..0b82f9b4 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -349,6 +349,24 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.FactoryUnitList = FactoryUnit; } + private async Task GetFactoryUnit(string unit_no) + { + var result = await _basApi.GetFactoryUnit(unit_no); + + var FactoryUnit = new List(); + for (int i = 0; i < result.Count; i++) + { + FactoryUnit.Add(new SelectListItem(result[i].UnitName, result[i].UnitNo.ToString())); + } + + if (FactoryUnit.Count == 0) + { + FactoryUnit.Add(new SelectListItem("N/A", null)); + } + + ViewBag.FactoryUnitList = FactoryUnit; + } + /// /// 組件資料 /// @@ -2770,9 +2788,19 @@ namespace AMESCoreStudio.Web.Controllers #endregion #region PCS005 工單資料查詢 - public async Task PCS005() + public async Task PCS005(string id) { - await GetFactoryUnit(); + if (id != null) + { + await GetFactoryUnit(id); + ViewBag.UnitNo = id; + } + else + { + await GetFactoryUnit(); + } + + //await GetFactoryUnit(); return View(); } @@ -2785,6 +2813,15 @@ namespace AMESCoreStudio.Web.Controllers /// public async Task PCS005QueryAsync(string unitno, string wipNo, string itemNo, int page = 0, int limit = 10) { + if (unitno == null) + { + string unit_no = Request.Path.ToString().Replace("/PCS/PCS005Query/", ""); + if (unit_no != "") + { + unitno = unit_no; + } + } + IResultModel result = await _pcsApi.GetWipInfoSelectParameter(unitno: unitno , wipno: wipNo , itemno: itemNo @@ -2827,9 +2864,19 @@ namespace AMESCoreStudio.Web.Controllers #region PCS006 工單開線收線作業 [ResponseCache(Duration = 0)] [HttpGet] - public async Task PCS006() + public async Task PCS006(string id) { - await GetFactoryUnit(); + if (id != null) + { + await GetFactoryUnit(id); + ViewBag.UnitNo = id; + } + else + { + await GetFactoryUnit(); + } + + //await GetFactoryUnit(); return View(); } @@ -2841,6 +2888,15 @@ namespace AMESCoreStudio.Web.Controllers [HttpGet] public async Task PCS006QueryAsync(string unitno, string wipno, int page = 0, int limit = 10) { + if (unitno == null) + { + string unit_no = Request.Path.ToString().Replace("/PCS/PCS006Query/", ""); + if (unit_no != "") + { + unitno = unit_no; + } + } + // 工單基本資料 IResultModel result = await _pcsApi.GetWipInfoSelectParameter(unitno: unitno , wipno: wipno @@ -4245,9 +4301,18 @@ namespace AMESCoreStudio.Web.Controllers #region PCS024條碼組件维护相关 - public async Task PCS024() + public async Task PCS024(string id) { - await GetFactoryUnit(); + if (id != null) + { + await GetFactoryUnit(id); + ViewBag.UnitNo = id; + } + else + { + await GetFactoryUnit(); + } + //await GetFactoryUnit(); return View(); } //新增頁面 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml index d561a4e1..5cd20ed0 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml @@ -45,8 +45,8 @@
+
@@ -204,7 +204,7 @@ } ]; //基本数据表格 - var table = hg.table.datatable('query', '工單資料查詢', '/PCS/PCS005Query', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('query', '工單資料查詢', '/PCS/PCS005Query/' + unitNo.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); $(document).off('mousedown', '.layui-table-grid-down'). on('mousedown', '.layui-table-grid-down', function (event) { diff --git a/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml index 620b02a4..43cd3312 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml @@ -35,9 +35,8 @@
- +
@@ -214,7 +213,7 @@ //基本数据表格 - var table = hg.table.datatable('test', '條碼狀態維護', '/PCS/PCS006Query', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', '條碼狀態維護', '/PCS/PCS006Query/' + unitNo.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); // var table = hg.table.datatable('test', '條碼狀態維護', '/PCS/GetWipInfo', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/PCS/PCS024.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS024.cshtml index d7f6e7c2..56af9284 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS024.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS024.cshtml @@ -18,10 +18,9 @@
- +