From a8139117aea911f1960550349c3f36a6f0fc9768 Mon Sep 17 00:00:00 2001 From: Sai Date: Thu, 19 Dec 2024 13:33:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=B7=A5=E5=96=AE=E7=B6=AD=E8=AD=B7?= =?UTF-8?q?=E5=8F=8A=E6=A2=9D=E7=A2=BC=E6=AD=B7=E7=A8=8B=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E5=B0=8D=E7=85=A7=202.=20=E9=81=8E?= =?UTF-8?q?=E7=AB=99=E5=8A=A0=E5=85=A5=E4=BA=8C=E6=AC=A1=E5=88=A4=E6=96=B7?= =?UTF-8?q?KP=E9=87=8D=E8=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 157 ++-- .../CustomStringLocalizerFactory.cs | 30 + .../Resources/Views/PCS/Shared.en-US.resx | 816 ++++++++++++++++++ .../Resources/Views/PCS/Shared.zh-TW.resx | 816 ++++++++++++++++++ AMESCoreStudio.Web/Startup.cs | 13 +- AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml | 155 ++-- AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 368 ++++---- AMESCoreStudio.Web/Views/PCS/PCS002.cshtml | 65 +- AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 498 +++++------ AMESCoreStudio.Web/Views/PCS/PCS005.cshtml | 83 +- AMESCoreStudio.Web/Views/PCS/PCS009.cshtml | 25 +- AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml | 113 +-- .../BLL/BarCodeCheckNewController.cs | 52 +- 13 files changed, 2401 insertions(+), 790 deletions(-) create mode 100644 AMESCoreStudio.Web/Resources/Localization/CustomStringLocalizerFactory.cs create mode 100644 AMESCoreStudio.Web/Resources/Views/PCS/Shared.en-US.resx create mode 100644 AMESCoreStudio.Web/Resources/Views/PCS/Shared.zh-TW.resx diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 25d57cb..f68587b 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -16,7 +16,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using Newtonsoft.Json.Bson; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -50,7 +49,7 @@ namespace AMESCoreStudio.Web.Controllers //public static int NoLength = 4; public PCSController(ILogger logger, ILogger log, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi, IFQC fqcApi - , IFileServerProvider fileServerProvider, IWebHostEnvironment env, IKCS kcsApi, IStringLocalizer sharedLocalizer + , IFileServerProvider fileServerProvider, IWebHostEnvironment env, IKCS kcsApi, IStringLocalizerFactory factory , IConfiguration configuration, IBLL bllApi) { _logger = logger; @@ -63,7 +62,7 @@ namespace AMESCoreStudio.Web.Controllers _kcsApi = kcsApi; _fileServerProvider = fileServerProvider; _env = env; - _sharedLocalizer = sharedLocalizer; + _sharedLocalizer = factory.Create("Controllers.PCS", "AMESCoreStudio.Web"); _configuration = configuration; _bllApi = bllApi; } @@ -82,23 +81,22 @@ namespace AMESCoreStudio.Web.Controllers string Msg = string.Empty; if (string.IsNullOrWhiteSpace(model.wipInfo.LineID.ToString())) - Msg += model.wipInfo.GetAttributeFrom(nameof(model.wipInfo.LineID)).Name + ","; + Msg += $"{_sharedLocalizer["Lineid"]},"; if (string.IsNullOrWhiteSpace(model.wipInfo.UnitNO)) - Msg += model.wipInfo.GetAttributeFrom(nameof(model.wipInfo.UnitNO)).Name + ","; + Msg += $"{_sharedLocalizer["UnitNo"]},"; if (model.wipInfo.WipDueDate == DateTime.MinValue) - Msg += model.wipInfo.GetAttributeFrom(nameof(model.wipInfo.WipDueDate)).Name + ","; + Msg += $"{_sharedLocalizer["WipDueDate"]},"; if (model.wipInfo.WipScheduleDate == DateTime.MinValue) - Msg += model.wipInfo.GetAttributeFrom(nameof(model.wipInfo.WipScheduleDate)).Name + ","; + Msg += $"{_sharedLocalizer["WipScheduleDate"]},"; if (model.wipInfo.UnitNO == "全部" || string.IsNullOrWhiteSpace(model.wipInfo.UnitNO)) - Msg += model.wipInfo.GetAttributeFrom(nameof(model.wipInfo.UnitNO)).Name + ","; - + Msg += $"{_sharedLocalizer["UnitNo"]},"; if (model.wipInfo.PlanQTY == 0) - Msg += model.wipInfo.GetAttributeFrom(nameof(model.wipInfo.PlanQTY)).Name + ","; + Msg += $"{_sharedLocalizer["PlanQty"]},"; // 序號編碼sheet // 工單新增不用判斷 @@ -133,14 +131,8 @@ namespace AMESCoreStudio.Web.Controllers } } - //// 出貨序號 - //if (string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) != string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) - //{ - // Msg += ",客戶序號未填完整"; - //} - if (!string.IsNullOrWhiteSpace(Msg)) - Msg = "必填欄位未填寫:(" + Msg.Substring(0, (Msg.Length - 1)) + " )"; + Msg = _sharedLocalizer["Error_RequiredFieldsNotFilled", Msg.TrimEnd(',')]; return Msg; } @@ -183,20 +175,20 @@ namespace AMESCoreStudio.Web.Controllers string.IsNullOrWhiteSpace(model.Fw)) { if (string.IsNullOrWhiteSpace(model.Engineer)) - Msg += model.GetAttributeFrom(nameof(model.Engineer)).Name + ","; + Msg += $"{_sharedLocalizer["Engineer"]},"; // 1 N/A , 4 備註說明 if (string.IsNullOrWhiteSpace(model.Bios) && model.BiosType != 1 && model.BiosType != 4) - Msg += model.GetAttributeFrom(nameof(model.Bios)).Name + ","; + Msg += $"{_sharedLocalizer["Bios"]},"; if (string.IsNullOrWhiteSpace(model.Ec) && model.ECType != 1 && model.ECType != 4) - Msg += model.GetAttributeFrom(nameof(model.Ec)).Name + ","; + Msg += $"EC,"; if (string.IsNullOrWhiteSpace(model.Fw) && model.FWType != 1 && model.FWType != 4) - Msg += model.GetAttributeFrom(nameof(model.Fw)).Name + ","; + Msg += $"FW,"; if (string.IsNullOrWhiteSpace(model.BiRatio.ToString())) - Msg += model.GetAttributeFrom(nameof(model.BiRatio)).Name + ","; + Msg += $"{_sharedLocalizer["BIRatio"]},"; } } return Msg; @@ -236,29 +228,28 @@ namespace AMESCoreStudio.Web.Controllers model.PartsBake == 999) { if (string.IsNullOrWhiteSpace(model.BiRatio.ToString())) - Msg += model.GetAttributeFrom(nameof(model.BiRatio)).Name + ","; + Msg += $"{_sharedLocalizer["BIRatio"]},"; if (string.IsNullOrWhiteSpace(model.PartsBakeTime.ToString())) - Msg += model.GetAttributeFrom(nameof(model.PartsBakeTime)).Name + ","; + Msg += $"{_sharedLocalizer["PartsBakeTime"]},"; if (model.PartsBake == 999 && model.PartsBakeOther == 0) - Msg += "零件烘烤-其他溫度" + ","; + Msg += $"{_sharedLocalizer["PartsBakeTemperature"]}-{_sharedLocalizer["PartsBakeOther"]},"; if (string.IsNullOrWhiteSpace(model.BiosVer)) - Msg += model.GetAttributeFrom(nameof(model.BiosVer)).Name + ","; + Msg += $"{_sharedLocalizer["BiosVer"]},"; if (string.IsNullOrWhiteSpace(model.BiTemperature)) - Msg += model.GetAttributeFrom(nameof(model.BiTemperature)).Name + ","; + Msg += $"{_sharedLocalizer["BITemperature"]},"; if (string.IsNullOrWhiteSpace(model.BiTime)) - Msg += model.GetAttributeFrom(nameof(model.BiTime)).Name + ","; + Msg += $"{_sharedLocalizer["BITime"]},"; if (string.IsNullOrWhiteSpace(model.Checksum)) - Msg += model.GetAttributeFrom(nameof(model.Checksum)).Name + ","; + Msg += $"{_sharedLocalizer["CheckSum"]},"; if (string.IsNullOrWhiteSpace(model.BurnLocation)) - Msg += model.GetAttributeFrom(nameof(model.BurnLocation)).Name + ","; - + Msg += $"{_sharedLocalizer["BurnLocation"]},"; } } return Msg; @@ -1678,7 +1669,7 @@ namespace AMESCoreStudio.Web.Controllers if (wipInfoCopyItem == null) { await WipDataSelectAll(); - ModelState.AddModelError("error", $"工單號碼【{model.wipInfo.WipNO}】找不到該生產單位已建立資料,請在確認"); + ModelState.AddModelError("error", _sharedLocalizer["Error_WorkOrder_UnitNotFound", model.wipInfo.WipNO]); return View("PCS001N", model); } @@ -1686,7 +1677,7 @@ namespace AMESCoreStudio.Web.Controllers if (model.wipInfo.UnitNO == "P" || model.wipInfo.UnitNO == "O") { await WipDataSelectAll(); - ModelState.AddModelError("error", $"生產單位【為包裝單位】無法複製工單資料"); + ModelState.AddModelError("error", _sharedLocalizer["Error_Unit_CopyNotAllowed", "包裝單位"]); return View("PCS001N", model); } @@ -1713,7 +1704,7 @@ namespace AMESCoreStudio.Web.Controllers // 判斷是否有開重複 工單+生產單位+線別 if (wipInfoQuery.Where(w => w.UnitNO == model.wipInfo.UnitNO && w.LineID == model.wipInfo.LineID).Any()) { - ModelState.AddModelError("error", $"工單號碼【{model.wipInfo.WipNO}】已有相同生產單位、線別重複建立,請在確認"); + ModelState.AddModelError("error", _sharedLocalizer["Error_WorkOrder_Duplicate", model.wipInfo.WipNO]); model.wipInfo.ECNCheck = model.wipInfo.ECNCheck == "Y" ? "true" : "false"; model.wipInfo.ModelCheck = model.wipInfo.ModelCheck == "Y" ? "true" : "false"; model.wipInfo.InputFlag = model.wipInfo.InputFlag == "Y" ? "true" : "false"; @@ -1726,6 +1717,7 @@ namespace AMESCoreStudio.Web.Controllers // 有包裝生產單位不能再新增一筆了 if (wipInfoQuery.Where(w => w.UnitNO == "P" || w.UnitNO == "O").Any()) { + if (model.wipInfo.UnitNO == "P" || model.wipInfo.UnitNO == "O") { model.wipInfo.ECNCheck = model.wipInfo.ECNCheck == "Y" ? "true" : "false"; @@ -1735,7 +1727,7 @@ namespace AMESCoreStudio.Web.Controllers model.wipInfo.CustomerMedical = model.wipInfo.CustomerMedical == "Y" ? "true" : "false"; model.wipInfo.CustomerVIP = model.wipInfo.CustomerVIP == "Y" ? "true" : "false"; model.wipInfo.SFISFlowCk = model.wipInfo.SFISFlowCk == "Y" ? "true" : "false"; - ModelState.AddModelError("error", $"該筆工單號碼已經有產生【包裝單位】,不能再建立了"); + ModelState.AddModelError("error", _sharedLocalizer["Error_WorkOrder_UnitAlreadyExists", "包裝單位"]); return View("PCS001N", model); } } @@ -1760,7 +1752,7 @@ namespace AMESCoreStudio.Web.Controllers { if (model.WipKps.Where(w => w.WipKpID != -1).GroupBy(g => g.KpSeq).Where(w => w.Count() > 1).Any()) { - Msg += ",KeyParts 順序有重複 "; + Msg += $",{_sharedLocalizer["Error_KeyParts_DuplicateOrder"]} "; } // KP料號正確 var kpNameArray = model.WipKps.Where(w => w.WipKpID != -1).Select(s => s.KpName).Distinct().ToList(); @@ -1768,7 +1760,7 @@ namespace AMESCoreStudio.Web.Controllers { if (_pcsApi.GetPlmMeterialInfo(item.Trim().ToUpper()).InvokeAsync().Result.Count == 0) { - Msg += $",KP料號名稱【{item}】在PLM料號檔找不到 "; + Msg += $",{_sharedLocalizer["Error_KeyParts_NotFoundInPLM", item]} "; } } } @@ -1781,19 +1773,6 @@ namespace AMESCoreStudio.Web.Controllers { // 判斷MAC是否正確 Msg += CheckMACData(CreateMac, model.wipInfo.UnitNO); - // 取消數量判斷 - //var q = await _pcsApi.GetMACInfo(model.wipAtt.ItemNO); - //var MacQty = q == null ? 2 : q.Qty; - //var result_wipMac = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); - //if (result_wipMac.Sum(s => s.Qty) >= model.wipInfo.PlanQTY * MacQty) - //{ - // Msg += ",該筆工單已取滿MAC數量,請在確認"; - //} - //else - //{ - // // 判斷MAC是否正確 - // Msg += CheckMACData(CreateMac, model.wipInfo.UnitNO); - //} } // 判斷出貨序號是否錯誤 @@ -2064,7 +2043,7 @@ namespace AMESCoreStudio.Web.Controllers if (result.Success) { ModelState.Clear(); - ModelState.AddModelError("error", "新增成功!"); + ModelState.AddModelError("error", _sharedLocalizer["Success_Created"]); var viewModel = new WipDataViewModel(); return View(viewModel); } @@ -2226,28 +2205,28 @@ namespace AMESCoreStudio.Web.Controllers // 判斷工單號碼是否已經投入 if (await _pcsApi.GetWipInfoCheckStart(q.FirstOrDefault().WipNO, q.FirstOrDefault().UnitNO, q.FirstOrDefault().LineID) == "Y") { - var _msg = "工單號碼【" + q.FirstOrDefault().WipNO + "】,已開始投入,不可修改!"; + var _msg = _sharedLocalizer["Error_WorkOrder_InProgress", q.FirstOrDefault().WipNO]; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } // 判斷工單號碼是否已經開線 if (await _pcsApi.GetWipInfoCheckStartLine(q.FirstOrDefault().WipNO, q.FirstOrDefault().UnitNO, q.FirstOrDefault().LineID) == "Y") { - var _msg = "工單號碼【" + q.FirstOrDefault().WipNO + "】,已開線,不可修改!"; + var _msg = _sharedLocalizer["Error_WorkOrder_LineStarted", q.FirstOrDefault().WipNO]; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } // 判斷是否完工 if (q.Where(w => w.StatusNO == "E").Any()) { - var _msg = "工單號碼【" + q.FirstOrDefault().WipNO + "】,已經投入完工,不可修改"; + var _msg = _sharedLocalizer["Error_WorkOrder_Completed", q.FirstOrDefault().WipNO]; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } // 判斷是否刪除 if (q.Where(w => w.StatusNO == "C").Any()) { - var _msg = "工單號碼【" + q.FirstOrDefault().WipNO + "】,已刪除,不可修改"; + var _msg = _sharedLocalizer["Error_WorkOrder_Deleted", q.FirstOrDefault().WipNO]; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } @@ -2433,7 +2412,7 @@ namespace AMESCoreStudio.Web.Controllers { // 判斷是否有開重複 工單+生產單位+線別 if (wipInfoQuery.Where(w => w.WipID != model.wipInfo.WipID && w.LineID == model.wipInfo.LineID).Any()) - Msg += ",該線別已有建立相同工單號碼了,請在確認"; + Msg += $",{_sharedLocalizer["Error_WorkOrder_DuplicateForLine"]} "; } // 判斷出貨序號是否錯誤 @@ -2447,7 +2426,7 @@ namespace AMESCoreStudio.Web.Controllers { if (model.WipKps.Where(w => w.WipKpID != -1).GroupBy(g => g.KpSeq).Where(w => w.Count() > 1).Any()) { - Msg += ",KeyParts 順序有重複 "; + Msg += $",{_sharedLocalizer["Error_KeyParts_DuplicateOrder"]} "; } // KP料號正確 var kpNameArray = model.WipKps.Where(w => w.WipKpID != -1).Select(s => s.KpName).Distinct().ToList(); @@ -2455,7 +2434,7 @@ namespace AMESCoreStudio.Web.Controllers { if (_pcsApi.GetPlmMeterialInfo(item.Trim().ToUpper()).InvokeAsync().Result.Count == 0) { - Msg += $",KP料號名稱【{item}】在PLM料號檔找不到 "; + Msg += $",{_sharedLocalizer["Error_KeyParts_NotFoundInPLM", item]} "; } } } @@ -2463,13 +2442,13 @@ namespace AMESCoreStudio.Web.Controllers // 判斷SOP是否沒填文件名稱 if (model.WipSops.Where(w => string.IsNullOrWhiteSpace(w.SOPName) && w.WipSOPID != -1).Any()) { - Msg += ",SOP文件 請填寫SOP文件敘述 "; + Msg += $",{_sharedLocalizer["Error_SOP_DescriptionRequired"]} "; } // 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填 if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo)) { - Msg += ",標籤:工單性質選擇非標96工單時,需填入資料"; + Msg += $",{_sharedLocalizer["Error_WorkOrder_NonStandard96Required"]} "; } // 判斷治具中生產單位與作業站吻合 @@ -2482,7 +2461,7 @@ namespace AMESCoreStudio.Web.Controllers if (!RuleStation.Where(w => Outfits.StationID == w.StationID).Any()) { - Msg += ",治具組合中生產單位與作業站不匹配"; + Msg += $",{_sharedLocalizer["Error_Fixture_MismatchUnitAndStation"]} "; } } } @@ -2495,19 +2474,6 @@ namespace AMESCoreStudio.Web.Controllers { // 判斷MAC是否正確 Msg += CheckMACData(CreateMac, model.wipInfo.UnitNO); - // 取消數量判斷 - //var q = await _pcsApi.GetMACInfo(model.wipAtt.ItemNO); - //var MacQty = q == null ? 2 : q.Qty; - //var result_wipMac = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); - //if (result_wipMac.Sum(s => s.Qty) >= model.wipInfo.PlanQTY * MacQty) - //{ - // Msg += ",該筆工單已取滿MAC數量,請在確認"; - //} - //else - //{ - // // 判斷MAC是否正確 - // Msg += CheckMACData(CreateMac, model.wipInfo.UnitNO); - //} } if (!string.IsNullOrWhiteSpace(Msg)) @@ -2525,7 +2491,7 @@ namespace AMESCoreStudio.Web.Controllers if (!string.IsNullOrWhiteSpace(WipExecuteMsg)) { - ModelState.AddModelError("error", $"修改失敗,錯誤訊息:{WipExecuteMsg}"); + ModelState.AddModelError("error", _sharedLocalizer["Error_Modification_Failed", WipExecuteMsg]); return View("PCS003", model); } @@ -2556,13 +2522,12 @@ namespace AMESCoreStudio.Web.Controllers model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipInfoBlobs = await _pcsApi.GetWipInfoBlob(model.wipInfo.WipNO); - var _msg = "修改成功!"; - ModelState.AddModelError("error", _msg); + ModelState.AddModelError("error", _sharedLocalizer["Success_Modification_Successful"]); return View("PCS003", model); } catch (Exception ex) { - ModelState.AddModelError("error", "系統錯誤,錯誤訊息:" + ex.Message); + ModelState.AddModelError("error", _sharedLocalizer["Error_System_Generic", ex.Message]); return View("PCS003", model); } } @@ -3005,7 +2970,6 @@ namespace AMESCoreStudio.Web.Controllers GetWipBI_OSSelect(); // SOP Type GetSOPTypeSelect(); - } /// @@ -3017,21 +2981,20 @@ namespace AMESCoreStudio.Web.Controllers public string CheckMACData(List wipMacs, string unit) { var Msg = string.Empty; - var pp = string.Empty; + var Unit = string.Empty; var PcbUnitNo = new List { "D", "I", "P", "S" }; var SystemUnitNo = new List { "B", "O", "T" }; if (PcbUnitNo.Contains(unit)) { - pp = "PCB"; + Unit = "PCB"; } else if (SystemUnitNo.Contains(unit)) { - pp = "SYSTEM"; + Unit = "SYSTEM"; } - foreach (var item in wipMacs) { // 當前值 16 進位 @@ -3039,7 +3002,7 @@ namespace AMESCoreStudio.Web.Controllers try { if (item.StartNO.Length != 12 || item.EndNO.Length != 12) - Msg += $",【{item.StartNO.ToUpper()}】與【{item.EndNO.ToUpper()}】MAC區間長度不足12碼,請在確認"; + Msg += $",{_sharedLocalizer["Error_MAC_RangeLengthInvalid", item.StartNO.ToUpper(), item.EndNO.ToUpper()]}"; else { var Title = item.StartNO.Substring(0, 6).ToUpper().Trim(); @@ -3049,29 +3012,28 @@ namespace AMESCoreStudio.Web.Controllers int Max = (int.Parse(Entire.DecHex(End, "HexToDec"))); if (Max < Min) - Msg += $",【{item.StartNO.ToUpper()}】與【{item.EndNO.ToUpper()}】區間設定有誤"; + Msg += $",{_sharedLocalizer["Error_MAC_RangeInvalid", item.StartNO.ToUpper(), item.EndNO.ToUpper()]}"; else if (item.StartNO.ToUpper().Substring(0, 6) != item.EndNO.ToUpper().Substring(0, 6)) - Msg += $",【{item.StartNO.ToUpper()}】與【{item.EndNO.ToUpper()}】前綴不一樣"; + Msg += $",{_sharedLocalizer["Error_MAC_PrefixMismatch", item.StartNO.ToUpper(), item.EndNO.ToUpper()]}"; else { var MacInfos = _pcsApi.GetMACInfoByTitle(Title).InvokeAsync().Result; if (MacInfos.Where(w => (string.Compare(w.Min, Start) <= 0 && string.Compare(Start, w.Max) <= 0) || (string.Compare(w.Min, End) <= 0 && string.Compare(End, w.Max) <= 0)).Any()) - Msg += $",【{item.StartNO.ToUpper()}】與【{item.EndNO.ToUpper()}】已有設定自動MAC區間內,請確認"; + Msg += $",{_sharedLocalizer["Error_MAC_RangeAlreadyAssigned", item.StartNO.ToUpper(), item.EndNO.ToUpper()]}"; // 判斷MAC區間是否有重複使用 // 場亨新增 因為前後段MAC會重複,所以切開板卡與板卡 系統與系統判斷 - var result = _pcsApi.GetCheckMAC(item.StartNO.ToUpper(), item.EndNO.ToUpper(), pp).InvokeAsync().Result; + var result = _pcsApi.GetCheckMAC(item.StartNO.ToUpper(), item.EndNO.ToUpper(), Unit).InvokeAsync().Result; if (!result.Success) - Msg += $",【{item.StartNO.ToUpper()}】與【{item.EndNO.ToUpper()}】區間已有重複,請確認"; + Msg += $",{_sharedLocalizer["Error_MAC_RangeDuplicate", item.StartNO.ToUpper(), item.EndNO.ToUpper()]}"; } } } catch (Exception ex) { - return $",MAC區間轉換錯誤:{ex.Message},請確認數值填寫是否正確"; + return $",{_sharedLocalizer["Error_MAC_ConversionFailed", ex.Message]}"; } - } return Msg; } @@ -3212,7 +3174,7 @@ namespace AMESCoreStudio.Web.Controllers } else { - Msg += $"找不到【{data.Cell(i, j).Value.ToString()}】相關KeyParts代號
"; + Msg += _sharedLocalizer["Error_KeyParts_CodeNotFound", data.Cell(i, j).Value.ToString()]; } break; case 3: // 前置碼 @@ -3223,7 +3185,7 @@ namespace AMESCoreStudio.Web.Controllers { if (!int.TryParse(data.Cell(i, j).Value.ToString(), out _)) { - Msg += $"【{data.Cell(i, j).Value.ToString()}】長度格式錯誤
"; + Msg += _sharedLocalizer["Error_KeyParts_LengthFormatInvalid", data.Cell(i, j).Value.ToString()]; } wipKpDto.Length = int.Parse(data.Cell(i, j).Value.ToString()); } @@ -3237,7 +3199,7 @@ namespace AMESCoreStudio.Web.Controllers } else { - Msg += $"找不到【{data.Cell(i, j).Value}】相關生產單位名稱
"; + Msg += _sharedLocalizer["Error_KeyParts_ProductionUnitNameNotFound", data.Cell(i, j).Value.ToString()]; } break; case 6: // kp數量 @@ -3245,7 +3207,7 @@ namespace AMESCoreStudio.Web.Controllers { if (!int.TryParse(data.Cell(i, j).Value.ToString(), out _)) { - Msg += $"【{data.Cell(i, j).Value.ToString()}】KP數量格式錯誤
"; + Msg += _sharedLocalizer["Error_KeyParts_KPQuantityFormatInvalid", data.Cell(i, j).Value.ToString()]; } for (int x = 1; x <= int.Parse(data.Cell(i, j).Value.ToString()); x++) @@ -3266,7 +3228,7 @@ namespace AMESCoreStudio.Web.Controllers } else { - Msg += $"請輸入KP數量
"; + Msg += _sharedLocalizer["Error_KeyParts_EnterKPQuantity"]; } break; } @@ -3992,7 +3954,6 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PCS006AAsync(WipInfo wipInfo) { - await GetLineInfo(wipInfo.UnitNO); // 判斷是否有開重複工單+生產單位 @@ -4005,7 +3966,6 @@ namespace AMESCoreStudio.Web.Controllers ModelState.AddModelError("error", "該線別已有在相同工單建立了"); return View(wipInfo); } - } IResultModel result; @@ -7048,7 +7008,6 @@ namespace AMESCoreStudio.Web.Controllers #endregion - //修改页面 [HttpGet] public async Task BAS001UAsync(int id) diff --git a/AMESCoreStudio.Web/Resources/Localization/CustomStringLocalizerFactory.cs b/AMESCoreStudio.Web/Resources/Localization/CustomStringLocalizerFactory.cs new file mode 100644 index 0000000..5bdf8e1 --- /dev/null +++ b/AMESCoreStudio.Web/Resources/Localization/CustomStringLocalizerFactory.cs @@ -0,0 +1,30 @@ +using Microsoft.Extensions.Localization; +using System; + +namespace AMESCoreStudio.Web.Resources.Localization +{ + public class CustomStringLocalizerFactory : IStringLocalizerFactory + { + private readonly IStringLocalizerFactory _baseFactory; + + public CustomStringLocalizerFactory(IStringLocalizerFactory baseFactory) + { + _baseFactory = baseFactory; + } + + public IStringLocalizer Create(Type resourceSource) + { + return _baseFactory.Create(resourceSource); + } + + public IStringLocalizer Create(string baseName, string location) + { + // 自訂邏輯:如果是 Views.PCS,或是 Controllers.PCS,使用 Shared 資源 + if (baseName.Contains("Views.PCS") || baseName.Contains("Controllers.PCS")) + { + baseName = "Views.PCS.Shared"; + } + return _baseFactory.Create(baseName, location); + } + } +} diff --git a/AMESCoreStudio.Web/Resources/Views/PCS/Shared.en-US.resx b/AMESCoreStudio.Web/Resources/Views/PCS/Shared.en-US.resx new file mode 100644 index 0000000..85b22bc --- /dev/null +++ b/AMESCoreStudio.Web/Resources/Views/PCS/Shared.en-US.resx @@ -0,0 +1,816 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Work Order Number + + + Planned Quantity + + + First Station Completed Quantity + + + Work Order Number + + + Engineering Number + + + Work Order Type + + + Product Category + + + Factory/Outsourcing Factory + + + Outsourcing Factory Number + + + Customer Category + + + Medical + + + VIP + + + Customer Name + + + Finished Product Part Number + + + Customer Work Order + + + Production Unit + + + Line Number + + + Related Work Order + + + Customer Order + + + Work Order Remarks + + + Model Description + + + Mixed_Line_Input_Machine + + + Mixed_Line_Input_ECN_Check + + + Online_Forced_Work_Order + + + Determine if Pre-process has Started + + + Model Name + + + Work Order Nature + + + SMD Production Priority + + + Number of Panelized Boards + + + Quantity per Box + + + BOM Date + + + ECN + + + EAN + + + Estimated Start Date + + + Estimated Completion Date + + + SerialNumber + + + Starting Serial Number + + + Ending Serial Number + + + Shipment Serial Number + + + Add Shipment Serial Number + + + Starting Shipment Serial Number + + + Ending Shipment Serial Number + + + Increment + + + Sequential Number + + + Remove Tail Digits + + + Duplicate Check + + + Delete + + + Yes + + + No + + + MAC + + + Add MAC Address + + + Auto Generate MAC + + + Starting MAC Address + + + Ending MAC Address + + + Add + + + Keyparts Grouping + + + FileUpload + + + KeypartsPartName + + + KeypartsPartNumber + + + Sequence + + + Prefix Code + + + String Length + + + Is Repeatable + + + Not in Production + + + Process Confirmation + + + Work Process Notes + + + Project Engineer + + + Name + + + With Standard Maintenance Hours + + + **Without Standard Maintenance Hours** + + + SMD Red Glue Application + + + SMD Red Glue Remarks + + + SMD Solder Resist Application + + + SMD Solder Mask Remarks + + + DIP + + + CARRIER + + + DIPRemarks + + + Apply Adhesive Tape + + + Solder Mask Dot + + + Burn + + + BurnLocation + + + BurnedIn + + + BurnRemarks + + + PartsBake + + + ISPartsBake + + + PartsBakeTemperature + + + PartsBakeTemperatureOther + + + PartsBakeTime + + + Hours + + + PartsBake_Over_48_Hours + + + PartsBakeRemarks + + + PCB Part Number + + + ISPCB Bake + + + PCB Baking + + + PCB Baking Remarks + + + Solder Paste + + + Solder Paste Remarks + + + PCB Processing + + + PCB Processing Remarks + + + Burn-In Ratio + + + Burn-In Temperature + + + Burn-In Time + + + Burn-In Remarks + + + BIOS Version + + + BIOS Remarks + + + Check Sum + + + Check Sum Remarks + + + Power Mode + + + PLM Production Remarks + + + Burn-in Software + + + Update Burn-in Information + + + BIOS + + + OS Version + + + CPU + + + RAM + + + ISPremium package + + + DMI Burn-in + + + DMI Burn-in Instructions + + + JUMPER + + + Bab Remarks + + + Test Remarks + + + Packaging Remarks + + + Process Station + + + Fixture Type + + + SOP Type + + + SOP Version + + + SOP Description + + + Printing Method + + + Print Quantity + + + Sheet + + + Certification Logo + + + Company Logo + + + Work Order Attributes + + + Remarks + + + Preview + + + File Name + + + File Path + + + File + + + File Remarks + + + DownLoad + + + Confirmed + + + Engineering Confirmation + + + Save + + + Preview can only display image files, PDFs, and text files + + + Keypart Combination + + + Serial Number Code + + + Production Process + + + Board - Engineering Information + + + Engineering Information + + + Fixture Combination + + + SOP Document + + + Label Options + + + Upload File + + + Work Order Data Modification + + + Edit + + + View + + + Action + + + Inspection Completion Date + + + Start Date + + + Send Notification + + + View Work Order Data + + + Delete Successful! + + + Process + + + Work Order Data Query + + + Work Order Status + + + BoxNumber + + + Inbound Order Number + + + Status Description + + + Wight(g) + + + Barcode Production History Query + + + Keyparts Barcode + + + Barcode Production History + + + Barcode Data + + + Work Order History + + + Production History + + + Keyparts List + + + Repair Record + + + Fixture List + + + Barcode Change + + + Keyparts Change + + + Material Preparation + + + Creation Date + + + User + + + Reply User + + + Reply Date + + + Station Name + + + Station Date + + + System Type + + + Defect Code + + + Part Location + + + Repair Code + + + Repair Status + + + Equipment Number + + + Barcode Serial Number + + + (Old) Barcode Serial Number + + + (New) Barcode Serial Number + + + Change Type + + + Change Date + + + Replace User + + + Replace Date + + + (Old)Keyparts Barcode + + + Change User + + + Work order number [{0}] does not have data for the specified production unit. + + + Production unit [{0}] cannot copy work order data. + + + Work order number [{0}] already exists for the same production unit and line. + + + The work order number has already been created for [{0}]. + + + KeyParts order has duplicates + + + KP Part Name [{0}] not found in PLM file + + + Created successfully! + + + Work order number [{0}] is already in progress and cannot be modified! + + + Work order number [{0}] has already started on the line and cannot be modified! + + + Work order number [{0}] is already completed and cannot be modified! + + + Work order number [{0}] has been deleted and cannot be modified! + + + The same work order number has already been created for this line. Please verify! + + + When selecting a non-standard 96 work order type, data must be entered. + + + Mismatch between production unit and station in fixture combination. + + + Modification failed. Error message: {0} + + + System error. Error message: {0} + + + Modification successful! + + + Please fill in the SOP document description. + + + The MAC range between [{0}] and [{1}] is less than 12 characters. Please check again. + + + The range between [{0}] and [{1}] is invalid. + + + The prefixes of [{0}] and [{1}] do not match. + + + The range between [{0}] and [{1}] is already assigned in the automatic MAC range. Please check. + + + The range between [{0}] and [{1}] is already duplicated. Please check. + + + MAC range conversion error: {0}. Please ensure the values are entered correctly. + + + Cannot find the related KeyParts code for [{0}] + + + The length format of [{0}] is incorrect + + + Cannot find the related production unit name for [{0}] + + + The KP quantity format for 【{0}】 is incorrect + + + Please enter the KP quantity + + + Required fields not filled: ({0}) + + \ No newline at end of file diff --git a/AMESCoreStudio.Web/Resources/Views/PCS/Shared.zh-TW.resx b/AMESCoreStudio.Web/Resources/Views/PCS/Shared.zh-TW.resx new file mode 100644 index 0000000..817891c --- /dev/null +++ b/AMESCoreStudio.Web/Resources/Views/PCS/Shared.zh-TW.resx @@ -0,0 +1,816 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 工單號碼 + + + 計劃數量 + + + 第一站完成數量 + + + 線別 + + + 生產單位 + + + 產品別 + + + 混線投入機 + + + 制令序號 + + + 混線投入ECN相同檢查 + + + 工單備註 + + + 機種描述 + + + 線上強制工單 + + + 客戶訂單 + + + 廠別/委外廠 + + + 工單類型 + + + 客戶類別 + + + 醫療 + + + VIP + + + 關聯工單 + + + 委外廠編號 + + + 客戶名稱 + + + 成品料號 + + + 客戶工單 + + + 工程編號 + + + 判斷前製程是否已經投入 + + + 機種名稱 + + + 工單性質 + + + SMD投產優先面 + + + 聯板數 + + + 單箱數量 + + + BOM日期 + + + ECN + + + EAN + + + 預計開工日期 + + + 預計完工日期 + + + 生產序號 + + + 起始生產序號 + + + 結束生產序號 + + + 出貨序號 + + + 新增出貨序號 + + + 出貨序號起 + + + 出貨序號迄 + + + 進位 + + + 流水碼 + + + 去尾碼數 + + + 判斷重複 + + + 刪除 + + + + + + + + + MAC + + + 新增MAC + + + 自動產生MAC + + + MAC區間起 + + + MAC區間迄 + + + 新增 + + + Keyparts組合 + + + 文件上傳 + + + 組件名稱 + + + 組件料號NO + + + 順序 + + + 前置碼 + + + 字串長度 + + + 是否可重複 + + + 不生產 + + + 途程確認 + + + 作業流程註解 + + + 工程負責人員 + + + 姓名 + + + 有維護標準工時 + + + **無維護標準工時** + + + SMD點紅膠 + + + SMD點紅膠備註 + + + SMD點防焊膠 + + + SMD點防焊膠備註 + + + DIP + + + CARRIER + + + DIP備註 + + + 貼付膠帶 + + + 點防焊膠 + + + 燒錄 + + + 燒機位置 + + + 是否燒入 + + + 燒錄備註 + + + 零件烘烤 + + + 零件是否需要烘烤 + + + 零件烘烤溫度 + + + 其他溫度 + + + 零件烘烤時間 + + + 小時 + + + 零件烘烤超過48hrs + + + 零件烘烤備註 + + + PCB板號 + + + PCB是否需要烘烤 + + + PCB烘烤 + + + PCB烘烤備註 + + + 錫膏 + + + 錫膏備註 + + + PCB加工 + + + PCB加工備註 + + + 燒機比率 + + + 燒機溫度 + + + 燒機時間 + + + 燒機備註 + + + BIOS版本 + + + BIOS備註 + + + Check Sum + + + Check Sum備註 + + + Power Mode + + + PLM生產備註 + + + 燒機軟體 + + + 更新燒機資訊 + + + BIOS + + + OS版本 + + + CPU頻率 + + + RAM + + + 是否為精裝 + + + DMI燒入 + + + DMI燒入說明 + + + JUMPER + + + 組裝備註 + + + 測試備註 + + + 包裝備註 + + + 流程站別 + + + 治具種類 + + + SOP類型 + + + SOP版本 + + + SOP文件敘述 + + + 列印方式 + + + 列印張數 + + + + + + 認證LOGO + + + 公司LOGO + + + 工單屬性 + + + 備註 + + + 預覽 + + + 檔案名稱 + + + 檔案路徑 + + + 檔案 + + + 檔案備註 + + + 下載 + + + 確認 + + + 工程確認 + + + 儲存 + + + 預覽只能顯示圖檔、PDF、文字檔 + + + Keypart組合 + + + 序號編碼 + + + 生產流程 + + + 板卡-工程資訊 + + + 工程資訊 + + + 治具組合 + + + SOP文件 + + + 標籤選項 + + + 上傳檔案 + + + 工單修改資料 + + + 修改 + + + 檢視 + + + 操作 + + + 檢驗完成日 + + + 開工日 + + + 發送通知 + + + 檢視工單資料 + + + 刪除成功! + + + 流程 + + + 工單資料查詢 + + + 工單狀態 + + + 包裝箱號 + + + 入庫單號 + + + 狀態描述 + + + 重量(g) + + + 條碼生產歷程查詢 + + + 組件條碼 + + + 條碼生產歷程 + + + 條碼資料 + + + 工單歷程 + + + 生產歷程 + + + 組件清單 + + + 送修紀錄 + + + 治具清單 + + + 條碼變更 + + + 組件變更 + + + 備料 + + + 建立日期 + + + 使用者 + + + 回覆人員 + + + 回覆日期 + + + 站別名稱 + + + 過站時間 + + + 系統類型 + + + 不良代碼 + + + 零件位置 + + + 維修代碼 + + + 設備編號 + + + 條碼序號 + + + (舊)條碼序號 + + + (新)條碼序號 + + + 變更類型 + + + 變更日期 + + + 替換人員 + + + 維修狀態 + + + 替換日期 + + + (舊)組件條碼 + + + 變更人員 + + + 工單號碼【{0}】找不到該生產單位已建立資料,請再確認。 + + + 生產單位【{0}】無法複製工單資料。 + + + 工單號碼【{0}】已有相同生產單位、線別重複建立,請再確認。 + + + 該筆工單號碼已經有產生【{0}】,不能再建立了。 + + + KeyParts 順序有重複 + + + KP料號名稱【{0}】在PLM料號檔找不到 + + + 新增成功! + + + 工單號碼【{0}】,已開始投入,不可修改! + + + 工單號碼【{0}】,已開線,不可修改! + + + 工單號碼【{0}】,已經投入完工,不可修改! + + + 工單號碼【{0}】,已刪除,不可修改! + + + 該線別已有建立相同工單號碼了,請再確認! + + + 工單性質選擇非標96工單時,需填入資料。 + + + 治具組合中生產單位與作業站不匹配。 + + + 修改失敗,錯誤訊息:{0} + + + 系統錯誤,錯誤訊息:{0} + + + 修改成功! + + + SOP文件請填寫SOP文件敘述。 + + + 【{0}】與【{1}】MAC區間長度不足12碼,請在確認。 + + + 【{0}】與【{1}】區間設定有誤。 + + + 【{0}】與【{1}】前綴不一樣。 + + + 【{0}】與【{1}】已有設定自動MAC區間內,請確認。 + + + 【{0}】與【{1}】區間已有重複,請確認。 + + + MAC區間轉換錯誤:{0},請確認數值填寫是否正確。 + + + 找不到【{0}】相關KeyParts代號 + + + 【{0}】長度格式錯誤 + + + 找不到【{0}】相關生產單位名稱 + + + 【{0}】KP數量格式錯誤 + + + 請輸入KP數量 + + + 必填欄位未填寫:({0}) + + \ No newline at end of file diff --git a/AMESCoreStudio.Web/Startup.cs b/AMESCoreStudio.Web/Startup.cs index ec1cfc3..b076dfc 100644 --- a/AMESCoreStudio.Web/Startup.cs +++ b/AMESCoreStudio.Web/Startup.cs @@ -17,6 +17,8 @@ using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Localization; using AMESCoreStudio.Web.Code; using Microsoft.AspNetCore.Http.Features; +using AMESCoreStudio.Web.Resources.Localization; +using Microsoft.Extensions.Localization; namespace AMESCoreStudio.Web { @@ -101,19 +103,22 @@ namespace AMESCoreStudio.Web o.ResourcesPath = "Resources"; }); - // Add framework services. - //services.AddMvc(); - //services.AddMvc().AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix); services.AddMvc() .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix) .AddDataAnnotationsLocalization(options => { options.DataAnnotationLocalizerProvider = (type, factory) => factory.Create(typeof(SharedResource)); }); - //services.AddControllersWithViews(); services.AddControllersWithViews().AddRazorRuntimeCompilation(); + // Uۭq Localizer Factory + services.AddSingleton(sp => + { + var baseFactory = ActivatorUtilities.CreateInstance(sp); + return new CustomStringLocalizerFactory(baseFactory); + }); + //ʹSession services.AddSession(); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml index c464846..ba917b2 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml @@ -1,5 +1,6 @@ @model AMESCoreStudio.Web.ViewModels.PCS.WipDataViewModel - +@using Microsoft.AspNetCore.Mvc.Localization +@inject IViewLocalizer Localizer @{ ViewData["Title"] = "PCS001"; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } @@ -23,27 +24,27 @@
- +
@ViewData["message"]
- +
- +
- +
- +
@@ -52,42 +53,41 @@
- +
- +
- +
- +
-
- +
- - + +
- +
- +
- +
@@ -96,14 +96,14 @@
- +
- +
@@ -111,12 +111,12 @@ - +
- +
@@ -124,46 +124,46 @@
- +
- +
- - - + + +
    -
  • 工單屬性
  • -
  • 序號編碼
  • -
  • Keypart組合
  • -
  • 生產流程
  • +
  • @Localizer["WipAtt"]
  • +
  • @Localizer["SerialNumberItemName"]
  • +
  • @Localizer["KeypartItemName"]
  • +
  • @Localizer["ProductionItemName"]
