diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 7feab4a6..6cf355e2 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -255,6 +255,27 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.GetAQL_TypeSelect = q; } + + /// + /// AQL_類型 + /// + /// + private void GetInspectionStatusSelect(string SelectedValue = null) + { + List values = new List(); + if (SelectedValue != null) + { + values = SelectedValue.Split(',').ToList(); + } + var q = Enum.GetValues(typeof(EnumFQC.EnumInspection_Status)).Cast() + .Select(s => new SelectListItem + { + Text = EnumPCS.GetDisplayName(s).ToString(), + Value = s.ToString() + }).ToList(); + + ViewBag.GetInspectionStatusSelect = q; + } #endregion #region FQC001 檢驗類別維護 @@ -756,6 +777,7 @@ namespace AMESCoreStudio.Web.Controllers { GetInspection_TypeSelect(); GetAQL_TypeSelect(); + GetInspectionStatusSelect(); var model = new FqcDto(); if (!string.IsNullOrWhiteSpace(inhouseNo) && seqID != 0) { @@ -803,6 +825,9 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task FQC007Async(FqcDto model, string action) { + GetInspection_TypeSelect(); + GetAQL_TypeSelect(); + GetInspectionStatusSelect(); if (string.IsNullOrWhiteSpace(model.InhouseNo)) { ModelState.AddModelError("error", "請輸入入庫單號"); @@ -827,6 +852,9 @@ namespace AMESCoreStudio.Web.Controllers result_FQCResultMaster.Proved = model.Proved; result_FQCResultMaster.OutfitNo = model.OutfitNo; result_FQCResultMaster.InspectionType = model.InspectionType; + result_FQCResultMaster.Note = model.Note; + result_FQCResultMaster.ECN_Memo = model.ECN_Memo; + result_FQCResultMaster.InspectionStatus = model.InspectionStatus; await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); ModelState.AddModelError("error", "儲存成功!"); } @@ -1040,8 +1068,17 @@ namespace AMESCoreStudio.Web.Controllers var result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); var fqcItem = result.Data.FirstOrDefault(); + // 抽驗數量 大於 本批次送驗量 + if (fqcItem.QcQty > fqcItem.InhouseQty) + { + if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.FailQty) + { + var _msg = "抽樣數量不足,無法判定"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + } //當抽驗數量 小於 抽樣數量就離開 - if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty) + else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty) { var _msg = "抽樣數量不足,無法判定"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); @@ -1412,7 +1449,7 @@ namespace AMESCoreStudio.Web.Controllers DefectDescription = FqcQuery.QaMeno, InspectionDate = FqcQuery.EndTime, AC = FqcQuery.AcQty.ToString(), - Approved = "王曉明", + Approved = FqcQuery.Supervisor_Name, AQL = FqcQuery.AQL.ToString(), SpeciallyAdoption = FqcQuery.SpecialPo, BIOSVer = FqcQuery.BIOS, @@ -1425,7 +1462,7 @@ namespace AMESCoreStudio.Web.Controllers InspectionNumber = FqcQuery.InhouseNo, InspectionStatus = FqcQuery.InspectionStatus, InspectionType = FqcQuery.InspectionTypeName, - Inspector = "蔡喬虎", + Inspector = FqcQuery.UpdateUser_Name, Judgment = "Defect Quantity", Line = FqcQuery.InhouseMemo, LotSize = FqcQuery.InhouseQty.ToString(), @@ -1527,12 +1564,16 @@ namespace AMESCoreStudio.Web.Controllers if (resultFqcQuery.Data.Count() != 0) { var FqcQuery = resultFqcQuery.Data.FirstOrDefault(); + // Enum 轉換 + FqcQuery.AQLType = EnumFQC.GetDisplayName((EnumFQC.EnumAQL_Type)Enum.Parse(typeof(EnumFQC.EnumAQL_Type), FqcQuery.AQLType)); + FqcQuery.InspectionStatus = EnumFQC.GetDisplayName((EnumFQC.EnumInspection_Status)Enum.Parse(typeof(EnumFQC.EnumInspection_Status), FqcQuery.InspectionStatus)); + FQC010Master = new FQC010VIiew() { DefectDescription = FqcQuery.QaMeno, InspectionDate = FqcQuery.EndTime, AC = FqcQuery.AcQty.ToString(), - Approved = "王曉明", + Approved = FqcQuery.Supervisor_Name, AQL = FqcQuery.AQL.ToString(), SpeciallyAdoption = FqcQuery.SpecialPo, BIOSVer = FqcQuery.BIOS, @@ -1545,7 +1586,7 @@ namespace AMESCoreStudio.Web.Controllers InspectionNumber = FqcQuery.InhouseNo, InspectionStatus = FqcQuery.InspectionStatus, InspectionType = FqcQuery.InspectionTypeName, - Inspector = "蔡喬虎", + Inspector = FqcQuery.UpdateUser_Name, Judgment = "Defect Quantity", Line = FqcQuery.InhouseMemo, LotSize = FqcQuery.InhouseQty.ToString(), diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index 4c633798..ca6d3a2a 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -102,13 +102,16 @@
- +
+ +
+ @**@
-
+ @*
-
+
*@
@@ -129,8 +132,8 @@
@* - - *@ + + *@
@@ -289,10 +292,10 @@
-
+
-
+
@@ -301,10 +304,10 @@
-
+
-
+
@@ -312,6 +315,22 @@
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+