From b2a6c008b7be37dc42a72e598a79082503539418 Mon Sep 17 00:00:00 2001 From: Sai Date: Tue, 18 Jul 2023 14:04:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=81=8E=E7=AB=99=E5=88=B7=E6=B2=BB?= =?UTF-8?q?=E5=85=B7=E5=88=A4=E6=96=B7=E6=B2=BB=E5=85=B7=E7=B8=BD=E9=A1=9E?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=AD=A3=E7=A2=BA=202.=20=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E6=A2=9D=E7=A2=BC=E5=8D=80=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 51 +++++++++++++++++-- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 11 ++++ .../ViewModels/PCS/PCS004CViewModel.cs | 3 ++ AMESCoreStudio.Web/Views/PCS/PCS004C.cshtml | 51 +++++++++++-------- AMESCoreStudio.Web/Views/PCS/PCS021.cshtml | 29 ++++++++++- 5 files changed, 118 insertions(+), 27 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 8f2d2c09..d0436487 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1539,6 +1539,35 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Result() { success = true, data = result.Count() }); } + + /// + /// 判斷治具總類 + /// + /// 治具編號 + /// 設備名稱(No) + /// + [HttpPost] + public async Task CheckOutfitInfoPartNo(string outfitNo, string partNo) + { + string msg = string.Empty; + if (!string.IsNullOrWhiteSpace(outfitNo)) + { + var q = await _pcsApi.GetOutfitInfoByOutfitNo(outfitNo); + if (q != null) + { + var OutfitCommodityInfos = await _pcsApi.GetOutfitCommodityInfo(); + if (!OutfitCommodityInfos.Where(w => w.CommodityID == q.CommodityID && w.CommodityNo == partNo).Any()) + msg = "刷入的治具總類不一致,請確認"; + } + else + { + msg = $"找不到這筆【{outfitNo}】治具編號相關資料,請確認"; + } + + } + return Json(new { data = msg }); + } + #endregion ///// @@ -3627,15 +3656,27 @@ namespace AMESCoreStudio.Web.Controllers await GetFlowRuleList(); // 起訖序號沒填寫 或者 綁定序號沒填寫 - if ((string.IsNullOrWhiteSpace(model.WipBarcode.StartNO) || string.IsNullOrWhiteSpace(model.WipBarcode.EndNO)) - && string.IsNullOrWhiteSpace(model.BarcodeNo)) + if (model.Type1 == "LIMIT") { - ModelState.AddModelError("error", "請確認新增的條碼是否有填寫?"); - return View(model); + if ((string.IsNullOrWhiteSpace(model.WipBarcode.StartNO) || string.IsNullOrWhiteSpace(model.WipBarcode.EndNO)) + && string.IsNullOrWhiteSpace(model.BarcodeNo)) + { + ModelState.AddModelError("error", "請確認新增的條碼是否有填寫?"); + return View(model); + } + } + else if (model.Type1 == "SOLO") + { + if (string.IsNullOrWhiteSpace(model.WipBarcode.StartNO)) + { + ModelState.AddModelError("error", "請確認新增的條碼是否有填寫?"); + return View(model); + } + model.WipBarcode.EndNO = model.WipBarcode.StartNO; } if ((!string.IsNullOrWhiteSpace(model.WipBarcode.StartNO) || !string.IsNullOrWhiteSpace(model.WipBarcode.EndNO)) - && !string.IsNullOrWhiteSpace(model.BarcodeNo)) + && !string.IsNullOrWhiteSpace(model.BarcodeNo)) { ModelState.AddModelError("error", "請則一選擇要新增條碼的方式?"); return View(model); diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index c6b85537..c34e0a72 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1720,5 +1720,16 @@ namespace AMESCoreStudio.Web //YIRU End ---------------------------------------------------------------------------------------- #endregion + #region OutfitInfoes 設備資料檔 + + /// + /// By 治具編號 查詢 + /// + /// + [WebApiClient.Attributes.HttpGet("api/OutfitInfoes/ByOutfitNo/{id}")] + ITask GetOutfitInfoByOutfitNo(string id); + + #endregion + } } diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS004CViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS004CViewModel.cs index 7d05e58d..6794c6d9 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/PCS004CViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS004CViewModel.cs @@ -26,6 +26,9 @@ namespace AMESCoreStudio.Web.ViewModels.PCS // 序號綁定 Type SN:內部序號 SSN:出貨序號 public string Type { get; set; } + // 內部條碼綁定類型 Type1 LIMIT:設定區間 SOLO:單一條碼 + public string Type1 { get; set; } + // 綁定條碼 public string BarcodeNo { get; set; } } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS004C.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS004C.cshtml index c2aee0aa..75eb970a 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS004C.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS004C.cshtml @@ -137,23 +137,23 @@ @if (Model.WipBarcodes != null) { - @foreach (var index in Model.WipBarcodes) - { - - - - - - - - - - - 刪除 - - - i++; - } + @foreach (var index in Model.WipBarcodes) + { + + + + + + + + + + + 刪除 + + + i++; + } } @@ -162,6 +162,10 @@
新增內部條碼
+
+ + +
@@ -175,12 +179,14 @@
+
+
+ 既有條碼綁定內部條碼
-
- - + +
@@ -201,6 +207,11 @@ }