@* 工單屬性sheet *@
- +
- +
- +
@@ -172,15 +172,15 @@
- +
- +
- +
@@ -189,11 +189,11 @@
- +
- +
@@ -202,11 +202,11 @@
- +
- +
@@ -219,16 +219,15 @@
- + - @@ -250,9 +249,9 @@
- +
- 起始生產序號 + @Localizer["StartingSerialNumber"] - 結束生產序號 + @Localizer["EndingSerialNumber"]
@@ -262,22 +261,22 @@ @@ -305,11 +304,11 @@ m++; @@ -320,10 +319,10 @@
- 出貨序號起 + @Localizer["StartingShipmentSerialNumber"] - 出貨序號迄 + @Localizer["EndingShipmentSerialNumber"] - 進位 + @Localizer["Increment"] - 流水碼 + @Localizer["SequentialNumber"] - 去尾碼數 + @Localizer["RemoveTailDigits"] - 判斷重複 + @Localizer["DuplicateCheck"] - - + + - 刪除 + @Localizer["Delete"]
@@ -333,10 +332,10 @@ @@ -372,7 +371,7 @@
- +
@@ -381,32 +380,32 @@ @* Keypart組合sheet *@
- MAC區間起 + @Localizer["StartingMACAddress"] - MAC區間迄 + @Localizer["AutoGenerateMAC"] @@ -359,7 +358,7 @@ @if (index.ClassGroup == "New") { - 刪除 + @Localizer["Delete"] }
@{int k = 0;} k++; @@ -456,19 +455,19 @@
- +
- +
- +
- +
- KP料號名稱 + @Localizer["KeypartsPartName"] - KP料號NO + @Localizer["KeypartsPartNumber"] - 順序 + @Localizer["Sequence"] - 前置碼 + @Localizer["PrefixCode"] - 長度 + @Localizer["StringLength"] - 生產單位代號 + @Localizer["UnitNo"] - 是否可重複 + @Localizer["IsRepeatable"] @@ -438,12 +437,12 @@ - 刪除 + @Localizer["Delete"]
@@ -480,7 +479,7 @@ @Html.ValidationMessage("error")
- +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index 73af400..8650d49 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -1,8 +1,8 @@ @model AMESCoreStudio.Web.ViewModels.PCS.WipDataViewModel - +@using Microsoft.AspNetCore.Mvc.Localization +@inject IViewLocalizer Localizer @{ - ViewData["Title"] = "PCS001C"; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } @@ -25,26 +25,26 @@
- +
- +
- +
- +
- +
@@ -54,19 +54,19 @@
- +
- +
- +
- +
@@ -77,21 +77,21 @@
- +
- - + +
- +
- +
- +
@@ -100,12 +100,12 @@
- +
- +
@@ -114,13 +114,13 @@ - +
- +
@@ -128,52 +128,52 @@
- +
- +
- - - + + +
    -
  • 工單屬性
  • -
  • 序號編碼
  • -
  • Keypart組合
  • -
  • 生產流程
  • -
  • 板卡-工程資訊
  • -
  • 工程資訊
  • -
  • 治具組合
  • -
  • SOP文件
  • -
  • 標籤選項
  • -
  • 上傳檔案
  • +
  • @Localizer["WipAtt"]
  • +
  • @Localizer["SerialNumberItemName"]
  • +
  • @Localizer["KeypartItemName"]
  • +
  • @Localizer["ProductionItemName"]
  • +
  • @Localizer["BoardItemName"]
  • +
  • @Localizer["SystemItemName"]
  • +
  • @Localizer["FixtureItemName"]
  • +
  • @Localizer["SopItemName"]
  • +
  • @Localizer["LabelItemName"]
  • +
  • @Localizer["UploadFileItemName"]
