|
|
@ -1246,7 +1246,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
|
|
|
|
// 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,11 +1368,13 @@ 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); |
|
|
|
} |
|
|
|
|
|
|
|