From fc1663698e9846d516ec4c256996243016af6e16 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 6 Jan 2023 16:43:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9DISPLAY=20=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=96=87=E5=AD=97=E9=A1=8F=E8=89=B2=202.=20FQC007=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=93=81=E8=A6=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 13 ++-- AMESCoreStudio.Web/Views/FQC/FQC007.cshtml | 59 ++++++++++++------- AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml | 13 ++-- .../wwwroot/lib/layui/css/layui.css | 2 +- .../AMES/FqcInhouseMasterController.cs | 3 +- AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs | 12 +++- 6 files changed, 66 insertions(+), 36 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index a6110834..2ee044b7 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -1242,11 +1242,11 @@ namespace AMESCoreStudio.Web.Controllers var _msg = "工單類型不是無序號工單,檢驗類型不能選擇無序號廠驗"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } - } + } } // Fail數量 小於0 才要判斷抽樣數量 && 不等於免驗||無序號廠驗 - if (fqcItem.FailQty <= 0 && (fqcItem.InspectionStatus != "C" || fqcItem.InspectionStatus != "D")) + if (fqcItem.FailQty <= 0 && (fqcItem.InspectionStatus != "C" && fqcItem.InspectionStatus != "D")) { // 抽驗數量 大於 本批次送驗量 if (fqcItem.QcQty > fqcItem.InhouseQty) @@ -1305,13 +1305,14 @@ namespace AMESCoreStudio.Web.Controllers var fqcItem = FqcQuery.Data.FirstOrDefault(); // 免驗||無序號廠驗排除 - if (fqcItem.InspectionStatus != "C" || fqcItem.InspectionStatus != "D") + if (fqcItem.InspectionStatus != "C" && fqcItem.InspectionStatus != "D") { // 判斷狀態選擇 if (fqcItem.FailQty >= fqcItem.ReQty) { if (model.QaResult == "P" && string.IsNullOrWhiteSpace(model.SpecialPo)) { + //return Json(new { data = "請輸入特採單號", success = false }); ModelState.AddModelError("error", "請輸入特採單號"); return View("FQC007B", model); } @@ -1327,11 +1328,13 @@ namespace AMESCoreStudio.Web.Controllers { ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); return View("FQC007B", model); + //return Json(new { data = "抽樣數量不足,不可判定允收", success = false }); } } //當抽驗數量 小於 抽樣數量就離開 else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty && model.QaResult == "P") { + //return Json(new { data = "抽樣數量不足,不可判定允收", success = false }); ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); return View("FQC007B", model); } @@ -1365,14 +1368,16 @@ namespace AMESCoreStudio.Web.Controllers //FQC報表自動派送 await CheckFQCToMail(fqcInhouseMaster.ItemNo, model.QaResult, model.InhouseNo, model.SeqID); + //return Json(new { data = "新增成功!", success = true }); var _msg = "新增成功!"; return RedirectToAction("WindowReload", "Home", new { msg = _msg }); } else { + //return Json(new { data = result.Msg, success = false }); ModelState.AddModelError("error", result.Msg); } - + return View("FQC007B", model); } #endregion diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index 890d1a0a..315af9f4 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -9,11 +9,13 @@ font-weight: bold; color: #FF5722; } + .textF { font-size: 14px; font-weight: bold; color: #009688; } + .aa input { font-size: 14px; color: #0600f0; @@ -90,12 +92,12 @@
- +
- +
@@ -263,8 +265,8 @@
- @*
- + @*
+
*@
@@ -538,24 +540,37 @@ }); //通过行tool檢視,lay-event="detail" function detail(obj) { - let InhouseNo = $("#hInhouseNo").val().trim(); - let SeqID = $("#hSeqID").val().trim(); - layui.use('layer', function () { - var layer = layui.layer; - layer.open({ - title: 'FQC細項資料', - type: 2, - area: ['1000px', '500px'], - fixed: false, //不固定 - maxmin: false, - scrollbar: true, - moveOut: true, - content: '/FQC/FQC007V?inhouseNo=' + InhouseNo + '&seqID=' + SeqID + '&boxNo=' + obj, - end: function () { - window.location.reload(); - } - }); + var data = $("#FQC007Form").serialize(); + $.ajax({ + url: "@Url.Action("FQC007AjaxJson", "FQC")", + type: "POST", + data: data, + success: function (result) { + let InhouseNo = $("#hInhouseNo").val().trim(); + let SeqID = $("#hSeqID").val().trim(); + layui.use('layer', function () { + var layer = layui.layer; + layer.open({ + title: 'FQC細項資料', + type: 2, + area: ['1000px', '500px'], + fixed: false, //不固定 + maxmin: false, + scrollbar: true, + moveOut: true, + content: '/FQC/FQC007V?inhouseNo=' + InhouseNo + '&seqID=' + SeqID + '&boxNo=' + obj, + end: function () { + window.location.reload(); + } + }); + }); + }, + error: function (result) { + alert(`呼叫API失敗`); + } }); + + //hg.open('FQC細項資料', '/FQC/FQC007V?inhouseNo=' + InhouseNo + '&seqID=' + SeqID + '&boxNo=' + obj, '1000', '500'); } @@ -721,7 +736,7 @@ $.ajax({ url: "@Url.Action("FQC007GetPLMECN", "FQC")", type: "Post", - data: { "ItemNo":'@Model.ItemNo'}, + data: { "ItemNo": '@Model.ItemNo' }, success: function (result) { if (result.success) { $('#PLMECN').val(result.msg); diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml index ec35e028..1929c2c9 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml @@ -2,7 +2,8 @@ @{ - Layout = "~/Views/Shared/_AMESLayout.cshtml"; } + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +}