From 55ae82b687266802b6c41dd028d546b579219fc2 Mon Sep 17 00:00:00 2001 From: Sai Date: Mon, 4 Sep 2023 16:52:26 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=AA=BF=E6=95=B4=E5=A4=96=E5=8C=85?= =?UTF-8?q?=E9=81=8E=E7=AB=99=E7=A8=8B=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/QRSController.cs | 51 +++++++++------ AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml | 2 +- AMESCoreStudio.Web/Views/PCS/PCS021.cshtml | 14 ---- AMESCoreStudio.Web/Views/QRS/QRS021.cshtml | 65 ++++++++++++++++++- 4 files changed, 93 insertions(+), 39 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/QRSController.cs b/AMESCoreStudio.Web/Controllers/QRSController.cs index 427e42f3..0d6cc5b4 100644 --- a/AMESCoreStudio.Web/Controllers/QRSController.cs +++ b/AMESCoreStudio.Web/Controllers/QRSController.cs @@ -10378,6 +10378,10 @@ namespace AMESCoreStudio.Web.Controllers // ResultModel string Msg = string.Empty; bool Success = true; + + if (string.IsNullOrWhiteSpace(model.Input)) + return Json(new Result1() { success = Success, msg = Msg, data = "", data1 = "" }); + string Data = model.Input; // 刷入條碼+異常欄位 if (!string.IsNullOrWhiteSpace(model.InputNo)) @@ -10561,17 +10565,24 @@ namespace AMESCoreStudio.Web.Controllers } else { + // 組件資料 var items = await _pcsApi.GetItems(); - items = items.Where(w => model.WipKps.Any(wi => wi.KpNo == w.ItemNo)).ToList(); + items = items.Where(w => model.WipKps.Any(wi => wi.KpNo.Trim().ToUpper() == w.ItemNo.Trim().ToUpper())).ToList(); + // 判斷Input為指定KeyParts順序 if (items.Any(a => a.ItemName.ToUpper() == Data.ToUpper())) { - // 判斷是否有重複輸入KP順序代號 if (model.KpItemName != null) { - if (model.KpItemName.Split(",").Where(w => w.ToUpper() == Data.ToUpper()).Any()) + // 取得目前Input指定KP代碼的綁定數量 + var KpItemNameByCount = model.KpItemName.Split(",").Where(w => w.ToUpper() == Data.ToUpper()).Count(); + // WipKp的ByKpNo數量 + var WipKpByCount = model.WipKps.Where(w1 => w1.KpNo == items.Where(w => w.ItemName.ToUpper() == Data.ToUpper()) + .Select(s => s.ItemNo).FirstOrDefault()).Count(); + // 目前綁定KpNo 等於 WipKp ByKpNo 數量 + if (KpItemNameByCount == WipKpByCount) { Success = false; - Msg = $"KeyParts代號重複輸入:{Data}
"; + Msg = $"指定KeyParts:{Data} 已超過資料設定數量
"; return Json(new Result() { success = Success, msg = Msg, data = Data }); } } @@ -10580,22 +10591,22 @@ namespace AMESCoreStudio.Web.Controllers } } - #region 判斷下一站為完工站 - var NextStopCloseStation = await _pcsApi.CheckNextStopCloseStation(model.WipNO, model.UnitNO, model.Station); - #endregion + //#region 判斷下一站為完工站 + //var NextStopCloseStation = await _pcsApi.CheckNextStopCloseStation(model.WipNO, model.UnitNO, model.Station); + //#endregion - if (NextStopCloseStation.Success) - { - // 刪除 BarCodeGroup DIP完工後刪除 - if (model.UnitNO == "D") - { - var GroupID = await _pcsApi.GetBarcodeGroupByBarCodeID(model.BarCodeID); - if (GroupID.Count != 0) - { - await _pcsApi.DeleteBarcodeGroupByGroupID(GroupID.FirstOrDefault().GroupID); - } - } - } + //if (NextStopCloseStation.Success) + //{ + // // 刪除 BarCodeGroup DIP完工後刪除 + // if (model.UnitNO == "D") + // { + // var GroupID = await _pcsApi.GetBarcodeGroupByBarCodeID(model.BarCodeID); + // if (GroupID.Count != 0) + // { + // await _pcsApi.DeleteBarcodeGroupByGroupID(GroupID.FirstOrDefault().GroupID); + // } + // } + //} return Json(new Result1() { success = Success, msg = Msg, data = Data, data1 = "" }); } @@ -10655,7 +10666,6 @@ namespace AMESCoreStudio.Web.Controllers public async Task GetFactoryNo() { string factoryNo = string.Empty; - int user_id = 0; HttpContext.Request.Cookies.TryGetValue("UserID", out string userID); if (userID != null) @@ -10672,7 +10682,6 @@ namespace AMESCoreStudio.Web.Controllers } } - return factoryNo; } } diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml index 1c09c268..bbbdba9f 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml @@ -167,7 +167,7 @@ layer.close(index); }, error: function (result) { - hg.msg(result.data); + hg.msg("呼叫Api TimeOut,再重新FQC是否已完成檢驗結果"); } }); }); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml index 6feaa5d3..03b21449 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml @@ -57,24 +57,10 @@ .td-Input { white-space: pre; } - /* .layui-tab-brief>.layui-tab-title .layui-this{ - color: #5672a7 - } - - .layui-tab-brief>.layui-tab-title .layui-this:after{ - border-bottom: 2px solid #5672a7; - }*/
- @*
-
-
-
@ViewBag.Title
-
-
-
*@
diff --git a/AMESCoreStudio.Web/Views/QRS/QRS021.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS021.cshtml index 3ba921f0..0e48bf81 100644 --- a/AMESCoreStudio.Web/Views/QRS/QRS021.cshtml +++ b/AMESCoreStudio.Web/Views/QRS/QRS021.cshtml @@ -54,6 +54,9 @@ color: blue; } + .td-Input { + white-space: pre; + } @@ -290,6 +293,8 @@ + + @@ -298,7 +303,7 @@ - + k++; @@ -402,6 +407,28 @@ $('.element').responsiveEqualHeightGrid(); }); + function getUnitLineList(data) { + $.ajax( + { + url: "@Url.Action("GetUnitLineJson", "BAS")", + dataType: 'json', + data: { "unit_no": $("#unit").val() }, + type: 'post', + success: function (result) { + $("#line").empty();//清空下拉框的值 + $.each(result.data, function (index, item) { + $("#line").append($("