|
@ -80,6 +80,45 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
ViewBag.QcQuotSelect = QcQuotList; |
|
|
ViewBag.QcQuotSelect = QcQuotList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// FQC狀態維護 Select
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private async Task GetStatusTypeSelect() |
|
|
|
|
|
{ |
|
|
|
|
|
var result = await _fqcApi.GetStatusType(); |
|
|
|
|
|
|
|
|
|
|
|
var StatusTypetList = new List<SelectListItem>(); |
|
|
|
|
|
result = result.OrderByDescending(o => o.StatusNo).ToList(); |
|
|
|
|
|
for (int i = 0; i < result.Count; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
StatusTypetList.Add(new SelectListItem(result[i].StatusName, result[i].StatusNo.ToString())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StatusTypetList.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
StatusTypetList.Add(new SelectListItem("N/A", null)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.StatusTypeSelect = StatusTypetList; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 不良狀態 Select
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private async Task GetNGReasonSelect() |
|
|
|
|
|
{ |
|
|
|
|
|
var result = await _fqcApi.GetNGReasons(); |
|
|
|
|
|
|
|
|
|
|
|
var NGReasonList = new List<SelectListItem>(); |
|
|
|
|
|
for (int i = 0; i < result.Count; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
NGReasonList.Add(new SelectListItem(result[i].NGReasonDesc, result[i].NGReasonNo.ToString())); |
|
|
|
|
|
} |
|
|
|
|
|
ViewBag.NGReasonSelect = NGReasonList; |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region FQC001 檢驗類別維護
|
|
|
#region FQC001 檢驗類別維護
|
|
@ -593,8 +632,46 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
return View("FQC007", model); |
|
|
return View("FQC007", model); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<IActionResult> FQC007C() |
|
|
[HttpGet] |
|
|
|
|
|
public async Task<IActionResult> FQC007C(string inhouseNo, int seq) |
|
|
|
|
|
{ |
|
|
|
|
|
await GetStatusTypeSelect(); |
|
|
|
|
|
await GetNGReasonSelect(); |
|
|
|
|
|
return View(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
|
|
public async Task<IActionResult> FQC007CAsync(FqcResultDetail model) |
|
|
|
|
|
{ |
|
|
|
|
|
await GetStatusTypeSelect(); |
|
|
|
|
|
await GetNGReasonSelect(); |
|
|
|
|
|
if (string.IsNullOrWhiteSpace(model.BarcodeNo) && |
|
|
|
|
|
string.IsNullOrWhiteSpace(model.BoxNo) && |
|
|
|
|
|
string.IsNullOrWhiteSpace(model.ExtraBarcodeNo)) |
|
|
|
|
|
{ |
|
|
|
|
|
ModelState.AddModelError("error", "請輸入要抽驗的相關序號"); |
|
|
|
|
|
return View("FQC007C", model); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ModelState.IsValid) |
|
|
|
|
|
{ |
|
|
|
|
|
IResultModel result; |
|
|
|
|
|
|
|
|
|
|
|
result = await _fqcApi.PostStatusType(JsonConvert.SerializeObject(model)); |
|
|
|
|
|
|
|
|
|
|
|
if (result.Success) |
|
|
{ |
|
|
{ |
|
|
|
|
|
var _msg = "新增成功!"; |
|
|
|
|
|
return RedirectToAction("Refresh", "Home", new { msg = _msg }); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return View("FQC006C", model); |
|
|
return View(); |
|
|
return View(); |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|