From 59bd88ddce696581c7b27eda477f7b11be5386da Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 7 Jun 2022 17:36:53 +0800 Subject: [PATCH] =?UTF-8?q?1.=20FQC007=E4=BF=AE=E6=94=B9=20=E6=8A=BD?= =?UTF-8?q?=E9=A9=97=E4=B8=8D=E9=9B=A2=E9=96=8B=E9=A0=81=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?Input=20=E6=8C=89Enter=E4=B8=8D=E5=9F=B7=E8=A1=8Csubmit=202.=20?= =?UTF-8?q?=E6=9C=AA=E7=B5=90=E5=B7=A5=E5=96=AE=E4=BF=AE=E6=AD=A3=E6=95=B8?= =?UTF-8?q?=E5=AD=97=E9=A1=AF=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 5 +-- .../Controllers/PCSController.cs | 8 ++++- AMESCoreStudio.Web/Views/FQC/FQC007.cshtml | 34 ++++++++++++++----- AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml | 12 ++++++- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 8b4ae22c..fea10ed0 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -934,8 +934,9 @@ namespace AMESCoreStudio.Web.Controllers if (result_detail.Success) { - var _msg = "新增成功!"; - return RedirectToAction("WindowReload", "Home", new { msg = _msg }); + ModelState.AddModelError("error", "新增成功!"); + //return RedirectToAction("WindowReload", "Home", new { msg = _msg }); + return View("FQC007C", model); } else { diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index ec93ba78..ae72f63c 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -3493,7 +3493,8 @@ namespace AMESCoreStudio.Web.Controllers string ct1 = ""; if (standardWorkTimes.Count > 0) { - ct1 = standardWorkTimes.Where(w => w.LineID == line_id).FirstOrDefault().CT.ToString(); + if (standardWorkTimes.Where(w => w.LineID == line_id).FirstOrDefault() != null) + ct1 = standardWorkTimes.Where(w => w.LineID == line_id).FirstOrDefault().CT.ToString(); } wipDataList = wipDataList + "" + unit_name + " - " + line_desc + "" + " - " + "" + wip_no + "" + "" + "(" + item_no + ")" + "" + " - " + "" + plan_qty + " / " + input_qty + " / " + output_qty + "" + " | " + "" + "標準工時: " + "" + ct1 + "
"; @@ -3551,6 +3552,11 @@ namespace AMESCoreStudio.Web.Controllers double rate = ((okQty * 1.0) / (okQty + ngQty)) * 100; + if (okQty + ngQty == 0) + { + rate = 100; + } + if (j == rule_sation.Count - 2) { if (rate <= 90) diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index caa9d066..7472871e 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -222,10 +222,10 @@
- +
- +
@@ -449,7 +449,10 @@ maxmin: false, scrollbar: true, moveOut:true, - content: '/FQC/FQC007C?inhouseNo=@Model.h_InhouseNo&seq=@Model.h_SeqID' + content: '/FQC/FQC007C?inhouseNo=@Model.h_InhouseNo&seq=@Model.h_SeqID', + end: function () { + window.location.reload(); + } }); }); //hg.open('抽驗', '/FQC/FQC007C?inhouseNo=@Model.h_InhouseNo&seq=@Model.h_SeqID', 600, 600); @@ -514,18 +517,33 @@ var error = '@Html.ValidationMessage("error")'; $("#CustomerMedical").attr("disabled", "disabled"); $("#CustomerVIP").attr("disabled", "disabled"); - if ($(error).text() != '') { - parent.hg.msg(error); - }; - let InhouseNo = $("#hInhouseNo").val().trim(); + + if ($(error).text() != '') { + parent.hg.msg(error); + }; + + + let InhouseNo = $("#hInhouseNo").val().trim(); let SeqID = $("#hSeqID").val().trim(); let Result = '@Model.StatusName'; if (InhouseNo.length != 0 && SeqID.length != 0 && Result == 'A') { $("#click").show(); } - + setupEnterToNext(); }); + function setupEnterToNext() { + // add keydown event for all inputs + $(':input').keydown(function (e) { + if (e.keyCode == 13 /*Enter*/) { + + // focus next input elements + $(':input:visible:enabled:eq(' + ($(':input:visible:enabled').index(this) + 1) + ')').focus(); + e.preventDefault(); + } + + }); + } } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml index 70caa7bb..46a9e0e0 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml @@ -164,9 +164,19 @@ $(document).ready(function () { var error = '@Html.ValidationMessage("error")'; if ($(error).text() != '') { - parent.hg.msg(error); + + if ($(error).text() == '新增成功!') { + add(); + } + else + parent.hg.msg(error); } }); + + function add() { + $("#BarcodeNo").val(''); + $("#BarcodeNo").focus(); + }