diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 23957efb..39e6731f 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1444,7 +1444,27 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } + /// + /// + /// + /// + /// + /// + /// + [ResponseCache(Duration = 0)] + [HttpPost] + public async Task GetRuleStationByFlow(int flow) + { + var result = await _pcsApi.GetRuleStationByFlow(flow); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = 0 }); + } + return Json(new Table() { count = 0, data = null }); + } + /// /// 回傳工單號碼相關資料 @@ -1511,8 +1531,28 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task PCS001NAsync(WipDataViewModel model, IFormFile formFile) + public async Task PCS001NAsync(WipDataViewModel model, string action, IFormFile formFile) { + await WipDataSelectAll(model.wipAtt.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO); + // 料號刷新 + if (action == "ItemNo") + { + var result_materialKP = await _pcsApi.GetMaterialKpByItemNo(model.wipAtt.ItemNO); + + foreach (var item in result_materialKP) + { + model.WipKps.Add(new WipKpDto + { + KpName = item.KpName, + KpNo = item.KpNo, + KpSeq = item.KpSeq, + Length = item.Length, + Title = item.Title + }); + } + return View(model); + } + await WipDataSelectAll(model.wipAtt.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO); return View(model); } @@ -2612,6 +2652,55 @@ namespace AMESCoreStudio.Web.Controllers } #endregion + #region PCS002 工單設定 + public async Task PCS002(string id) + { + if (id != null) + { + await GetFactoryUnit(id); + ViewBag.UnitNo = id; + } + else + { + await GetFactoryUnit(); + } + + //await GetFactoryUnit(); + return View(); + } + + /// + /// PCS005 Query + /// + /// 生產單位 + /// 工單號碼 + /// 料號 + /// + public async Task PCS002QueryAsync(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 + , page: page + , limit: limit); + + if (result.Data != null) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + return Json(new Table() { count = 0, data = null }); + } + #endregion + #region PCS004 工單條碼區間設定 [ResponseCache(Duration = 0)] [HttpGet] diff --git a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs index f6d3262c..c6562c90 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs @@ -51,7 +51,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS public IEnumerable materialSops { get; set; } - public IEnumerable WipKps { get; set; } + public List WipKps { get; set; } public IEnumerable WipOutfits { get; set; } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml index f1330c23..450b1926 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml @@ -30,17 +30,21 @@
- - + +
- +
- - + +
@@ -326,9 +330,6 @@ 長度 - - 生產單位代號 - @@ -339,7 +340,6 @@ { - @@ -354,9 +354,6 @@ - - - 刪除 @@ -365,9 +362,6 @@ } -
- -
@* 生產流程sheet *@ @@ -601,11 +595,12 @@ if (itemNo != '') { getFlowRuleList(data.value); } - + }); form.on('select(flow)', function (data) { $("#flowId").val(data.value); + RuleStation(data.value); }); form.on('select(lind)', function (data) { @@ -619,7 +614,7 @@ { url: "@Url.Action("GetMaterialFlowRuleJson", "PCS")", dataType: 'json', - data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#unitNos").val()}, + data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#unitNo").val()}, type: 'post', success: function (result) { @@ -673,7 +668,7 @@ { url: "@Url.Action("getMaterialFlowRuleRemark", "PCS")", dataType: 'json', - data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#unitNo").val(), "flowID": NewID }, + data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#unitNo").val(), "flowID": NewID }, type: 'post', success: function (result) { @@ -689,9 +684,6 @@ NewID = 0; } - var OldID = $("#flowId").val(); - - $("#rulestionOld").empty(); var tableCols_rule = [[ { field: 'unitNoName', @@ -723,7 +715,7 @@ sort: true },] ]; - var tableruleStation = hg.table.datatable('ruleStation', '', '/PCS/GetRuleStationByWipNo?wipNo=' + $("#wipInfo_WipNO").val() + '&newID='+NewID+'&oldID='+OldID , {}, tableCols_rule, '', false, 'full-100'); + var tableruleStation = hg.table.datatable('ruleStation', '', '/PCS/GetRuleStationByFlow/' + NewID , {}, tableCols_rule, '', false, 'full-100'); tableruleStation; } @@ -731,12 +723,6 @@ $('#KPTableAdd').click(); $('#KPTableAdd').on('click', function () { let No = parseInt($('#WipKpCount').val()); - var FactoryUnit = getFactoryUnitByWipNoList(); - var Select = "'; var Items = getItemsList(); var SelectKPNo = "' + '' + '' + - '' + Select + '' + '刪除' + ''; @@ -773,29 +758,6 @@ //table.deleteRow(row[0].rowIndex); }; - //生產單位By工單號碼選單 - function getFactoryUnitByWipNoList() - { - var a; - $.ajax( - { - url: "@Url.Action("GetFactoryUnitByWipNoJson", "PCS")", - dataType: 'json', - data: { "wipNo": $("#wipInfo_WipNO").val()}, - async:false, - type: 'post', - success: function (result) - { - a = result.data; - }, - error: function (result) - { - alert(result); - } - }); - return a; - }; - //KP Items 選單 function getItemsList() { diff --git a/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml new file mode 100644 index 00000000..53196f65 --- /dev/null +++ b/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml @@ -0,0 +1,210 @@ +@{ + ViewData["Title"] = "工單資料修改"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} +@using Microsoft.AspNetCore.Mvc.Localization +@inject IHtmlLocalizer sharedLocalizer + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 2443aaaf..5a80dae1 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -1421,8 +1421,6 @@ var OldID = $("#flowId").val(); - - $("#rulestionOld").empty(); var tableCols_rule = [[ {