diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index ef01aca6..5647d913 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -874,6 +874,11 @@ namespace AMESCoreStudio.Web.Controllers { Text = "驗證工單", Value = "1", + }, + new SelectListItem + { + Text = "ECN", + Value = "2", }, new SelectListItem { @@ -1399,7 +1404,6 @@ namespace AMESCoreStudio.Web.Controllers return Json(new { data = items }); } - /// /// 取出貨序號 取到資料先儲存出貨序號 /// @@ -1523,6 +1527,18 @@ namespace AMESCoreStudio.Web.Controllers } + /// + /// 取It提供的工單EAN + /// + /// 工單號碼 + /// + [HttpPost] + public async Task GetKpDbCount(string wipNo) + { + var result = await _pcsApi.GetWipKpByWipNo(wipNo); + return Json(new Result() { success = true, data = result.Count() }); + + } #endregion ///// @@ -5952,7 +5968,7 @@ namespace AMESCoreStudio.Web.Controllers string Msg = string.Empty; bool Success = true; - if(string.IsNullOrWhiteSpace(model.Input)) + if (string.IsNullOrWhiteSpace(model.Input)) return Json(new Result1() { success = Success, msg = Msg, data = "", data1 = "" }); string Data = model.Input.ToUpper(); @@ -7347,9 +7363,9 @@ namespace AMESCoreStudio.Web.Controllers IResultModel result; if (factority == "1") { - result = await _pcsApi.GetFqcInhouseMasterMultiQuery(barcodeNo: barcodeNo, wipNo: wipNo - , boxNo: boxNo, inhouseNo: inhouseNo, date_str: date_str, date_end: date_end - , status: status, page: page, limit: limit); + result = await _pcsApi.GetFqcInhouseMasterMultiQuery(barcodeNo: barcodeNo, wipNo: wipNo + , boxNo: boxNo, inhouseNo: inhouseNo, date_str: date_str, date_end: date_end + , status: status, page: page, limit: limit); } else @@ -7426,7 +7442,7 @@ namespace AMESCoreStudio.Web.Controllers } } - public async Task PCS031inhouseAsync(string InhouseNo, string boxNo, int seq, string recordNumber, string locationNo,string factorityID) + public async Task PCS031inhouseAsync(string InhouseNo, string boxNo, int seq, string recordNumber, string locationNo, string factorityID) { var result = await PCS0311inhouse(InhouseNo, boxNo, seq, recordNumber, locationNo, factorityID); return Json(new Result() { success = result.success, msg = result.msg }); @@ -7447,11 +7463,11 @@ namespace AMESCoreStudio.Web.Controllers var result1 = new List(); if (factorityID == "1") { - result1 = await _pcsApi.GetWareHouseing(inhouseNo: InhouseNo, seq: seq); + result1 = await _pcsApi.GetWareHouseing(inhouseNo: InhouseNo, seq: seq); } else { - result1 = await _pcsApi.GetWareHouseing_EVER(inhouseNo: InhouseNo, seq: seq); + result1 = await _pcsApi.GetWareHouseing_EVER(inhouseNo: InhouseNo, seq: seq); } if (result1.Count() > 0) @@ -7465,11 +7481,11 @@ namespace AMESCoreStudio.Web.Controllers var result = new List(); if (factorityID == "1") { - result = await _fqcApi.GetBarcodeInfoesByBoxNo(boxNo: boxNo); + result = await _fqcApi.GetBarcodeInfoesByBoxNo(boxNo: boxNo); } else { - result = await _pcsApi.GetBarcodeInfoesByBoxNo_EVER(boxNo: boxNo); + result = await _pcsApi.GetBarcodeInfoesByBoxNo_EVER(boxNo: boxNo); } if (result.Count() != 0) @@ -7530,7 +7546,7 @@ namespace AMESCoreStudio.Web.Controllers var FlowRules_result = new List(); if (factorityID == "1") { - FlowRules_result = await _basApi.GetFlowRulesByUnit("W"); + FlowRules_result = await _basApi.GetFlowRulesByUnit("W"); } else { @@ -7543,11 +7559,11 @@ namespace AMESCoreStudio.Web.Controllers var ruleStations_result = new List(); if (factorityID == "1") { - ruleStations_result = await GetRuleStationByFlowRuleID(FlowRuleID); + ruleStations_result = await GetRuleStationByFlowRuleID(FlowRuleID); } else { - ruleStations_result = await GetRuleStationByFlowRuleID_EVER(FlowRuleID); + ruleStations_result = await GetRuleStationByFlowRuleID_EVER(FlowRuleID); } if (ruleStations_result.Count() != 0) @@ -7568,16 +7584,16 @@ namespace AMESCoreStudio.Web.Controllers var WipAtt_result = new WipAtt(); if (factorityID == "1") { - WipAtt_result = await _pcsApi.GetWipAtt(Wipinfo_result.Select(s => s.WipNO).First()); //料號 + WipAtt_result = await _pcsApi.GetWipAtt(Wipinfo_result.Select(s => s.WipNO).First()); //料號 } else { - WipAtt_result = await _pcsApi.GetWipAtt_EVER(Wipinfo_result.Select(s => s.WipNO).First()); //料號 + WipAtt_result = await _pcsApi.GetWipAtt_EVER(Wipinfo_result.Select(s => s.WipNO).First()); //料號 } - var Userinfo_result = new List(); + var Userinfo_result = new List(); if (factorityID == "1") { - Userinfo_result = await _sysApi.GetUserInfo(GetLogInUserID()); + Userinfo_result = await _sysApi.GetUserInfo(GetLogInUserID()); } else { @@ -7589,23 +7605,23 @@ namespace AMESCoreStudio.Web.Controllers var fqcInhouseMaster = new FqcInhouseMaster(); if (factorityID == "1") { - fqcInhouseMaster = await _fqcApi.GetFqcInhouseMaster(InhouseNo, seq); + fqcInhouseMaster = await _fqcApi.GetFqcInhouseMaster(InhouseNo, seq); } else { - fqcInhouseMaster = await _pcsApi.GetFqcInhouseMaster_EVER(InhouseNo, seq); + fqcInhouseMaster = await _pcsApi.GetFqcInhouseMaster_EVER(InhouseNo, seq); } fqcInhouseMaster.LocationNo = locationNo; - var result_FQC = new ResultModel(); + var result_FQC = new ResultModel(); if (factorityID == "1") { - result_FQC = await _fqcApi.PutFqcInhouseMaster(JsonConvert.SerializeObject(fqcInhouseMaster)); + result_FQC = await _fqcApi.PutFqcInhouseMaster(JsonConvert.SerializeObject(fqcInhouseMaster)); } else { - result_FQC = await _pcsApi.PutFqcInhouseMaster_EVER(JsonConvert.SerializeObject(fqcInhouseMaster)); + result_FQC = await _pcsApi.PutFqcInhouseMaster_EVER(JsonConvert.SerializeObject(fqcInhouseMaster)); } if (!result_FQC.Success) @@ -7770,22 +7786,22 @@ namespace AMESCoreStudio.Web.Controllers #endregion #region PCS031V入庫單箱號查詢 - public async Task PCS031V(string Factory_API,string InhouseNo, int SeqID) + public async Task PCS031V(string Factory_API, string InhouseNo, int SeqID) { var model = new FqcDto(); model.InhouseNo = InhouseNo;// "QWO0002A1001"; model.SeqID = SeqID; - + IResultModel result; if (Factory_API == "1") { result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); } - else + else { result = await _pcsApi.GetFqcQuery_EVER(model.InhouseNo, model.SeqID); } - + if (result.Data.Count() != 0) { model = result.Data.FirstOrDefault(); @@ -7824,7 +7840,7 @@ namespace AMESCoreStudio.Web.Controllers { result = await _pcsApi.GetFqcQuery_EVER(model.InhouseNo, model.SeqID); } - + if (result.Data.Count() != 0) { @@ -7847,7 +7863,7 @@ namespace AMESCoreStudio.Web.Controllers #region PCS031Q入庫單箱號查詢 // [HttpGet] - public async Task PCS031Q(string BoxNo,string factorityID) + public async Task PCS031Q(string BoxNo, string factorityID) { @@ -7885,7 +7901,7 @@ namespace AMESCoreStudio.Web.Controllers if (factorityID == "1") { - result = await _pcsApi.GetBarcodeInfoesByBoxNoPCS031Q(boxNo: id, page: page, limit: limit); + result = await _pcsApi.GetBarcodeInfoesByBoxNoPCS031Q(boxNo: id, page: page, limit: limit); } else { diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 9f2ab409..5c4de706 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -250,14 +250,14 @@ @foreach (var index in Model.wipBarcodes) { - - - @index.StartNO - - - @index.EndNO - - + + + @index.StartNO + + + @index.EndNO + + } @@ -309,14 +309,14 @@ @foreach (var index in Model.wipMACs) { - - - @index.Title@index.StartNO - - - @index.Title@index.EndNO - - + + + @index.Title@index.StartNO + + + @index.Title@index.EndNO + + } @@ -346,6 +346,11 @@ + 確認筆數: + + + + @@ -381,30 +386,30 @@ @foreach (var index in Model.WipKps) { - - - - - - - - - - - - - - - - - - - - - - 刪除 - - + + + + + + + + + + + + + + + + + + + + + + 刪除 + + k++; } @@ -455,11 +460,11 @@ @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) { - 有維護標準工時 + 有維護標準工時 } else { - **無維護標準工時** + **無維護標準工時** } @@ -502,9 +507,18 @@
- - - + + +
@@ -520,7 +534,10 @@
- +
@@ -541,7 +558,10 @@
- +
@@ -554,7 +574,10 @@
- +
@@ -570,7 +593,10 @@
- +
@@ -700,11 +726,11 @@ @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) { - 有維護標準工時 + 有維護標準工時 } else { - **無維護標準工時** + **無維護標準工時** }
@@ -878,7 +904,10 @@
- +
@@ -952,23 +981,23 @@ @foreach (var index in Model.WipOutfits) { - + - - - - - - - - - - - - - 刪除 - - + + + + + + + + + + + + + 刪除 + + l++; } @@ -994,8 +1023,8 @@ SOP文件敘述 @* - 檔案路徑 - *@ + 檔案路徑 + *@ SOP類型 @@ -1013,27 +1042,27 @@ @foreach (var index in Model.WipSops) { - - - - - - @* - - *@ - - - - - - - - - - - 刪除 - - + + + + + + @* + + *@ + + + + + + + + + + + 刪除 + + i++; } @@ -1105,23 +1134,23 @@ @foreach (var index in Model.wipInfoBlobs) { - - - @index.ImageName - - - @index.Filepath - - - @index.Remark + + + @index.ImageName + + + @index.Filepath + + + @index.Remark - - - 預覽 - 下載 - 刪除 - - + + + 預覽 + 下載 + 刪除 + + } @@ -1340,7 +1369,7 @@ }); // 產生MAC - $("#GetMAC").click(function (event) { + $("#GetMAC").click(function (event) { var wipNO = $('#wipAtt_ItemNO').val(); var planQTY = $('#wipInfo_PlanQTY').val(); if (wipNO == '' || !wipNO) { @@ -1970,18 +1999,18 @@ hg.msghide("查無資料,不需要更新!"); } else { - var result_data = result.data.eaN_NO; - console.log(result_data.eaN_NO); - if (result_data.length == 0) { - hg.msghide("不需要更新!"); - } - else if ('@Model.wipAtt.ECN' != result_data) { - layer.confirm('比對與PLM ECN/ECR不一樣,確定更新ECN/ECR嗎?', { - btn: ['確定', '取消'] - }, function () { - layer.closeAll('dialog'); - $("#wipAtt_ECN").val(result_data); - }) + var result_data = result.data.eaN_NO; + console.log(result_data.eaN_NO); + if (result_data.length == 0) { + hg.msghide("不需要更新!"); + } + else if ('@Model.wipAtt.ECN' != result_data) { + layer.confirm('比對與PLM ECN/ECR不一樣,確定更新ECN/ECR嗎?', { + btn: ['確定', '取消'] + }, function () { + layer.closeAll('dialog'); + $("#wipAtt_ECN").val(result_data); + }) } } } @@ -2024,59 +2053,77 @@ layer.confirm('確定要同步料號SOP資料嗎?', { btn: ['確定', '取消'] }, function () { - $.ajax({ - type: "POST", - url: "@Url.Action("GetMaterialSop", "PCS")", - type: "Post", - async: true, - data: { "ItemNo": '@Model.wipAtt.ItemNO' }, - success: function (result) { - if (result.success) { - let No = 0; - var Unit = getFactoryUnitByWipNoList(); - var SopType = getSOPType(); - $("#SopTable").find("tr:not(:first)").remove(); - $.each(result.data, function (index, item) { - var FactoryUnit = Unit; - var Select = "'; - var SoptypeItem = SopType; - var SelectSoptype = ""; + $.each(FactoryUnit, function (index, item1) { + if (item1.value == item.unitNo) { + Select += ''; + } + }); + Select += ''; + var SoptypeItem = SopType; + var SelectSoptype = "'; + var contactdiv = '' + + '' + + '' + + '' + SelectSoptype + '' + + '' + Select + '' + + ' ' + + '刪除' + + ''; + $('#SopTable').append(contactdiv); + No += 1; }); - SelectSoptype += ''; - var contactdiv = '' + - '' + - '' + - '' + SelectSoptype + '' + - '' + Select + '' + - ' ' + - '刪除' + - ''; - $('#SopTable').append(contactdiv); - No += 1; - }); - $('#WipSopCount').val(No); - layui.form.render("select");//重新渲染 固定写法 + $('#WipSopCount').val(No); + layui.form.render("select");//重新渲染 固定写法 + } + else { + hg.msg("同步SOP失敗:" + result.data); + } + }, + error: function () { + hg.msg("同步SOP失敗"); } - else { - hg.msg("同步SOP失敗:" + result.data); + }); + layer.closeAll('dialog'); + }) + } + + // 抓DB目前KP數量 + function GetKpDbCount() { + $.ajax({ + url: "@Url.Action("GetKpDbCount", "PCS")", + type: "Post", + async: true, + data: { "wipNo": '@Model.wipInfo.WipNO' }, + success: function (result) { + if (result.success) { + $("#wipKpDbCount").val(result.data); } }, - error: function () { - hg.msg("同步SOP失敗"); + error: function (result) { + parent.hg.msg(`呼叫API失敗`); } }); - layer.closeAll('dialog'); - }) } }