From de88dbc3831e5da61a0c706ba07522e37d5c469c Mon Sep 17 00:00:00 2001 From: Sai Date: Wed, 11 Oct 2023 14:41:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E8=B3=87=E6=96=99=E7=B6=AD=E8=AD=B7=20=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E8=B3=87=E8=A8=8AOS=E7=89=88=E6=9C=AC=E6=9C=89E158=E7=9B=B8?= =?UTF-8?q?=E9=97=9C=E9=96=8B=E9=A0=AD=20T3=E6=8E=83=E6=AF=92=E6=89=93?= =?UTF-8?q?=E5=8B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 11 - AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 109 ++++++--- AMESCoreStudio.Web/Views/PCS/PCS034.cshtml | 215 ++++++++++-------- .../Controllers/BLL/BarCodeCheckController.cs | 17 +- 4 files changed, 214 insertions(+), 138 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 23cfcaf1..6440ca27 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -2623,17 +2623,6 @@ namespace AMESCoreStudio.Web.Controllers model.wipSystem.Engineer_Name = UserInof.UserName; } } - // 判斷是否預設打勾掃毒 - else - { - var AntivirusItemNo = new List { "E1582", "E1583", "E1584", "E1585", "E1586", - "E1587","E1588","E1589","E158C"}; - if (AntivirusItemNo.Any(item => model.wipAtt.ItemNO.StartsWith(item))) - { - model.wipSystem = new WipSystem(); - model.wipSystem.Antivirus = "Y"; - } - } model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index a5f3a05d..49633912 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -519,9 +519,18 @@
- - - + + +
@@ -537,7 +546,10 @@
- +
@@ -558,7 +570,10 @@
- +
@@ -571,7 +586,10 @@
- +
@@ -587,7 +605,10 @@
- +
@@ -875,8 +896,11 @@
- +
@@ -897,7 +921,10 @@
- +
@@ -1013,8 +1040,8 @@ SOP文件敘述 @* - 檔案路徑 - *@ + 檔案路徑 + *@ SOP類型 @@ -1038,8 +1065,8 @@ @* - - *@ + + *@ @@ -1269,27 +1296,27 @@ } - $.ajax({ - url: '@Url.Action("GetBarcodeOther", "PCS")', - dataType: 'json', - data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, - cache: false, - type: "POST", - success: function (result) { - // 錯誤訊息 - if (!result.success) { - parent.hg.msg(result.msg); - } - else { - var contactdiv = `${result.data.startNO}${result.data.endNO}`; - $('#wipBarcodeOtherTable').append(contactdiv); - $("#barcodeOtherDiv").hide(); - } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("Found error when using Ajax!!"); + $.ajax({ + url: '@Url.Action("GetBarcodeOther", "PCS")', + dataType: 'json', + data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, + cache: false, + type: "POST", + success: function (result) { + // 錯誤訊息 + if (!result.success) { + parent.hg.msg(result.msg); } - }); + else { + var contactdiv = `${result.data.startNO}${result.data.endNO}`; + $('#wipBarcodeOtherTable').append(contactdiv); + $("#barcodeOtherDiv").hide(); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + alert("Found error when using Ajax!!"); + } + }); }); // 產生MAC @@ -1416,6 +1443,18 @@ form.on('select(lind)', function (data) { $("#lindId").val(data.value); }); + + $("#wipSystem_OsVer").on("input", function () { + var value = $(this).val().trim().toUpperCase(); + if (value.startsWith("E1582") || value.startsWith("E1583") || value.startsWith("E1584") || + value.startsWith("E1585") || value.startsWith("E1586") || value.startsWith("E1587") || + value.startsWith("E1588") || value.startsWith("E1589") || value.startsWith("E158C")) { + $("#wipSystem_Antivirus").prop("checked", true); + } else { + $("#wipSystem_Antivirus").prop("checked", false); + } + form.render(); + }); }); //通过行tool编辑,lay-event="show" @@ -2049,5 +2088,7 @@ } }); } + + } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml index 8bec0871..08036d14 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml @@ -501,9 +501,18 @@
- - - + + +
@@ -519,7 +528,10 @@
- +
@@ -540,7 +552,10 @@
- +
@@ -553,7 +568,10 @@
- +
@@ -569,7 +587,10 @@
- +
@@ -857,8 +878,11 @@
- +
@@ -879,7 +903,10 @@
- +
@@ -995,8 +1022,8 @@ SOP文件敘述 @* - 檔案路徑 - *@ + 檔案路徑 + *@ SOP類型 @@ -1020,8 +1047,8 @@ @* - - *@ + + *@ @@ -1213,7 +1240,7 @@ }); - // 產生出貨序號 + // 產生出貨序號 $("#GetBarcodeOther").click(function (event) { var itemNo = $('#wipAtt_ItemNO').val(); var planQTY = $('#wipInfo_PlanQTY').val(); @@ -1240,31 +1267,31 @@ } - $.ajax({ - url: '@Url.Action("GetBarcodeOther", "PCS")', - dataType: 'json', - data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, - cache: false, - type: "POST", - success: function (result) { - // 錯誤訊息 - if (!result.success) { - parent.hg.msg(result.msg); - } - else { - var contactdiv = `${result.data.startNO}${result.data.endNO}`; - $('#wipBarcodeOtherTable').append(contactdiv); - $("#barcodeOtherDiv").hide(); - } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("Found error when using Ajax!!"); + $.ajax({ + url: '@Url.Action("GetBarcodeOther", "PCS")', + dataType: 'json', + data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, + cache: false, + type: "POST", + success: function (result) { + // 錯誤訊息 + if (!result.success) { + parent.hg.msg(result.msg); } - }); + else { + var contactdiv = `${result.data.startNO}${result.data.endNO}`; + $('#wipBarcodeOtherTable').append(contactdiv); + $("#barcodeOtherDiv").hide(); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + alert("Found error when using Ajax!!"); + } + }); }); // 產生MAC - $("#GetMAC").click(function (event) { + $("#GetMAC").click(function (event) { var wipNO = $('#wipAtt_ItemNO').val(); var planQTY = $('#wipInfo_PlanQTY').val(); if (wipNO == '' || !wipNO) { @@ -1373,7 +1400,17 @@ RuleStation(data.value); }); - + $("#wipSystem_OsVer").on("input", function () { + var value = $(this).val().trim().toUpperCase(); + if (value.startsWith("E1582") || value.startsWith("E1583") || value.startsWith("E1584") || + value.startsWith("E1585") || value.startsWith("E1586") || value.startsWith("E1587") || + value.startsWith("E1588") || value.startsWith("E1589") || value.startsWith("E158C")) { + $("#wipSystem_Antivirus").prop("checked", true); + } else { + $("#wipSystem_Antivirus").prop("checked", false); + } + form.render(); + }); }); //通过行tool编辑,lay-event="show" @@ -1791,7 +1828,7 @@ return b; } - // 更新ECN or ECR + // 更新ECN or ECR function GetPLM_ECN() { $.ajax({ url: "@Url.Action("GetItApiEcnByWipNo", "PCS")", @@ -1799,7 +1836,7 @@ async: true, data: { "wipNo": '@Model.wipInfo.WipNO' }, success: function (result) { - if (result.success) { + if (result.success) { if (result.data.changE_NO == null) { hg.msghide("查無資料,不需要更新!"); } @@ -1858,58 +1895,58 @@ 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");//重新渲染 固定写法 - } - else { - hg.msg("同步SOP失敗:" + result.data); + $('#WipSopCount').val(No); + layui.form.render("select");//重新渲染 固定写法 + } + else { + hg.msg("同步SOP失敗:" + result.data); + } + }, + error: function () { + hg.msg("同步SOP失敗"); } - }, - error: function () { - hg.msg("同步SOP失敗"); - } - }); + }); layer.closeAll('dialog'); }) } diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index b9261a54..f7d07aab 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -2522,13 +2522,22 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (wipInfo != null) { int wipID = wipInfo.WipID; - BarcodeInfoesController barcodeInfoesController = new BarcodeInfoesController(_context); - var barcodeInfos = await barcodeInfoesController.GetBarcodeInfoesByWipID(wipID); + // 取Rules 最後一站為完工站的Station及狀態 + var rules = await _context.Ruleses.Where(w => w.FlowRuleID == wipInfo.FlowRuleID).ToListAsync(); + var lastStation = rules.Where(w => w.NextStationID == 1000).Select(s => new { s.StationID, s.RuleStatus }).ToList(); + + var barcodeStations = await _context.BarcodeStation.Where(w => w.WipID == wipID).ToListAsync(); + // ByLastStation Count = 工單數 (完工) + var closeWipQty = 0; // 比對過站Station完工跟工單數一樣 = 完工 + foreach (var item in lastStation) + { + closeWipQty += barcodeStations.Where(w => item.StationID == w.StationID && item.RuleStatus == w.RuleStatus) + .Select(s => s.BarcodeID).Distinct().Count(); + } - if (wipInfo.PlanQTY == - barcodeInfos.Value.Where(w => w.RuleStatus == "P" && w.StationID == stationID).Count()) + if (wipInfo.PlanQTY == closeWipQty) { var result = await wipInfosController.PutWipinfoToStatusNO(wipID, "E"); if (!result.Success)