|
@ -964,7 +964,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
} |
|
|
} |
|
|
//修改页面
|
|
|
//修改页面
|
|
|
[HttpGet] |
|
|
[HttpGet] |
|
|
public async Task<IActionResult> WHS009UAsync(int id, string type) |
|
|
public async Task<IActionResult> WHS009UAsync(string id) |
|
|
{ |
|
|
{ |
|
|
//製程單位
|
|
|
//製程單位
|
|
|
await GetFactoryUnitsList2(); |
|
|
await GetFactoryUnitsList2(); |
|
@ -978,13 +978,17 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
GetClassList(); |
|
|
GetClassList(); |
|
|
//其他部門
|
|
|
//其他部門
|
|
|
await GetDeptList(); |
|
|
await GetDeptList(); |
|
|
//+異常代碼
|
|
|
|
|
|
//+判定負責人詢問如何關聯單位與人
|
|
|
|
|
|
//+判定類別
|
|
|
|
|
|
|
|
|
|
|
|
ViewBag.type = type; |
|
|
await GetExceptionClassesList(); |
|
|
|
|
|
|
|
|
|
|
|
await GetExceptionCodesList(); |
|
|
|
|
|
|
|
|
|
|
|
var result = await _whsApi.GetExceptionWorktime(id); |
|
|
|
|
|
var result2 = await _whsApi.GetExceptionCode(result[0].ExceptionNo); |
|
|
|
|
|
ViewBag.ClassNo = result2[0].ExceptionClassNo; |
|
|
|
|
|
var result3 = await _whsApi.GetExceptionClass(result2[0].ExceptionClassNo); |
|
|
|
|
|
ViewBag.GroupNo = result3[0].ExceptionGroupNo; |
|
|
|
|
|
|
|
|
var result = await _whsApi.GetSupportUser(id); |
|
|
|
|
|
|
|
|
|
|
|
if (result.Count == 0) |
|
|
if (result.Count == 0) |
|
|
{ |
|
|
{ |
|
@ -1041,14 +1045,17 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
if (result.Errors.Count > 0) |
|
|
await GetExceptionClassesList(); |
|
|
{ |
|
|
|
|
|
ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); |
|
|
await GetExceptionCodesList(); |
|
|
} |
|
|
|
|
|
else |
|
|
var result2 = await _whsApi.GetExceptionCode(model.ExceptionNo); |
|
|
{ |
|
|
ViewBag.ClassNo = result2[0].ExceptionClassNo; |
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
var result3 = await _whsApi.GetExceptionClass(result2[0].ExceptionClassNo); |
|
|
} |
|
|
ViewBag.GroupNo = result3[0].ExceptionGroupNo; |
|
|
|
|
|
|
|
|
|
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return View("WHS009U", model); |
|
|
return View("WHS009U", model); |
|
@ -1632,13 +1639,13 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
[HttpGet] |
|
|
[HttpGet] |
|
|
public async Task<IActionResult> WHS016UAsync(string id) |
|
|
public async Task<IActionResult> WHS016UAsync(string id) |
|
|
{ |
|
|
{ |
|
|
|
|
|
await GetExceptionClassesList(); |
|
|
|
|
|
await GetExceptionCodesList(); |
|
|
var result = await _whsApi.GetExceptionReason(id); |
|
|
var result = await _whsApi.GetExceptionReason(id); |
|
|
var result2 = await _whsApi.GetExceptionCode(result[0].ExceptionNo); |
|
|
var result2 = await _whsApi.GetExceptionCode(result[0].ExceptionNo); |
|
|
ViewBag.ClassNo = result2[0].ExceptionClassNo; |
|
|
ViewBag.ClassNo = result2[0].ExceptionClassNo; |
|
|
var result3 = await _whsApi.GetExceptionClass(result2[0].ExceptionClassNo); |
|
|
var result3 = await _whsApi.GetExceptionClass(result2[0].ExceptionClassNo); |
|
|
ViewBag.GroupNo = result3[0].ExceptionGroupNo; |
|
|
ViewBag.GroupNo = result3[0].ExceptionGroupNo; |
|
|
await GetExceptionClassesList(); |
|
|
|
|
|
await GetExceptionCodesList(); |
|
|
|
|
|
|
|
|
|
|
|
if (result.Count == 0) |
|
|
if (result.Count == 0) |
|
|
{ |
|
|
{ |
|
@ -1684,9 +1691,6 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
public async Task<IActionResult> WHS016USaveAsync(ExceptionReason model) |
|
|
public async Task<IActionResult> WHS016USaveAsync(ExceptionReason model) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
var ExceptionGroupNo = ViewBag.GroupNo ; |
|
|
|
|
|
var ExceptionClassNo = ViewBag.ClassNo; |
|
|
|
|
|
|
|
|
|
|
|
if (ModelState.IsValid) |
|
|
if (ModelState.IsValid) |
|
|
{ |
|
|
{ |
|
|
IResultModel result; |
|
|
IResultModel result; |
|
@ -1703,8 +1707,12 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
await GetExceptionClassesList(); |
|
|
await GetExceptionClassesList(); |
|
|
await GetExceptionCodesList(); |
|
|
await GetExceptionCodesList(); |
|
|
ViewBag.GroupNo = ExceptionGroupNo; |
|
|
var result1 = await _whsApi.GetExceptionReason(model.ReasonNo); |
|
|
ViewBag.ClassNo = ExceptionClassNo; |
|
|
var result2 = await _whsApi.GetExceptionCode(result1[0].ExceptionNo); |
|
|
|
|
|
ViewBag.ClassNo = result2[0].ExceptionClassNo; |
|
|
|
|
|
var result3 = await _whsApi.GetExceptionClass(result2[0].ExceptionClassNo); |
|
|
|
|
|
ViewBag.GroupNo = result3[0].ExceptionGroupNo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
|
|
|
|
|
|