diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index f283b2a5..03b0f57c 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -1068,6 +1068,10 @@ namespace AMESCoreStudio.Web.Controllers { await GetStatusTypeSelect(); await GetNGGroupSelect(); + + // 回傳前端清空欄位 + string InputType = string.Empty; + if (string.IsNullOrWhiteSpace(model.BarcodeNo) && string.IsNullOrWhiteSpace(model.BoxNo) && string.IsNullOrWhiteSpace(model.ExtraBarcodeNo)) @@ -1081,14 +1085,17 @@ namespace AMESCoreStudio.Web.Controllers if (!string.IsNullOrWhiteSpace(model.BarcodeNo)) { result_BarCodeInfo = await _fqcApi.GetBarcodeInfoesByNo(model.BarcodeNo); + InputType = "BarcodeNo"; } else if (!string.IsNullOrWhiteSpace(model.ExtraBarcodeNo)) { result_BarCodeInfo = await _fqcApi.GetBarcodeInfoesByExtraNo(model.ExtraBarcodeNo); + InputType = "ExtraBarcodeNo"; } else if (!string.IsNullOrWhiteSpace(model.BoxNo)) { result_BarCodeInfo = await _fqcApi.GetBarcodeInfoesByBoxNo(model.BoxNo); + InputType = "BoxNo"; } if (result_BarCodeInfo.Count == 0) @@ -1223,7 +1230,7 @@ namespace AMESCoreStudio.Web.Controllers if (result_detail.Success) { ModelState.AddModelError("error", "新增成功!"); - //return RedirectToAction("WindowReload", "Home", new { msg = _msg }); + ModelState.AddModelError("InputType", InputType); return View("FQC007C", model); } else diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index 1bfe5e1e..7e5bb46e 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -127,8 +127,8 @@