diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 2d5e4d9c..693136f1 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -65,18 +65,34 @@ namespace AMESCoreStudio.Web.Controllers /// 廠別/委外廠 /// /// - private async Task GetFactoryInfoType() + private async Task GetFactoryInfo() { var result = await _pcsApi.GetFactoryInfo(); var FactoryInfo = new List(); for (int i = 0; i < result.Count; i++) { - FactoryInfo.Add(new SelectListItem(result[i].FactoryNO + "-" + result[i].FactoryNameCH, result[i].FactoryID.ToString())); + FactoryInfo.Add(new SelectListItem(result[i].FactoryNo + "-" + result[i].FactoryNameCh, result[i].FactoryID.ToString())); } ViewBag.FactoryInfoList = FactoryInfo; } + /// + /// 生產單位 + /// + /// + private async Task GetFactoryUnit() + { + var result = await _pcsApi.GetFactoryUnit(); + + var FactoryUnit = new List(); + for (int i = 0; i < result.Count; i++) + { + FactoryUnit.Add(new SelectListItem(result[i].UnitName,result[i].UnitNo.ToString())); + } + ViewBag.FactoryUnitList = FactoryUnit; + } + /// /// 正背面 /// @@ -377,6 +393,71 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.GetSolderPasteList = SolderPaste; } + + /// + /// PCS List1 共用 BIOS/Checksum + /// + private void GetPCSList1() + { + var PCSList1 = new List(){ + new SelectListItem() { + Text = "NA", + Value = "NA", + }, + new SelectListItem + { + Text = "Check", + Value = "Check", + }, + new SelectListItem + { + Text = "Program", + Value = "Program", + }, + new SelectListItem + { + Text = "備註說明", + Value = "備註說明", + } + }; + + ViewBag.PCSList1 = PCSList1; + } + + /// + /// SOP相關下班 + /// + private void GetPCSOPList() + { + var PCSOPList = new List(){ + new SelectListItem() { + Text = "SOP", + Value = "SOP", + }, + new SelectListItem + { + Text = "技術轉移", + Value = "技術轉移", + }, + new SelectListItem + { + Text = "NA", + Value = "NA", + }, + new SelectListItem + { + Text = "暫時文件", + Value = "備暫時文件", + }, + new SelectListItem + { + Text = "備註說明", + Value = "備註說明", + } + }; + + ViewBag.PCSOPList = PCSOPList; + } #endregion @@ -390,12 +471,25 @@ namespace AMESCoreStudio.Web.Controllers public async Task PCS001C() { await GetProductType(); - GetWipSEQType(); - GetWipType(); - GetCustomerType(); + await GetFactoryInfo(); + await GetFactoryUnit(); await GetLineInfo(); await GetMFGType(); await GetProcessTypes(); + GetSMDType(); + GetDIPType(); + GetWipSEQType(); + GetBurnType(); + GetPartsBakeType(); + GetPCBBakeType(); + GetPCBWorkingType(); + GetSolderPaste(); + GetWipType(); + GetCustomerType(); + GetPCSList1(); + GetPCSOPList(); + //var result = new WipAllViewModel(); + //return View(result); return View(); } @@ -403,36 +497,43 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PCS001CSaveAsync(WipAllViewModel model) { - if (ModelState.IsValid) + //if (ModelState.IsValid) + //{ + IResultModel result; + if (model.WipInfo.WipID == 0) { - IResultModel result; - if (model.WipInfo.WipID == 0) - { - result = await _pcsApi.PostWipInfo(JsonConvert.SerializeObject(model.WipInfo)); - result = await _pcsApi.PostWipAtt(JsonConvert.SerializeObject(model.WipAtt)); - } - else - { - result = await _pcsApi.PostWipInfo(JsonConvert.SerializeObject(model.WipInfo)); - } + // Checkbox轉換 + model.WipInfo.ECNCheck = model.WipInfo.ECNCheck == "true" ? "Y" : "N"; + model.WipInfo.ModelCheck = model.WipInfo.ModelCheck == "true" ? "Y" : "N"; + model.WipInfo.InputFlag = model.WipInfo.InputFlag == "true" ? "Y" : "N"; + model.WipInfo.Priority = model.WipInfo.Priority == "true" ? "Y" : "N"; + + result = await _pcsApi.PostWipInfo(JsonConvert.SerializeObject(model.WipInfo)); + model.WipAtt.WipNO = model.WipInfo.WipNO; + result = await _pcsApi.PostWipAtt(JsonConvert.SerializeObject(model.WipAtt)); + } + else + { + result = await _pcsApi.PostWipInfo(JsonConvert.SerializeObject(model.WipInfo)); + } - if (!result.Success) + if (!result.Success) + { + var _msg = model.WipInfo.WipID == 0 ? "添加成功!" : "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + if (result.Errors.Count > 0) { - var _msg = model.WipInfo.WipID == 0 ? "添加成功!" : "修改成功!"; - return RedirectToAction("Refresh", "Home", new { msg = _msg }); + ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); } else { - if (result.Errors.Count > 0) - { - ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); - } - else - { - ModelState.AddModelError("error", result.Msg); - } + ModelState.AddModelError("error", result.Msg); } } + //} if (model.WipInfo.WipID == 0) { return View("PCS001C", model); diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 6e735def..219bb5fb 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -4,6 +4,7 @@ using WebApiClient.Attributes; using AMESCoreStudio.WebApi; using Microsoft.AspNetCore.Mvc; using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; namespace AMESCoreStudio.Web { @@ -23,14 +24,21 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/LineInfos")] - ITask> GetLineInfo(); + ITask> GetLineInfo(); /// /// 廠別/委外廠 /// /// [WebApiClient.Attributes.HttpGet("api/FactoryInfos")] - ITask> GetFactoryInfo(); + ITask> GetFactoryInfo(); + + /// + /// 獲取生產製程單位 + /// + /// + [WebApiClient.Attributes.HttpGet("api/FactoryUnits")] + ITask> GetFactoryUnit(); /// /// 正背面 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001C.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001C.cshtml index 3257cbdd..94228259 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001C.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001C.cshtml @@ -2,7 +2,7 @@ @{ ViewData["Title"] = "PCS001C"; - Layout = "~/Views/Shared/_FormLayout.cshtml"; } + Layout = "~/Views/Shared/_AMESLayout.cshtml"; } -
+
-
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- [混線投入機種檢查] -
[ 工單屬性 ]
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - -
- - - -
-
+
+
    +
  • 工單基本資料
  • +
  • 單板-工程資訊
  • +
  • 系統組裝-工程資訊
  • +
+
+ @* 基本資料sheet *@ +
+
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
- @Html.ValidationMessage("error") -
- +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
+
+ +
+ + + +
+ +
+ +
+
+
+ +
+
+ +
+ + + +
+ +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+ + +
+ + +
+
+ +
+ +
+
+ +
+ + +
+ +
+ + +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + + +
+ +
+ [ 工單屬性 ] +
+ +
+
+ +
+ +
+ + +
+ +
+
+
+ +
+
+ +
+ + +
+ + + +
+ + +
+
+
+ +
+
+ +
+ +
+ + + +
+ +
+
+
+ +
+
+ +
+ +
+ + + +
+ +
+
+
+ + +
+
+ +
+ +
+ + +
+ +
+
+
+ + +
+
+ +
+ +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ @* 單板-工程資訊sheet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await Html.RenderPartialAsync("_ValidationScriptsPartial"); await Html.RenderPartialAsync("_FileinputScriptsPartial"); }