@* 工單屬性sheet *@
- +
- +
- +
@@ -183,17 +183,17 @@
- +
- +
- +
@@ -202,11 +202,11 @@
- +
- +
@@ -215,12 +215,12 @@
- +
- +
@@ -234,16 +234,15 @@
- + - @@ -266,7 +265,7 @@
- +
- 起始生產序號 + @Localizer["StartingSerialNumber"] - 結束生產序號 + @Localizer["EndingSerialNumber"]
@{ int m = 0; @@ -274,22 +273,22 @@ @@ -315,8 +314,8 @@ m++; @@ -328,16 +327,16 @@
- +
- 出貨序號起 + @Localizer["StartingShipmentSerialNumber"] - 出貨序號迄 + @Localizer["EndingShipmentSerialNumber"] - 進位 + @Localizer["Increment"] - 流水碼 + @Localizer["SequentialNumber"] - 去尾碼數 + @Localizer["RemoveTailDigits"] - 判斷重複 + @Localizer["DuplicateCheck"]
- - + +
@@ -359,7 +358,7 @@
- +
@@ -375,28 +374,25 @@
- @@ -412,25 +408,21 @@ @@ -444,22 +436,22 @@
- +
- +
- +
- +
- MAC區間起 + @Localizer["StartingMACAddress"] - MAC區間迄 + @Localizer["AutoGenerateMAC"]
- KP料號名稱 + @Localizer["KeypartsPartName"] - KP料號NO + @Localizer["KeypartsPartNumber"] - 順序 + @Localizer["Sequence"] - 前置碼 + @Localizer["PrefixCode"] - 長度 + @Localizer["StringLength"] - 生產單位代號 + @Localizer["UnitNo"] - 是否可重複 - - + @Localizer["IsRepeatable"]
- @index.KpSeq - @index.Title - @index.Length - @index.UnitNoName
@@ -512,12 +504,12 @@
- +
- +
@@ -526,7 +518,7 @@
- +
@@ -534,7 +526,7 @@
- +
@@ -542,7 +534,7 @@
- +
@@ -550,7 +542,7 @@
- +
@@ -558,27 +550,27 @@
- +
+ } type="checkbox" title=@Localizer["DIPCarrier"] name="wipBoard.DipCarrier" /> + } type="checkbox" title=@Localizer["DIPTape"] name="wipBoard.DipTape" /> + } type="checkbox" title=@Localizer["DIPSolderMask"] name="wipBoard.SmdSolderMask" />
- +
@@ -586,15 +578,15 @@
- +
+ } type="checkbox" title=@Localizer["BurnedIn"] name="wipBoard.Burn" />
- +
@@ -602,7 +594,7 @@
- +
@@ -610,44 +602,44 @@
- +
+ } type="checkbox" title=@Localizer["ISPartsBake"] name="wipBoard.ISPartsBake" />
- +
- +
-
其他溫度
- +
@Localizer["PartsBakeOther"]
+
-
小時
+
@Localizer["Hours"]
+ } type="checkbox" title=@Localizer["PartsBakeOvertime"] name="wipBoard.PartsBakeOvertime" />
- +
- +
@@ -655,12 +647,12 @@
- +
+ } type="checkbox" title=@Localizer["ISPCBBake"] name="wipBoard.ISPcbBake" />
@@ -669,7 +661,7 @@
- +
@@ -677,7 +669,7 @@
- +
@@ -685,7 +677,7 @@
- +
@@ -693,7 +685,7 @@
- +
@@ -701,7 +693,7 @@
- +
@@ -709,25 +701,25 @@
- +
- +
- +
-
小時
+
@Localizer["Hours"]
- +
@@ -735,7 +727,7 @@
- +
@@ -744,7 +736,7 @@
- +
@@ -752,7 +744,7 @@
- +
@@ -761,7 +753,7 @@
- +
@@ -772,23 +764,23 @@
- +
- +
@if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) { - 有維護標準工時 + @Localizer["WithStandardMaintenanceHours"] } else { - **無維護標準工時** + @Localizer["WithoutStandardMaintenanceHours"] }
@@ -796,7 +788,7 @@
- +
@@ -807,7 +799,7 @@
- +
@@ -815,20 +807,20 @@
- +
- +
-
小時
- +
@Localizer["Hours"]
+
- +
@@ -836,7 +828,7 @@
- +
@@ -844,7 +836,7 @@
- +
@@ -927,7 +919,7 @@
- +
@@ -942,11 +934,11 @@
- +
- +
@@ -957,7 +949,7 @@
- @@ -968,11 +960,11 @@
- +
- +
@@ -980,28 +972,28 @@
- +
- +
- +
- +
@@ -1017,13 +1009,13 @@
@@ -1056,11 +1048,10 @@ } - - @**@ - - - + + + + @@ -1070,9 +1061,6 @@ - @**@ @@ -1092,33 +1080,32 @@ @* 標籤選項sheet *@
- +
- +
-
+
@Localizer["Sheet"]
- +
- +
-
- +
@@ -1126,7 +1113,7 @@
- +
@@ -1135,14 +1122,14 @@ @* 上傳資料sheet *@
- **預覽只能顯示圖檔、PDF、文字檔** + @Localizer["PreviewUpLoadItem"]
- 治具種類 + @Localizer["FixtureType"] - 生產單位 + @Localizer["UnitNo"] - 作業站 + @Localizer["ProcessStation"]
SOP文件敘述檔案路徑SOP類型生產單位SOP版本 @Localizer["SOPName"]@Localizer["SOPType"]@Localizer["UnitNo"]@Localizer["SOPVer"]
@index.SOPName - @index.SOPPath - @index.SOPTypeName
- - - + + + @@ -1161,8 +1148,8 @@ } @@ -1259,41 +1246,6 @@ console.log(filePath); $(obj).attr("href", filePath); }; - - var tableCols = [[ - { - field: 'unitName', - title: '生產單位', - width: 200, - sort: true - }, - { - field: 'sopName', - title: 'SOP敘述', - sort: true - }, - { - field: 'sopPath', - title: '檔案路徑', - sort: true - }, - { - field: 'sopTypeName', - title: 'SOP類型', - width: 100, - sort: true - }, - { - field: 'right', - width: 80, - title: '操作', - align: 'center', - fixed: 'right', - templet: function (d) { - return '預覽' - } - }] - ]; } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml index 56e8ebe..ba24fff 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml @@ -1,17 +1,11 @@ -@{ - ViewData["Title"] = "工單資料修改"; +@using Microsoft.AspNetCore.Mvc.Localization +@inject IViewLocalizer Localizer + +@{ + ViewData["Title"] = @Localizer["PCS002"]; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } -@using Microsoft.AspNetCore.Mvc.Localization -@inject IHtmlLocalizer sharedLocalizer - +
@@ -26,23 +20,23 @@
- +
- +
- +
- +
- +
@@ -86,76 +80,75 @@ { field: 'wipNo', width: 100, - title: '工單號碼', + title: '@Localizer["WipNo"]', sort: true }, { field: 'itemNo', - title: '工程編號', + title: '@Localizer["ItemNo"]', width: 150, sort: true, expandedMode: 'tips' }, { field: 'description', - title: '機種描述', + title: '@Localizer["WipDescription"]', width: 100, expandedMode: 'tips' }, { field: 'planQTY', - title: '數量' + title: '@Localizer["PlanQty"]' }, { field: 'lineDesc', - title: '線別', + title: '@Localizer["Lineid"]', sort: true }, { field: 'unitName', - title: '生產單位', + title: '@Localizer["UnitNo"]', width: 100, sort: true }, { field: 'factoryNameCh', - title: '委外廠名稱', + title: '@Localizer["Werks"]', sort: true }, { field: 'wipScheduleDate', - title: '預計開工日', + title: '@Localizer["WipScheduleDate"]', sort: true, templet: '
{{ layui.util.toDateString(d.wipScheduleDate, "yyyy/MM/dd") }}
' }, { field: 'workDate', - title: '開工日', + title: '@Localizer["StartDate"]', sort: true }, { field: 'wipDueDate', - title: '預計完成日', + title: '@Localizer["WipDueDate"]', sort: true, templet: '
{{ layui.util.toDateString(d.wipDueDate, "yyyy/MM/dd") }}
' }, { field: 'wipCheck', - title: '發送通知' + title: '@Localizer["SendNotification"]' }, { field: 'fqcDate', - title: '檢驗完成日' + title: '@Localizer["FQCDate"]' }, { field: 'right', width: 150, - title: '操作', + title: '@Localizer["Action"]', fixed: 'right', templet: function (d) { - return '修改\ - 檢視' - //// 刪除 + return '@Localizer["Edit"]\ + @Localizer["View"]' } } ] @@ -164,7 +157,7 @@ //通过行tool編輯,lay-event="edit" function edit(obj) { if (obj.data.wipID) { - hg.open('修改工單資料', '/PCS/PCS003/' + obj.data.wipID, '', '', true); + hg.open('@Localizer["PCS002"]', '/PCS/PCS003/' + obj.data.wipID, '', '', true); } } @@ -176,7 +169,7 @@ type: 'POST', success: function (data) { if (data.success) { - hg.msghide("刪除成功!"); + hg.msghide('@Localizer["DeleteOk"]'); var qs = $('button[lay-filter="querysubmit"]'); qs.click(); } @@ -194,7 +187,7 @@ //通过行tool檢視,lay-event="detail" function detail(obj) { if (obj.data.wipID) { - hg.open('檢視工單資料', '/PCS/PCS001R/' + obj.data.wipID, '', '', true); + hg.open('@Localizer["PCS001R"]', '/PCS/PCS001R/' + obj.data.wipID, '', '', true); } } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index e1b3983..a601274 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -1,8 +1,9 @@ @model AMESCoreStudio.Web.ViewModels.PCS.WipDataViewModel - +@using Microsoft.AspNetCore.Mvc.Localization +@inject IViewLocalizer Localizer @{ - ViewData["Title"] = "PCS003"; + ViewData["Title"] = @Localizer["PCS003"]; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } @@ -33,26 +34,26 @@ }" />
- +
- +
- +
- +
- +
@@ -62,44 +63,43 @@
- +
- +
- +
- +
-
- +
- - + +
- +
- +
- +
@@ -108,25 +108,24 @@
- +
- +
- - +
- +
@@ -134,52 +133,52 @@
- +
- +
- - - + + +
    -
  • 工單屬性
  • -
  • 序號編碼
  • -
  • Keypart組合
  • -
  • 生產流程
  • -
  • 板卡-工程資訊
  • -
  • 工程資訊
  • -
  • 治具組合
  • -
  • SOP文件
  • -
  • 標籤選項
  • -
  • 上傳檔案
  • +
  • @Localizer["WipAtt"]
  • +
  • @Localizer["SerialNumberItemName"]
  • +
  • @Localizer["KeypartItemName"]
  • +
  • @Localizer["ProductionItemName"]
  • +
  • @Localizer["BoardItemName"]
  • +
  • @Localizer["SystemItemName"]
  • +
  • @Localizer["FixtureItemName"]
  • +
  • @Localizer["SopItemName"]
  • +
  • @Localizer["LabelItemName"]
  • +
  • @Localizer["UploadFileItemName"]
@* 工單屬性sheet *@
- +
- +
- +
@@ -189,15 +188,15 @@
- +
- +
- +
@@ -206,14 +205,11 @@
- +
- @* - - *@
- +
@@ -222,11 +218,11 @@
- +
- +
@@ -239,15 +235,15 @@
- +
檔案名稱檔案路徑備註@Localizer["FileName"]@Localizer["FilePath"]@Localizer["Remarks"]
- 預覽 - 下載 + @Localizer["Preview"] + @Localizer["DownLoad"]
@@ -269,9 +265,9 @@
- +
- 起始生產序號 + @Localizer["StartingSerialNumber"] - 結束生產序號 + @Localizer["EndingSerialNumber"]
@@ -281,22 +277,22 @@ @@ -324,11 +320,11 @@ m++; @@ -339,10 +335,10 @@
- 出貨序號起 + @Localizer["StartingShipmentSerialNumber"] - 出貨序號迄 + @Localizer["EndingShipmentSerialNumber"] - 進位 + @Localizer["Increment"] - 流水碼 + @Localizer["SequentialNumber"] - 去尾碼數 + @Localizer["RemoveTailDigits"] - 判斷重複 + @Localizer["DuplicateCheck"] - - + + - 刪除 + @Localizer["Delete"]
@@ -352,10 +348,10 @@ @@ -391,7 +387,7 @@
- +
@@ -402,15 +398,14 @@
- Keyparts組合: + @Localizer["KeypartsGrouping"] -
@@ -423,25 +418,25 @@
k++; }
- MAC區間起 + @Localizer["StartingMACAddress"] - MAC區間迄 + @Localizer["AutoGenerateMAC"] @@ -378,7 +374,7 @@ @if (index.ClassGroup == "New") { - 刪除 + @Localizer["Delete"] }
- KP料號名稱 + @Localizer["KeypartsPartName"] - KP料號NO + @Localizer["KeypartsPartNumber"] - 順序 + @Localizer["Sequence"] - 前置碼 + @Localizer["PrefixCode"] - 長度 + @Localizer["StringLength"] - 生產單位代號 + @Localizer["UnitNo"] - 是否可重複 + @Localizer["IsRepeatable"] @@ -473,42 +468,39 @@ - 刪除 + @Localizer["Delete"]
- @*
- -
*@
@* 生產流程sheet *@
- +
- +
- +
- +
@@ -519,12 +511,12 @@
- +
- +
@@ -533,11 +525,11 @@ @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) { - 有維護標準工時 + @Localizer["WithStandardMaintenanceHours"] } else { - **無維護標準工時** + @Localizer["WithoutStandardMaintenanceHours"] }
@@ -545,7 +537,7 @@
- +
@@ -553,7 +545,7 @@
- +
@@ -561,7 +553,7 @@
- +
@@ -569,7 +561,7 @@
- +
@@ -577,18 +569,27 @@
- +
- - - + + +
- +
@@ -596,12 +597,15 @@
- +
- +
- +
@@ -609,7 +613,7 @@
- +
@@ -617,38 +621,44 @@
- +
- +
- +
- +
-
其他溫度
- +
@Localizer["PartsBakeOther"]
+
-
小時
+
@Localizer["Hours"]
- +
- +
- +
@@ -656,9 +666,12 @@
- +
- +
@@ -667,7 +680,7 @@
- +
@@ -675,7 +688,7 @@
- +
@@ -683,7 +696,7 @@
- +
@@ -691,7 +704,7 @@
- +
@@ -699,7 +712,7 @@
- +
@@ -707,25 +720,25 @@
- +
- +
- +
-
小時
+
@Localizer["Hours"]
- +
@@ -733,16 +746,16 @@
- +
- +
- +
@@ -750,16 +763,16 @@
- +
- +
- +
@@ -770,12 +783,12 @@
- +
- +
@@ -784,11 +797,11 @@ @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) { - 有維護標準工時 + @Localizer["WithStandardMaintenanceHours"] } else { - **無維護標準工時** + @Localizer["WithoutStandardMaintenanceHours"] }
@@ -796,7 +809,7 @@
- +
@@ -807,7 +820,7 @@
- +
@@ -815,25 +828,25 @@
- +
- +
-
小時
- +
@Localizer["Hours"]
+
- +
@@ -841,7 +854,7 @@
- +
@@ -849,7 +862,7 @@
- +
@@ -932,7 +945,7 @@
- +
@@ -947,11 +960,11 @@
- +
- +
@@ -962,18 +975,21 @@
- +
- +
- +
@@ -981,28 +997,28 @@
- +
- +
- +
- +
@@ -1011,7 +1027,7 @@ @* 治具組合sheet *@
- 新增 + @Localizer["Add"] @{ @@ -1020,13 +1036,13 @@ - l++; @@ -1061,7 +1076,7 @@ @* SOP文件 sheet *@
- 治具種類 + @Localizer["FixtureType"] - 生產單位 + @Localizer["UnitNo"] - 流程站別 + @Localizer["ProcessStation"] @@ -1037,7 +1053,6 @@ @foreach (var index in Model.WipOutfits) {
@@ -1050,7 +1065,7 @@ - 刪除 + @Localizer["Delete"]
@{ @@ -1070,19 +1085,16 @@ - @**@ *@ + + *@ @@ -1110,7 +1122,7 @@ i++; @@ -1118,65 +1130,65 @@
- SOP文件敘述 + @Localizer["SOPName"] - 檔案路徑 - - SOP類型 + @Localizer["SOPType"] - 生產單位 + @Localizer["UnitNo"] - SOP版本 + @Localizer["SOPVer"] @@ -1098,8 +1110,8 @@ @* - - - 刪除 + @Localizer["Delete"]
@*
- -
*@ + +
*@
@* 標籤選項sheet *@
- +
- +
-
+
@Localizer["Sheet"]
- +
- +
- +
- +
- +
@* 上傳資料sheet *@
- **預覽只能顯示圖檔、PDF、文字檔** + @Localizer["PreviewUpLoadItem"]
- - - + + + @@ -1195,9 +1207,9 @@ } @@ -1206,7 +1218,7 @@
- + @@ -1214,7 +1226,7 @@
- +
@@ -1226,7 +1238,7 @@ @Html.ValidationMessage("error")
- +
@@ -1268,7 +1280,7 @@ } - // DIV keyPartsExcel + // DIV keyPartsExcel @if (Model.wipInfo.WipNO.StartsWith("981")) { $("#keyPartExcel").show(); @@ -1580,15 +1592,15 @@ $('#wipBarcodeOtherTableAdd').on('click', function () { let No = parseInt($('#wipBarcodeOtherCount').val()); var contactdiv = '
' + - '' + '' + '' + - ''+ - ''+ - '' + + '' + + '' + + '' + '' + ''; $('#wipBarcodeOtherTable').append(contactdiv); @@ -1601,9 +1613,9 @@ $('#MACTableAdd').on('click', function () { let No = parseInt($('#WipMacCount').val()); var contactdiv = '' + - '' + - '' + + '' + '' + ''; $('#MACTable').append(contactdiv); @@ -1628,9 +1640,9 @@ SelectKPNo += ''; var SelectIsRepeat = ``; + + + `; var contactdiv = '' + '`; - $('#MACTable').append(contactdiv); - if (result.msg.length != 0) { - parent.hg.msg(result.msg); - } - } - else { + // 產生MAC + function GetMAC() { + var wipNO = $('#wipAtt_ItemNO').val(); + var planQTY = $('#wipInfo_PlanQTY').val(); + if (wipNO == '' || !wipNO) { + parent.hg.msg("請輸入工程編號"); + return; + } + if (planQTY == '' || !planQTY || planQTY == 0) { + parent.hg.msg("請確認計畫數量"); + return; + } + $.ajax({ + url: '@Url.Action("GetMAC", "PCS")', + dataType: 'json', + data: { "itemno": $("#wipAtt_ItemNO").val(), "wipNo": $('#wipInfo_WipNO').val(), "planQTY": $('#wipInfo_PlanQTY').val() }, + cache: false, + type: "POST", + success: function (result, textStatus, jqXHR) { + if (result.success) { + var contactdiv = ``; + $('#MACTable').append(contactdiv); + if (result.msg.length != 0) { parent.hg.msg(result.msg); } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("Found error when using Ajax!!"); } - }); - }; + else { + parent.hg.msg(result.msg); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + alert("Found error when using Ajax!!"); + } + }); + }; } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml index af452bb..c290e84 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml @@ -1,9 +1,11 @@ -@{ - ViewData["Title"] = "工單資料查詢"; +@using Microsoft.AspNetCore.Mvc.Localization +@inject IViewLocalizer Localizer + +@{ + ViewData["Title"] = @Localizer["PCS005"]; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } -@using Microsoft.AspNetCore.Mvc.Localization -@inject IHtmlLocalizer sharedLocalizer +
檔案名稱檔案路徑備註@Localizer["FileName"]@Localizer["FilePath"]@Localizer["Remarks"]
- 預覽 - 下載 - 刪除 + @Localizer["Preview"] + @Localizer["DownLoad"] + @Localizer["Delete"]
'+ + '' + '' + ''+ - '' + + '刪除
'+ + '' + '刪除
' + @@ -1988,40 +2000,40 @@ }); } - // 產生MAC - function GetMAC() { - var wipNO = $('#wipAtt_ItemNO').val(); - var planQTY = $('#wipInfo_PlanQTY').val(); - if (wipNO == '' || !wipNO) { - parent.hg.msg("請輸入工程編號"); - return; - } - if (planQTY == '' || !planQTY || planQTY == 0) { - parent.hg.msg("請確認計畫數量"); - return; - } - $.ajax({ - url: '@Url.Action("GetMAC", "PCS")', - dataType: 'json', - data: { "itemno": $("#wipAtt_ItemNO").val(), "wipNo": $('#wipInfo_WipNO').val(), "planQTY": $('#wipInfo_PlanQTY').val() }, - cache: false, - type: "POST", - success: function (result, textStatus, jqXHR) { - if (result.success) { - var contactdiv = `
${result.data.mix}${result.data.max}
${result.data.mix}${result.data.max}